Skip to content

fix(es/minifier): retain class evaluation semantics - #12331

Open
labor0-bot[bot] wants to merge 5 commits into
mainfrom
fix/es-minifier-class-evaluation
Open

labor0-bot[bot] wants to merge 5 commits into
mainfrom
fix/es-minifier-class-evaluation

Conversation

@labor0-bot

@labor0-bot labor0-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description:

Preserve class evaluation when side-effect extraction would change implicit strict-mode behavior or skip superclass constructor/null validation. The extractor now retains classes with non-null heritage and declines sloppy-context assignments and deletions, while preserving safe extraction in strict, no-heritage, and extends null cases.

Add SWC-owned execution fixtures for static public/private/block assignments, heritage TypeErrors, valid controls, and static-call ordering. Add a patch changeset for swc_ecma_minifier and swc_core.

Related issue (if exists):

Closes #12309
Closes #12310

Testing:

  • UPDATE=1 cargo test -p swc_ecma_minifier
  • cargo test -p swc_ecma_minifier
  • ./scripts/exec.sh
  • cargo fmt --all
  • cargo clippy -p swc_ecma_minifier --all-targets -- -D warnings

Unavailable: git submodule update --init --recursive is disabled by the runner because submodules require independently bound credentials; ./scripts/test.sh fails in swc --test tsc on stale derived-class snapshots; workspace-wide Clippy is blocked by absent html5lib submodule fixtures.

@changeset-bot

changeset-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9a13962

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.

@codspeed

codspeed Bot commented Sep 9, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 200 untouched benchmarks
⏩ 61 skipped benchmarks1


Comparing fix/es-minifier-class-evaluation (9a13962) with main (c3e2d35)

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.

@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: 62024bec0f

ℹ️ 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".

Comment thread crates/swc_ecma_minifier/src/compress/optimize/util.rs
Comment thread crates/swc_ecma_minifier/src/compress/optimize/util.rs
Comment thread crates/swc_ecma_minifier/src/compress/optimize/util.rs
Comment thread crates/swc_ecma_minifier/src/compress/optimize/util.rs
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.

es/minifier: unused class elimination removes superclass validation es/minifier: class effect extraction loses implicit strict mode

2 participants