Skip to content

fix(start): prebundle client RPC dependencies - #8384

Open
tannerlinsley wants to merge 2 commits into
mainfrom
taren/start-cold-dependencies
Open

fix(start): prebundle client RPC dependencies#8384
tannerlinsley wants to merge 2 commits into
mainfrom
taren/start-cold-dependencies

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Sep 11, 2026

Copy link
Copy Markdown
Member

🎯 Changes

Prebundle the client RPC dependencies that Start's transforms introduce after Vite's initial scan. A clean first visit to the Form example discovered these dependencies during rendering, reoptimized them, and loaded different React module instances. The page logged invalid-hook-call errors before recovering through a reload.

Add the existing serialization and cookie dependencies to the client optimizer using their framework-owned dependency paths. Server optimization and production bundling are unchanged. No example-specific override is needed.

The companion regression in #8376 forces a cold dependency scan and fails on hook errors logged through React's boundary. It fails against the original framework and passes with this change. That PR must include this fix before merging.

Validation:

  • Cold Form browser regression: baseline 1 failed / 1 passed; fixed 2 passed.
  • Three fresh browser contexts: no console or page errors after the fix, and no mid-render dependency reoptimization.
  • Production build/types and both production browser tests pass.
  • All 3 production public assets are byte-for-byte identical, totaling 378,948 bytes before and after.
  • Dependency paths resolve for React, Solid, and Vue. Browser reproduction is React, not a claim of full Solid/Vue browser coverage.
  • Required repository lint, types and unit checks pass.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with the relevant test commands, or tests do not apply to this pull request.
  • I fully understand the code in this pull request.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes
    • Improved client startup reliability by pre-bundling required serialization dependencies before the first render.
    • Prevented page reloads caused by mixed React module instances when dependencies are discovered late.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: db9ffe8a-f03a-4ae2-8281-074fdbc6e319

📥 Commits

Reviewing files that changed from the base of the PR and between 6365b67 and 9763973.

📒 Files selected for processing (1)
  • .changeset/quiet-clients-scan.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/quiet-clients-scan.md

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The client Vite environment now prebundles cookie-es, seroval, and seroval-plugins/web through the TanStack Start client dependency chain. A patch changeset documents the update.

Changes

Client dependency optimization

Layer / File(s) Summary
Prebundle RPC dependencies
packages/start-plugin-core/src/vite/planning.ts, .changeset/quiet-clients-scan.md
The client dependency plan includes cookie-es, seroval, and seroval-plugins/web. The changeset declares a patch release for @tanstack/start-plugin-core.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 97639

The supplied change introduces no verified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description explains the change, motivation, validation results, release impact, and checklist status. It includes the required changeset and testing information.
Title check ✅ Passed The title is concise and accurately identifies the primary change: prebundling client RPC dependencies.
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 1 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/start-cold-dependencies

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.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

4 package(s) bumped directly, 20 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/history 1.162.3 → 1.162.4 Changeset
@tanstack/router-core 1.171.29 → 1.171.30 Changeset
@tanstack/start-plugin-core 1.171.42 → 1.171.43 Changeset
@tanstack/start-server-core 1.169.34 → 1.169.35 Changeset
@tanstack/react-router 1.170.35 → 1.170.36 Dependent
@tanstack/react-start 1.168.52 → 1.168.53 Dependent
@tanstack/react-start-client 1.168.33 → 1.168.34 Dependent
@tanstack/react-start-rsc 0.1.51 → 0.1.52 Dependent
@tanstack/react-start-server 1.167.40 → 1.167.41 Dependent
@tanstack/router-cli 1.167.35 → 1.167.36 Dependent
@tanstack/router-generator 1.167.35 → 1.167.36 Dependent
@tanstack/router-plugin 1.168.37 → 1.168.38 Dependent
@tanstack/router-vite-plugin 1.167.37 → 1.167.38 Dependent
@tanstack/solid-router 1.170.33 → 1.170.34 Dependent
@tanstack/solid-start 1.168.50 → 1.168.51 Dependent
@tanstack/solid-start-client 1.168.32 → 1.168.33 Dependent
@tanstack/solid-start-server 1.167.39 → 1.167.40 Dependent
@tanstack/start-client-core 1.170.29 → 1.170.30 Dependent
@tanstack/start-static-server-functions 1.167.34 → 1.167.35 Dependent
@tanstack/start-storage-context 1.167.31 → 1.167.32 Dependent
@tanstack/vue-router 1.170.32 → 1.170.33 Dependent
@tanstack/vue-start 1.168.49 → 1.168.50 Dependent
@tanstack/vue-start-client 1.167.35 → 1.167.36 Dependent
@tanstack/vue-start-server 1.167.39 → 1.167.40 Dependent

@nx-cloud

nx-cloud Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 9763973

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 17m 55s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 43s View ↗

☁️ Nx Cloud last updated this comment at 2026-09-12 00:22:04 UTC

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

This pull request does not affect bundle size in any measured scenario.

@pkg-pr-new

pkg-pr-new Bot commented Sep 12, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@8384

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8384

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8384

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@8384

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@8384

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@8384

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@8384

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8384

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@8384

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@8384

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@8384

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@8384

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@8384

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@8384

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@8384

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@8384

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@8384

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@8384

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8384

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@8384

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8384

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@8384

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8384

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8384

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@8384

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@8384

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@8384

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@8384

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8384

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@8384

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@8384

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8384

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@8384

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@8384

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8384

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@8384

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8384

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8384

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@8384

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@8384

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@8384

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@8384

commit: 9763973

@codspeed-hq

codspeed-hq Bot commented Sep 12, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 180 untouched benchmarks


Comparing taren/start-cold-dependencies (9763973) with main (dbf0bd9)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (05422da) during the generation of this report, so dbf0bd9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant