Repository navigation
feat(commonjs): expose named data exports from wrapped entries - #2049
Open
businessdeveloper69 wants to merge 2 commits into
Open
businessdeveloper69 wants to merge 2 commits into
businessdeveloper69 wants to merge 2 commits into
Conversation
[Medium impact] The PR appears safe to merge; the cached-build failure is fixed, and no new actionable issues were found. Reviews (2) · Last reviewed commit: "fix(commonjs): handle cached named entry..." · Reviewed by Greptile |
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.
Rollup Plugin Name:
commonjsThis PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Resolves #1885.
Description
With
commonjs({ namedExportsForEntries: true }), a wrapped CommonJS entry exposes statically assigned data properties as named ESM exports. Its default export is preserved. A directly defined getter stays on the default object so importing the entry does not evaluate it. The option defaults to false.Tuta’s Undici build currently adds named exports after bundling. With the option enabled, its consumer imported
Agent,fetchandHeadersdirectly and made an HTTP request on Node 22 and 24. I also checkedreadable-stream3.6.0 against Node’s native ESM imports, including constructor identity, circular imports and lazy module execution.The type checks, repository lint, and formatting checks passed.
The cache regression test reuses
bundle.cachetwice, including after an export changes. Cached builds passed on Rollup 2, 3 and 4. Tuta’s Undici bundle and readable-stream both ran with a cache created by the previous revision. The CommonJS suite passed all 298 tests on Node 20 and 24.AI assisted.