Skip to content

fix(es/codegen): Emit export as namespace correctly#11923

Merged
kdy1 merged 2 commits into
mainfrom
fix/codegen-export-as-namespace
Jun 7, 2026
Merged

fix(es/codegen): Emit export as namespace correctly#11923
kdy1 merged 2 commits into
mainfrom
fix/codegen-export-as-namespace

Conversation

@magic-akari

Copy link
Copy Markdown
Member

@changeset-bot

changeset-bot Bot commented Jun 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0805d72

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codspeed-hq

codspeed-hq Bot commented Jun 7, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 306 skipped benchmarks1


Comparing fix/codegen-export-as-namespace (0805d72) with main (b6dfa74)

Open in CodSpeed

Footnotes

  1. 306 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@magic-akari
magic-akari marked this pull request as ready for review June 7, 2026 06:58
@magic-akari
magic-akari requested a review from a team as a code owner June 7, 2026 06:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 971fa03cf7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 811 to 812
emit!(self.id);
Ok(())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Terminate namespace export declarations

When Config::minify is enabled, ModuleDecl::emit does not write a newline between module declarations, so this declaration needs to emit a semicolon or another separator itself. Otherwise a .d.ts module like export as namespace Foo; export {} is printed as export as namespace Fooexport{};, merging the identifier with the next export keyword and producing invalid output; the new fixture only exercises the non-minified path.

Useful? React with 👍 / 👎.

@kdy1
kdy1 requested a review from a team as a code owner June 7, 2026 07:18
@kdy1
kdy1 merged commit 4e1f832 into main Jun 7, 2026
22 of 37 checks passed
@kdy1
kdy1 deleted the fix/codegen-export-as-namespace branch June 7, 2026 07:19
@github-actions github-actions Bot added this to the Planned milestone Jun 7, 2026
kdy1 pushed a commit that referenced this pull request Jun 9, 2026
@kdy1 kdy1 modified the milestones: Planned, v1.15.41 Jun 10, 2026
@swc-project swc-project locked as resolved and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants