Skip to content

feat: enable createRequire parser by default for node targets#14826

Draft
JSerFeng wants to merge 1 commit into
codex/defer-create-require-argument-walkfrom
codex/enable-create-require-node-webpack-default
Draft

feat: enable createRequire parser by default for node targets#14826
JSerFeng wants to merge 1 commit into
codex/defer-create-require-argument-walkfrom
codex/enable-create-require-node-webpack-default

Conversation

@JSerFeng

@JSerFeng JSerFeng commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • default module.parser.javascript.createRequire to true when the resolved target is Node.js-compatible, matching webpack’s createRequire = isNode default
  • keep the default independent from javascript.requireResolve; explicit createRequire configuration still takes precedence
  • remove explicit createRequire: true from the existing Node integration case and the two ESM createRequire regression cases
  • make the requireResolve: false ESM case validate the parser delegation fix from fix: parse preserved createRequire arguments #14813 under the new Node default
  • update defaults coverage, public types, and English/Chinese documentation

This PR is stacked on #14813 and should be retargeted to main after #14813 merges.

Validation

  • corepack pnpm run build:js
  • CARGO_TARGET_DIR=/Users/bytedance/libs/rspack/target corepack pnpm run build:binding:dev
  • complete tests/rspack-test suite: 46 files, 8812 tests passed, 4 skipped
  • corepack pnpm run lint:js
  • Prettier check for all changed files
  • git diff --check

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📝 Rspack Ecosystem CI: Open

suite result
modernjs ❌ failure
rsbuild ❌ failure
rsdoctor ❌ failure
plugin ✅ success
examples ✅ success
rstest ✅ success
rslib ❌ failure
rspress ✅ success
rsbuild-rsc-plugin ✅ success
devserver ✅ success
lynx-stack ❌ failure

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 17, 2026

Copy link
Copy Markdown

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b90ccf
Status: ✅  Deploy successful!
Preview URL: https://d85ee92f.rspack-v2.pages.dev
Branch Preview URL: https://codex-enable-create-require-bvkj.rspack-v2.pages.dev

View logs

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 4b90ccf to test: make createRequire define case cross-platform by Fy

⏳ The base commit triggered a linux binding build, but its binary size data has not been generated yet, so the size comparison is skipped.

Please re-run this workflow once the ecosystem-benchmark data for that commit is published.

Warning

Reference only — not the real baseline. The base commit's data isn't ready yet, so this compares against the nearest earlier commit that has data (58d8d6b) for a rough estimate:

🙈 Size remains the same at 66.60MB

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 551.8 KB 0 0
react-1k 823.1 KB 217.0 KB 0 0
react-10k 5.6 MB 1.3 MB 0 0
react-5k 2.7 MB 663.8 KB 0 0
ui-components 4.9 MB 1.4 MB 0 0

Generated by Rsdoctor GitHub Action

@codspeed-hq

codspeed-hq Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 3.88%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 42 untouched benchmarks
⏩ 47 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation rust@create_concatenate_module 14.4 ms 15 ms -3.88%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/enable-create-require-node-webpack-default (4b90ccf) with codex/defer-create-require-argument-walk (f6879c9)

Open in CodSpeed

Footnotes

  1. 47 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.

@JSerFeng
JSerFeng force-pushed the codex/enable-create-require-node-webpack-default branch from ea71bf4 to b64f56b Compare July 17, 2026 07:36
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📝 Rspack Ecosystem CI: Open

suite result
rspress ✅ success
examples ✅ success
modernjs ❌ failure
rsdoctor ✅ success
rsbuild-rsc-plugin ✅ success
rstest ✅ success
devserver ✅ success
rslib ❌ failure
rsbuild ❌ failure
plugin ✅ success
lynx-stack ❌ failure

@JSerFeng
JSerFeng force-pushed the codex/enable-create-require-node-webpack-default branch from b64f56b to 4b90ccf Compare July 17, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant