Skip to content

refactor: Remove concatenated module second parse#14033

Draft
LingyuCoder wants to merge 2 commits into
mainfrom
codex/concat-no-second-parse-main
Draft

refactor: Remove concatenated module second parse#14033
LingyuCoder wants to merge 2 commits into
mainfrom
codex/concat-no-second-parse-main

Conversation

@LingyuCoder
Copy link
Copy Markdown
Contributor

Summary

Remove the codegen-time second parse/analyze pass from concatenated module generation.

This moves the required scope-hoisting metadata to parser/codegen metadata and pre-allocates stable names through ConcatenationScope, so dependency templates can obtain deterministic aliases without reparsing the rendered module source. The ESM library render path is updated along the same lines, and namespace/import/template export handling now registers generated symbols through the shared scope machinery.

Notes

  • Snapshot updates are expected from the new stable name allocation, namespace object rendering, and related hash changes.
  • The old diagnostic case that asserted concatenated-module post-codegen parse failure was removed because that parse path no longer exists.
  • The branch was recreated from latest origin/main to avoid carrying an unrelated local commit.

Validation

  • pnpm run build:cli:dev
  • pnpm run test:unit
  • git diff --check origin/main...HEAD

One initial full test:unit run hit a CLI serve stdout timing failure; rerunning that file passed, and the following full test:unit run passed.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

📦 Binary Size-limit

Comparing 14ec209 to feat: inline const with module declarations (#14032) by Gengkun

🎉 Size decreased by 300.00KB from 61.95MB to 61.66MB (⬇️0.47%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 13, 2026

Merging this PR will degrade performance by 5.9%

⚡ 1 improved benchmark
❌ 7 regressed benchmarks
✅ 26 untouched benchmarks
⏩ 25 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation rust@build_module_graph 925.2 ms 957.2 ms -3.34%
Simulation rust@runtime_requirements 34.7 ms 36.6 ms -5.24%
Simulation bundle@basic-react-development 308.1 ms 321.8 ms -4.27%
Simulation bundle@threejs-development 258 ms 270.1 ms -4.5%
Simulation bundle@threejs-production-sourcemap 387.4 ms 322.6 ms +20.09%
Simulation rust@concatenate_module_code_generation 99.8 ms 122.8 ms -18.73%
Simulation rust@persistent_cache_restore@basic-react-development 15.8 ms 18 ms -12%
Simulation rust@persistent_cache_restore_after_single_file_change@basic-react-development 16.6 ms 19.4 ms -14.54%

Tip

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


Comparing codex/concat-no-second-parse-main (14ec209) with main (1f4032a)

Open in CodSpeed

Footnotes

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

@LingyuCoder LingyuCoder force-pushed the codex/concat-no-second-parse-main branch 3 times, most recently from 5b7d137 to c708e5c Compare May 14, 2026 05:22
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Rsdoctor Bundle Diff Analysis

Found 6 projects in monorepo, 6 projects with changes.

📊 Quick Summary
Project Total Size Change
popular-libs 1.7 MB -
react-10k 5.7 MB -
react-1k 826.3 KB -
rome 1.6 MB -
react-5k 2.7 MB -
ui-components 4.8 MB -
📋 Detailed Reports (Click to expand)

📁 popular-libs

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 1.7 MB - -
📄 JavaScript 1.7 MB - -
🎨 CSS 0 B - -
🌐 HTML 289.0 B - -
📁 Other Assets 0 B - -

📁 react-10k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 5.7 MB - -
📄 JavaScript 5.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 react-1k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 826.3 KB - -
📄 JavaScript 826.0 KB - -
🎨 CSS 0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 rome

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 1.6 MB - -
📄 JavaScript 1.6 MB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-5k

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.7 MB - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 ui-components

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 4.8 MB - -
📄 JavaScript 4.7 MB - -
🎨 CSS 107.0 KB - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@LingyuCoder LingyuCoder force-pushed the codex/concat-no-second-parse-main branch 5 times, most recently from 574f5f6 to 68d782e Compare May 14, 2026 08:22
@LingyuCoder LingyuCoder force-pushed the codex/concat-no-second-parse-main branch from 68d782e to 60a4b05 Compare May 14, 2026 09:12
@LingyuCoder LingyuCoder changed the title [codex] Remove concatenated module second parse refactor: Remove concatenated module second parse May 14, 2026
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