- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.3k
fix: only transform files in codesplitter if changes were made #5460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| WalkthroughAdds 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
 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
 Suggested reviewers
 Poem
 Pre-merge checks and finishing touches❌ Failed checks (1 warning)
 ✅ Passed checks (2 passed)
 ✨ Finishing touches
 🧪 Generate unit tests (beta)
 Comment  | 
| View your CI Pipeline Execution ↗ for commit 7a7f1f5 
 ☁️ Nx Cloud last updated this comment at  | 
| More templates
 
 @tanstack/arktype-adapter
 @tanstack/directive-functions-plugin
 @tanstack/eslint-plugin-router
 @tanstack/history
 @tanstack/nitro-v2-vite-plugin
 @tanstack/react-router
 @tanstack/react-router-devtools
 @tanstack/react-router-ssr-query
 @tanstack/react-start
 @tanstack/react-start-client
 @tanstack/react-start-server
 @tanstack/router-cli
 @tanstack/router-core
 @tanstack/router-devtools
 @tanstack/router-devtools-core
 @tanstack/router-generator
 @tanstack/router-plugin
 @tanstack/router-ssr-query-core
 @tanstack/router-utils
 @tanstack/router-vite-plugin
 @tanstack/server-functions-plugin
 @tanstack/solid-router
 @tanstack/solid-router-devtools
 @tanstack/solid-start
 @tanstack/solid-start-client
 @tanstack/solid-start-server
 @tanstack/start-client-core
 @tanstack/start-plugin-core
 @tanstack/start-server-core
 @tanstack/start-static-server-functions
 @tanstack/start-storage-context
 @tanstack/valibot-adapter
 @tanstack/virtual-file-routes
 @tanstack/zod-adapter
 commit:  | 
There was a problem hiding this 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 occurThe new
if (!modified) return nullshort‑circuits before we emit the “exports won’t be split” warnings. When a route exports the component/loader (so we skip transformation)modifiedstays false butknownExportedIdentsis populated. Previously we still warned (and injected the devconsole.warn) so users knew their exports blocked splitting. Now we silently returnnull, 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 tonull/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
📒 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
loaderFnuses 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_HEIGHTandASIDE_WIDTHcorrectly remain unexportedThese 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
childrenprop on line 405 is a false positive. TheAwaitcomponent uses a render prop pattern wherechildrenis a function, which is the canonical approach for this component.
| <Await | ||
| promise={sponsorsPromise} | ||
| fallback={<CgSpinner className="text-2xl animate-spin" />} | ||
| children={(sponsors) => { | ||
| return <SponsorPack sponsors={sponsors} /> | ||
| }} | ||
| /> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| <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.
Summary by CodeRabbit