You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the TypeScript 5 check in Next.js builds with tsrs to reduce type-check time. The build script checks types after Next.js generates declarations and fails on type errors. npm run typecheck also runs this check directly.
scripts/tsrs.js selects native tsrs on macOS ARM64 and Linux ARM64/x64. It uses @ts-rs/wasm on other platforms, including Windows. The typescript dependency remains because Next.js requires its compiler API.
The configuration uses es2015 and bundler, which the newer compiler supports. Test files remain outside the build's type-check scope, as in Next.js. Explicit Next.js and CSS declarations support type checks before the first build.
Standalone type checking took 89% less time, an 8.88× speedup:
Compiler
Median time
typescript@5.9.3
1.267 s
tsrs@0.15.0-ts7.1.0-dev.20260929
0.143 s
Each compiler had one warmup and five interleaved measured runs with the same source, dependencies, and final tsconfig.json. Both used --noEmit --incremental false, fresh processes, and warm filesystem caches. These times cover type checking only, not the full Next.js build.
The machine used an Apple M4 Max, macOS 26.2, and Node.js 22.23.2. The compiler versions target different TypeScript revisions.
Summary by CodeRabbit
Chores
The production build now runs a TypeScript check after building.
Documentation
Development instructions now include commands for running TypeScript checks and creating a production build.
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.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: b821ce66-d3bf-494d-be49-c063d1b9220c
📥 Commits
Reviewing files that changed from the base of the PR and between fdb5000 and 2b98e57.
📒 Files selected for processing: 6
README.md
index.d.ts
next.config.js
package.json
scripts/tsrs.js
tsconfig.json
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
📝 Walkthrough
The project adds a TypeScript check command and runs it after the Next.js production build. The changes also update TypeScript compiler options, declarations, platform-specific compiler selection, and development instructions.
The TypeScript configuration targets ES2015, uses bundler module resolution, and excludes test files. The declarations add Next.js types and a CSS module declaration. A script selects the native tsrs compiler on specified arm64 and x64 platforms and uses @ts-rs/wasm on other platforms. Both packages are added as development dependencies.
Run checks after the production build next.config.js, package.json, README.md
The build script runs typecheck after next build. Next.js ignores build-time TypeScript errors, and the development instructions list the typecheck and build commands.
The checked-in CI and documented package build run the new typecheck. No concrete current-head issue is established; the external webhook’s build command is not visible, so a deployment bypass is unconfirmed.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: using tsrs for build-time TypeScript checking.
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches
📝 Generate docstrings
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
Warning
Some tools did not complete. Review the errors below.
🔧 ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
package.json
Parsing error: Missing semicolon. (2:8)
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the TypeScript 5 check in Next.js builds with
tsrsto reduce type-check time. The build script checks types after Next.js generates declarations and fails on type errors.npm run typecheckalso runs this check directly.scripts/tsrs.jsselects nativetsrson macOS ARM64 and Linux ARM64/x64. It uses@ts-rs/wasmon other platforms, including Windows. Thetypescriptdependency remains because Next.js requires its compiler API.The configuration uses
es2015andbundler, which the newer compiler supports. Test files remain outside the build's type-check scope, as in Next.js. Explicit Next.js and CSS declarations support type checks before the first build.Standalone type checking took 89% less time, an 8.88× speedup:
typescript@5.9.3tsrs@0.15.0-ts7.1.0-dev.20260929Each compiler had one warmup and five interleaved measured runs with the same source, dependencies, and final
tsconfig.json. Both used--noEmit --incremental false, fresh processes, and warm filesystem caches. These times cover type checking only, not the full Next.js build.The machine used an Apple M4 Max, macOS
26.2, and Node.js22.23.2. The compiler versions target different TypeScript revisions.Summary by CodeRabbit