Repository navigation
Fix invalid output for exported destructuring declarations with defaults - #6648
lukastaegert merged 6 commits into
Conversation
|
@trleo is attempting to deploy a commit to the rollup-js Team on Vercel. A member of the Team first needs to authorize it. |
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install trleo/rollup#fix/rollup-6646-destructuring-default-exportNotice: To build the native dependencies, you need Rustup installed; the required nightly toolchain is then picked up automatically from |
lukastaegert
left a comment
There was a problem hiding this comment.
Thank you for your fix. I took the liberty to slightly simplify it and also reduce the huge amount of comments and extend test coverage.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6648 +/- ##
=======================================
Coverage 98.33% 98.33%
=======================================
Files 380 380
Lines 14070 14081 +11
Branches 3007 3011 +4
=======================================
+ Hits 13836 13847 +11
Misses 192 192
Partials 42 42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Performance report
|
The chunk-level export resolution already keeps variables declared in destructuring patterns on plain local names, so the dedicated binding-name API and the render branch were dead code. Remove them, extend the tests to cover update/for-of and reassigned rest bindings, and pin the CJS export shape with a form snapshot.
4877713 to
4308865
Compare
|
This PR has been released as part of rollup@4.68.1. You can test it via |
Exported destructuring declarations could produce invalid output in non-ES formats. The bug is broader than the reported default case: any exported variable in a destructuring pattern was rendered invalidly because Identifier.render used the base qualified name in binding positions.
The fix renders binding identifiers with the plain name and uses a live getter for reassigned pattern variables, so exports stay live.
Fixes #6646
Trleo