qmlweb-parser icon indicating copy to clipboard operation
qmlweb-parser copied to clipboard

Investigate the possibility to port to UglifyJS 2

Open ChALkeR opened this issue 9 years ago • 3 comments

Probably after #3.

ChALkeR avatar May 02 '16 11:05 ChALkeR

This is technically possible and not so hard to do, but the new output from UglifyJS2 is much more vebrose — this means that the runtime will consume more memory and will require to load larger files from the server when in pre-parsed mode.

We could investigate converting that into a shorter form suitable to use by qmlweb, though, but that will still slow down parsing.

Also, the parser itself became about two times larger (and I included only the required files).

ChALkeR avatar Jun 07 '16 09:06 ChALkeR

Filed a patch to uglify-js@2 that will allow us to wrap tokenizer() method in the meantime: https://github.com/mishoo/UglifyJS2/pull/1113 (it's somewhy not exported in uglify-js@2, but was exported in uglify-js@1).

Update: merged.

ChALkeR avatar Jun 07 '16 09:06 ChALkeR

uglify-js-2 branch has some initial work, mostly broken. It also requires the abovementioned UglifyJS2 patch.

ChALkeR avatar Jun 07 '16 19:06 ChALkeR