Skip to content

Conversation

schiller-manuel
Copy link
Contributor

@schiller-manuel schiller-manuel commented Oct 12, 2025

Summary by CodeRabbit

  • Refactor

    • Updated client-side code splitting to also exclude headers-related nodes, alongside server and SSR elements.
    • Results in leaner client route trees and improved tree-shaking.
  • Chores

    • Optimized bundling behavior to reduce client bundle size, improving initial load times without changing user-facing behavior.

Copy link
Contributor

coderabbitai bot commented Oct 12, 2025

Walkthrough

Expanded the set of nodes removed during client-side code splitting in tanStackStartRouter by adding "headers" to codeSplittingOptions.deleteNodes alongside "ssr" and "server". No public APIs or exports were altered.

Changes

Cohort / File(s) Summary of Changes
Router code-splitting behavior
packages/start-plugin-core/src/start-router-plugin/plugin.ts
Added "headers" to deleteNodes in tanStackStartRouter codeSplittingOptions, altering which nodes are omitted from the client route tree during code splitting.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Build as Build/Plugin
  participant Router as tanStackStartRouter
  participant Splitter as CodeSplitter
  participant ClientTree as Client Route Tree

  Build->>Router: Initialize with codeSplittingOptions
  Router->>Splitter: Provide deleteNodes = { ssr, server, headers } (updated)
  Splitter->>ClientTree: Generate client route tree
  Splitter-->>ClientTree: Omit nodes: ssr, server, headers
  Note over Splitter,ClientTree: Headers-related code is excluded in client bundles
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • fix: various fixes #5215 — Also modifies how deleteNodes is constructed/accessed for router code-splitting; closely aligned with adding "headers" to the deletion set.

Poem

I hop through routes with nimble care,
Snipping nodes from client air—
SSR, server, headers too,
Trim the tree for a lighter view.
Thump-thump, tidy paths I tread,
Bundles slim, the code well-fed. 🥕

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the removal of headers from the client route, which directly matches the update to codeSplittingOptions.deleteNodes in this pull request. It is concise, specific, and free of extraneous detail.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-headers-client

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de825dd and e106ed5.

📒 Files selected for processing (1)
  • packages/start-plugin-core/src/start-router-plugin/plugin.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript in strict mode with extensive type safety across the codebase

Files:

  • packages/start-plugin-core/src/start-router-plugin/plugin.ts
packages/{*-start,start-*}/**

📄 CodeRabbit inference engine (AGENTS.md)

Name and place Start framework packages under packages/-start/ or packages/start-/

Files:

  • packages/start-plugin-core/src/start-router-plugin/plugin.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test
  • GitHub Check: Preview
🔇 Additional comments (1)
packages/start-plugin-core/src/start-router-plugin/plugin.ts (1)

225-225: Approve adding 'headers' to client-side deleteNodes. 'headers' is a recognized route node property (see packages/router-core/src/route.ts) and is not used in client code.


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

Copy link

nx-cloud bot commented Oct 12, 2025

View your CI Pipeline Execution ↗ for commit e106ed5

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

☁️ Nx Cloud last updated this comment at 2025-10-12 23:19:53 UTC

Copy link

pkg-pr-new bot commented Oct 12, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5459

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5459

@tanstack/eslint-plugin-router

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

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5459

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5459

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5459

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5459

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5459

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5459

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5459

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5459

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5459

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5459

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5459

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5459

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5459

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5459

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5459

commit: e106ed5

@schiller-manuel schiller-manuel merged commit 8066a59 into main Oct 12, 2025
6 checks passed
@schiller-manuel schiller-manuel deleted the remove-headers-client branch October 12, 2025 23:24
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