Opened 13 years ago

Closed 11 years ago

Last modified 10 years ago

#5885 closed feature (patcheswelcome)

Build: Try to use Closure Compiler's Advanced mode

Reported by: Jörn Zaefferer Owned by:
Priority: major Milestone:
Component: [meta] Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:

Description (last modified by Jörn Zaefferer)

Probably needs some metadata to keep the right exports intact.

See for details.

Change History (10)

comment:1 Changed 13 years ago by Jörn Zaefferer

Description: modified (diff)

comment:2 Changed 13 years ago by Jörn Zaefferer

jquery-ui.min.js ADVANCED: 150kb, SIMPLE: 194kb. Doesn't work out-of-the-box, looks like too many externaly defined properties, eg. jQuery core methods, are renamed.

Accordin to the docs, we'd have to compile the full page scripts all in one go. The only other option is to use externs, where the compiled code declares functions with empty bodies for all functions it uses. That doesn't seem feasible for the jQuery Core dependency.

comment:3 Changed 13 years ago by Jörn Zaefferer

So far I'd the only thing we can do is to document how to use the Closure Compiler on an application-level. It doesn't look like we can provide a pre-compiled version of jQuery UI with the ADVANCED mode.

comment:4 Changed 12 years ago by Jörn Zaefferer

Resolution: wontfix
Status: newclosed

After some discussion at the jQuery Conference I'm confident that the Advanced Mode is useful only on an application level, where libaries like jQuery are declared as external dependencies.

comment:5 Changed 12 years ago by Jörn Zaefferer

Priority: minormajor
Resolution: wontfix
Status: closedreopened

Reopening after getting some useful input on this. We should try the mode on one plugin to see what the difference in size could be.

For the minifier to work, we'd need to specify all public symbols (or whatever that should be called). Here's a reference with some standalone tooltipl plugin:

comment:6 Changed 12 years ago by Jörn Zaefferer

Even more useful input, with some documentation on how to create thesefiles:

comment:7 Changed 12 years ago by ChadKillingsworth

As a test case, I defined the externs needed and compiled jquery.core.js. Without modifying the core.js source in any way I get 3 warnings (I use VERBOSE warnings settings on the compiler). However, the resulting code is smaller and passes all unit tests:

I should note that I use a very recent build of the compiler and turn on the non-standard AmbiguateProperties and DisambiguateProperties passes which give slightly better results.

I also use/reference the jQuery 1.5 externs: While I realize that UI still depends upon jQuery 1.4.4, the externs for 1.5 are much more accurate as I refine the generation program with every new release.

Last edited 12 years ago by ChadKillingsworth (previous) (diff)

comment:8 Changed 12 years ago by Jörn Zaefferer

comment:9 Changed 11 years ago by Scott González

Resolution: patcheswelcome
Status: reopenedclosed

This isn't something we're looking into. Perhaps if core adds suport, we will look into this.

comment:10 Changed 10 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.