guybedford / es-module-lexer

Low-overhead lexer dedicated to ES module parsing for fast analysis
MIT License
917 stars 48 forks source link

Feat: Dynamic import refinements & fixes, optimization #102

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

This PR upgrades dynamic import analysis, as described in the readme diff here, and fixes https://github.com/guybedford/es-module-lexer/issues/56, https://github.com/guybedford/es-module-lexer/issues/53 and https://github.com/guybedford/es-module-lexer/issues/98.

To summarize the changes:

This also includes a bugfix for the asm.js build with multiline dynamic imports.

Since this is a breaking change it will be the 0.10 release.

It also includes some hard-won optimization work bringing the footprints from:

    dist/lexer.js:  4,670B Brotli (11,532B raw)
dist/lexer.asm.js:  4,975B Brotli (19,476B raw)

to:

    dist/lexer.js:  4,512B Brotli (10,668B raw)
dist/lexer.asm.js:  4,685B Brotli (16,896B raw)