Skip to content

chore: use tsrs for workspace compiler commands - #6076

Open
fengmk2 wants to merge 1 commit into
mainfrom
chore/use-tsrs
Open

fengmk2 wants to merge 1 commit into
mainfrom
chore/use-tsrs

Conversation

@fengmk2

@fengmk2 fengmk2 commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

All 88 workspace typecheck scripts now use scripts/tsrs.js to reduce compiler time and keep compiler selection in one place. Repository compiler fixtures and the HTTP benchmark build use the same runner.

The runner selects native tsrs on macOS ARM64 and Linux ARM64/x64. It uses @ts-rs/wasm on other platforms, including Windows.

This removes compiler-only typescript dependencies and the @typescript/native alias. TypeScript 5.9 remains for the SWC compiler API. Generated application templates keep their existing compiler dependencies.

The median time for ut run typecheck decreased by 35%, a 1.54× speedup:

Compiler Median time
typescript@7.0.2 9.68 s
tsrs@0.15.0-ts7.1.0-dev.20260929 6.30 s

Each compiler had one warmup and five interleaved measured runs across all 88 workspaces. The machine used an Apple M4 Max, macOS 26.2, and Node.js 22.23.2.

Before each run, the benchmark removed *.tsbuildinfo files; filesystem caches stayed warm. Both compilers used the same Node launcher; TSRS_BINARY selected the native TypeScript baseline. These compiler versions target different TypeScript revisions.

Summary by CodeRabbit

  • Developer Tooling
    • Type checking and TypeScript builds now use a shared compiler runner across the repository, examples, and templates.
    • The runner selects a native compiler on supported platforms and a WebAssembly-based compiler elsewhere.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:31

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.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 81fad9e6-c3f1-4bcd-82bd-5c29f21d748d
📥 Commits

Reviewing files that changed from the base of the PR and between 2448031 and 1969853.

📒 Files selected for processing: 103
  • .utoo.toml
  • examples/helloworld-service-worker/package.json
  • examples/helloworld-tegg/package.json
  • examples/helloworld-typescript/package.json
  • package.json
  • packages/cluster/package.json
  • packages/cookies/package.json
  • packages/core/package.json
  • packages/egg/package.json
  • packages/errors/package.json
  • packages/extend2/package.json
  • packages/koa-static-cache/package.json
  • packages/koa/package.json
  • packages/loader-fs/package.json
  • packages/logger/package.json
  • packages/path-matching/package.json
  • packages/router/package.json
  • packages/supertest/package.json
  • packages/tsconfig/package.json
  • packages/tsconfig/test/index.test.ts
  • packages/typings/package.json
  • packages/utils/package.json
  • plugins/cors/package.json
  • plugins/development/package.json
  • plugins/i18n/package.json
  • plugins/jsonp/package.json
  • plugins/logrotator/package.json
  • plugins/mock/package.json
  • plugins/multipart/package.json
  • plugins/onerror/package.json
  • plugins/redis/package.json
  • plugins/redis/test/redis.test.ts
  • plugins/schedule/package.json
  • plugins/security/package.json
  • plugins/session/package.json
  • plugins/static/package.json
  • plugins/status/package.json
  • plugins/tracer/package.json
  • plugins/typebox-validate/package.json
  • plugins/view-nunjucks/package.json
  • plugins/view/package.json
  • plugins/watcher/package.json
  • scripts/test/resolve-typescript.d.mts
  • scripts/test/resolve-typescript.mjs
  • scripts/test/workspace.test.js
  • scripts/tsrs.js
  • tegg/AGENTS.md
  • tegg/benchmark/http/package.json
  • tegg/core/agent-runtime/package.json
  • tegg/core/ajv-decorator/package.json
  • tegg/core/aop-decorator/package.json
  • tegg/core/aop-runtime/package.json
  • tegg/core/background-task/package.json
  • tegg/core/common-util/package.json
  • tegg/core/controller-decorator/package.json
  • tegg/core/controller-runtime/package.json
  • tegg/core/core-decorator/package.json
  • tegg/core/dal-decorator/package.json
  • tegg/core/dal-runtime/package.json
  • tegg/core/dynamic-inject-runtime/package.json
  • tegg/core/dynamic-inject/package.json
  • tegg/core/dynamic-inject/test/typing.test.ts
  • tegg/core/eventbus-decorator/package.json
  • tegg/core/eventbus-runtime/package.json
  • tegg/core/langchain-decorator/package.json
  • tegg/core/lifecycle/package.json
  • tegg/core/loader/package.json
  • tegg/core/mcp-client/package.json
  • tegg/core/metadata/package.json
  • tegg/core/orm-decorator/package.json
  • tegg/core/runtime/package.json
  • tegg/core/schedule-decorator/package.json
  • tegg/core/standalone-decorator/package.json
  • tegg/core/tegg/package.json
  • tegg/core/test-util/package.json
  • tegg/core/transaction-decorator/package.json
  • tegg/core/types/package.json
  • tegg/core/vitest/package.json
  • tegg/plugin/ajv/package.json
  • tegg/plugin/aop/package.json
  • tegg/plugin/common/package.json
  • tegg/plugin/config/package.json
  • tegg/plugin/controller/package.json
  • tegg/plugin/dal/package.json
  • tegg/plugin/dns-cache/package.json
  • tegg/plugin/eventbus/package.json
  • tegg/plugin/langchain/package.json
  • tegg/plugin/mcp-client/package.json
  • tegg/plugin/mcp-proxy/package.json
  • tegg/plugin/orm/package.json
  • tegg/plugin/schedule/package.json
  • tegg/plugin/tegg/package.json
  • tegg/standalone/service-worker-controller/package.json
  • tegg/standalone/service-worker-runtime/package.json
  • tegg/standalone/service-worker/package.json
  • tegg/standalone/standalone/package.json
  • tools/create-egg/package.json
  • tools/egg-bin/package.json
  • tools/egg-bundler/package.json
  • tools/scripts/package.json
  • tools/scripts/test/fixtures/ts-pkg/package.json
  • tools/scripts/test/fixtures/ts/package.json
  • tools/scripts/test/ts.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The repository adds a platform-selecting tsrs compiler runner and migrates workspace typecheck and build scripts from tsc to tsrs. Compiler resolution, workspace validation, and TypeScript fixture tests are updated to use the runner.

Changes: tsrs compiler migration

Layer / File(s) Summary
Shared compiler runner
.utoo.toml, package.json, scripts/tsrs.js
The shared catalog adds tsrs and @ts-rs/wasm and removes the TypeScript entries. The runner selects a compiler package based on platform and architecture, then imports its first declared executable.
Workspace scripts
examples/*/package.json, packages/*/package.json, plugins/*/package.json, tegg/**/package.json, tools/*/package.json, tegg/AGENTS.md
Typecheck scripts now use the shared tsrs runner. The HTTP benchmark build script also uses the runner. Workspace manifests remove their TypeScript devDependency entries where present.
Compiler tests and fixtures
scripts/test/*, packages/tsconfig/test/*, plugins/redis/test/*, tegg/core/dynamic-inject/test/*, tools/scripts/test/*
The compiler resolver now returns the tsrs runner path without a from argument. Tests validate workspace runner commands and version output. TypeScript fixtures use the shared build command on all platforms.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 19698

The PR moves typecheck and build scripts to a shared tsrs runner. No concrete merge-blocking defect was identified. Running the full typecheck across workspaces after install is a normal check.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 8 files. (95 skipped: 9… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: replacing workspace compiler commands with the shared tsrs runner.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 8 files. (95 skipped: 95 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1969853
Status: ✅  Deploy successful!
Preview URL: https://3d12345c.egg-v3.pages.dev
Branch Preview URL: https://chore-use-tsrs.egg-v3.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1969853
Status: ✅  Deploy successful!
Preview URL: https://fba2a103.egg-cci.pages.dev
Branch Preview URL: https://chore-use-tsrs.egg-cci.pages.dev

View logs

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.02%. Comparing base (2448031) to head (1969853).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6076      +/-   ##
==========================================
+ Coverage   83.65%   84.02%   +0.37%     
==========================================
  Files         734      734              
  Lines       22639    22639              
  Branches     4560     4560              
==========================================
+ Hits        18938    19022      +84     
+ Misses       3201     3126      -75     
+ Partials      500      491       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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