-
Notifications
You must be signed in to change notification settings - Fork 678
fix: apply output.paths transformation to chunk.imports and generated code #6923
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: apply output.paths transformation to chunk.imports and generated code #6923
Conversation
How to use the Graphite Merge QueueAdd the label graphite: merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Benchmarks Rust |
08198a9 to
bc8efb9
Compare
sapphi-red
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can also enable some of these tests?
rolldown/packages/rollup-tests/src/ignored-by-unsupported-features.md
Lines 139 to 144 in 3d1985a
| ### The `output.paths` is not supported | |
| - rollup@function@re-export-own: avoid using export.hasOwnProperty | |
| - rollup@function@mixed-external-paths: allows using the path option selectively | |
| - rollup@form@paths-function: external paths (#754)@generates es | |
| - rollup@form@paths-relative: external paths (#754)@generates es | |
| - rollup@form@paths: external paths (#754)@generates es |
packages/rolldown/tests/fixtures/output/paths/generate-bundle-imports-function/_config.ts
Show resolved
Hide resolved
Enabled all 5 Rollup tests for |
|
@copilot, investigate why the test failed. |
Investigated and fixed the test failures: Root cause: The Fixes applied (commit 7292044):
Test results:
|
Co-authored-by: IWANABETHATGUY <[email protected]>
Co-authored-by: IWANABETHATGUY <[email protected]>
…hunk hook Co-authored-by: IWANABETHATGUY <[email protected]>
Co-authored-by: IWANABETHATGUY <[email protected]>
- Fixed dynamic import paths transformation to use output.paths option - Fixed require() calls to use output.paths option - Fixed re-export statements to use output.paths option - Updated ignored tests list: kept 2 tests that fail for non-paths reasons (variable naming and hasOwnProperty behavior) - 3 paths-related Rollup tests now pass: mixed-external-paths, paths, paths-relative Co-authored-by: IWANABETHATGUY <[email protected]>
7292044 to
3fc69bb
Compare
## [1.0.0-beta.50] - 2025-11-12 ### 🚀 Features - rolldown: oxc_resolver v11.13.2 (#6956) by @Boshen - rolldown: oxc v0.97.0 (#6940) by @Boshen ### 🐛 Bug Fixes - handle error when creating output chunk directories (#6953) by @sapphi-red - throw error if `experimental.hmr` is set for APIs other than `dev` (#6860) by @Copilot - apply output.paths transformation to chunk.imports and generated code (#6923) by @Copilot ### 🚜 Refactor - use `anyhow::Context::context` where applicable (#6952) by @sapphi-red - dev: use actor design pattern and allow to recover from intial build error (#6936) by @hyf0 ### 📚 Documentation - add sitemap (#6929) by @mdong1909 ### 🧪 Testing - validate publishConfig.exports matches exports field (#6950) by @Copilot - re-enable output/paths/function test (#6934) by @Copilot ### ⚙️ Miscellaneous Tasks - rename `rolldown_watcher` to `rolldown_fs_watcher` (#6958) by @hyf0 - enable trust policy (#6948) by @iiio2 - deps: update napi (#6951) by @renovate[bot] - deps: update dependency rolldown-plugin-dts to v0.17.6 (#6947) by @renovate[bot] - deps: update npm packages (#6937) by @renovate[bot] - deps: update dependency tsdown to v0.16.2 (#6933) by @renovate[bot] ### ❤️ New Contributors * @mdong1909 made their first contribution in [#6929](#6929) Co-authored-by: sapphi-red <[email protected]>
chunk.importsin both therenderChunkandgenerateBundlehooks was returning original external module IDs instead of applying theoutput.pathstransformation. Additionally, the generated code for dynamic imports and require calls was not applying the transformation. This diverged from Rollup behavior.Changes
Core fixes:
finalize_chunks.rsnow callsExternalModule::get_file_name(paths)instead ofModule::id()when populating external imports inOutputChunk(forgenerateBundlehook)mod.rs(chunk utils) now callsExternalModule::get_file_name(paths)instead ofModule::id()when populating external imports inRenderedChunk(forrenderChunkhook)module_finalizers/mod.rsnow passesoptions.pathstoget_import_path()for dynamic imports, require calls, and re-export statements in generated codeTest coverage: Added tests for both object and function forms of
output.pathswith assertions for bothrenderChunkandgenerateBundlehooks to verifychunk.importsreflects transformed pathsRollup compatibility: Enabled 3 Rollup test cases that now pass (
mixed-external-paths,paths,paths-relative). Moved 2 tests to snapshot differences section (paths-functionhas different variable naming,re-export-ownhas unrelated hasOwnProperty behavior difference)Fixes [Bug]: bundle.imports of generateBundle hook missing output.paths modify #6916
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.