Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Dynamic import refinements & fixes, optimization #102

Merged
merged 2 commits into from Feb 22, 2022

Conversation

guybedford
Copy link
Owner

@guybedford guybedford commented Feb 22, 2022

This PR upgrades dynamic import analysis, as described in the readme diff here, and fixes #56, #53 and #98.

To summarize the changes:

  • d no longer tracks the start of the dynamic import statement import('x') but rather the start of the bracket at ('x')
  • The ss to se range can be reliably used for the whole statement import('x')
  • The s and e range will either be the inside of the brackets for an unknown expression, or the exact quoted string start and end position after whitespace and comments but including the quotes for a string literal import.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose string start/end for dynamic imports
1 participant