feat(runtime): introduce experimental.runtimeMode#14254
Conversation
📦 Binary Size-limit
❌ Size increased by 88.13KB from 62.60MB to 62.68MB (⬆️0.14%) |
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 5 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 popular-libsPath:
📦 Download Diff Report: popular-libs Bundle Diff 📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff 🤖 AI Degradation Analysis (Click to expand)📁 popular-libs📊 Size ChangesNo significant regressions detected 🎉 🔍 Root Cause Analysis
|
Merging this PR will improve performance by 11.64%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | rust@create_chunk_assets |
3.2 ms | 3.3 ms | -3.07% |
| ⚡ | WallTime | bundle@threejs-10x-development |
308.7 ms | 223.7 ms | +37.99% |
| ⚡ | Simulation | rust@persistent_cache_restore@basic-react-development |
15.8 ms | 15.2 ms | +4.02% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing codex/runtime-proxy-context-redesign (e867c35) with main (1fd4fca)
Footnotes
-
40 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. ↩
14633c9 to
59afc1b
Compare
Deploying rspack with
|
| Latest commit: |
55a76d8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ec6512e6.rspack-v2.pages.dev |
| Branch Preview URL: | https://codex-runtime-proxy-context.rspack-v2.pages.dev |
5172147 to
55a76d8
Compare
0cc26f1 to
e867c35
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e867c3553b
ℹ️ 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".
| if parser.compiler_options.experiments.runtime_mode != ExperimentRuntimeMode::Rspack { | ||
| return None; | ||
| } | ||
| static_require_member_chain(parser, for_name, members, member_expr.span, false) |
There was a problem hiding this comment.
Preserve trailing require member chains
When experiments.runtimeMode is 'rspack' and code reads a static chain beyond a known runtime global, such as __webpack_require__.g.document or __webpack_require__.m.foo, members.first() only maps the first property but this call passes the full member_expr.span, so the dependency replaces the entire chain with __rspack_context.g/.m and drops the trailing property. This changes the generated code for those inputs; use the member ranges to replace only the __webpack_require__.<prop> prefix or bail out when there are additional members.
Useful? React with 👍 / 👎.
Summary
Introduce
experiments.runtimeModeas an experimental runtime rendering mode.This PR adds the rspack runtime context path and updates runtime code generation so runtime globals can be rendered through
__rspack_contextin rspack mode while preserving the existing webpack-compatible runtime output by default.Main changes:
SCRIPT_NONCE; nonce code is emitted only when the runtime requirement is actually present.