js-parser-discussions icon indicating copy to clipboard operation
js-parser-discussions copied to clipboard

Investigate Uglify

Open xjamundx opened this issue 9 years ago • 8 comments

A lot of modern tools use an esprima/estree-compatible parser.

Can we find out how many projects are using uglify and if it should be included in this discussion.

xjamundx avatar Sep 13 '16 20:09 xjamundx

They consider themself a parser though. And I believe implement AST parsing by hand (no deps) for 1?

TheLarkInn avatar Sep 13 '16 20:09 TheLarkInn

They do, and it's a cool project but it's not ESTree/Esprima compatible from what I understand. It's kind of it's own thing and not really used by any projects outside of minifiers (let's actually find out).

xjamundx avatar Sep 13 '16 20:09 xjamundx

Yeah I think there is lessons learned from it. Pros, cons. Features, etc. Maybe we can update this issue to "Investigate Uglify". Thoughts?

TheLarkInn avatar Sep 13 '16 20:09 TheLarkInn

Updated the OP a bit...

xjamundx avatar Sep 13 '16 20:09 xjamundx

awesome! Thank you.

TheLarkInn avatar Sep 13 '16 20:09 TheLarkInn

I believe both Uglify and JSHint both implemented their own parsers to do streaming analysis rather than a separate parse / analyze / transform step.

mikesherov avatar Sep 13 '16 21:09 mikesherov

Right and same with jslint :)

xjamundx avatar Sep 13 '16 21:09 xjamundx

UglifyJS actually does have separate parsing (http://lisperator.net/uglifyjs/parser) / compression (http://lisperator.net/uglifyjs/compress) stages, and allows writing own transformers (http://lisperator.net/uglifyjs/transform).

RReverser avatar Sep 13 '16 21:09 RReverser