Skip to content

feat!: revert enable verbatimModuleSyntax#12846

Merged
hardfist merged 1 commit intomainfrom
yj/revert-verbatim
Jan 26, 2026
Merged

feat!: revert enable verbatimModuleSyntax#12846
hardfist merged 1 commit intomainfrom
yj/revert-verbatim

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

@hardfist hardfist commented Jan 26, 2026

Summary

Reverts #12668
setting verbatimModuleSyntax to true will cause huge performance regression caused by build unnecessary modules(which is removed by verbatimModuleSyntax) for some cases. so consider revert it back to false

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 26, 2026 10:00
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Jan 26, 2026
@hardfist hardfist changed the title Revert "feat!: enable verbatimModuleSyntax of builtin:swc-loader feat!: revert enable verbatimModuleSyntax Jan 26, 2026
@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Jan 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts the previous change that enabled verbatimModuleSyntax by default in builtin:swc-loader, aligning behavior, tests, and documentation back with the non‑verbatim default.

Changes:

  • Remove English and Chinese documentation that stated builtin:swc-loader enables verbatimModuleSyntax by default and showed how to turn it off.
  • Remove the tests/rspack-test/configCases/builtin-swc-loader/verbatim-module-syntax integration test case and its associated TS/JS files and README that validated the default verbatimModuleSyntax: true behavior.
  • Adjust SwcLoader’s transform setup to stop forcing verbatim_module_syntax = true and to only merge a TransformConfig (setting react.development) when a jsc.transform config is already present.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/docs/en/guide/features/builtin-swc-loader.mdx Removes the tip describing verbatimModuleSyntax as enabled by default and how to disable it, so docs no longer claim that behavior.
website/docs/zh/guide/features/builtin-swc-loader.mdx Chinese docs updated in the same way, removing the default-verbatimModuleSyntax tip and example.
tests/rspack-test/configCases/builtin-swc-loader/verbatim-module-syntax/types.ts Deletes test‑only TypeScript types used to verify that type‑only imports are erased under default verbatimModuleSyntax.
tests/rspack-test/configCases/builtin-swc-loader/verbatim-module-syntax/lib.ts Deletes the TS helper module that imported the test types and exposed runtime values to assert the behavior of verbatimModuleSyntax.
tests/rspack-test/configCases/builtin-swc-loader/verbatim-module-syntax/index.js Removes the Jest/Mocha-style test that asserted verbatimModuleSyntax: true was enabled by default.
tests/rspack-test/configCases/builtin-swc-loader/verbatim-module-syntax/rspack.config.js Removes the dedicated Rspack config used to run the verbatim module syntax test case.
tests/rspack-test/configCases/builtin-swc-loader/verbatim-module-syntax/README.md Deletes README documenting what verbatimModuleSyntax does and the expectations of the now-removed test case.
crates/rspack_loader_swc/src/lib.rs Stops forcing transform.verbatim_module_syntax = true in SwcLoader and changes the merge logic so that a default TransformConfig (with react.development set) is only merged when config.jsc.transform is already present, altering behavior beyond just the verbatimModuleSyntax default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

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

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: f36aa578aa

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions
Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (b726ec5668) does not have baseline artifacts. Using commit 419edec841 for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 5 projects in monorepo, 3 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB +8.0 B (0.0%)
react-1k 825.5 KB 0
react-5k 2.7 MB -1.0 B (-0.0%)
rome 984.2 KB -1.7 KB (-0.2%)
ui-components 2.3 MB 0
📋 Detailed Reports (Click to expand)

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

📌 Baseline Commit: 419edec841 | PR: #12841

Metric Current Baseline Change
📊 Total Size 5.7 MB 5.7 MB +8.0 B (0.0%)
📄 JavaScript 5.7 MB 5.7 MB +8.0 B (0.0%)
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-10k Bundle Diff

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

📌 Baseline Commit: 419edec841 | PR: #12841

Metric Current Baseline Change
📊 Total Size 2.7 MB 2.7 MB -1.0 B (-0.0%)
📄 JavaScript 2.7 MB 2.7 MB -1.0 B (-0.0%)
🎨 CSS 21.0 B 21.0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: react-5k Bundle Diff

📁 rome

Path: ../build-tools-performance/cases/rome/dist/rsdoctor-data.json

📌 Baseline Commit: 419edec841 | PR: #12841

Metric Current Baseline Change
📊 Total Size 984.2 KB 985.9 KB -1.7 KB (-0.2%)
📄 JavaScript 984.2 KB 985.9 KB -1.7 KB (-0.2%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: rome Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing f36aa57 to fix(mf): use dynamic exports type for MF modules (#12841) by Gengkun

🙈 Size remains the same at 48.33MB

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: f36aa57
Status: ✅  Deploy successful!
Preview URL: https://220c02a9.rspack-v2.pages.dev
Branch Preview URL: https://yj-revert-verbatim.rspack-v2.pages.dev

View logs

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jan 26, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing yj/revert-verbatim (f36aa57) with main (419edec)

Summary

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@hardfist hardfist merged commit 36b6f6f into main Jan 26, 2026
93 of 100 checks passed
@hardfist hardfist deleted the yj/revert-verbatim branch January 26, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants