Visitar URL original
fix(es/minifier): avoid JSX sequence inlining loop by labor0-bot[bot] · Pull Request #12149 · swc-project/swc · GitHub
Skip to content

fix(es/minifier): avoid JSX sequence inlining loop - #12149

Merged
Donny/강동윤 (kdy1) merged 2 commits into
mainfrom
fix/minifier-jsx-sequence-progress
Aug 25, 2026
Merged

Donny/강동윤 (kdy1) merged 2 commits into
mainfrom
fix/minifier-jsx-sequence-progress

Conversation

@labor0-bot

@labor0-bot labor0-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description:

Prevent sequence inlining from reporting progress when an identifier is used solely as a JSX element name, which cannot be represented by an arbitrary replacement expression. The replacement is preflighted before consuming the initializer, and evaluator regression tests cover parenthesized JSX, direct JSX, and normal expression inlining.

Related issue (if exists):

Closes #12148

@labor0-bot
labor0-bot Bot requested a review from a team as a code owner August 24, 2026 11:19
@changeset-bot

changeset-bot Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1e5e3ed

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

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@labor0-bot

labor0-bot Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Continue working with Labor0

Submit a formal review from Files changed, or leave an inline review comment; neither requires an @mention. To request work from Conversation, include @labor0-bot plus a meaningful instruction in the comment.

Reviews from collaborators with Write, Maintain, or Admin access are handled automatically. Ask a question for an explanation, or request a code change and Labor0 will evaluate it and update this pull request when appropriate.

Successful change requests update the branch without a routine completion reply. Labor0 replies to questions and non-actionable feedback and resolves each processed inline review thread unless clarification is required. Conversation comments have no review thread to resolve. Automated review boilerplate paired with selected inline feedback does not receive a separate reply. Related feedback may be handled together, so wait for any necessary replies, new commits, and required checks before merging.

Learn more


Labor0 task status

  • Status: Completed
  • Current work: None
  • Last updated: 2026-08-25 04:12 UTC

Open the Labor0 task

@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: b094657a49

ℹ️ 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 (@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 (@codex) address that feedback".

// `ExprReplacer` cannot replace (for example, JSX element names).
// Probe the actual replacer before taking the initializer so a failed
// replacement cannot report progress or discard the source binding.
let mut replacement_probe = b.clone();

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 Avoid cloning the whole expression to probe replacement

When b is a large fallback expression—particularly a parenthesized JSX subtree—this deep-clones and traverses the entire AST before traversing the original again, adding allocations and potentially substantial latency in this hot minifier path. Use a read-only replaceability visitor, or make ExprReplacer report whether it consumed the value, so the preflight does not duplicate the subtree.

AGENTS.md reference: AGENTS.md:L7-L7

Useful? React with 👍 / 👎.

@codspeed

codspeed Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 200 untouched benchmarks
⏩ 61 skipped benchmarks1


Comparing fix/minifier-jsx-sequence-progress (1e5e3ed) with main (61ff097)

Open in CodSpeed

Footnotes

  1. 61 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. ↩

@kdy1 Donny/강동윤 (kdy1) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add changeset

@labor0-bot
labor0-bot Bot requested a review from a team as a code owner August 24, 2026 11:51

@kdy1 Donny/강동윤 (kdy1) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving as there's no perf regression

@kdy1
Donny/강동윤 (kdy1) merged commit 4e79b94 into main Aug 25, 2026
109 of 112 checks passed
@kdy1
Donny/강동윤 (kdy1) deleted the fix/minifier-jsx-sequence-progress branch August 25, 2026 04:12
@github-actions github-actions Bot added this to the Planned milestone Aug 25, 2026
@github-actions github-actions Bot modified the milestones: Planned, v1.16.2 Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

minifier: Evaluator loops forever when a sequence candidate is used as a JSX element name

2 participants