Skip to content

fix(es/minifier): Remove inert property writes to fresh objects - #12278

Open
labor0-bot[bot] wants to merge 6 commits into
mainfrom
labor0/fix-minifier-const-prop-assign-pure
Open

labor0-bot[bot] wants to merge 6 commits into
mainfrom
labor0/fix-minifier-const-prop-assign-pure

Conversation

@labor0-bot

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

Copy link
Copy Markdown
Contributor

Description:

Remove unused simple property writes to fresh RegExp literals and eligible function/class prototype objects with pure_getters: true, side_effects: true, and pristine built-ins. Keep RHS evaluation, including both x() and y(), and preserve Simulator's this._aircraft initialization. Dynamic keys, accessors, spreads, escaped objects, and observable class initialization remain conservative.

Activate only properties/const_prop_assign_pure/input.js. Its existing output.terser.js preserves both calls; accept that alternate baseline directly instead of rewriting output.js during validation. All existing Terser fixture assets and other backlog entries remain unchanged. Add six SWC-owned regression fixtures and patch changesets for swc_ecma_minifier and swc_core.

Validation:

Passed:

  • cargo test -p swc_ecma_minifier --test compress fixture_tests__terser__compress__
  • cargo test -p swc_ecma_minifier
  • (cd crates/swc_ecma_minifier && ./scripts/test.sh)
  • (cd crates/swc_ecma_minifier && ./scripts/exec.sh)
  • cargo fmt --all
  • cargo clippy -p swc_ecma_minifier --all-targets -- -D warnings

Unavailable or blocked validation:

  • git submodule update --init --recursive is disabled by the hosted runner because each submodule requires an independently bound repository credential.
  • cargo clippy --all --all-targets -- -D warnings fails in swc_html_parser's html5lib_tests: the unavailable HTML5lib submodule causes two No test found fixture-macro panics and consequent unused-import errors.

Related issue (if exists):

None.

@labor0-bot
labor0-bot Bot requested review from a team as code owners September 6, 2026 08:28
@changeset-bot

changeset-bot Bot commented Sep 6, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b05ef37

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.

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

ℹ️ 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/tests/compress.rs Outdated
@codspeed

codspeed Bot commented Sep 6, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 200 untouched benchmarks
⏩ 61 skipped benchmarks1


Comparing labor0/fix-minifier-const-prop-assign-pure (b05ef37) with main (a5bd592)

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: 8b126bd468

ℹ️ 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/mod.rs Outdated

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

ℹ️ 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/tests/compress.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.

2 participants