Conversation
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Revert the optimization that skipped wrapping modules without imports and only side effects, ensuring all modules are correctly wrapped again.
- Restore wrapping behavior for modules that have side effects even if they lack imports.
- Update expected snapshots across tests to reflect the restored
__esminitialization calls.
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rolldown/src/stages/link_stage/wrapping.rs | Removed early exit that skipped wrapping for modules without imports and side effects. |
| crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap | Updated hashed filenames in snapshots due to restored wrapping. |
| crates/rolldown/tests/rolldown/topics/bundler_esm_cjs_tests/25/artifacts.snap | Added init_bar/init_foo calls in CJS artifacts. |
| crates/rolldown/tests/rolldown/topics/bundler_esm_cjs_tests/24/artifacts.snap | Added init_bar/init_foo calls in ESM artifacts. |
| crates/rolldown/tests/rolldown/issues/3437/artifacts.snap | Imported __esm where needed for wrapping side-effect modules. |
| crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/top_level_await_syntax_minify/artifacts.snap | Adjusted helper invocation order for strict execution. |
| crates/rolldown/tests/rolldown/function/experimental/strict_execution_order/remove_unused_no_side_effect_module/artifacts.snap | Added initialization call for no-side-effect module. |
| crates/rolldown/tests/rolldown/function/advanced_chunks/issue_2617/artifacts.snap | Inserted init_shaked call before lib.js execution. |
| crates/rolldown/tests/rolldown/function/advanced_chunks/basic/artifacts.snap | Exported init_a/init_b and invoked them in a.js/b.js. |
| crates/rolldown/tests/esbuild/default/top_level_await_forbidden_require/artifacts.snap | Added init_something invocation before top-level await. |
| crates/rolldown/tests/esbuild/default/export_forms_common_js/artifacts.snap | Initialized abc and xyz via __esm calls and invoked them. |
| crates/rolldown/tests/esbuild/dce/tree_shaking_in_esm_wrapper/artifacts.snap | Ensured init_lib() is called before tree-shaken functions. |
Files not reviewed (1)
- crates/rolldown/tests/rolldown/function/advanced_chunks/split_node_modules/artifacts.snap: Language not supported
9f1f3e9 to
1626cb5
Compare
hyf0
commented
May 26, 2025
...lldown/tests/rolldown/function/experimental/strict_execution_order/issue_4684/artifacts.snap
Show resolved
Hide resolved
… on others and have side effect #4670`
1626cb5 to
221794c
Compare
shulaoda
approved these changes
May 26, 2025
Contributor
Benchmarks Rust
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Close #4684.
No side effect is not the full condition to safely remove the wrapper. A module might not have side effects, but it might rely on the order that side-effect module get executed first. See the case at #4684.