Repository navigation
chore(upgrade): Node 24, vitest 4 - #7200
Conversation
Co-authored-by: Nick-Lucas <[email protected]>
β¦apshots Co-authored-by: Nick-Lucas <[email protected]>
β¦AbortController/FormData hacks Co-authored-by: Nick-Lucas <[email protected]>
β¦ vitest.projects.json; add restoreMocks: true Co-authored-by: Nick-Lucas <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughBumps Node/toolchain to Node 24, updates test dependencies and Vitest config, adjusts tests/snapshots for AbortError wording, changes FormData construction in a client test, and ensures Set-Cookie headers are applied from the response cookie source when writing Node HTTP responses. Changes
Sequence Diagram(s)(omitted) Estimated code review effortπ― 3 (Moderate) | β±οΈ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
π₯ Pre-merge checks | β 1 | β 2β Failed checks (2 warnings)
β Passed checks (1 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
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. Comment |
|
π Deployed to the trpc-pr-7200 environment in trpc-sse-and-websockets
|
There was a problem hiding this comment.
Actionable comments posted: 1
π€ Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 6: The package.json engines field requires Node "^24.0.0" but the
monorepo still uses "@types/node" ^22.13.5; update the type definitions to match
the runtime by bumping "@types/node" to a 24.x version (e.g., ^24.x.x) in the
root package.json and in every workspace package.json where "@types/node" is
declared (or update devDependencies/tools that pin it), ensuring
package-lock/yarn.lock is refreshed and CI types build passes; if you
intentionally must keep Node 22 typings, add a clear comment in the root README
or package.json explaining the compatibility decision instead of changing
versions.
βΉοΈ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
β Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
π Files selected for processing (13)
.github/setup/action.yml.nvmrc.tool-versionspackage.jsonpackages/next/src/app-dir/client.test.tsxpackages/server/src/adapters/node-http/writeResponse.tspackages/server/src/unstable-core-do-not-import/stream/jsonl.test.tspackages/tests/package.jsonpackages/tests/server/adapters/fastify.test.tspackages/tests/server/regression/issue-6461-stream-error.test.tspackages/tests/server/streaming.test.tsvitest.config.tsvitest.projects.json
| "type": "module", | ||
| "engines": { | ||
| "node": "^22.18.0", | ||
| "node": "^24.0.0", |
There was a problem hiding this comment.
π§© Analysis chain
π Script executed:
#!/bin/bash
set -euo pipefail
echo "Root engine + `@types/node`:"
jq -r '.engines.node as $e | "engines.node=\($e)"' package.json
jq -r '.dependencies["@types/node"] // .devDependencies["@types/node"] // "MISSING"' package.json \
| sed 's/^/@types\/node=/'
echo
echo "Workspace package.json files with `@types/node` pins:"
fd package.json -t f | while read -r file; do
v=$(jq -r '.dependencies["@types/node"] // .devDependencies["@types/node"] // empty' "$file")
if [ -n "$v" ]; then
echo "$file -> $v"
fi
doneRepository: trpc/trpc
Length of output: 1710
Update @types/node to align with Node 24 runtime requirement.
Line 6 specifies engines.node: ^24.0.0, but @types/node remains at ^22.13.5 across the entire monorepo (root and all 33+ workspace packages). This mismatch between runtime and type definitions can cause compile-time API surface misalignment and potential type errors. Bump @types/node to ^24.x.x to match the Node 24 runtime requirement, or document if Node 22 typings are intentionally maintained for compatibility reasons.
π€ Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@package.json` at line 6, The package.json engines field requires Node
"^24.0.0" but the monorepo still uses "@types/node" ^22.13.5; update the type
definitions to match the runtime by bumping "@types/node" to a 24.x version
(e.g., ^24.x.x) in the root package.json and in every workspace package.json
where "@types/node" is declared (or update devDependencies/tools that pin it),
ensuring package-lock/yarn.lock is refreshed and CI types build passes; if you
intentionally must keep Node 22 typings, add a clear comment in the root README
or package.json explaining the compatibility decision instead of changing
versions.
| const cookies = response.headers.getSetCookie(); | ||
| if (cookies.length > 0) { | ||
| rawResponse.setHeader('set-cookie', cookies); | ||
| } |
There was a problem hiding this comment.
this approach is correct/modern and has support for node 19.7+, and v20 which is the oldest LTS so that's fine.
There was a problem hiding this comment.
Pull request overview
Updates the repoβs runtime/tooling baseline for a Node 24-centric development and CI environment, along with accompanying test/config adjustments needed for the newer Node/Vitest/jsdom behavior.
Changes:
- Bump Node/Vitest-related tooling (Node 24 engines + CI setup, Vitest v4, jest-dom/jsdom updates) and add a Vitest projects definition.
- Update multiple test snapshots to match AbortError/DOMException message changes under newer Node/jsdom.
- Fix Node HTTP adapter response header forwarding to correctly handle
Set-CookieviagetSetCookie().
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
vitest.projects.json |
Introduces a Vitest projects/workspace definition targeting packages/*. |
vitest.config.ts |
Updates Vitest setup files (adds jest-dom) and adjusts test runner options for the new baseline. |
packages/tests/server/streaming.test.ts |
Updates inline snapshots for abort behavior/message changes. |
packages/tests/server/regression/issue-6461-stream-error.test.ts |
Updates abort error snapshot to match new error formatting. |
packages/tests/server/adapters/fastify.test.ts |
Forces Node test environment for this suite. |
packages/tests/package.json |
Bumps jsdom dependency version. |
packages/server/src/unstable-core-do-not-import/stream/jsonl.test.ts |
Updates abort-related snapshots/messages. |
packages/server/src/adapters/node-http/writeResponse.ts |
Ensures Set-Cookie is forwarded correctly by using headers.getSetCookie(). |
packages/next/src/app-dir/client.test.tsx |
Avoids FormData(formElement) usage by constructing FormData manually in the test. |
package.json |
Moves engines to Node 24 and bumps Vitest + related dependencies. |
.tool-versions |
Pins Node version for asdf users to Node 24. |
.nvmrc |
Updates nvm Node version target to 24. |
.github/setup/action.yml |
Updates GitHub Actions setup-node to 24.x. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,2 +1,2 @@ | |||
| nodejs 20.10.0 | |||
| nodejs 24.13.1 | |||
| pnpm 8.15.5 | |||
There was a problem hiding this comment.
.tool-versions still pins pnpm 8.15.5, but the repoβs root package.json declares packageManager: [email protected] / engines.pnpm: ^9.12.2. This mismatch can cause local toolchain drift for asdf users (different lockfile behavior, install layout, etc.). Consider updating the pinned pnpm version here to match the repoβs declared pnpm version.
| pnpm 8.15.5 | |
| pnpm 9.12.2 |
@trpc/client
@trpc/next
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Closes #
π― Changes
What changes are made in this PR? Is it a feature or a bug fix?
β Checklist
Summary by CodeRabbit