Giter Site home page Giter Site logo

ClosureCompiler ADVANCED - Errors about jquip HOT 5 CLOSED

mythz avatar mythz commented on August 11, 2024
ClosureCompiler ADVANCED - Errors

from jquip.

Comments (5)

statianzo avatar statianzo commented on August 11, 2024

Just committed 1c20317 which eliminates that error.

from jquip.

statianzo avatar statianzo commented on August 11, 2024

Just checked, and the tests don't seem too happy with the closure compiled version. It's going to need some work to get that corrected.

from jquip.

statianzo avatar statianzo commented on August 11, 2024

Did some work on making tests pass with closure. https://github.com/mythz/jquip/tree/closure-compat

So far the file size isn't too different from what UglifyJS provides (6.5k gzipped vs 6.6k).

from jquip.

dimitrii avatar dimitrii commented on August 11, 2024

Jason thanks for the help! Looks like jquip.js compiles now using ADVANCED w/ closure compiler.

I combined src/jquip.js & src/jquip.events.js using closure compiler advanced. I then called a $(document).bind() command when compiled I get this error (in a non-compiled version it works fine):

Uncaught TypeError: Object # has no method 'make' line: jquip/src/jquip.js:73 (using source mapping)

I prittified the compiled code to get a better idea of what's going on:

'''javascript
(function(window, undefined) {
var h = void 0, i = !0, j = null, l = !1, aa = window, ba = window;
function m(a, b) {
for (var c, d = 0, e = p.length; d < e; d++)
if (p[d].apply(this, arguments))
return this;
if (!a)
return this;
if (q(a))
return r ? a() : t.push(a), this;
if (v(a))
return this.make(a);
if (a.nodeType || w(a))
return this.make([a]); //<--- Uncaught TypeError: Object # has no method 'make'
if ("body" == a && !b && x.body)
return this.context = a.context, this[0] = x.body, this.length = 1, this.selector = a, this;
if (a.selector !== h)
return this.context = a.context, this.selector = a.selector, this.make(a);
a = y(a) && "<" === a.charAt(0) ? (c = ca.exec(a)) ? [x.createElement(c[1])] : z(a).childNodes : A(this.selector =
a, b);
this.make(a);
B(b) && this.attr(b);
return this;
...
'''

I thought maybe it was because I was combining my code & jquip into an anonymous closure but that doesn't seem to be the cause of the issue; i moved jquip code out of the closure and still got the same error. Any idea what's causing this error?

In your opinion should we use uglifyjs (not closurecompiler) when working on project that include jquip?

from jquip.

statianzo avatar statianzo commented on August 11, 2024

The reason for the missing 'make' error is that a good number of the functions are not exported correctly for closure and get optimized away.

I recommend using either uglifyjs or closure with simple optimizations until jquip works again with advanced optimizations.

from jquip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.