Skip to content

feat(pack): support React 17 compiler target - #3341

Merged
fireairforce merged 2 commits into
nextfrom
zoomdong/feat-react17-compiler
Sep 9, 2026
Merged

fireairforce merged 2 commits into
nextfrom
zoomdong/feat-react17-compiler

Conversation

@fireairforce

@fireairforce fireairforce commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Accept reactCompiler: { target: "17" } in the TypeScript API, Rust configuration, and generated JSON Schema. The existing compiler dependency already supports React 17, but utoo's target enum previously rejected it. React 19 remains the default; React 17/18 applications must install react-compiler-runtime as a runtime dependency.

Pin the next.js submodule to merged commit 3409f1882aa5ea8b3ddc70b32ae590277a9d2bb1 from utooland/next.js#189. Its source tree is identical to the previously tested compiler commit. Add a React 17 bundler snapshot that verifies the standalone runtime import and generated memoization, while retaining the existing default React 19 snapshot.

Test Plan

  • cargo fmt and cargo fmt --check
  • cargo clippy --all-targets -- -D warnings --no-deps
  • cargo run -p pack-schema
  • cargo test -p pack-tests --test snapshot react_compiler
  • tsc -p packages/pack-shared/tsconfig.json --noEmit
  • tombi format --check, biome ci, and typos

@fireairforce
fireairforce marked this pull request as ready for review September 8, 2026 08:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T08:53:21.187498Z fe86d49 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

📊 Performance Benchmark Report (with-antd)

Utoopack Performance Report

Report ID: utoopack_performance_report_20260908_090440
Generated: 2026-09-08 09:04:40
Trace File: trace_antd.json (0.3GB, 0.82M spans)
Test Project: examples/with-antd


Executive Summary

Metric Value Assessment
Total Wall Time 6,229.4 ms Baseline
Total Thread Work (de-duped) 18,373.7 ms Non-overlapping busy time
Effective Parallelism 2.9x thread_work / wall_time
Working Threads 10 Threads with actual spans
Thread Utilization 29.5% ⚠️ Suboptimal
Total Spans 820,101 All B/E + X events
Meaningful Spans (>= 10us) 205,752 (25.1% of total)
Tracing Noise (< 10us) 614,349 (74.9% of total)

Build Phase Timeline

Shows when each build phase is active and how much CPU it consumes.
Self-Time is the time spent exclusively in that phase (excluding children).

Phase Spans Inclusive (ms) Self-Time (ms) Wall Range (ms)
Resolve 47,250 6,348.2 1,754.3 2,949.8
Parse 8,184 1,363.6 1,014.3 5,707.2
Analyze 131,276 37,713.5 8,288.4 5,615.0
Chunk 5,733 5,652.8 950.9 2,380.5
Codegen 10,615 2,185.6 1,381.2 2,045.1
Emit 32 37.9 19.0 8.9
Other 2,662 6,210.0 3,417.7 6,229.3

Workload Distribution by Diagnostic Tier

Category Spans Inclusive (ms) % Work Self-Time (ms) % Self
P0: Scheduling & Resolution 178,781 44,645.0 243.0% 10,290.9 56.0%
P1: I/O & Heavy Tasks 2,890 115.7 0.6% 96.7 0.5%
P2: Architecture (Locks/Memory) 0 0.0 0.0% 0.0 0.0%
P3: Asset Pipeline 23,091 9,239.6 50.3% 3,367.5 18.3%
P4: Bridge/Interop 0 0.0 0.0% 0.0 0.0%
Other 990 5,511.2 30.0% 3,070.6 16.7%

Top 20 Tasks by Self-Time

Self-time is the exclusive duration: time spent in the task itself, not in sub-tasks.
This is the most accurate indicator of where CPU cycles are actually spent.

Self (ms) Inclusive (ms) Count Avg Self (us) P95 Self (ms) Max Self (ms) % Work Task Name Top Caller
4,148.0 23,357.5 90,585 45.8 0.1 9.5 22.6% module module (60%)
2,002.1 2,126.4 2,276 879.7 2.8 213.2 10.9% analyze ecmascript module module (76%)
1,938.4 2,038.8 20 96920.9 302.6 485.0 10.5% save snapshot persist (5%)
1,261.8 11,131.3 29,233 43.2 0.1 6.0 6.9% process module process module (80%)
1,153.6 3,102.1 25,591 45.1 0.1 5.3 6.3% internal resolving internal resolving (76%)
946.1 1,295.4 6,014 157.3 0.6 60.4 5.1% parse ecmascript parse ecmascript (65%)
821.5 5,254.8 3,983 206.2 0.2 97.2 4.5% chunking chunking (44%)
776.7 844.5 8,366 92.8 0.4 4.7 4.2% precompute code generation generate merged code (42%)
731.3 838.5 6,572 111.3 0.4 129.1 4.0% compute async module info compute async module info (55%)
636.1 2,065.1 731 870.1 1.9 216.7 3.5% generate merged code chunking (60%)
591.1 3,236.6 20,971 28.2 0.0 4.8 3.2% resolving module (57%)
414.5 414.5 329 1259.9 1.1 245.4 2.3% generate source map code generation (83%)
367.3 783.0 129 2847.1 4.7 217.9 2.0% emit code emit code (53%)
314.2 541.6 1,354 232.1 0.1 171.9 1.7% write all entrypoints to disk write all entrypoints to disk (16%)
190.0 926.6 1,920 99.0 0.2 38.6 1.0% code generation code generation (84%)
124.8 392.6 1,666 74.9 0.1 10.7 0.7% compute async chunks compute async chunks (47%)
104.1 104.1 9 11571.0 58.8 95.3 0.6% blocking save snapshot (56%)
89.4 105.9 729 122.6 0.0 31.9 0.5% compute binding usage info compute binding usage info (49%)
68.2 68.2 2,168 31.5 0.0 3.0 0.4% read file parse ecmascript (91%)
42.6 75.1 1,863 22.9 0.0 15.7 0.2% collect mergeable modules collect mergeable modules (100%)

Critical Path Analysis

The longest sequential dependency chains that determine wall-clock time.
Focus on reducing the depth of these chains to improve parallelism.

Rank Self-Time (ms) Depth Path
1 489.1 3 persist → save snapshot → blocking
2 438.1 6 chunking → generate merged code → emit code → emit code → emit code → read file
3 282.3 4 chunking → generate merged code → emit code → generate source map
4 213.6 7 module → module → process module → process module → process module → process module → analyze ecmascript module
5 192.5 4 chunking → generate merged code → emit code → generate source map

Batching Candidates

High-volume tasks dominated by a single parent. If the parent can batch them,
it drastically reduces scheduler overhead.

Task Name Count Top Caller (Attribution) Avg Self P95 Self Total Self
process module 29,233 process module (80%) 43.2 us 0.07 ms 1,261.8 ms
internal resolving 25,591 internal resolving (76%) 45.1 us 0.08 ms 1,153.6 ms

Duration Distribution

Range Count Percentage
<10us 614,349 74.9%
10us-100us 134,081 16.3%
100us-1ms 61,723 7.5%
1ms-10ms 9,732 1.2%
10ms-100ms 178 0.0%
>100ms 38 0.0%

Action Items

  1. [P0] Focus on tasks with the highest Self-Time — these are where CPU cycles are actually spent.
  2. [P0] Use Batching Candidates to identify callers that should use try_join or reduce #[turbo_tasks::function] granularity.
  3. [P1] Check Build Phase Timeline for phases with disproportionate wall range vs. self-time (= serialization).
  4. [P1] Inspect P95 Self (ms) for heavy monolith tasks. Focus on long-tail outliers, not averages.
  5. [P1] Review Critical Paths — reducing the longest chain depth directly improves wall-clock time.
  6. [P2] If Thread Utilization < 60%, investigate scheduling gaps (lock contention or deep dependency chains).

Report generated by Utoopack Performance Analysis Agent

@fireairforce
fireairforce merged commit e702fc1 into next Sep 9, 2026
65 of 77 checks passed
@fireairforce
fireairforce deleted the zoomdong/feat-react17-compiler branch September 9, 2026 06:34
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.

2 participants