Opened 13 years ago

Closed 10 years ago

#8395 closed enhancement (worksforme)

Suggest refactoring of optmize= parameters to

Reported by: scott.a.jenkins Owned by: Rawld Gill
Priority: low Milestone: 2.0
Component: BuildSystem Version: 1.2.3
Keywords: build, shrinksafe, optimize needsreview Cc: [email protected]…, Rawld Gill
Blocked By: Blocking:


I am attempting to document the behavior of build for optimize= (and there is a second parameter for layers that does the same thing).

The current options are extremely confusing.

Suggest doing the following:

Make a few sets of very simple parameters indicating what is KEPT in the build, based on whatever parameters shrinksafe.js itself exppects like

  • min (keeps nothing at all that can be minified)
  • linebreaks (keeps newlines)
  • comments (keeps comments)
  • etc (and so on)

Map the current parameter values on to sets of these simple parameters if they are used so as not to break existing scripts.

Then the parameter optimze= would just take a comma separated list of these discrete values.

Suggest deprecating packer option.

This will make this option much simpler to understand and to document.

If shrinksafe does not take such simple and obvious arguments, obviously I suggest refactoring it in the same manner.

Change History (6)

comment:1 Changed 13 years ago by Adam Peller

Component: GeneralBuildSystem
Milestone: 1.3tbd
Owner: changed from anonymous to James Burke

Shrinksafe only does the symbol minification, IIRC. Stuff like comments and newlines are the responsibility of the buildscript.

comment:2 Changed 13 years ago by James Burke

Milestone: tbd2.0

Shrinksafe minification includes comment removal, or at least there is not a way to separate comment remove from minification. Line returns are stripped in the build process, not part of shrinksafe. So asking for min will imply comments.

I agree with the packer removal, I believe the version that is there has some edge issues that causes errors in the generated code. However I am reticent to this in a 1.x release, for API compatibility lets do it in 2.0. I do like the idea of allowing other minifiers though, even YUICompressor (there are distribution issues with shipping with YUICompressor out of the box, but we could give instructions on how to enable).

scott.a.jenkins, any thought on an API that would allow for that?

Good ideas, moving to 2.0.

comment:3 Changed 13 years ago by scott.a.jenkins

Suggest following general command line interface for external program parameter passing:

localparameter:"external flags"

For example, to pass parameters to the YUI compressor, the command line would be something like

optimize=yui:"string that gets passed to YUI compressor"

Specific example:

optimize=yui:"--nomunge --preservesemi"

External strings would not be subject to analysis. Errors returned by external minifier should halt build.

It would be an error to include optimize:yui with any other optimize example.

Shrinksafe parameter passing warrants special treatment of its parameters because it is a Dojo foundation project and the "native" minifier.

. . .

Suggest perhaps line break removal should be moved from builder into shrinksafe, especially if 3rd party minification will be supported. Builder should not be a partial minifier.

comment:4 Changed 10 years ago by ben hockey

Cc: Rawld Gill added
Keywords: needsreview added
Priority: highlow

Many options can be set from the command line with the latest builder in 1.7. Can this ticket be closed?

comment:5 Changed 10 years ago by bill

Owner: changed from James Burke to Rawld Gill

Bulk update to assign BuildSystem? tickets to Rawld. Many of these are probably already fixed in 1.7.

comment:6 Changed 10 years ago by Rawld Gill

Resolution: worksforme
Status: newclosed

with so much new in 1.7, i'm hesitant to make these kind of changes without letting the new stuff cook for a version or two. If anybody desires a simplification to the new builder knobs please open a new ticket.

Note: See TracTickets for help on using tickets.