feat: tree-shake deterministic dynamic imports#4952
feat: tree-shake deterministic dynamic imports#4952lukastaegert merged 26 commits intorollup:masterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #4952 +/- ##
=======================================
Coverage 98.98% 98.98%
=======================================
Files 222 222
Lines 8050 8112 +62
Branches 2210 2236 +26
=======================================
+ Hits 7968 8030 +62
Misses 28 28
Partials 54 54
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
04cd599 to
913bb4c
Compare
056a017 to
9ac9832
Compare
lukastaegert
left a comment
There was a problem hiding this comment.
Just some final comments and a possible optimization I stumbled upon.
|
This PR has been released as part of [email protected]. You can test it via |
| * - `const { foo } = await import('bar')`. | ||
| * - `(await import('bar')).foo` | ||
| * - `import('bar').then(({ foo }) => {})` |
There was a problem hiding this comment.
Should this be doc'ed here too? https://rollupjs.org/introduction/#tree-shaking
There was a problem hiding this comment.
Any PR for the docs is welcome! I guess something similar to what Parcel has does not hurt.
There was a problem hiding this comment.
Is this what you're referring to? https://parceljs.org/features/scope-hoisting/#dynamic-imports
There was a problem hiding this comment.
👍
And we might even include a REPL link to see it in action and play around
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
resolves #4951
fix #3417
fix #3447
Description
Full proposal in #4951
This PR enables tree-shaking for deterministic dynamic imports. The following are valid cases:
Idea credits to: