Skip to content

perf(deps-dev): use native TypeScript in React sandboxes - #218

Open
glebedel wants to merge 5 commits into
mainfrom
chore/native-typescript-sandboxes
Open

glebedel wants to merge 5 commits into
mainfrom
chore/native-typescript-sandboxes

Conversation

@glebedel

@glebedel glebedel commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Upgrade the existing tsc --noEmit stage in the React web-component and React 19 sandboxes to TypeScript 7.0.2. Keep the library compiler and the Angular, Next.js and Vue compiler integrations unchanged.

CI scope: this PR introduces no workflows or jobs. The compiler-migration workflow additions have been removed, and pre-existing workflows are unchanged. This deletion changes no compiler, dependency graph, source or benchmarked command, so the recorded performance measurements remain applicable. Hosted results and bot reviews below refer to the earlier commits explicitly linked; they are not claims about the cleanup commit. The cleanup independently passed diff/reference checks and a scoped security/Forge review. Hub's existing npm run lint also passed after deletion.

The React web-component sandbox already failed under TypeScript 5.9.3 because its custom element augmented the old global JSX namespace. This PR moves that same declaration, with all property types preserved, into React’s JSX namespace. Both compilers pass on the identical repaired final source. No runtime expression or compiler configuration changes.

Both sandboxes now have npm lockfiles for reproducible npm ci installs. The React lock was generated with npm after review identified that its previous unlocked install could drift between runs. The migration-only sandbox workflow has been removed; the existing root workflow is unchanged.

Measured compiler performance

Node 22.22.0 on a 14-core macOS host; two warmup rounds followed by seven measured rounds, alternating compiler order. All 36 compiler invocations passed. Both compilers use the final locked dependency graph and identical repaired source.

Existing build stage TypeScript 5.9.3 TypeScript 7.0.2 Less time Saved per run
React web component: tsc --noEmit 0.446 s 0.104 s 76.72% 0.342 s
React 19: tsc --noEmit 0.516 s 0.104 s 79.92% 0.413 s

One-minute host load ranged from 8.03 to 8.79 on 14 cores. These are local observations, with no claim of a completely idle host. Other audit jobs were paused; unrelated user processes were not stopped. These are compiler-process measurements, not an end-to-end build or CI speedup. No incremental cache is configured. OS/package caches remained warm; package-manager startup, dependency installation, library bundling and Vite are excluded.

Reproduce with the baseline 5.9.3 compiler and candidate 7.0.2 compiler installed separately: from each sandbox directory, time node /absolute/path/to/compiler/bin/tsc --noEmit against the same checkout and dependencies. Use two warmups and seven measured rounds, alternating compiler order. The benchmark driver, exact compiler paths, independent version checks, and raw samples are retained in the audit workspace.

dev/react samples in seconds:

  • TypeScript 5.9.3: 0.446343, 0.446070, 0.461486, 0.447987, 0.451562, 0.438523, 0.441833
  • TypeScript 7.0.2: 0.105811, 0.103240, 0.102489, 0.103900, 0.102637, 0.104565, 0.106603

dev/vite-react19 samples in seconds:

  • TypeScript 5.9.3: 0.516455, 0.486804, 0.516603, 0.509993, 0.509755, 0.536676, 0.522426
  • TypeScript 7.0.2: 0.107452, 0.102891, 0.107087, 0.102013, 0.103722, 0.102104, 0.104155

Measurement correction: final audit found that the earlier driver invoked the root TypeScript 5.8.3 executable while labeling it 5.9.3. Those two runs are retained and explicitly marked superseded; neither is used in the table above. The corrected driver selects the original sandbox’s exact 5.9.3 executable, asserts actual --version output for every selected compiler before sampling, and repeats both scope/build validation and timing. The final numbers above replace all earlier PR numbers.

Validation and boundaries

  • Both sandbox builds pass under both compilers on final source. All three web-component sandbox output files and all four React 19 output files are byte-identical. The existing large-chunk warnings remain unchanged.
  • Compiler scope is identical: the web-component sandbox checks three project files plus 144 dependency declarations; React 19 checks three project files, the built library declaration, and 185 dependency declarations. Compiler-provided standard libraries change with the compiler version.
  • Root Biome and compiler lint passed across 97 checked files, including after the lockfile review fix. The format-vector conformance script and all 26 root tests passed. The local npm test wrapper hit a sandbox IPC restriction in the tsx launcher; equivalent direct invocation passed, and the first hosted CI round subsequently passed the ordinary npm test command.
  • Library source and build configuration are unchanged. Local consumer validation used the exact baseline library outputs already verified for this default head. Both hosted rounds successfully performed normal root npm ci, full library build, build verification, lint and all 26 tests.
  • The React 19 npm lock preserves all 123 existing noncompiler package records and its local library link. npm 10 generated the compiler replacement and all 20 official platform packages. Exact host graphs were fetched through disposable frozen transport fixtures, restored into npm directory layouts, and checked for package versions, SRI, file hashes and dependency edges.
  • The new web-component sandbox lock was generated by npm 10 from the unchanged dependency ranges and verbatim cached publisher metadata in an empty fixture. It has 133 registry package records plus the root and intended local-library metadata/link. All optional native edges are present. Its complete 67-package host graph, 2,797 files and 101 resolution edges were verified. Frozen npm dry-run passes. The final graph includes Rollup 4.63.1; both compiler checks, output comparisons and the headline benchmark were rerun on this graph.
  • The original unlocked local fixture had pinned Rollup 4.60.4 within Vite’s range because a newer cached optional-package record was incomplete. That fixture is not the final dependency graph. No fixture override is committed. The first hosted round passed ordinary React npm install and React 19 npm ci; the final follow-up head passed normal npm ci for both sandboxes (68 and 75 installed packages on Linux), followed by their complete compiler and Vite builds.
  • The previously added sandbox workflow has been removed. The successful sandbox CI runs below are historical migration evidence.

Independent security and Forge review passed for both the initial change and the lock/workflow follow-up. All 133 new registry lock records matched official cached publisher metadata, including tarball/SRI, dependency and optional edges, platform restrictions, engines and executable declarations. No compiler or platform package introduces an install hook. The new sandbox lock fixes its previously unlocked dependency selection; it is not a broad dependency-security remediation. Previous-head root and sandbox CI, semantic title and Aikido all passed. Cubic approved a781829 with zero new findings (review 5477395473); its original lockfile finding was fixed, answered, and automatically resolved by Cubic. The agent did not resolve the thread.

Audit evidence: continuation/evidence/hub-sandboxes/benchmark.json, locked-react-validation.json, scope-parity.json, candidate-gates.json, and continuation/benchmark_hub_sandboxes.py. The original-source baseline failure remains explicit. Framework probes are recorded separately: the exact Vue compiler rejects native TypeScript’s missing lib/tsc API; Next.js’ actual prerequisite helper rejects its missing lib/typescript.js. Angular 18’s upstream version guard rejects 7.0.2. Their existing checks are preserved.

The repository security overview showed code scanning needing setup, secret scanning enabled, and Dependabot enabled with 84 pre-existing default-branch alerts (2 critical, 50 high, 29 moderate, 3 low). No code-scanning pass or full-graph vulnerability-free claim is made. Aikido passed on the previous PR head and reported no new issues. Automatic Copilot review was unavailable because its quota was exhausted; no manual retrigger was requested.

Hosted evidence: root build, lint and 26 tests, React locked install and build, and React 19 locked install and build.

Scope clarification for automated review summaries: this PR upgrades only the two React sandboxes. The root library’s TypeScript 5.8.3 and Angular’s TypeScript 5.5 series remain unchanged. The JSX namespace issue also failed under the original sandbox TypeScript 5.9.3; it was not introduced solely by TypeScript 7.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 03:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/react-sandbox-ci.yml Resolved
@glebedel glebedel changed the title perf(tooling): use native TypeScript in React sandboxes perf(deps-dev): use native TypeScript in React sandboxes Oct 10, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Auto-approved: Dev-only upgrade of the two React sandboxes to TypeScript 7.0.2, with JSX augmentation moved into React's namespace and a new sandbox CI workflow; no library/runtime changes and both compilers pass the validated builds.

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Auto-approved: Dev-only upgrade of the two React sandboxes to TypeScript 7.0.2 with npm lockfile updates, plus moving the JSX augmentation into React's namespace; no library or runtime changes.

View guided diff | Turn on auto-fix | Re-trigger cubic

@glebedel

Copy link
Copy Markdown
Contributor Author

Conflict refresh against main 27be7fc9b209ddde8bbdbf09d4cd2ad36b278d9e:

  • Retained upstream Vite ^6.4.3 alongside native TypeScript 7.0.2 in the React web-component sandbox. Regenerated its npm lock and refreshed both sandbox locks' local-library metadata for the current Hub 1.13.1 dependency graph.
  • Root library source, dependencies, version, workflows and runner configuration match main exactly. Only the original five sandbox files differ. No workflow or validation script was added.
  • The current full library build, build verification, root lint, format-vector conformance, all 32 root tests and both complete sandbox builds pass locally. The normal npm test launcher encounters the environment's existing tsx IPC EPERM; its equivalent direct Node execution passes. This is not a claim that the normal local wrapper passed.
  • The new root dependency graph was restored from an exact frozen transport fixture. All 271 host package paths, 11,547 package files and 427 dependency edges were verified. Existing npm lockfiles and package-manager configuration remain the repository's source of truth.

The earlier compiler timings are historical measurements of the explicitly recorded graph, not new measurements of the expanded current main.

Published signed merge: 9cdec8c18ae232b5db580a4035c3708f8b4c6779.

The published refresh passes the existing root CI run: normal npm ci, full build and verification, lint, and all 32 tests. Aikido reports no new security issues on this head.

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Conflict refresh against main 27be7fc9b209ddde8bbdbf09d4cd2ad36b278d9e:

  • Retained upstream Vite ^6.4.3 alongside native TypeScript 7.0.2 in the React web-component sandbox. Regenerated its npm lock and refreshed both sandbox locks' local-library metadata for the current Hub 1.13.1 dependency graph.
  • Root library source, dependencies, version, workflows and runner configuration match main exactly. Only the original five sandbox files differ. No workflow or validation script was added.
  • The current full library build, build verification, root lint, format-vector conformance, all 32 root tests and both complete sandbox builds pass locally. The normal npm test launcher encounters the environment's existing tsx IPC EPERM; its equivalent direct Node execution passes. This is not a claim that the normal local wrapper passed.
    ...

@glebedel I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Dev-only upgrade of two React sandboxes to TypeScript 7.0.2 with lockfile updates and the JSX augmentation moved into React's namespace; no runtime, library, or CI changes, so risk is confined to sandbox type-checking.

View guided diff | Turn on auto-fix | Re-trigger cubic

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@glebedel

Copy link
Copy Markdown
Contributor Author

s2d2 fix pass (requested by guillaume@stackone.com in Slack): merged main into the branch (12 commits behind, CI had not run). Only the dev sandboxes changed, so CI exercises nothing new here.

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.

3 participants