fix(solid-start): navigation transitions #5792
main fromrefs/pull/5792/head·merged by birkskyum(GitHub profile, opens in a new tab) Follow-up to
Closes https://github.com/TanStack/router/issues/5636
Summary by CodeRabbit#
New Features
- Improved transition handling during navigation, including better propagation and visibility of navigation errors.
Bug Fixes
- Ensure prior state remains visible until new state arrives, preventing unexpected loading flashes during transitions.
Tests
- Added end-to-end test validating UI transition behavior and state persistence during navigation.
- Updated unit/integration tests to reflect adjusted update counts and refined transition behavior.
- 1
View your CI Pipeline Execution ↗ for commit 705b95298eeab0e4e90d9a87433d7503a7c77036
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded 5m 48s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 1s View ↗
☁️ Nx Cloud last updated this comment at
2025-11-09 20:19:04UTCMore templates
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-kitchen-sink-solid-query
- tanstack-router-solid-example-kitchen-sink-solid-query-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-auth
- tanstack-solid-start-example-basic-cloudflare
- tanstack-solid-start-example-basic-netlify
- tanstack-solid-start-example-basic-nitro
- tanstack-start-example-basic-solid-query
- tanstack-solid-start-example-basic-static
- tanstack-solid-start-example-basic-supabase
- tanstack-solid-start-example-convex-better-auth
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-i18n-paraglide
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-start-example-basic-cloudflare
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-static
- tanstack-start-bun-hosting
- tanstack-start-example-clerk-basic
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-i18n-paraglide
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-streaming-data-from-server-functions
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
@tanstack/arktype-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5792@tanstack/directive-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5792@tanstack/eslint-plugin-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5792@tanstack/history
npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5792@tanstack/nitro-v2-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5792@tanstack/react-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5792@tanstack/react-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5792@tanstack/react-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5792@tanstack/react-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5792@tanstack/react-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5792@tanstack/react-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5792@tanstack/router-cli
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5792@tanstack/router-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5792@tanstack/router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5792@tanstack/router-devtools-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5792@tanstack/router-generator
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5792@tanstack/router-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5792@tanstack/router-ssr-query-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5792@tanstack/router-utils
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5792@tanstack/router-vite-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5792@tanstack/server-functions-plugin
npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5792@tanstack/solid-router
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5792@tanstack/solid-router-devtools
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5792@tanstack/solid-router-ssr-query
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-ssr-query@5792@tanstack/solid-start
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5792@tanstack/solid-start-client
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5792@tanstack/solid-start-server
npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5792@tanstack/start-client-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5792@tanstack/start-plugin-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5792@tanstack/start-server-core
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5792@tanstack/start-static-server-functions
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5792@tanstack/start-storage-context
npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5792@tanstack/valibot-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5792@tanstack/virtual-file-routes
npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5792@tanstack/zod-adapter
npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5792commit:
705b952Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 509f14b5343a1ae2cbf1f28f73cab37270f03a81 and 6a8758c5628b3c921143ad5ac7b2f515f9e76d16.
📒 Files selected for processing (12)
e2e/react-router/basic-react-query-file-based/src/routeTree.gen.ts(8 hunks)e2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsx(2 hunks)e2e/react-router/basic-react-query-file-based/tests/transition.spec.ts(1 hunks)e2e/solid-router/basic-file-based/src/routeTree.gen.ts(11 hunks)e2e/solid-router/basic-file-based/src/routes/transition/count/create-resource.tsx(2 hunks)e2e/solid-router/basic-file-based/tests/transition.spec.ts(4 hunks)e2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts(8 hunks)e2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsx(3 hunks)e2e/solid-router/basic-solid-query-file-based/tests/transition.spec.ts(1 hunks)e2e/solid-start/basic/src/routeTree.gen.ts(11 hunks)e2e/solid-start/basic/src/routes/transition/count/create-resource.tsx(1 hunks)e2e/solid-start/basic/tests/transition.spec.ts(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:
e2e/solid-start/basic/tests/transition.spec.tse2e/solid-router/basic-solid-query-file-based/tests/transition.spec.tse2e/solid-router/basic-file-based/src/routes/transition/count/create-resource.tsxe2e/solid-start/basic/src/routes/transition/count/create-resource.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsxe2e/react-router/basic-react-query-file-based/tests/transition.spec.tse2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsxe2e/solid-start/basic/src/routeTree.gen.tse2e/solid-router/basic-file-based/tests/transition.spec.tse2e/react-router/basic-react-query-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Store end-to-end tests under the e2e/ directory
Files:
e2e/solid-start/basic/tests/transition.spec.tse2e/solid-router/basic-solid-query-file-based/tests/transition.spec.tse2e/solid-router/basic-file-based/src/routes/transition/count/create-resource.tsxe2e/solid-start/basic/src/routes/transition/count/create-resource.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsxe2e/react-router/basic-react-query-file-based/tests/transition.spec.tse2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsxe2e/solid-start/basic/src/routeTree.gen.tse2e/solid-router/basic-file-based/tests/transition.spec.tse2e/react-router/basic-react-query-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts
**/src/routes/**
📄 CodeRabbit inference engine (AGENTS.md)
Place file-based routes under src/routes/ directories
Files:
e2e/solid-router/basic-file-based/src/routes/transition/count/create-resource.tsxe2e/solid-start/basic/src/routes/transition/count/create-resource.tsxe2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsxe2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsx
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Learnt from: nlynzaad Repo: TanStack/router PR: 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.Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directoriesLearnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{router-devtools,*-router-devtools}/** : Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to e2e/** : Store end-to-end tests under the e2e/ directoryLearnt from: FatahChan Repo: TanStack/router PR: 5475 File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0 Timestamp: 2025-10-14T18:59:33.990Z Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad Repo: TanStack/router PR: 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:
e2e/solid-router/basic-solid-query-file-based/tests/transition.spec.tse2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsxe2e/react-router/basic-react-query-file-based/tests/transition.spec.tse2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsxe2e/solid-start/basic/src/routeTree.gen.tse2e/solid-router/basic-file-based/tests/transition.spec.tse2e/react-router/basic-react-query-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Applied to files:
e2e/solid-start/basic/src/routes/transition/count/create-resource.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsxe2e/solid-start/basic/src/routeTree.gen.tse2e/react-router/basic-react-query-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel Repo: TanStack/router PR: 5330 File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61 Timestamp: 2025-10-01T18:31:35.420Z Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.Applied to files:
e2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.tse2e/react-router/basic-react-query-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts
📚 Learning: 2025-09-28T21:41:45.233Z
Learnt from: nlynzaad Repo: TanStack/router PR: 5284 File: e2e/react-start/basic/server.js:50-0 Timestamp: 2025-09-28T21:41:45.233Z Learning: In Express v5, catch-all routes must use named wildcards. Use `/*splat` to match everything except root path, or `/{*splat}` (with braces) to match including root path. The old `*` syntax is not allowed and will cause "Missing parameter name" errors. This breaking change requires explicit naming of wildcard parameters.Applied to files:
e2e/solid-router/basic-file-based/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to **/src/routes/** : Place file-based routes under src/routes/ directoriesApplied to files:
e2e/react-router/basic-react-query-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts
🧬 Code graph analysis (5)
e2e/solid-router/basic-file-based/src/routes/transition/count/create-resource.tsx (1)
e2e/solid-start/basic/src/routes/transition/count/create-resource.tsx (1)
Route(5-10)
e2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsx (1)
e2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsx (1)
Route(20-27)
e2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsx (1)
e2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsx (1)
Route(20-27)
e2e/react-router/basic-react-query-file-based/src/routeTree.gen.ts (1)
e2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts (3)
FileRoutesByTo(75-82)FileRoutesById(83-94)RootRouteChildren(126-131)
e2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts (1)
e2e/react-router/basic-react-query-file-based/src/routeTree.gen.ts (3)
FileRoutesByTo(75-82)FileRoutesById(83-94)RootRouteChildren(126-131)
⏰ 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 (14)
e2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsx (1)
20-20: LGTM! Route path restructuring is consistent.The route path and Link
fromprop are correctly updated to the nested structure/transition/count/query. The React Query integration withplaceholderDataproperly maintains previous data during transitions, which the test verifies.Also applies to: 40-40
e2e/react-router/basic-react-query-file-based/tests/transition.spec.ts (1)
6-6: LGTM! Test navigation updated correctly.The navigation target properly reflects the new nested route structure. The test logic appropriately verifies that
placeholderDataprevents loading states during transitions.e2e/react-router/basic-react-query-file-based/src/routeTree.gen.ts (1)
1-9: Autogenerated file - no review required.This file is automatically generated by TanStack Router and should not be manually modified. The route tree updates correctly reflect the new
/transition/count/querystructure.e2e/solid-router/basic-file-based/src/routes/transition/count/create-resource.tsx (4)
5-10: LGTM! Route definition correctly updated.The route path has been properly updated to the nested structure '/transition/count/create-resource', and the route configuration with search validation is well-formed.
12-27: LGTM! Link navigation updated consistently.The Link component's
fromprop correctly references the new route path '/transition/count/create-resource', ensuring type-safe navigation.
3-6: LGTM! Test updated for new route path.The test name and navigation target are correctly updated to reflect the new nested route structure.
23-23: Verify: Fire-and-forget clicks intentional for transition testing?The
awaitkeyword has been removed from multiple click actions. This creates rapid consecutive clicks without waiting for each to complete, which appears intentional for testing that transitions keep old values visible during rapid navigation.Please confirm this is the intended behavior for testing transition handling under rapid user interactions.
Also applies to: 43-44, 64-66
e2e/solid-router/basic-solid-query-file-based/tests/transition.spec.ts (1)
6-6: LGTM! Test navigation updated for query variant.The test correctly navigates to '/transition/count/query', which aligns with this being the Solid Query-based variant of the transition test.
e2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsx (3)
2-2: Good addition! Suspense import now explicit.The
Suspenseimport from 'solid-js' has been properly added. Since the component uses<Suspense>at line 35, this import is necessary for the code to function correctly.
20-27: LGTM! Route definition correctly updated.The route path has been updated to the nested structure '/transition/count/query', and the route configuration properly integrates with Solid Query for data loading.
40-40: LGTM! Link navigation updated consistently.The Link component's
fromprop correctly references the new route path '/transition/count/query'.e2e/solid-start/basic/src/routes/transition/count/create-resource.tsx (2)
5-10: LGTM! Solid Start route correctly defined.The route definition for '/transition/count/create-resource' is properly configured with search validation and component assignment for the Solid Start environment.
29-48: LGTM! Async resource with Suspense boundary.The Result component correctly uses
createResourcefor async data fetching with a Suspense boundary to handle loading states. This aligns with the test's goal of verifying transition behavior.e2e/solid-router/basic-file-based/tests/transition.spec.ts (1)
3-6: LGTM! Test updated to reflect new route structure.The test name and navigation target correctly reflect the restructured route hierarchy from
/transitionto/transition/count/create-resource.@@ -20,4 +20,4 @@20202121 // 1 click222223- await page.getByTestId('increase-button').click()23+ page.getByTestId('increase-button').click()⚠️ Potential issue | 🟠 Major
Await all Playwright click actions to prevent race conditions.
Removing
awaitfrom click operations can cause race conditions where the test proceeds before clicks are fully processed, leading to flaky tests. This is particularly problematic in this test because:- The test relies on precise timing to verify transition behavior
- Multiple rapid clicks need to complete before subsequent expectations run
- The polling mechanism may not capture the correct state transitions
Playwright best practice is to always await actions, even when firing multiple clicks in rapid succession.
Apply this diff to restore the await keywords:
- page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() await expect(page.getByTestId('n-value')).toContainText('n: 1', { timeout: 2_000, })- page.getByTestId('increase-button').click() - page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() await expect(page.getByTestId('n-value')).toContainText('n: 2', { timeout: 2000, })- page.getByTestId('increase-button').click() - page.getByTestId('increase-button').click() - page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() await expect(page.getByTestId('n-value')).toContainText('n: 4', { timeout: 2000, })Also applies to: 43-44, 64-66
🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/tests/transition.spec.ts around lines 23 (and similarly at 43-44 and 64-66), several Playwright click() calls are missing await which can cause race conditions and flaky tests; update each page.getByTestId(...).click() invocation to be awaited (prepend with await) so the test waits for each click to complete before proceeding, ensuring multiple rapid clicks and subsequent expectations observe the correct state transitions.e2e/solid-start/basic/tests/transition.spec.ts lines 41 to 84OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +64,21 @@64+ // 3 clicks65+66+ // page.getByTestId('increase-button').click()67+ // page.getByTestId('increase-button').click()68+ // page.getByTestId('increase-button').click()69+70+ // await expect(page.getByTestId('n-value')).toContainText('n: 4', {71+ // timeout: 2000,72+ // })73+ // await expect(page.getByTestId('double-value')).toContainText('double: 8', {74+ // timeout: 2000,75+ // })76+77+ // await page.waitForTimeout(200)78+79+ // await expect(page.getByTestId('n-value')).toContainText('n: 7', {80+ // timeout: 2000,81+ // })82+ // await expect(page.getByTestId('double-value')).toContainText('double: 14', {83+ // timeout: 2000,84+ // })⚠️ Potential issue | 🟠 Major
Incomplete test implementation with TODO sections.
The test has extensive commented-out sections for multi-click scenarios (2 clicks and 3 clicks). The TODO comment at line 41 states "the below tests should be possible to uncomment," suggesting these scenarios are not yet working in Solid Start.
This indicates potential issues with handling rapid consecutive transitions in Solid Start. Consider either:
- Documenting why these scenarios are disabled (known limitation, bug, etc.)
- Opening an issue to track enabling these test cases
- Implementing the necessary fixes to enable full transition testing
Would you like me to help analyze why these scenarios might be failing, or open an issue to track this work?
🤖 Prompt for AI Agents
In e2e/solid-start/basic/tests/transition.spec.ts around lines 41-84, multiple test blocks for rapid consecutive clicks (2-click and 3-click scenarios) are commented out; reproduce the failure locally to confirm why rapid transitions break, then either (A) fix the app so it correctly handles batched/rapid state transitions (ensure the transition logic updates state deterministically on successive clicks and emits expected DOM changes), or (B) if the behavior is a known framework limitation, re-enable the tests with robust awaiting in place (await the specific intermediate DOM/text changes or network response between clicks, add appropriate timeouts) or document the limitation and open a tracking issue; update the test file to reflect the chosen approach (re-enable and stabilize tests or leave commented with a link to the issue and a short explanation).✅ Addressed in commit f8dfc80
Actionable comments posted: 0
♻️ Duplicate comments (1)
e2e/solid-start/basic/tests/transition.spec.ts (1)
41-84: Commented-out multi-click scenarios need resolution.The TODO and commented sections for 2-click and 3-click scenarios indicate incomplete test coverage for rapid consecutive transitions. This was already flagged in previous reviews.
🧹 Nitpick comments (1)
e2e/solid-start/basic/tests/transition.spec.ts (1)
13-19: Consider awaiting pending polls before validation.The async callback in
setIntervalcan have multiple overlapping operations in flight, and clearing the interval (line 86) doesn't wait for pending async operations to complete. While unlikely to affect the test outcome given the timing, you could improve robustness by:Adding a brief wait after clearing the interval:
clearInterval(pollInterval) +await page.waitForTimeout(100) // Allow pending polls to completeOr using a more controlled polling approach with recursive setTimeout that waits for each poll to complete before scheduling the next.
Also applies to: 86-86
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 6a8758c5628b3c921143ad5ac7b2f515f9e76d16 and f8dfc8090f952d40be4cdbf85974eb37a280f410.
📒 Files selected for processing (1)
e2e/solid-start/basic/tests/transition.spec.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
e2e/solid-start/basic/tests/transition.spec.ts
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Store end-to-end tests under the e2e/ directory
Files:
e2e/solid-start/basic/tests/transition.spec.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/📚 Learning: 2025-10-09T12:59:02.129Z
Learnt from: hokkyss Repo: TanStack/router PR: 5418 File: e2e/react-start/custom-identifier-prefix/src/styles/app.css:19-21 Timestamp: 2025-10-09T12:59:02.129Z Learning: In e2e test directories (paths containing `e2e/`), accessibility concerns like outline suppression patterns are less critical since the code is for testing purposes, not production use.Applied to files:
e2e/solid-start/basic/tests/transition.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test
- GitHub Check: Preview
🔇 Additional comments (1)
e2e/solid-start/basic/tests/transition.spec.ts (1)
1-40: Well-structured transition test for single-click scenario.The test correctly validates that old values remain visible during navigation transitions:
- Initial state is verified
- Click is intentionally not awaited to enable immediate assertion of old values
- Old values are asserted to persist during transition
- New values are confirmed after a brief wait
- Validation ensures no "Loading..." state interrupts the user experience
The implementation aligns well with the PR objectives for testing resource-based transitions.
Also applies to: 86-97
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: router-core
Actionable comments posted: 2
♻️ Duplicate comments (1)
e2e/solid-router/basic-file-based/tests/transition.spec.ts (1)
23-23: Await all Playwright click actions to prevent race conditions.The missing
awaiton click operations was previously flagged and remains unresolved. Even when testing rapid transitions, Playwright actions should be awaited to ensure clicks are fully processed before subsequent expectations run. This prevents flaky test behavior.Apply this diff:
- page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click()Also applies to: 43-44, 64-66
🧹 Nitpick comments (1)
e2e/solid-start/basic/src/routes/transition/count/create-resource.tsx (1)
15-22: Consider removing redundantfromprop.The
fromprop on Line 18 is unnecessary since the Link is rendered within the route's component context. The Link can automatically infer the current route.Apply this diff:
<Link data-testid="increase-button" class="border bg-gray-50 px-3 py-1" - from="/transition/count/create-resource" search={(s) => ({ n: s.n + 1 })} > Increase </Link>📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between ad50018085479a0c74efc3c3baa60272d49e9eea and b76c0dffb3044c6bb3dc5adffc608481891fcc47.
📒 Files selected for processing (13)
e2e/react-router/basic-react-query-file-based/src/routeTree.gen.ts(8 hunks)e2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsx(2 hunks)e2e/react-router/basic-react-query-file-based/tests/transition.spec.ts(1 hunks)e2e/solid-router/basic-file-based/src/routeTree.gen.ts(11 hunks)e2e/solid-router/basic-file-based/src/routes/transition/count/create-resource.tsx(2 hunks)e2e/solid-router/basic-file-based/tests/transition.spec.ts(4 hunks)e2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts(8 hunks)e2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsx(3 hunks)e2e/solid-router/basic-solid-query-file-based/tests/transition.spec.ts(1 hunks)e2e/solid-start/basic/src/routeTree.gen.ts(11 hunks)e2e/solid-start/basic/src/routes/transition/count/create-resource.tsx(1 hunks)e2e/solid-start/basic/tests/transition.spec.ts(1 hunks)packages/router-core/src/router.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- e2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsx
- e2e/react-router/basic-react-query-file-based/tests/transition.spec.ts
- e2e/solid-router/basic-file-based/src/routes/transition/count/create-resource.tsx
- packages/router-core/src/router.ts
- e2e/react-router/basic-react-query-file-based/src/routeTree.gen.ts
🧰 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:
e2e/solid-start/basic/src/routes/transition/count/create-resource.tsxe2e/solid-router/basic-solid-query-file-based/tests/transition.spec.tse2e/solid-router/basic-file-based/tests/transition.spec.tse2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.tse2e/solid-start/basic/tests/transition.spec.ts
**/src/routes/**
📄 CodeRabbit inference engine (AGENTS.md)
Place file-based routes under src/routes/ directories
Files:
e2e/solid-start/basic/src/routes/transition/count/create-resource.tsxe2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsx
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Store end-to-end tests under the e2e/ directory
Files:
e2e/solid-start/basic/src/routes/transition/count/create-resource.tsxe2e/solid-router/basic-solid-query-file-based/tests/transition.spec.tse2e/solid-router/basic-file-based/tests/transition.spec.tse2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.tse2e/solid-start/basic/tests/transition.spec.ts
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/Learnt from: nlynzaad Repo: TanStack/router PR: 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.Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to docs/{router,start}/** : Place router docs under docs/router/ and start framework docs under docs/start/Learnt from: FatahChan Repo: TanStack/router PR: 5475 File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0 Timestamp: 2025-10-14T18:59:33.990Z Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Applied to files:
e2e/solid-start/basic/src/routes/transition/count/create-resource.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.ts
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad Repo: TanStack/router PR: 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:
e2e/solid-router/basic-solid-query-file-based/tests/transition.spec.tse2e/solid-router/basic-file-based/tests/transition.spec.tse2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.ts
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel Repo: TanStack/router PR: 5330 File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61 Timestamp: 2025-10-01T18:31:35.420Z Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.Applied to files:
e2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.ts
📚 Learning: 2025-09-28T21:41:45.233Z
Learnt from: nlynzaad Repo: TanStack/router PR: 5284 File: e2e/react-start/basic/server.js:50-0 Timestamp: 2025-09-28T21:41:45.233Z Learning: In Express v5, catch-all routes must use named wildcards. Use `/*splat` to match everything except root path, or `/{*splat}` (with braces) to match including root path. The old `*` syntax is not allowed and will cause "Missing parameter name" errors. This breaking change requires explicit naming of wildcard parameters.Applied to files:
e2e/solid-router/basic-file-based/src/routeTree.gen.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to **/src/routes/** : Place file-based routes under src/routes/ directoriesApplied to files:
e2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts
📚 Learning: 2025-10-09T12:59:02.129Z
Learnt from: hokkyss Repo: TanStack/router PR: 5418 File: e2e/react-start/custom-identifier-prefix/src/styles/app.css:19-21 Timestamp: 2025-10-09T12:59:02.129Z Learning: In e2e test directories (paths containing `e2e/`), accessibility concerns like outline suppression patterns are less critical since the code is for testing purposes, not production use.Applied to files:
e2e/solid-start/basic/tests/transition.spec.ts
🧬 Code graph analysis (2)
e2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsx (1)
e2e/solid-router/basic-solid-query-file-based/src/routes/transition/count/query.tsx (1)
Route(20-27)
e2e/solid-router/basic-solid-query-file-based/src/routeTree.gen.ts (1)
e2e/react-router/basic-react-query-file-based/src/routeTree.gen.ts (3)
FileRoutesByTo(75-82)FileRoutesById(83-94)RootRouteChildren(126-131)
⏰ 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 (6)
e2e/react-router/basic-react-query-file-based/src/routes/transition/count/query.tsx (2)
20-27: LGTM! Route path correctly matches file location.The route path update to
/transition/count/queryproperly aligns with the file-based routing convention, where the file path must match the route path. This refactoring to a more specific nested route structure improves test organization.
37-44: LGTM! Link reference correctly updated.The
fromprop is properly updated to match the new route path, maintaining type-safe routing behavior. The search parameter increment logic remains correct.e2e/solid-router/basic-file-based/tests/transition.spec.ts (1)
3-6: LGTM - Test updated for new route path.The test name and navigation correctly reflect the new nested route structure at
/transition/count/create-resource.e2e/solid-router/basic-solid-query-file-based/tests/transition.spec.ts (1)
6-36: LGTM - Test properly awaits actions.The test correctly navigates to the new
/transition/count/queryroute and properly awaits all Playwright actions, following best practices.e2e/solid-start/basic/src/routes/transition/count/create-resource.tsx (2)
5-10: LGTM - Route configuration is correct.The route setup properly validates search parameters with a sensible default value for
n.
29-48: LGTM - Resource implementation correctly tests transitions.The
createResourceimplementation with a 1-second delay properly simulates async data fetching for testing transition behavior. The Suspense fallback ensures loading states are handled correctly.@@ -0,0 +3,21 @@3+test('transitions/count/create-resource should keep old values visible during navigation', async ({4+ page,5+}) => {6+ await page.goto('/transition/count/create-resource')7+8+ await expect(page.getByTestId('n-value')).toContainText('n: 1')9+ await expect(page.getByTestId('double-value')).toContainText('double: 2')10+11+ const bodyTexts: Array<string> = []12+13+ const pollInterval = setInterval(async () => {14+ const text = await page15+ .locator('body')16+ .textContent()17+ .catch(() => '')18+ if (text) bodyTexts.push(text)19+ }, 50)20+21+ // 1 click22+23+ page.getByTestId('increase-button').click()⚠️ Potential issue | 🟠 Major
Await Playwright click actions to prevent race conditions.
The click operation is missing
await, which can cause race conditions where the test proceeds before the click is fully processed. This is particularly problematic when testing transition behavior with precise timing requirements.Apply this diff:
- page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click()Also applies to: 45-46, 66-68
🤖 Prompt for AI Agents
In e2e/solid-start/basic/tests/transition.spec.ts around lines 23 (and also at 45-46 and 66-68), the Playwright click calls are not awaited which can cause race conditions; update each occurrence to await the click promise (i.e., prefix each page.getByTestId(...).click() with await) so the test waits for the click to complete before proceeding, keeping the existing selectors and test flow intact.e2e/solid-start/basic/tests/transition.spec.ts line 41OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +21,21 @@21+ // 1 click22+23+ page.getByTestId('increase-button').click()24+25+ await expect(page.getByTestId('n-value')).toContainText('n: 1', {26+ timeout: 2_000,27+ })28+ await expect(page.getByTestId('double-value')).toContainText('double: 2', {29+ timeout: 2_000,30+ })31+32+ await page.waitForTimeout(200)33+34+ await expect(page.getByTestId('n-value')).toContainText('n: 2', {35+ timeout: 2000,36+ })37+ await expect(page.getByTestId('double-value')).toContainText('double: 4', {38+ timeout: 2000,39+ })40+41+ // TODO - the below tests should be possible to uncomment⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain
Remove misleading TODO comment.
The TODO comment states "the below tests should be possible to uncomment," but the tests on lines 43-84 are already uncommented and active. This comment should either be removed or clarified if there's a known issue with these test scenarios.
Could you clarify: Are these multi-click test scenarios working correctly, or is there a known issue that the TODO is referring to?
--- 🏁 Script executed: ```shell #!/bin/bash # Examine the transition.spec.ts file to verify the TODO comment and test state fd -n "transition.spec.ts" -t f | head -1 | xargs -I {} sh -c 'echo "=== File: {} ===" && sed -n "35,90p" {}'Length of output: 230
🏁 Script executed:
#!/bin/bash # Find and examine transition.spec.ts to verify TODO comment and test state find . -name "transition.spec.ts" -type f | head -1 | xargs -I {} sh -c 'echo "=== File: {} ===" && sed -n "35,90p" {}'Length of output: 123
🏁 Script executed:
#!/bin/bash # Read the specific transition.spec.ts file from solid-start directory cat "e2e/solid-start/basic/tests/transition.spec.ts" | sed -n "35,90p"Length of output: 1494
Add
awaitkeywords to click operations in multi-click test scenarios.The TODO comment is not misleading—it correctly identifies that these tests cannot function as written. While lines 43-84 are uncommented and active, the
click()calls at lines 47-48 and 61-63 are missingawaitkeywords, which breaks the test logic. Playwright requires these async operations to be awaited for proper sequencing. Addawaitbefore eachpage.getByTestId('increase-button').click()call to make these test scenarios functional.🤖 Prompt for AI Agents
In e2e/solid-start/basic/tests/transition.spec.ts around lines 43–84, the multi-click test calls page.getByTestId('increase-button').click() multiple times without awaiting the returned promises; add await before each page.getByTestId('increase-button').click() invocation (notably at the occurrences around lines 47–48 and 61–63) so Playwright sequences the clicks correctly and the test logic executes as intended.✅ Addressed in commits c825684 to 79f4fc4
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: solid-router
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between b76c0dffb3044c6bb3dc5adffc608481891fcc47 and fa5a90b7471d131189c218c4cbe6fb146af9122b.
📒 Files selected for processing (1)
packages/solid-router/src/Transitioner.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
packages/solid-router/src/Transitioner.tsx
packages/{react-router,solid-router}/**
📄 CodeRabbit inference engine (AGENTS.md)
Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
Files:
packages/solid-router/src/Transitioner.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Applied to files:
packages/solid-router/src/Transitioner.tsx
⏰ 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
@@ -39,9 +39,14 @@39- setIsTransitioning(true)40- Solid.startTransition(async () => {41- try {42- await fn()43- } finally {44- setIsTransitioning(false)45- }39+ // Execute fn synchronously to check if it returns a Promise40+ let result: void | Promise<void>41+ Solid.startTransition(() => {42+ result = fn()4643 })44+45+ // If fn returned a Promise, track the transition state46+ if (result! instanceof Promise) {47+ setIsTransitioning(true)48+ result.finally(() => {49+ setIsTransitioning(false)50+ })51+ }4752 }⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain
Remove unnecessary non-null assertion on line 46.
The
result!syntax is unnecessary and misleading. Sinceresultis typed asvoid | Promise<void>, it can beundefinedwhenfn()returns void. Theinstanceof Promisecheck works correctly without the non-null assertion:undefined instanceof Promise→false(skips the block)promise instanceof Promise→true(enters the block)
Apply this diff:
- if (result! instanceof Promise) { + if (result instanceof Promise) {Additionally, verify error handling behavior:
Consider whether synchronous errors thrown by
fn()or unhandled Promise rejections need explicit handling in this implementation. Thefinallyhandler will reset transition state even on rejection, but there's no explicit error catching.
I'll verify the review comment by examining the actual code in the repository.
🏁 Script executed:
#!/bin/bash # Locate and inspect the Transitioner.tsx file find . -type f -name "Transitioner.tsx" 2>/dev/null | head -20Length of output: 89
🏁 Script executed:
#!/bin/bash # Search for the startTransition function in Transitioner.tsx fd "Transitioner.tsx" --exec cat {} \;Length of output: 7491
🏁 Script executed:
#!/bin/bash # Check for TypeScript configuration to understand type checking strictness fd "tsconfig.json" -path "*/solid-router/*" --exec cat {} \;Length of output: 168
🏁 Script executed:
#!/bin/bash # Look for similar Promise handling patterns in the codebase rg -n "instanceof Promise" packages/ -A2 -B2Length of output: 1556
🏁 Script executed:
#!/bin/bash # Search for error handling patterns with promises in the solid-router package rg -n "\.finally\(" packages/solid-router/ -A2 -B2 | head -40Length of output: 370
🏁 Script executed:
#!/bin/bash # Check if there's error handling for startTransition elsewhere rg -n "startTransition" packages/solid-router/ -A5 -B2 | head -60Length of output: 2402
Remove unnecessary non-null assertion on line 46.
The
result!syntax is unnecessary and inconsistent with similarinstanceof Promisechecks elsewhere in the codebase (e.g.,packages/start-client-core/src/createServerFn.ts:677andpackages/router-core/src/router.ts:2604). Sinceresultis typed asvoid | Promise<void>, it can legitimately beundefined, and TypeScript'sinstanceofcheck works correctly without the assertion:- if (result! instanceof Promise) { + if (result instanceof Promise) {Note: The
finallyhandler resets transition state on both successful resolution and rejection, which is the current intended behavior. If explicit error handling for synchronous exceptions or Promise rejections is desired, add acatchhandler accordingly.📝 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.
router.startTransition = (fn: () => void | Promise<void>) => { // Execute fn synchronously to check if it returns a Promise let result: void | Promise<void> Solid.startTransition(() => { result = fn() }) // If fn returned a Promise, track the transition state if (result instanceof Promise) { setIsTransitioning(true) result.finally(() => { setIsTransitioning(false) }) } }🤖 Prompt for AI Agents
packages/solid-router/src/Transitioner.tsx around lines 38 to 52: the non-null assertion `result!` is unnecessary and should be removed; change the conditional to use the normal instanceof check (`if (result instanceof Promise)`) so the code correctly handles `void | Promise<void>` (allowing undefined) and leave the finally handler as-is to reset state on both resolve and reject.github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: react-router
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between d098795c7f7087e4f163058933d435120d57b2a3 and 80b7b5ef4f80c09bcfb2b7c191981fc4a4324180.
📒 Files selected for processing (3)
packages/router-core/src/Matches.ts(1 hunks)packages/router-core/src/load-matches.ts(5 hunks)packages/router-core/src/router.ts(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/router-core/src/Matches.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
packages/router-core/src/load-matches.tspackages/router-core/src/router.ts
packages/router-core/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep framework-agnostic core router logic in packages/router-core/
Files:
packages/router-core/src/load-matches.tspackages/router-core/src/router.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/Learnt from: nlynzaad Repo: TanStack/router PR: 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.Learnt from: FatahChan Repo: TanStack/router PR: 5475 File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0 Timestamp: 2025-10-14T18:59:33.990Z Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.Learnt from: schiller-manuel Repo: TanStack/router PR: 5330 File: packages/router-core/src/router.ts:2231-2245 Timestamp: 2025-10-01T18:30:26.591Z Learning: In `packages/router-core/src/router.ts`, the `resolveRedirect` method intentionally strips the router's origin from redirect URLs when they match (e.g., `https://foo.com/bar` → `/bar` for same-origin redirects) while preserving the full URL for cross-origin redirects. This logic should not be removed or simplified to use `location.publicHref` directly.📚 Learning: 2025-10-01T18:30:26.591Z
Learnt from: schiller-manuel Repo: TanStack/router PR: 5330 File: packages/router-core/src/router.ts:2231-2245 Timestamp: 2025-10-01T18:30:26.591Z Learning: In `packages/router-core/src/router.ts`, the `resolveRedirect` method intentionally strips the router's origin from redirect URLs when they match (e.g., `https://foo.com/bar` → `/bar` for same-origin redirects) while preserving the full URL for cross-origin redirects. This logic should not be removed or simplified to use `location.publicHref` directly.Applied to files:
packages/router-core/src/load-matches.tspackages/router-core/src/router.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/Applied to files:
packages/router-core/src/load-matches.tspackages/router-core/src/router.ts
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad Repo: TanStack/router PR: 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-core/src/load-matches.tspackages/router-core/src/router.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Applied to files:
packages/router-core/src/router.ts
🧬 Code graph analysis (1)
packages/router-core/src/router.ts (1)
packages/router-core/src/route.ts (1)
id(1547-1549)
⏰ 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: Preview
- GitHub Check: Test
🔇 Additional comments (8)
packages/router-core/src/load-matches.ts (5)
114-115: LGTM: Non-reactive error storage for transitions.The dual storage approach (both
_nonReactive.errorand reactiveerrorin updateMatch) correctly handles frameworks that batch reactive updates during transitions.
454-458: LGTM: Non-reactive context storage.Correctly stores
beforeLoadContextnon-reactively for immediate access during transitions, complementing the reactive context update at lines 459-465.
570-587: Context accumulation logic updated to walk entire ancestor chain.The new approach correctly builds context by merging
__routeContextand_nonReactive.__beforeLoadContextfrom all ancestor matches. This ensures proper context inheritance and bypasses reactive batching during transitions.
767-772: LGTM: Comprehensive error checking before loader.Correctly checks both non-reactive and reactive error storage to catch redirect/notFound errors from preloaded matches, ensuring errors aren't missed during transitions.
784-788: LGTM: Post-loader error handling.Correctly retrieves fresh match after awaiting the loader promise and checks both error storage locations for comprehensive error handling.
packages/router-core/src/router.ts (3)
1492-1492: LGTM: Context composition includes non-reactive beforeLoadContext.Correctly merges non-reactive
__beforeLoadContextinto the final context, ensuring proper precedence order.
1532-1532: LGTM: Consistent context composition.Same correct pattern as line 1492, ensuring
_nonReactive.__beforeLoadContextis included in the final context.
2284-2304: LGTM: Framework-agnostic transition wrapper.Wrapping
updateMatchlogic instartTransitionis correct. SincestartTransitionis a configurable function (line 939, defaults to direct execution), this maintains the framework-agnostic design of router-core while enabling framework-specific transition behavior when needed.packages/router-core/src/router.ts lines 1456 to 1458OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -1453,3 +1453,6 @@14531453 __routeContext: undefined,14541454 _nonReactive: {14551455 loadPromise: createControlledPromise(),1456+ __beforeLoadContext: undefined,1457+ // Preserve error from existing match (e.g., preloaded match) so redirects during preload are preserved1458+ error: (existingMatch as any)?._nonReactive?.error,⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain
Verify type assertion safety.
The
(existingMatch as any)?._nonReactive?.errortype assertion bypasses type checking. While the optional chaining provides runtime safety, consider whether the types forexistingMatch._nonReactiveshould be properly defined to avoid theas anycast.
🏁 Script executed:
#!/bin/bash # Check the type definition of _nonReactive in match types rg -n --type=ts -A5 -B5 "interface.*RouteMatch|type.*RouteMatch" | rg -A20 "_nonReactive"Length of output: 0
--- 🏁 Script executed: ```shell #!/bin/bash # View the actual code context around lines 1456-1458 sed -n '1445,1470p' packages/router-core/src/router.tsLength of output: 994
🏁 Script executed:
#!/bin/bash # Search for _nonReactive definition/declaration rg -n --type=ts "_nonReactive" -B3 -A3 | head -50Length of output: 3542
🏁 Script executed:
#!/bin/bash # Search for existingMatch parameter and its type in matchRoutesInternal rg -n --type=ts -B10 "__beforeLoadContext: undefined" | head -40Length of output: 1199
--- 🏁 Script executed: ```shell #!/bin/bash # Find the matchRoutesInternal function signature and existingMatch parameter type rg -n --type=ts "function matchRoutesInternal|const matchRoutesInternal" -A20 | head -60Length of output: 0
🏁 Script executed:
#!/bin/bash # Search for RouteMatch or match type interface definition with _nonReactive rg -n --type=ts "interface.*Match|type.*Match.*=" | grep -v "test\|spec" | head -30Length of output: 2830
🏁 Script executed:
#!/bin/bash # Look for where _nonReactive type is defined rg -n --type=ts "_nonReactive\s*:" -B5 -A5 | head -80Length of output: 1634
--- 🏁 Script executed: ```shell #!/bin/bash # Get full _nonReactive type definition sed -n '135,170p' packages/router-core/src/Matches.tsLength of output: 1241
🏁 Script executed:
#!/bin/bash # Get full RouteMatch interface sed -n '118,178p' packages/router-core/src/Matches.tsLength of output: 1823
🏁 Script executed:
#!/bin/bash # Find matchRoutesInternal function - search more broadly rg -n --type=ts "matchRoutesInternal" -B5 -A30 | head -100Length of output: 3366
--- 🏁 Script executed: ```shell #!/bin/bash # Find where existingMatch is declared in matchRoutesInternal sed -n '1237,1500p' packages/router-core/src/router.ts | rg -n "existingMatch" -B3 -A3Length of output: 1701
🏁 Script executed:
#!/bin/bash # Get more context around existingMatch declaration sed -n '1350,1470p' packages/router-core/src/router.tsLength of output: 3927
--- 🏁 Script executed: ```shell #!/bin/bash # Confirm getMatch method return type rg -n --type=ts "getMatch.*=.*|getMatch\(" -B2 -A5 packages/router-core/src/router.ts | head -50Length of output: 1646
Remove unnecessary type assertion.
The
as anycast is not needed. SinceexistingMatchis typed asAnyRouteMatch | undefined(fromgetMatch), andRouteMatchproperly defines_nonReactive: { error?: unknown, ... }, you can safely access the property with optional chaining alone:error: existingMatch?._nonReactive?.error,Remove the
as anycast to preserve type safety.🤖 Prompt for AI Agents
In packages/router-core/src/router.ts around lines 1456 to 1458, remove the unnecessary type assertion on existingMatch when accessing _nonReactive.error; replace the cast usage with plain optional chaining so the line reads access via existingMatch?._nonReactive?.error, preserving type safety and avoiding the as any override.✅ Addressed in commit 3e3af32
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 80b7b5ef4f80c09bcfb2b7c191981fc4a4324180 and 5fa6871e0794e2bb5da6581c144306a1db6f1c30.
📒 Files selected for processing (1)
packages/router-core/src/load-matches.ts(5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
packages/router-core/src/load-matches.ts
packages/router-core/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep framework-agnostic core router logic in packages/router-core/
Files:
packages/router-core/src/load-matches.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/Learnt from: nlynzaad Repo: TanStack/router PR: 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.Learnt from: FatahChan Repo: TanStack/router PR: 5475 File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0 Timestamp: 2025-10-14T18:59:33.990Z Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.Learnt from: nlynzaad Repo: TanStack/router PR: 5284 File: e2e/react-start/basic/server.js:50-0 Timestamp: 2025-09-28T21:41:45.233Z Learning: In Express v5, catch-all routes must use named wildcards. Use `/*splat` to match everything except root path, or `/{*splat}` (with braces) to match including root path. The old `*` syntax is not allowed and will cause "Missing parameter name" errors. This breaking change requires explicit naming of wildcard parameters.📚 Learning: 2025-10-01T18:30:26.591Z
Learnt from: schiller-manuel Repo: TanStack/router PR: 5330 File: packages/router-core/src/router.ts:2231-2245 Timestamp: 2025-10-01T18:30:26.591Z Learning: In `packages/router-core/src/router.ts`, the `resolveRedirect` method intentionally strips the router's origin from redirect URLs when they match (e.g., `https://foo.com/bar` → `/bar` for same-origin redirects) while preserving the full URL for cross-origin redirects. This logic should not be removed or simplified to use `location.publicHref` directly.Applied to files:
packages/router-core/src/load-matches.ts
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad Repo: TanStack/router PR: 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-core/src/load-matches.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/Applied to files:
packages/router-core/src/load-matches.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Preview
- GitHub Check: Test
🔇 Additional comments (2)
packages/router-core/src/load-matches.ts (2)
114-115: LGTM!Storing errors in non-reactive storage for immediate access during transitions is a sound pattern that maintains framework-agnostic code while supporting reactive frameworks.
454-458: LGTM!The non-reactive storage of
__beforeLoadContextwith proper null-safety checks is well-implemented. This pattern allows immediate access to context data during concurrent updates.packages/router-core/src/load-matches.ts lines 570 to 587OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -562,3 +569,19 @@562569 const parentMatchPromise = inner.matchPromises[index - 1] as any563- const { params, loaderDeps, abortController, context, cause } =564- inner.router.getMatch(matchId)!570+ const match = inner.router.getMatch(matchId)!571+ const { params, loaderDeps, abortController, cause } = match572+573+ // Build context by accumulating from all ancestors including current match574+ // We read from _nonReactive.__beforeLoadContext to bypass Solid's transition system575+ let context = inner.router.options.context ?? {}576+577+ for (let i = 0; i <= index; i++) {578+ const innerMatch = inner.matches[i]579+ if (!innerMatch) continue580+ const m = inner.router.getMatch(innerMatch.id)581+ if (!m || !m._nonReactive) continue582+ context = {583+ ...context,584+ ...(m.__routeContext ?? {}),585+ ...(m._nonReactive.__beforeLoadContext ?? {}),586+ }587+ }⚠️ Potential issue | 🟡 Minor
Remove framework-specific reference from comment.
The context aggregation logic is correct and the code is properly framework-agnostic. However, the comment at line 574 explicitly mentions "Solid's transition system," which violates the coding guideline that router-core should remain framework-agnostic.
Apply this diff to make the comment framework-agnostic:
// Build context by accumulating from all ancestors including current match - // We read from _nonReactive.__beforeLoadContext to bypass Solid's transition system + // We read from _nonReactive.__beforeLoadContext for immediate access during concurrent updates let context = inner.router.options.context ?? {}Based on coding guidelines.
🤖 Prompt for AI Agents
In packages/router-core/src/load-matches.ts around lines 570 to 587, the comment on line 574 contains a framework-specific reference ("Solid's transition system"); update the comment to be framework-agnostic by removing that reference and rephrasing it to explain why we read from the internal non-reactive before-load context in neutral terms (e.g., "We read from the internal non-reactive before-load context to avoid reactive transition behavior" or similar), leaving the rest of the logic unchanged.✅ Addressed in commits c825684 to 79f4fc4
packages/router-core/src/load-matches.ts lines 777 to 780OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -750,5 +774,7 @@750774 }751775 await prevMatch._nonReactive.loaderPromise752776 const match = inner.router.getMatch(matchId)!753- if (match.error) {754- handleRedirectAndNotFound(inner, match, match.error)777+ // Check both _nonReactive.error (for Solid router during transitions) and match.error778+ const error = match._nonReactive.error || match.error779+ if (error) {780+ handleRedirectAndNotFound(inner, match, error)⚠️ Potential issue | 🟡 Minor
Remove framework-specific reference from comment.
The dual error-checking logic is correct, but the comment at line 777 explicitly mentions "Solid router," which violates the coding guideline requiring router-core to remain framework-agnostic.
Apply this diff to make the comment framework-agnostic:
- // Check both _nonReactive.error (for Solid router during transitions) and match.error + // Check both _nonReactive.error (for immediate access during transitions) and match.error const error = match._nonReactive.error || match.errorBased on coding guidelines.
📝 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.
// Check both _nonReactive.error (for immediate access during transitions) and match.error const error = match._nonReactive.error || match.error if (error) { handleRedirectAndNotFound(inner, match, error)🤖 Prompt for AI Agents
In packages/router-core/src/load-matches.ts around lines 777 to 780, the inline comment names "Solid router" which is framework-specific; update the comment to a neutral description such as "Check both _nonReactive.error (used for transitional/non-reactive error storage) and match.error" so it no longer references any framework, leaving the existing dual error-checking logic intact.✅ Addressed in commits 73760d0 to 027835e
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 5fa6871e0794e2bb5da6581c144306a1db6f1c30 and 30c987b70533ae91980156225e210909dcddff6f.
📒 Files selected for processing (5)
e2e/solid-router/basic-file-based/src/routeTree.gen.ts(11 hunks)e2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsx(1 hunks)e2e/solid-start/basic/src/routeTree.gen.ts(11 hunks)e2e/solid-start/basic/src/routes/transition/typing/create-resource.tsx(1 hunks)e2e/solid-start/basic/vite.config.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- e2e/solid-start/basic/vite.config.ts
🧰 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:
e2e/solid-start/basic/src/routes/transition/typing/create-resource.tsxe2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.ts
**/src/routes/**
📄 CodeRabbit inference engine (AGENTS.md)
Place file-based routes under src/routes/ directories
Files:
e2e/solid-start/basic/src/routes/transition/typing/create-resource.tsxe2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsx
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Store end-to-end tests under the e2e/ directory
Files:
e2e/solid-start/basic/src/routes/transition/typing/create-resource.tsxe2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.ts
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/Learnt from: nlynzaad Repo: TanStack/router PR: 5182 File: e2e/react-router/basic-file-based/src/routes/non-nested/named/$baz_.bar.tsx:3-5 Timestamp: 2025-09-22T00:56:49.237Z Learning: In TanStack Router, underscores are intentionally stripped from route segments (e.g., `$baz_` becomes `baz` in generated types) but should be preserved in base path segments. This is the correct behavior as of the fix in PR #5182.Learnt from: nlynzaad Repo: TanStack/router PR: 5284 File: e2e/react-start/basic/server.js:50-0 Timestamp: 2025-09-28T21:41:45.233Z Learning: In Express v5, catch-all routes must use named wildcards. Use `/*splat` to match everything except root path, or `/{*splat}` (with braces) to match including root path. The old `*` syntax is not allowed and will cause "Missing parameter name" errors. This breaking change requires explicit naming of wildcard parameters.📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Applied to files:
e2e/solid-start/basic/src/routes/transition/typing/create-resource.tsxe2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.ts
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad Repo: TanStack/router PR: 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:
e2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsxe2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.ts
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel Repo: TanStack/router PR: 5330 File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61 Timestamp: 2025-10-01T18:31:35.420Z Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.Applied to files:
e2e/solid-router/basic-file-based/src/routeTree.gen.tse2e/solid-start/basic/src/routeTree.gen.ts
📚 Learning: 2025-09-28T21:41:45.233Z
Learnt from: nlynzaad Repo: TanStack/router PR: 5284 File: e2e/react-start/basic/server.js:50-0 Timestamp: 2025-09-28T21:41:45.233Z Learning: In Express v5, catch-all routes must use named wildcards. Use `/*splat` to match everything except root path, or `/{*splat}` (with braces) to match including root path. The old `*` syntax is not allowed and will cause "Missing parameter name" errors. This breaking change requires explicit naming of wildcard parameters.Applied to files:
e2e/solid-router/basic-file-based/src/routeTree.gen.ts
🧬 Code graph analysis (1)
e2e/solid-start/basic/src/routes/transition/typing/create-resource.tsx (1)
e2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsx (1)
Route(4-10)
⏰ 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). (1)
- GitHub Check: Test
e2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsx lines 27 to 34Outdated@@ -0,0 +14,21 @@14+ const navigate = Route.useNavigate()15+16+ const [asyncResult] = createResource(17+ () => searchQuery().query,18+ async (query) => {19+ await new Promise((r) => setTimeout(r, 1000))20+ return query21+ },22+ )23+24+ return (25+ <div class="p-2">26+ <div class="mt-2">27+ <input28+ class="border bg-gray-50 text-black px-3 py-1"29+ value={''}30+ placeholder="Type to search..."31+ onInput={(e) => {32+ navigate({ search: { query: e.currentTarget.value } })33+ }}34+ />⚠️ Potential issue | 🔴 Critical
Fix the input value binding.
The input
valueis hardcoded to an empty string, which means it will never display the current search query even though theonInputhandler correctly updates it. Users won't see what they've typed, creating a broken user experience.Apply this diff to bind the input to the search query:
<input class="border bg-gray-50 text-black px-3 py-1" - value={''} + value={searchQuery().query} placeholder="Type to search..." onInput={(e) => { navigate({ search: { query: e.currentTarget.value } }) }} />Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/transition/typing/create-resource.tsx around lines 27-34, the input's value is hardcoded to an empty string so user typing isn't displayed; change the value to the current search query (the source driving navigate({ search: { query } })) so the input is a controlled component — e.g., read the query from the route/search params or component state and set value to that query (falling back to an empty string when undefined) while keeping the onInput handler that updates navigate.@@ -0,0 +14,21 @@14+ const navigate = Route.useNavigate()15+16+ const [asyncResult] = createResource(17+ () => searchQuery().query,18+ async (query) => {19+ await new Promise((r) => setTimeout(r, 1000))20+ return query21+ },22+ )23+24+ return (25+ <div class="p-2">26+ <div class="mt-2">27+ <input28+ class="border bg-gray-50 text-black px-3 py-1"29+ value={''}30+ placeholder="Type to search..."31+ onInput={(e) => {32+ navigate({ search: { query: e.currentTarget.value } })33+ }}34+ />⚠️ Potential issue | 🔴 Critical
Fix the input value binding.
The input
valueis hardcoded to an empty string, which means it will never display the current search query even though theonInputhandler correctly updates it. Users won't see what they've typed, creating a broken user experience.Apply this diff to bind the input to the search query:
<input class="border bg-gray-50 text-black px-3 py-1" - value={''} + value={searchQuery().query} placeholder="Type to search..." onInput={(e) => { navigate({ search: { query: e.currentTarget.value } }) }} />📝 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.
<input class="border bg-gray-50 text-black px-3 py-1" value={searchQuery().query} placeholder="Type to search..." onInput={(e) => { navigate({ search: { query: e.currentTarget.value } }) }} />🤖 Prompt for AI Agents
In e2e/solid-start/basic/src/routes/transition/typing/create-resource.tsx around lines 27-34, the input's value is hardcoded to an empty string so user typing is never shown; change the value binding to read the current search query from the route search state (e.g. use the search object's query property or signal) instead of '' so the input displays the current query, leaving the existing placeholder and onInput navigate handler intact.birkskyum(GitHub profile, opens in a new tab) changed the title
birkskyum(GitHub profile, opens in a new tab) changed the title
Actionable comments posted: 0
♻️ Duplicate comments (1)
e2e/solid-start/basic/tests/transition.spec.ts (1)
23-68: Await Playwright click actionsEach
page.getByTestId('increase-button').click()must be awaited. Without awaiting, the test can advance before the click promise resolves, so the “old value stays visible during the transition” assertions may run before the navigation even starts. That turns this into a false positive and makes the later multi-click sections extremely flaky. Please await every click invocation in this test.- page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() ... - page.getByTestId('increase-button').click() - page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() ... - page.getByTestId('increase-button').click() - page.getByTestId('increase-button').click() - page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click() + await page.getByTestId('increase-button').click()🧹 Nitpick comments (1)
packages/router-core/src/load-matches.ts (1)
574-586: Keep router-core comments framework-agnosticThe new comment explicitly references “Solid's transition system.” In router-core we’ve been keeping docs neutral so the same logic applies to every adapter. Please rephrase to explain the immediate-access intent without naming a specific framework.
- // We read from _nonReactive.__beforeLoadContext to bypass Solid's transition system + // We read from _nonReactive.__beforeLoadContext to ensure the data stays immediately readable during transitions📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 027835e40b0f5541276be47308a771bd5c72750d and de8a3b5491489cdd3bfc8607a006189e03c6ba78.
📒 Files selected for processing (7)
e2e/solid-start/basic/tests/transition.spec.ts(1 hunks)packages/react-router/tests/store-updates-during-navigation.test.tsx(1 hunks)packages/router-core/src/Matches.ts(1 hunks)packages/router-core/src/load-matches.ts(5 hunks)packages/router-core/src/router.ts(2 hunks)packages/router-core/src/ssr/ssr-server.ts(1 hunks)packages/solid-router/tests/store-updates-during-navigation.test.tsx(6 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/solid-router/tests/store-updates-during-navigation.test.tsx
- packages/router-core/src/Matches.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with extensive type safety across the codebase
Files:
packages/react-router/tests/store-updates-during-navigation.test.tsxpackages/router-core/src/ssr/ssr-server.tse2e/solid-start/basic/tests/transition.spec.tspackages/router-core/src/load-matches.tspackages/router-core/src/router.ts
packages/{react-router,solid-router}/**
📄 CodeRabbit inference engine (AGENTS.md)
Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
Files:
packages/react-router/tests/store-updates-during-navigation.test.tsx
packages/router-core/**
📄 CodeRabbit inference engine (AGENTS.md)
Keep framework-agnostic core router logic in packages/router-core/
Files:
packages/router-core/src/ssr/ssr-server.tspackages/router-core/src/load-matches.tspackages/router-core/src/router.ts
e2e/**
📄 CodeRabbit inference engine (AGENTS.md)
Store end-to-end tests under the e2e/ directory
Files:
e2e/solid-start/basic/tests/transition.spec.ts
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad Repo: TanStack/router PR: 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/react-router/tests/store-updates-during-navigation.test.tsxpackages/router-core/src/router.ts
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad Repo: TanStack/router PR: 5732 File: packages/start-client-core/src/client/hydrateStart.ts:6-9 Timestamp: 2025-11-02T16:16:24.898Z Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.Applied to files:
packages/router-core/src/ssr/ssr-server.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/Applied to files:
packages/router-core/src/ssr/ssr-server.tspackages/router-core/src/load-matches.tspackages/router-core/src/router.ts
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR Repo: TanStack/router PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-09-23T17:36:12.598Z Learning: Applies to packages/router-core/** : Keep framework-agnostic core router logic in packages/router-core/Applied to files:
packages/router-core/src/ssr/ssr-server.tspackages/router-core/src/load-matches.tspackages/router-core/src/router.ts
📚 Learning: 2025-10-09T12:59:02.129Z
Learnt from: hokkyss Repo: TanStack/router PR: 5418 File: e2e/react-start/custom-identifier-prefix/src/styles/app.css:19-21 Timestamp: 2025-10-09T12:59:02.129Z Learning: In e2e test directories (paths containing `e2e/`), accessibility concerns like outline suppression patterns are less critical since the code is for testing purposes, not production use.Applied to files:
e2e/solid-start/basic/tests/transition.spec.ts
📚 Learning: 2025-10-01T18:30:26.591Z
Learnt from: schiller-manuel Repo: TanStack/router PR: 5330 File: packages/router-core/src/router.ts:2231-2245 Timestamp: 2025-10-01T18:30:26.591Z Learning: In `packages/router-core/src/router.ts`, the `resolveRedirect` method intentionally strips the router's origin from redirect URLs when they match (e.g., `https://foo.com/bar` → `/bar` for same-origin redirects) while preserving the full URL for cross-origin redirects. This logic should not be removed or simplified to use `location.publicHref` directly.Applied to files:
packages/router-core/src/load-matches.tspackages/router-core/src/router.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test
- GitHub Check: Preview
birkskyum(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Warning
Rate limit exceeded#
@birkskyum has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 8 seconds before requesting another review.
⌛ How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the
@coderabbitai reviewcommand as a PR comment. Alternatively, push new commits to this PR.We recommend that you space out your commits to avoid hitting the rate limit.
🚦 How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.
📥 Commits
Reviewing files that changed from the base of the PR and between 9d2fe253081443bbc49116c14f623bed107f7cf0 and 705b95298eeab0e4e90d9a87433d7503a7c77036.
📒 Files selected for processing (3)
e2e/solid-start/basic/tests/transition.spec.ts(1 hunks)packages/router-core/src/load-matches.ts(3 hunks)packages/router-core/src/router.ts(1 hunks)Walkthrough#
Wraps route-match updates in a transition boundary and surfaces redirect/not-found errors non-reactively on matches; updates loader context merging and error propagation in the load pipeline. Adds an e2e Playwright test for transition behavior and adjusts multiple test expectations for update counts.
Changes#
packages/router-core/src/router.tsupdateMatchmutation logic in astartTransitionboundary and initializes new match_nonReactive.errorfrom an existing match when present.packages/router-core/src/Matches.ts_nonReactive.error?: unknowntoRouteMatchto store redirect/notFound errors non-reactively.packages/router-core/src/load-matches.tsmatch._nonReactive.errorinhandleRedirectAndNotFound; merges contexts from router options and ancestor match__beforeLoadContext/__routeContextingetLoaderContext; treats reloaded matches’ non-reactive error when deciding redirect/not-found handling.e2e/solid-start/basic/tests/transition.spec.tspackages/solid-router/tests/store-updates-during-navigation.test.tsx,packages/react-router/tests/store-updates-during-navigation.test.tsxSequence Diagram(s)#
Estimated code review effort#
🎯 3 (Moderate) | ⏱️ ~25 minutes
packages/router-core/src/load-matches.ts— verify error propagation,handleRedirectAndNotFoundbehavior, and context merge correctness.packages/router-core/src/router.ts— ensurestartTransitionencapsulates mutation semantics safely and_nonReactive.errorinitialization is correct.Possibly related PRs#
Suggested reviewers#
Poem#
Pre-merge checks and finishing touches#
❌ Failed checks (1 warning)
@coderabbitai generate docstringsto improve docstring coverage.✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share