-
-
Notifications
You must be signed in to change notification settings - Fork 7k
fix: handle dynamic import with .then(m => m.a)
#20117
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
fix: handle dynamic import with .then(m => m.a)
#20117
Conversation
/ecosystem-ci run |
commit: |
This comment was marked as outdated.
This comment was marked as outdated.
📝 Ran ecosystem CI on
✅ laravel, nuxt, marko, ladle, unocss, rakkas, quasar, vite-plugin-react, react-router, qwik, storybook, vite-environment-examples, vite-plugin-pwa, vitest, vuepress, vitepress, vite-setup-catalogue, vite-plugin-vue, waku, vite-plugin-svelte |
vike is failing with a different error but the reason is same with #20080 (comment) and not caused by this PR. |
## [1.0.0-beta.19] - 2025-06-22 ### 🚀 Features - support `OutputOptions#manualChunks` (#5037) by @hyf0 - advanced-chunks: support `advancedChunks#gruop#name` to be function (#5035) by @hyf0 - rolldown_plugin_import_glob: align with `vitejs/vite#20163` (#5034) by @shulaoda - rust/advanced-chunks: support `MatchGroup#name` to be dynamic (#5033) by @hyf0 - rolldown_plugin_build_import_analysis: align with `vitejs/vite#20117` (#5027) by @shulaoda - rolldown_plugin_build_import_analysis: align with `vitejs/vite#20115` (#5020) by @shulaoda - add validation warning for advanced chunks options without groups (#5009) by @sapphi-red ### 🐛 Bug Fixes - moduleInfo is not updated when entry module is emitted by this.emitFile (#5032) by @IWANABETHATGUY - preserveEntrySignatures: false generates circular imports that hangs with TLA (#5029) by @IWANABETHATGUY - rolldown_plugin_build_import_analysis: align pure dynamic import handling with rolldown-vite (#5016) by @shulaoda - plugin/vite-resolve: normalize leading slash (#5013) by @sapphi-red - debug: `build_id` doesn't increase (#5015) by @hyf0 - side effects in this.emitFile({ type: 'chunk' }) is removed when preserveEntrySignatures: false is set (#5012) by @IWANABETHATGUY ### 🚜 Refactor - rolldown_utils: simplify `block_on_spawn_all` (#5019) by @shulaoda - use `rolldown_utils::futures::block_on` for `WatcherImpl#start` (#5018) by @shulaoda ### 📚 Documentation - jsdoc: document `experimental.attachDebugInfo` (#5028) by @hyf0 - clarify that `advancedChunks` options are in bytes (#5022) by @sapphi-red - add a note that sequential conversion may break the code (#5024) by @sapphi-red ### ⚙️ Miscellaneous Tasks - infra: clean up `dist` before building `rolldown` (#5036) by @hyf0 - Align status notice in readme with documentation (#5021) by @rijkvanzanten ### ❤️ New Contributors * @rijkvanzanten made their first contribution in [#5021](#5021) Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
Description
fixes #19695
close #19721
#19722 implements the preload mechanism using a different approach from the current one. With that approach, we can avoid wrapping the dynamic imports in the
transform
hook, which allows Rollup to analyze the used imports more easily. However, the downside is that it marks marks all modules containing a dynamic import as side-effectful, which can lead to less optimal chunking (#19722 (review)).While the current implementation is a bit fragile, we're planning to migrate to Rolldown. This will unlock native plugins, which should reduce the cost of AST traversal and allow us to improve the robustness of this part without impacting performance. Given that, I think we can stick with the current approach for now.
refs #14221 #17472