Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@schwing
Copy link
Contributor

@schwing schwing commented Dec 19, 2025

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

Fixes regression introduced in #5842 (v4.34.7).

Found this issue when importing a third party module that exports like export * as ns from './values.js';. This worked through version v4.34.6, with the issue introduced in v4.34.7 continuing through current latest version v4.53.5 as of this writing.

Add a check in MemberExpression.include to call this.variable.includePath(UNKNOWN_PATH, context) when includeChildrenRecursively is true, ensuring namespace properties are preserved.

This mirrors the change made to IdentifierBase.include in #5842, which added the same check. MemberExpression was missing this handling for its namespace variable.

Added two tests, one for each case I found while debugging, export * as ns from './values.js'; and import * as ns from './dep.js';.

Repl for reproducing the issue

Uncomment the last line to see the difference in the resulting const foo =.

https://rollupjs.org/repl/?version=4.53.5&shareable=eyJleGFtcGxlIjpudWxsLCJtb2R1bGVzIjpbeyJjb2RlIjoiaW1wb3J0IHsgbnMgfSBmcm9tICcuL2RlcC5qcyc7XG5cbmZ1bmN0aW9uIHJ1bkluVHJ5Q2F0Y2goZm4pIHtcblx0dHJ5IHtcblx0XHRyZXR1cm4gZm4oKTtcblx0fSBjYXRjaCB7fVxufVxuXG5mdW5jdGlvbiBnZXRCYXIob2JqKSB7XG5cdHJldHVybiBvYmouYmFyO1xufVxuXG4vLyBUaGlzIHJlc3VsdHMgaW4gYGNvbnN0IGZvbyA9IHsgfTtgXG5ydW5JblRyeUNhdGNoKCgpID0-IGdldEJhcihucy5mb28pKTtcblxuLy8gVW5jb21tZW50aW5nIHRoaXMgcmVzdWx0cyBpbiBgY29uc3QgZm9vID0geyBiYXI6ICdiYXonIH07YCBcbi8vZ2V0QmFyKG5zLmZvbyk7IiwiaXNFbnRyeSI6dHJ1ZSwibmFtZSI6Im1haW4uanMifSx7ImNvZGUiOiJleHBvcnQgKiBhcyBucyBmcm9tICcuL3ZhbHVlcy5qcyc7IiwiaXNFbnRyeSI6ZmFsc2UsIm5hbWUiOiJkZXAuanMifSx7ImNvZGUiOiJleHBvcnQgY29uc3QgZm9vID0geyBiYXI6ICdiYXonIH07IiwiaXNFbnRyeSI6ZmFsc2UsIm5hbWUiOiJ2YWx1ZXMuanMifV0sIm9wdGlvbnMiOnsib3V0cHV0Ijp7ImZvcm1hdCI6ImVzIn0sInRyZWVzaGFrZSI6dHJ1ZX19

Fixes regression introduced in #5842 (v4.34.7).

Add a check in `MemberExpression.include` to call
`this.variable.includePath(UNKNOWN_PATH, context)` when
`includeChildrenRecursively` is true, ensuring namespace properties are
preserved.

This mirrors the change made to `IdentifierBase.include` in #5842, which
added the same check. `MemberExpression` was missing this handling for
its namespace variable.
@vercel
Copy link

vercel bot commented Dec 19, 2025

@schwing is attempting to deploy a commit to the rollup-js Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Dec 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
rollup Ready Ready Preview, Comment Dec 20, 2025 7:03am

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, nice catch, and thank you for the well-crafted fix! Will merge this right away if CI agrees.

@codecov
Copy link

codecov bot commented Dec 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.76%. Comparing base (160514d) to head (4fbe4b4).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6216   +/-   ##
=======================================
  Coverage   98.76%   98.76%           
=======================================
  Files         271      271           
  Lines       10660    10662    +2     
  Branches     2852     2853    +1     
=======================================
+ Hits        10528    10530    +2     
  Misses         89       89           
  Partials       43       43           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lukastaegert lukastaegert added this pull request to the merge queue Dec 20, 2025
Merged via the queue into rollup:master with commit e5e01c1 Dec 20, 2025
80 of 81 checks passed
@github-actions
Copy link

This PR has been released as part of [email protected]. You can test it via npm install rollup.

@schwing
Copy link
Contributor Author

schwing commented Dec 22, 2025

Thanks for the quick response @lukastaegert! Glad I could contribute something back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants