Skip to content

Conversation

@schiller-manuel
Copy link
Contributor

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

Summary by CodeRabbit

  • New Features
    • Skips code emission for routes with no code-splitting changes.
  • Performance
    • Reduces build work and output noise by short-circuiting unchanged routes.
  • Bug Fixes
    • Prevents rare crashes by safely handling cases where no code-splitting transformation occurs.
  • Tests
    • Updated tests and snapshots to accommodate unchanged-route handling and formatting adjustments.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 12, 2025

Walkthrough

Adds change-detection to the code-split compiler so it returns null when no AST edits occur, and updates the router plugin to skip emission in that case. Tests are adjusted to handle optional compile results, and snapshots are refreshed largely for formatting and minor output differences.

Changes

Cohort / File(s) Summary
Core compiler change
packages/router-plugin/src/core/code-splitter/compilers.ts
compileCodeSplitReferenceRoute now tracks a modified flag and returns null when no AST changes occur; various transformation paths set the flag. Signature updated to return `GeneratorResult
Plugin integration
packages/router-plugin/src/core/router-code-splitter-plugin.ts
Handles null from compiler: early-return with debug log to skip code-splitting/emission for unchanged routes.
Tests: null-safe fallbacks
packages/router-plugin/tests/add-hmr.test.ts, .../tests/code-splitter.test.ts, .../tests/delete-nodes.test.ts
Assertions now use `compileResult?.code
Snapshots: React — formatting updates
packages/router-plugin/tests/add-hmr/snapshots/react/*, .../tests/code-splitter/snapshots/react/1-default/*, .../2-components-combined-loader-separate/*, .../3-all-combined-errorComponent-separate/*
Snapshot outputs updated: semicolon removal, trailing commas, multiline JSX returns, destructuring simplifications, import reflows, and removal of some console.warn lines. One snapshot adds export const SIDEBAR_WIDTH = '150px'.
Snapshots: Solid — formatting updates
packages/router-plugin/tests/delete-nodes/snapshots/solid/*
Snapshot outputs updated for semicolon removal, trailing commas, and closing punctuation/line breaks; no semantic changes.

Sequence Diagram(s)

sequenceDiagram
  participant Plugin as Router Code-Splitter Plugin
  participant Compiler as Code-Split Compiler
  participant Logger as Debug Logger

  Plugin->>Compiler: compileCodeSplitReferenceRoute(opts)
  Compiler-->>Plugin: Generated result
  alt Modified AST
    Plugin->>Plugin: Emit transformed code
  else No modifications
    Compiler-->>Plugin: null
    Plugin->>Logger: debug("skip code-splitting for unchanged route")
    Plugin->>Plugin: Skip emission
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • SeanCassiere

Poem

A rabbit nibbles lines of code, so spry,
If nothing changed, it hops on by.
When ASTs bloom, it leaves a trail,
But skips the fields that tell no tale.
Snapshots tidied, commas aligned—
Split or skip, with a hop refined. 🐇✨

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 accurately summarizes the primary change by indicating that files will only be transformed in the code splitter when modifications occur, reflecting the newly added early exit for unmodified routes.
✨ 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 codesplitter-track

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

@nx-cloud
Copy link

nx-cloud bot commented Oct 12, 2025

View your CI Pipeline Execution ↗ for commit 7a7f1f5

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

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

@pkg-pr-new
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@5460

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 7a7f1f5

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/router-plugin/src/core/code-splitter/compilers.ts (1)

426-449: Regressing export warnings when no edits occur

The new if (!modified) return null short‑circuits before we emit the “exports won’t be split” warnings. When a route exports the component/loader (so we skip transformation) modified stays false but knownExportedIdents is populated. Previously we still warned (and injected the dev console.warn) so users knew their exports blocked splitting. Now we silently return null, dropping both the build‑time warning and the injected runtime notice.

Please keep the early exit but only when there are truly no edits and no export warnings to surface. One option:

-  if (!modified) {
-    return null
-  }
+  const hasExportWarnings = knownExportedIdents.size > 0
+
+  if (!modified && !hasExportWarnings) {
+    return null
+  }
+
+  if (hasExportWarnings) {
+    modified = true
+  }

This preserves the “skip emission when untouched” goal while retaining the warning behavior users rely on.

🧹 Nitpick comments (2)
packages/router-plugin/tests/delete-nodes.test.ts (1)

60-62: Use nullish coalescing for the fallback.

|| will also fall back when the compiler intentionally emits an empty string, masking that output. ?? keeps the fallback strictly to null/undefined, which is what we’re guarding for here.

-            await expect(compileResult?.code || code).toMatchFileSnapshot(
+            await expect(compileResult?.code ?? code).toMatchFileSnapshot(
packages/router-plugin/tests/code-splitter.test.ts (1)

70-72: Prefer ?? over || for the compile-result fallback.

This test only needs to fall back when the compiler returns null/undefined. With ||, an intentional empty-string output would erroneously fall back to the original source. Switching to ?? avoids that edge case.

-            await expect(compileResult?.code || code).toMatchFileSnapshot(
+            await expect(compileResult?.code ?? code).toMatchFileSnapshot(
📜 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 7a7f1f5.

📒 Files selected for processing (51)
  • packages/router-plugin/src/core/code-splitter/compilers.ts (9 hunks)
  • packages/router-plugin/src/core/router-code-splitter-plugin.ts (1 hunks)
  • packages/router-plugin/tests/add-hmr.test.ts (2 hunks)
  • packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx (1 hunks)
  • packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx (1 hunks)
  • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx (1 hunks)
  • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter.test.ts (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/explicit-undefined-component.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-as-parameter.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-export-component.tsx (2 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx (2 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-function.tsx (2 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/undefined-literals.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/useStateDestructure.tsx (12 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/using.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/explicit-undefined-component.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-as-parameter.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-const.tsx (2 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-function.tsx (2 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/undefined-literals.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/useStateDestructure.tsx (12 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/explicit-undefined-component.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-as-parameter.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-const.tsx (2 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-function.tsx (2 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/undefined-literals.tsx (1 hunks)
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/useStateDestructure.tsx (12 hunks)
  • packages/router-plugin/tests/delete-nodes.test.ts (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRoute-ssr-function.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRouteWithContext-ssr-function.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-data-only.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-false.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-function.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRoute-ssr-function.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRouteWithContext-ssr-function.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-data-only.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-false.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-function.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-data-only.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-false.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-function.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-data-only.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-false.tsx (1 hunks)
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-function.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx
  • packages/router-plugin/tests/add-hmr.test.ts
  • packages/router-plugin/src/core/router-code-splitter-plugin.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/using.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/undefined-literals.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-function.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx
  • packages/router-plugin/src/core/code-splitter/compilers.ts
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter.test.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-function.tsx
  • packages/router-plugin/tests/delete-nodes.test.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-data-only.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-data-only.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRoute-ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-function.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/useStateDestructure.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRouteWithContext-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/explicit-undefined-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRouteWithContext-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-const.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/undefined-literals.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/explicit-undefined-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/useStateDestructure.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-data-only.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/undefined-literals.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/useStateDestructure.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-const.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/explicit-undefined-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRoute-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-export-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-data-only.tsx
packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/**

📄 CodeRabbit inference engine (AGENTS.md)

Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories

Files:

  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx
  • packages/router-plugin/tests/add-hmr.test.ts
  • packages/router-plugin/src/core/router-code-splitter-plugin.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/using.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/undefined-literals.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-function.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx
  • packages/router-plugin/src/core/code-splitter/compilers.ts
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter.test.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-function.tsx
  • packages/router-plugin/tests/delete-nodes.test.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-data-only.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-data-only.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRoute-ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-function.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/useStateDestructure.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRouteWithContext-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/explicit-undefined-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRouteWithContext-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-const.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/undefined-literals.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/explicit-undefined-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/useStateDestructure.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-data-only.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/undefined-literals.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/useStateDestructure.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-const.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/explicit-undefined-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRoute-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-export-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-data-only.tsx
packages/router-plugin/**

📄 CodeRabbit inference engine (AGENTS.md)

Use unplugin for universal bundler plugins in the router-plugin package

Files:

  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx
  • packages/router-plugin/tests/add-hmr.test.ts
  • packages/router-plugin/src/core/router-code-splitter-plugin.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/using.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/undefined-literals.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-function.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx
  • packages/router-plugin/src/core/code-splitter/compilers.ts
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter.test.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-function.tsx
  • packages/router-plugin/tests/delete-nodes.test.ts
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-data-only.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-data-only.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRoute-ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-function.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/useStateDestructure.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRouteWithContext-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/explicit-undefined-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRouteWithContext-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-const.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/undefined-literals.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component.tsx
  • packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/explicit-undefined-component.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/useStateDestructure.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-data-only.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/undefined-literals.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/useStateDestructure.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/function-as-parameter.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-const.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/explicit-undefined-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRoute-ssr-function.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-export-component.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-data-only.tsx
🧠 Learnings (1)
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
PR: TanStack/router#5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.

Applied to files:

  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/1-default/undefined-literals.tsx
  • packages/router-plugin/tests/code-splitter.test.ts
  • packages/router-plugin/tests/delete-nodes.test.ts
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-data-only.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRoute-ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-false.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRouteWithContext-ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRouteWithContext-ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-false.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/undefined-literals.tsx
  • packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/undefined-literals.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-function.tsx
  • packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRoute-ssr-function.tsx
🧬 Code graph analysis (26)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx (4)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx (1)
  • test (3-11)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/src/core/router-code-splitter-plugin.ts (1)
packages/router-plugin/src/core/utils.ts (1)
  • debug (1-3)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/undefined-literals.tsx (2)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/undefined-literals.tsx (1)
  • Route (3-8)
packages/router-plugin/tests/code-splitter/test-files/react/undefined-literals.tsx (1)
  • Route (3-8)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx (1)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-function.tsx (4)
  • loaderFn (8-10)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-function.tsx (3)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-function.tsx (4)
  • loaderFn (8-10)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-const.tsx (4)
  • loaderFn (8-10)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-export-component.tsx (3)
  • Layout (8-24)
  • Route (26-29)
  • SIDEBAR_WIDTH (32-32)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx (1)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx (1)
  • Route (4-6)
packages/router-plugin/src/core/code-splitter/compilers.ts (2)
packages/router-utils/src/ast.ts (1)
  • GeneratorResult (38-38)
packages/router-utils/src/index.ts (1)
  • GeneratorResult (2-2)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-function.tsx (2)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx (4)
  • loaderFn (8-10)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-export-component.tsx (3)
  • Layout (8-24)
  • Route (26-29)
  • SIDEBAR_WIDTH (32-32)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx (4)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx (1)
  • test (3-11)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx (2)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/explicit-undefined-component.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx (4)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx (1)
  • test (3-11)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-false.tsx (2)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-function.tsx (1)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-function.tsx (4)
  • loaderFn (8-10)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx (1)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component.tsx (1)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component.tsx (2)
  • Route (4-6)
  • Home (8-16)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/explicit-undefined-component.tsx (4)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/explicit-undefined-component.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/explicit-undefined-component.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-const.tsx (2)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx (4)
  • loaderFn (8-10)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-function.tsx (4)
  • loaderFn (8-10)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/undefined-literals.tsx (2)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/undefined-literals.tsx (1)
  • Route (3-8)
packages/router-plugin/tests/code-splitter/test-files/react/undefined-literals.tsx (1)
  • Route (3-8)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component.tsx (2)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component.tsx (2)
  • Route (4-6)
  • Home (8-16)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/export-default-component.tsx (2)
  • Route (4-6)
  • Home (8-16)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/export-default-component.tsx (1)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/export-default-component.tsx (2)
  • Route (4-6)
  • Home (8-16)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@true.tsx (4)
packages/router-plugin/tests/add-hmr/snapshots/react/destructuring@false.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx (1)
  • test (3-11)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/explicit-undefined-component.tsx (4)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@false.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/explicit-undefined-component.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/explicit-undefined-component.tsx (1)
  • Route (4-6)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/undefined-literals.tsx (2)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/undefined-literals.tsx (1)
  • Route (3-8)
packages/router-plugin/tests/code-splitter/test-files/react/undefined-literals.tsx (1)
  • Route (3-8)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/useStateDestructure.tsx (1)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/useStateDestructure.tsx (2)
  • Route (76-83)
  • VersionIndex (87-526)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-const.tsx (1)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx (4)
  • loaderFn (8-10)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-export-component.tsx (2)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx (3)
  • Route (30-33)
  • SIDEBAR_WIDTH (36-36)
  • SIDEBAR_MINI_WIDTH (37-37)
packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/retain-exports-loader.tsx (2)
  • SIDEBAR_WIDTH (15-15)
  • SIDEBAR_MINI_WIDTH (16-16)
🪛 Biome (2.1.2)
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/useStateDestructure.tsx

[error] 405-405: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)

packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/useStateDestructure.tsx

[error] 405-405: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)

packages/router-plugin/tests/code-splitter/snapshots/react/1-default/useStateDestructure.tsx

[error] 405-405: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)

⏰ 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 (19)
packages/router-plugin/tests/code-splitter/snapshots/react/1-default/explicit-undefined-component.tsx (1)

5-6: Snapshot formatting aligns with other fixtures.

Trailing comma and semicolon removal keep the snapshot consistent with the updated style; no behavioral impact.

packages/router-plugin/tests/delete-nodes/snapshots/solid/2-delete-nodes-empty/ssr-data-only.tsx (1)

1-8: LGTM! Snapshot formatting normalized.

The semicolon removals on lines 1, 6, and 8 are consistent formatting changes reflecting the compiler's normalized output. The snapshot correctly captures the expected transformation result with no runtime behavior changes.

packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/destructuring.tsx (1)

1-11: LGTM! Formatting normalization is consistent across snapshots.

The changes are purely stylistic (import formatting and blank line addition) and the destructuring pattern matches other snapshot files shown in the relevant code snippets. This snapshot update aligns with the PR's goal of refining the code-splitter's output formatting.

packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createRootRoute-ssr-function.tsx (1)

1-14: LGTM! Expected snapshot formatting update.

These formatting changes (removal of trailing semicolons and adjusted closing punctuation) are consistent with the PR's objective of refreshing test snapshots to reflect the updated compiler output format. The logic and runtime behavior remain unchanged.

packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/ssr-function.tsx (1)

1-13: LGTM! Expected snapshot formatting update.

These formatting changes (removal of trailing semicolons and adjusted closing punctuation) are consistent with the PR's objective of refreshing test snapshots to reflect the updated compiler output format. The logic and runtime behavior remain unchanged.

packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createRootRouteWithContext-ssr-function.tsx (1)

1-14: LGTM! Snapshot appropriately refreshed.

The formatting adjustments (import styling, return statement layout, JSX formatting, closing brace positioning) align with the PR's snapshot refresh for consistency. No behavioral changes to the SSR logic or component rendering.

packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-exports-const.tsx (1)

1-40: LGTM! Snapshot correctly reflects formatting improvements.

The changes are formatting-only adjustments that improve code style while preserving all functional aspects:

  • Import statements reformatted to multiline style
  • loaderFn uses explicit return statement (functionally identical)
  • Layout component JSX wrapped in parentheses (common formatting preference)
  • All public exports retained: loaderFn, Layout, Route, SIDEBAR_WIDTH, SIDEBAR_MINI_WIDTH, and default export
  • Private constants HEADER_HEIGHT and ASIDE_WIDTH correctly remain unexported

These snapshot updates align with the PR's goal of adding change detection to the code-splitter, ensuring the expected output matches the current transformation behavior.

packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/retain-exports-const.tsx (5)

1-6: LGTM! Import formatting updated consistently.

The import statements have been reformatted with no functional changes. All required imports are preserved.


8-10: LGTM! Loader function unchanged.

The loader function logic and export signature remain identical with minor formatting adjustments.


12-28: LGTM! Layout component formatting improved.

The Layout component logic is unchanged. The return statement now uses parentheses around the multi-line JSX, which is standard React formatting practice.


30-33: LGTM! Trailing comma added following best practices.

The Route export structure is unchanged, with a trailing comma added after the loader property, which aligns with modern JavaScript formatting conventions.


35-39: LGTM! Constants preserved with formatting updates.

All constant declarations remain unchanged with updated formatting. The public API surface (exported constants) is fully preserved.

packages/router-plugin/tests/code-splitter/snapshots/react/1-default/retain-export-component.tsx (1)

32-33: Retained exports match original source
In retain-export-component.tsx, only SIDEBAR_WIDTH was originally exported; SIDEBAR_MINI_WIDTH remained local.

Likely an incorrect or invalid review comment.

packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-data-only.tsx (1)

1-8: Snapshot formatting update looks good.

The changes reflect formatting adjustments (semicolons, blank lines) consistent with the code-splitter updates. No functional changes.

packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/ssr-false.tsx (1)

1-8: Snapshot formatting update looks good.

Formatting changes match the pattern across other snapshots in this PR.

packages/router-plugin/tests/code-splitter/snapshots/react/1-default/destructuring.tsx (1)

1-11: Destructuring pattern update looks good.

The simplified destructuring pattern is consistent across multiple snapshots in this PR, reflecting standardized compiler output.

packages/router-plugin/tests/delete-nodes/snapshots/solid/1-delete-nodes-undefined/ssr-false.tsx (1)

1-8: Snapshot formatting update looks good.

Formatting changes are consistent with the broader snapshot refresh in this PR.

packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/destructuring.tsx (1)

1-11: Destructuring pattern update looks good.

Matches the standardized destructuring pattern applied across snapshots.

packages/router-plugin/tests/code-splitter/snapshots/react/1-default/useStateDestructure.tsx (1)

1-526: Snapshot formatting updates look good.

The extensive formatting changes (import grouping, multi-line route config, JSX restructuring) are consistent with the code-splitter standardization across this PR. No functional changes.

Note: The Biome warning about the children prop on line 405 is a false positive. The Await component uses a render prop pattern where children is a function, which is the canonical approach for this component.

Comment on lines +402 to +408
<Await
promise={sponsorsPromise}
fallback={<CgSpinner className="text-2xl animate-spin" />}
children={(sponsors) => {
return <SponsorPack sponsors={sponsors} />
}}
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Use JSX children instead of the children prop

Passing the render function via the children prop triggers Biome’s noChildrenProp error and breaks our lint gate. Wrap the render callback as the JSX child instead.

Apply this diff:

-          <Await
-            promise={sponsorsPromise}
-            fallback={<CgSpinner className="text-2xl animate-spin" />}
-            children={(sponsors) => {
-              return <SponsorPack sponsors={sponsors} />
-            }}
-          />
+          <Await
+            promise={sponsorsPromise}
+            fallback={<CgSpinner className="text-2xl animate-spin" />}
+          >
+            {(sponsors) => <SponsorPack sponsors={sponsors} />}
+          </Await>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Await
promise={sponsorsPromise}
fallback={<CgSpinner className="text-2xl animate-spin" />}
children={(sponsors) => {
return <SponsorPack sponsors={sponsors} />
}}
/>
<Await
promise={sponsorsPromise}
fallback={<CgSpinner className="text-2xl animate-spin" />}
>
{(sponsors) => <SponsorPack sponsors={sponsors} />}
</Await>
🧰 Tools
🪛 Biome (2.1.2)

[error] 405-405: Avoid passing children using a prop

The canonical way to pass children in React is to use JSX elements

(lint/correctness/noChildrenProp)

🤖 Prompt for AI Agents
In
packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/useStateDestructure.tsx
around lines 402 to 408, the Await component is passing its render callback via
the children prop which triggers Biome’s noChildrenProp lint error; replace the
children={...} prop with a JSX child by moving the render function inside the
Await tags (i.e., remove the children={...} prop and place the arrow function as
the component’s child), keeping the same fallback and returned <SponsorPack />
usage.

@schiller-manuel schiller-manuel merged commit 5022a60 into main Oct 12, 2025
6 checks passed
@schiller-manuel schiller-manuel deleted the codesplitter-track branch October 12, 2025 23:32
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