Skip to content

Conversation

@schiller-manuel
Copy link
Contributor

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

…ssets

Summary by CodeRabbit

  • Performance
    • Optimized route tree pruning to remove routes without assets or preloads
    • Streamlined manifest to exclude empty or undefined route entries

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2025

Walkthrough

The pull request modifies internal route filtering logic in the manifest generation pipeline. Routes without assets or preloads are pruned from the route tree, and the manifest shape is refined to conditionally include only present preloads and assets fields, avoiding undefined values in the output.

Changes

Cohort / File(s) Summary
Manifest route pruning and filtering logic
packages/start-plugin-core/src/start-manifest-plugin/plugin.ts, packages/start-server-core/src/router-manifest.ts
Post-processes route tree to remove routes lacking assets or preloads. Refines per-route mapping to conditionally attach preloads and assets only when present, using type-annotated accumulator and constraining assets type to Array. Eliminates undefined fields from manifest entries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

package: start-plugin-core

Poem

🐰 Routes stripped of burden, lean and clean,
Only the essential now is seen,
Assets dance with preloads true,
No undefined fields break through!
Manifest trimmed to shining bright.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 pull request title "fix: filter out routes from manifest that have neither preloads nor assets" directly and accurately describes the main change implemented across both modified files. The changes add a post-processing step to prune routes that lack both preloads and assets from the manifest in start-manifest-plugin/plugin.ts, and modify the route mapping logic in router-manifest.ts to conditionally include these fields only when present. The title is concise, uses a specific verb ("filter out"), clearly identifies what is being modified ("routes from manifest"), and specifies the filtering criteria ("neither preloads nor assets"). This is exactly the type of clear, actionable summary that helps developers understand the primary change without ambiguity.
✨ 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 filter-routes-manifest

📜 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 2c90c0c and 9a524c6.

📒 Files selected for processing (2)
  • packages/start-plugin-core/src/start-manifest-plugin/plugin.ts (1 hunks)
  • packages/start-server-core/src/router-manifest.ts (2 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-manifest-plugin/plugin.ts
  • packages/start-server-core/src/router-manifest.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-manifest-plugin/plugin.ts
  • packages/start-server-core/src/router-manifest.ts
🧬 Code graph analysis (1)
packages/start-server-core/src/router-manifest.ts (3)
packages/router-core/src/index.ts (1)
  • RouterManagedTag (73-73)
packages/react-router/src/index.tsx (1)
  • RouterManagedTag (82-82)
packages/solid-router/src/index.tsx (1)
  • RouterManagedTag (81-81)
🔇 Additional comments (3)
packages/start-server-core/src/router-manifest.ts (2)

4-4: LGTM! Type import properly added.

The RouterManagedTag import is correctly used in the type annotation at line 49.


47-57: LGTM! Cleaner manifest structure with conditional field inclusion.

The refactor correctly builds a result object that only includes preloads and assets when they are present, avoiding undefined values in the manifest. The explicit type annotation ensures type safety, and the logic aligns with the route filtering in packages/start-plugin-core/src/start-manifest-plugin/plugin.ts.

packages/start-plugin-core/src/start-manifest-plugin/plugin.ts (1)

247-255: LGTM! Clean filtering logic. Verified that downstream usage is safe.

The filtering correctly removes routes without assets or preloads. Downstream code either iterates existing manifest entries (Object.entries()) or uses optional chaining when accessing specific routes—both patterns safely handle filtered-out routes. The root route is protected by guaranteed preloads/assets assignments.


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

@nx-cloud
Copy link

nx-cloud bot commented Oct 23, 2025

View your CI Pipeline Execution ↗ for commit 9a524c6

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

☁️ Nx Cloud last updated this comment at 2025-10-23 23:35:03 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 23, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 9a524c6

@schiller-manuel schiller-manuel merged commit 9d5a4fb into main Oct 23, 2025
6 checks passed
@schiller-manuel schiller-manuel deleted the filter-routes-manifest branch October 23, 2025 23:37
This was referenced Nov 15, 2025
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.

2 participants