unify CLI & API under minify()#1811
Conversation
|
|
Ambitious PR! Is there a doc for the source map options? What do you plan to do with this misnamed CLI option which is related to mangle-props, not mangle? |
Will need to update
Haven't done those yet, but basically I'll group them all under |
|
So just to confirm, each module will only get the i.e., Some options like Edit: I guess |
Yes - I handled the cross-domain options with shorthands at the moment, and have
|
|
Any reason why not pass the topmost options reference to all modules? Compress could benefit by seeing an option in mangle in certain cases to facilitate better compression decisions, for example. |
Just a matter of whether I can manage those changes. 😅 Once I'm comfortable with the current batch, I'll see if I can pass the common |
Oops, I did forget to mention that in the commit logs, didn't I?
|
- refactor `screw_ie8` to `ie8` - compact `sourceMap` options - more stringent verification on input `options` - toplevel shorthands - `ie8` - `keep_fnames` - `toplevel` - deprecated `fromString` in `minify()` - `minify()` no longer handles any `fs` operations - unify order of operations for `mangle_properties()` on CLI & API - `bin/uglifyjs` used to `mangle_properties()` before even `Compressor` - `minify()` used to `mangle_properties()` after `Compressor` but before `mangle_names()` - both will now do `Compressor`, `mangle_names()` then `mangle_properties()` - `options.parse` / `--parse` for parser options beyond `bare_returns` closes mishoo#96 closes mishoo#1366 fixes mishoo#124 fixes mishoo#263 fixes mishoo#379 fixes mishoo#423 fixes mishoo#576 fixes mishoo#737 fixes mishoo#958 fixes mishoo#1036 fixes mishoo#1175 fixes mishoo#1220 fixes mishoo#1223 fixes mishoo#1280
|
@kzc 4a927b0 shows the current progress with |
shortcut for `options.compress.warnings="verbose"`
README.md
Outdated
| --config-file <file> Read `minify()` options from JSON file. | ||
| -d --define <expr>[=value] Global definitions. | ||
| --ie8 Support non-standard Internet Explorer 8. | ||
| Equivalent to setting `screw_ie8: false` in `minify()` |
There was a problem hiding this comment.
Is screw_ie8 still a minify option?
There was a problem hiding this comment.
screw_ie8 does not exist within the codebase anymore - this part of the documentation has been updated in a subsequent commit as well.
I'm not so sure now if it's a good idea to pass topmost options to every stage. Put the idea on hold unless you think it has some merit and will not impact maintainability or performance. |
That's what I meant. Given that the change won't affect user-facing part of |
|
So the items left to consider for
The rest are moved into their respective major switches and documented accordingly. And I got rid of that In terms of syntax sugar I've introduced |
|
The linter can go as it doesn't work very well anyway. The angular-specific stuff should be dropped. Get all the flags to agree on tense and plurality. Shouldn't warnings be moved to its own CLI flag |
|
Restarting |
Add them around here? https://github.com/mishoo/UglifyJS2#the-hard-way |
|
Yes. Or consider not exporting low level API at all. |
I'm more than happy to do that, to be honest. |
|
Can you expose the low level API to tests only? |
I'm thinking about that. I guess if I separate those from BTW, do you know what's the use for |
remove unsupported features from documentation
|
a70e9b0 removes ones that aren't even used by tests, but otherwise retain the rest albeit no longer mentioned under My thinking is now that they are declared as unsupported, we can remove them from the export list altogether in a latter PR. |
No idea. |
|
... you won't say a word if anything were to happen to it? 😏 |
|
Fine by me. |
|
@alexlamsl Nice work! Noticed that there are still references to the low level API in README. Search for "figure_out_scope". |
|
@kzc thanks for keeping an eye out as always 😉 Will open a new PR to fix up the docs in a moment. |
|
Wishing to be able to configure the |
|
@alexlamsl How does one craft a 3.x CLI command to do the equivalent of this 2.x command? |
|
@kzc this works on current $ echo 'var o = {foo:1, bar:2};' | uglifyjs --mangle-props
var o={o:1,v:2}; |
|
@alexlamsl Nevermind - I didn't |
|
@kzc ah - I've got bitten by that once on the fuzzing box. Otherwise I'm always thrilled to nuke |
There are actually a couple of improvements along the way, so we might as well. uglify-js 3 is a thing, but I’m not going up to it yet because of certain breaking changes that could potentially cause trouble: mishoo/UglifyJS#1811
There are actually a couple of improvements along the way, so we might as well. uglify-js 3 is a thing, but I’m not going up to it yet because of certain breaking changes that could potentially cause trouble: mishoo/UglifyJS#1811
There are actually a couple of improvements along the way, so we might as well. Although uglify-js 3 has [breaking changes], these do not affect Overture and should not affect anything that uses the Overture repository. [breaking changes]: mishoo/UglifyJS#1811
There are actually a couple of improvements along the way, so we might as well. Although uglify-js 3 has [breaking changes], these do not affect Overture and should not affect anything that uses the Overture repository. [breaking changes]: mishoo/UglifyJS#1811
screw_ie8toie8mangle.excepttomangle.reservedmangle.properties.ignore_quotedtomangle.properties.keep_quotedsourceMapoptionsoptionsie8keep_fnamestoplevelwarningsfromStringfromminify()minify()no longer handles anyfsoperationsmangle_properties()on CLI & APIbin/uglifyjsused tomangle_properties()before evenCompressorminify()used tomangle_properties()afterCompressorbut beforemangle_names()Compressor,mangle_names()thenmangle_properties()options.parse/--parsefor parser options beyondbare_returnsmangle.properties.builtinsto disable built-in reserved list--mangle-props builtinson CLIwarningsnow off by default--warnand--verboseon CLI--enclose--export-all--reserved-file--mangle reservedinstead--reserve-domprops--mangle-props domprops--prefix--source-map baseinstead--lintbin/extract-props.jscloses #96
closes #102
closes #136
closes #166
closes #243
closes #254
closes #261
closes #311
closes #700
closes #748
closes #912
closes #1072
closes #1366
fixes #101
fixes #123
fixes #124
fixes #263
fixes #379
fixes #419
fixes #423
fixes #461
fixes #465
fixes #576
fixes #737
fixes #772
fixes #958
fixes #1036
fixes #1142
fixes #1175
fixes #1220
fixes #1223
fixes #1280
fixes #1359
fixes #1368