Visitar URL original
fix(export-namespace-from): Keep import attributes by JLHwung · Pull Request #18586 · babel/babel · GitHub
Skip to content

fix(export-namespace-from): Keep import attributes - #18586

Open
JLHwung wants to merge 2 commits into
jlhwung/fix-computed-properties-spreadfrom
jlhwung/fix-export-namespace-from-attributes
Open

JLHwung wants to merge 2 commits into
jlhwung/fix-computed-properties-spreadfrom
jlhwung/fix-export-namespace-from-attributes

Conversation

@JLHwung

@JLHwung JLHwung commented Nov 11, 2026

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues? The transform result of export * as ns from "mod" with { type: "json" } loses the import attributes.
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
Need backport? No
License MIT

In this PR we fix an issue similar to #16233: This is a part of a broader Babel issue: A Babel plugin for an older language features do not pass through later language features due to the stale AST factory usage. Such issues cause plugin ordering issues: and they are typically very tedious to check / fix, but with LLM we can detect and fix them one by one, so this PR is stacked on the #18581.

@JLHwung
JLHwung added this pull request to stack #18587 November 11, 2026 13:39
@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Nov 11, 2026
@babel-bot

babel-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/63256

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

commit: 6d07a3d

export * as ns from "mod" with { type: "json" }

was compiled to an import declaration without the attributes, they are now preserved and cloned if necessary.

Assisted-by: Claude Fable 5.2
export default m from "mod" with { type: "json" }

was compiled to an export declaration without the attributes, they are now cloned.

Assisted-by: Claude Fable 5.2
@JLHwung
JLHwung force-pushed the jlhwung/fix-export-namespace-from-attributes branch from 3f4a502 to 6d07a3d Compare November 12, 2026 02:25

This branch has not been deployed

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

Labels

7.x: needs backport PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants