Skip to content
Source
Sign inSign up
TanStack/router

docs(solid-start): start-large example #5847

Mergedbirkskyum(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/5847/headmerged by birkskyum(GitHub profile, opens in a new tab)

Screenshot 2025-11-12 at 20 40 05

Summary by CodeRabbit

  • New Features
    • Added a new comprehensive "start-large" example project for Solid.js demonstrating TanStack Router integration with multiple routing patterns, nested routes, dynamic parameters, search validation, and type-safe navigation setup.
    1. Walkthrough

      A new Solid Start example project is added to examples/solid/start-large/ with configuration files, router infrastructure, multiple typed route definitions, utilities, and a route generation script for scalable routing patterns.

      Changes

      Cohort / File(s)Summary
      Configuration & Setup
      examples/solid/start-large/.gitignore, .vscode/settings.json, tsconfig.json, vite.config.ts, postcss.config.mjs, package.json
      Adds project-wide configuration including dependency management, TypeScript strict mode with Solid.js JSX, Vite + TanStack Solid Start plugin setup with SSR, Tailwind CSS integration via PostCSS, and VS Code workspace settings (excludes and readonly for generated routeTree.gen.ts).
      Router & App Infrastructure
      src/router.tsx, src/routes/__root.tsx, src/typePrimitives.tsx, src/styles.css
      Establishes root route with SSR context (QueryClient), TanStack Router Devtools integration, and Tailwind-based styling with CSS variables and light/dark mode support. Exports type-safe routing primitives (customRedirect, useCustomNavigate, MyLink, ListItems) for typed navigation and link composition.
      Route Files
      src/routes/index.tsx, src/routes/absolute.tsx, src/routes/relative.tsx, src/routes/linkProps.tsx, src/routes/params/route.tsx, src/routes/params/$paramsPlaceholder.tsx, src/routes/search/route.tsx, src/routes/search/searchPlaceholder.tsx
      Defines eight file-based routes demonstrating navigation patterns (relative, absolute, link props), dynamic segments ($paramsPlaceholder, searchPlaceholder), search validation via valibot, server functions with middleware, and query client integration for data fetching.
      Generated Route Tree
      src/routeTree.gen.ts
      Generates fully-typed route tree and module augmentations for @tanstack/solid-router and @tanstack/solid-start, including FileRoutesByFullPath, FileRoutesByTo, FileRoutesById interfaces, per-path route metadata, and SSR router registration.
      Route Generation Script
      src/createRoutes.mjs
      Adds build script that reads TSX templates, creates target directories, and generates 100 numbered route files via string replacement for demonstrating scalable routing.

      Sequence Diagram

      sequenceDiagram
          participant Browser
          participant App as Solid Start App
          participant Router as TanStack Router
          participant QueryClient as QueryClient
          
          Browser->>App: Request /
          App->>Router: Initialize Router (routeTree.gen)
          Router->>QueryClient: Create & attach QueryClient
          Router->>Router: Build typed route tree
          Note over Router: FileRoutesByPath, FileRoutesByTo<br/>augmented via module declarations
          Router-->>App: Configured Router
          App-->>Browser: Render RootComponent + Outlet
          
          Browser->>App: Navigate to /params/value
          App->>Router: useNavigate({ to: '/params/$value' })
          Router->>QueryClient: Execute loader via getQueryData
          QueryClient-->>Router: Cached/fetched data
          Router->>Browser: Render route component with data

      Estimated code review effort

      🎯 3 (Moderate) | ⏱️ ~20 minutes

      • Route configuration: Verify router initialization, QueryClient wiring, and SSR context setup in router.tsx and __root.tsx.
      • Generated type safety: Check that routeTree.gen.ts correctly maps routes, types, and parent/child relationships.
      • Route implementations: Scan route files for consistent patterns (validation schemas, loaders, server functions) and correct use of type-safe primitives.
      • Example quality: Ensure route examples properly demonstrate navigation, search validation, dynamic segments, and link props usage.
      • TanStack/router#5825 — Adds Solid Start example apps that create generated routeTree.gen.ts modules and corresponding __root.tsx route definitions with SSR integration.
      • TanStack/router#5816 — Adds near-identical Solid Start example scaffolds (including generated route trees and router setup) in different example folders.
      • TanStack/router#5625 — Adds TanStack Solid Router route trees and route file wiring with module augmentations for typed route lookups.

      Suggested labels

      ssr, package: solid-router, package: start-server-core, package: start-client-core, documentation

      Suggested reviewers

      • brenelz

      Poem

      🐰 A burrow of routes, so carefully laid, With types that are strong and cascades well-made, From search to params, each path finds its way, Solid Start shines—hop along, come what may! 🚀

      Pre-merge checks and finishing touches

      ❌ Failed checks (1 warning)
      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.You can run @coderabbitai generate docstrings to improve docstring coverage.
      ✅ Passed checks (2 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title check✅ PassedThe title accurately describes the main change: adding a new large-scale example for Solid Start, which is the primary focus of all 18 modified/added files in the changeset.
      ✨ Finishing touches
      • 📝 Generate docstrings
        🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment
      • Commit unit tests in branch `docs(solid-start)--start-large-example`

      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
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. View your CI Pipeline Execution ↗ for commit 08deea1d6003bed3acfbc871ebac307ec77d5d57

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded44sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded1sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-11-12 19:45:00 UTC

    3. More templates

      @tanstack/arktype-adapter

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

      @tanstack/directive-functions-plugin

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

      @tanstack/eslint-plugin-router

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

      @tanstack/history

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

      @tanstack/nitro-v2-vite-plugin

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

      @tanstack/react-router

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

      @tanstack/react-router-devtools

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

      @tanstack/react-router-ssr-query

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

      @tanstack/react-start

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

      @tanstack/react-start-client

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

      @tanstack/react-start-server

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

      @tanstack/router-cli

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

      @tanstack/router-core

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

      @tanstack/router-devtools

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

      @tanstack/router-devtools-core

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

      @tanstack/router-generator

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

      @tanstack/router-plugin

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

      @tanstack/router-ssr-query-core

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

      @tanstack/router-utils

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

      @tanstack/router-vite-plugin

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

      @tanstack/server-functions-plugin

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

      @tanstack/solid-router

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

      @tanstack/solid-router-devtools

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

      @tanstack/solid-router-ssr-query

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

      @tanstack/solid-start

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

      @tanstack/solid-start-client

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

      @tanstack/solid-start-server

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

      @tanstack/start-client-core

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

      @tanstack/start-plugin-core

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

      @tanstack/start-server-core

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

      @tanstack/start-static-server-functions

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

      @tanstack/start-storage-context

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

      @tanstack/valibot-adapter

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

      @tanstack/virtual-file-routes

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

      @tanstack/zod-adapter

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

      commit: 08deea1

    4. Actionable comments posted: 7

      🧹 Nitpick comments (1)
      examples/solid/start-large/src/styles.css (1)

      3-30: Consider consolidating the two @layer base blocks.

      The file defines two separate @layer base blocks (lines 3-11 and 13-30) that could be merged into a single block for better organization.

      Apply this diff to consolidate:

       @layer base {
         *,
         ::after,
         ::before,
         ::backdrop,
         ::file-selector-button {
           border-color: var(--color-gray-200, currentcolor);
         }
      -}
      -
      -@layer base {
      +
         html {
           color-scheme: light dark;
         }
       
         * {
           @apply border-gray-200 dark:border-gray-800;
         }
       
         html,
         body {
           @apply text-gray-900 bg-gray-50 dark:bg-gray-950 dark:text-gray-200;
         }
       
         .using-mouse * {
           outline: none !important;
         }
       }
      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between b5d7227677665a1256d684cf9680428dc0ffa873 and 08deea1d6003bed3acfbc871ebac307ec77d5d57.

      ⛔ Files ignored due to path filters (1)
      • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
      📒 Files selected for processing (20)
      • examples/solid/start-large/.gitignore (1 hunks)
      • examples/solid/start-large/.vscode/settings.json (1 hunks)
      • examples/solid/start-large/package.json (1 hunks)
      • examples/solid/start-large/postcss.config.mjs (1 hunks)
      • examples/solid/start-large/src/createRoutes.mjs (1 hunks)
      • examples/solid/start-large/src/routeTree.gen.ts (1 hunks)
      • examples/solid/start-large/src/router.tsx (1 hunks)
      • examples/solid/start-large/src/routes/__root.tsx (1 hunks)
      • examples/solid/start-large/src/routes/absolute.tsx (1 hunks)
      • examples/solid/start-large/src/routes/index.tsx (1 hunks)
      • examples/solid/start-large/src/routes/linkProps.tsx (1 hunks)
      • examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx (1 hunks)
      • examples/solid/start-large/src/routes/params/route.tsx (1 hunks)
      • examples/solid/start-large/src/routes/relative.tsx (1 hunks)
      • examples/solid/start-large/src/routes/search/route.tsx (1 hunks)
      • examples/solid/start-large/src/routes/search/searchPlaceholder.tsx (1 hunks)
      • examples/solid/start-large/src/styles.css (1 hunks)
      • examples/solid/start-large/src/typePrimitives.tsx (1 hunks)
      • examples/solid/start-large/tsconfig.json (1 hunks)
      • examples/solid/start-large/vite.config.ts (1 hunks)
      🧰 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:

      • examples/solid/start-large/src/routes/linkProps.tsx
      • examples/solid/start-large/src/routes/params/route.tsx
      • examples/solid/start-large/src/routes/__root.tsx
      • examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx
      • examples/solid/start-large/src/routes/search/route.tsx
      • examples/solid/start-large/src/router.tsx
      • examples/solid/start-large/src/routes/relative.tsx
      • examples/solid/start-large/src/typePrimitives.tsx
      • examples/solid/start-large/vite.config.ts
      • examples/solid/start-large/src/routes/absolute.tsx
      • examples/solid/start-large/src/routes/search/searchPlaceholder.tsx
      • examples/solid/start-large/src/routes/index.tsx
      • examples/solid/start-large/src/routeTree.gen.ts
      **/src/routes/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Place file-based routes under src/routes/ directories

      Files:

      • examples/solid/start-large/src/routes/linkProps.tsx
      • examples/solid/start-large/src/routes/params/route.tsx
      • examples/solid/start-large/src/routes/__root.tsx
      • examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx
      • examples/solid/start-large/src/routes/search/route.tsx
      • examples/solid/start-large/src/routes/relative.tsx
      • examples/solid/start-large/src/routes/absolute.tsx
      • examples/solid/start-large/src/routes/search/searchPlaceholder.tsx
      • examples/solid/start-large/src/routes/index.tsx
      examples/{react,solid}/**

      📄 CodeRabbit inference engine (AGENTS.md)

      Keep example applications under examples/react/ and examples/solid/

      Files:

      • examples/solid/start-large/src/routes/linkProps.tsx
      • examples/solid/start-large/src/routes/params/route.tsx
      • examples/solid/start-large/src/routes/__root.tsx
      • examples/solid/start-large/src/createRoutes.mjs
      • examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx
      • examples/solid/start-large/src/routes/search/route.tsx
      • examples/solid/start-large/src/router.tsx
      • examples/solid/start-large/src/styles.css
      • examples/solid/start-large/src/routes/relative.tsx
      • examples/solid/start-large/src/typePrimitives.tsx
      • examples/solid/start-large/vite.config.ts
      • examples/solid/start-large/src/routes/absolute.tsx
      • examples/solid/start-large/package.json
      • examples/solid/start-large/postcss.config.mjs
      • examples/solid/start-large/src/routes/search/searchPlaceholder.tsx
      • examples/solid/start-large/tsconfig.json
      • examples/solid/start-large/src/routes/index.tsx
      • examples/solid/start-large/src/routeTree.gen.ts
      **/package.json

      📄 CodeRabbit inference engine (AGENTS.md)

      Use workspace:* protocol for internal dependencies in package.json files

      Files:

      • examples/solid/start-large/package.json
      🧠 Learnings (11)
      📓 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 docs/{router,start}/** : Place router docs under docs/router/ and start framework docs under docs/start/
      Learnt from: CR
      Repo: TanStack/router PR: 0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.598Z
      Learning: Applies to examples/{react,solid}/** : Keep example applications under examples/react/ and examples/solid/
      📚 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:

      • examples/solid/start-large/src/routes/linkProps.tsx
      • examples/solid/start-large/src/routes/params/route.tsx
      • examples/solid/start-large/src/routes/__root.tsx
      • examples/solid/start-large/src/createRoutes.mjs
      • examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx
      • examples/solid/start-large/src/routes/search/route.tsx
      • examples/solid/start-large/src/routes/relative.tsx
      • examples/solid/start-large/src/typePrimitives.tsx
      • examples/solid/start-large/src/routes/absolute.tsx
      • examples/solid/start-large/src/routes/search/searchPlaceholder.tsx
      • examples/solid/start-large/tsconfig.json
      • examples/solid/start-large/src/routes/index.tsx
      • examples/solid/start-large/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/ directories

      Applied to files:

      • examples/solid/start-large/src/routes/params/route.tsx
      • examples/solid/start-large/src/createRoutes.mjs
      • examples/solid/start-large/src/routes/relative.tsx
      • examples/solid/start-large/src/routes/absolute.tsx
      • examples/solid/start-large/src/routes/index.tsx
      • examples/solid/start-large/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:

      • examples/solid/start-large/src/routes/params/route.tsx
      • examples/solid/start-large/src/createRoutes.mjs
      • examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx
      • examples/solid/start-large/src/routes/search/route.tsx
      • examples/solid/start-large/.vscode/settings.json
      • examples/solid/start-large/src/routes/relative.tsx
      • examples/solid/start-large/src/routes/absolute.tsx
      • examples/solid/start-large/src/routeTree.gen.ts
      📚 Learning: 2025-10-14T18:59:33.990Z
      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.

      Applied to files:

      • examples/solid/start-large/src/routes/params/route.tsx
      • examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx
      • examples/solid/start-large/src/routes/search/route.tsx
      📚 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:

      • examples/solid/start-large/src/routes/__root.tsx
      • examples/solid/start-large/src/createRoutes.mjs
      • examples/solid/start-large/.gitignore
      • examples/solid/start-large/.vscode/settings.json
      • examples/solid/start-large/src/routes/relative.tsx
      • examples/solid/start-large/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/{router-cli,router-generator,router-plugin,virtual-file-routes}/** : Keep CLI, generators, bundler plugins, and virtual file routing utilities in their dedicated tooling package directories

      Applied to files:

      • examples/solid/start-large/src/createRoutes.mjs
      • examples/solid/start-large/.gitignore
      • examples/solid/start-large/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 **/*.{ts,tsx} : Use TypeScript in strict mode with extensive type safety across the codebase

      Applied to files:

      • examples/solid/start-large/src/typePrimitives.tsx
      • examples/solid/start-large/tsconfig.json
      📚 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:

      • examples/solid/start-large/package.json
      • examples/solid/start-large/tsconfig.json
      • examples/solid/start-large/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/router-core/** : Keep framework-agnostic core router logic in packages/router-core/

      Applied to files:

      • examples/solid/start-large/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 docs/{router,start}/** : Place router docs under docs/router/ and start framework docs under docs/start/

      Applied to files:

      • examples/solid/start-large/src/routeTree.gen.ts
      🧬 Code graph analysis (9)
      examples/solid/start-large/src/routes/linkProps.tsx (3)
      examples/solid/start-large/src/routes/absolute.tsx (1)
      • Route (3-5)
      examples/solid/start-large/src/routes/search/searchPlaceholder.tsx (1)
      • Route (43-69)
      examples/solid/start-large/src/typePrimitives.tsx (4)
      • customRedirect (15-17)
      • useCustomNavigate (22-25)
      • MyLink (30-32)
      • ListItems (48-50)
      examples/solid/start-large/src/routes/params/route.tsx (1)
      examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx (1)
      • Route (46-63)
      examples/solid/start-large/src/routes/__root.tsx (2)
      examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx (1)
      • Route (46-63)
      examples/solid/start-large/src/routes/search/searchPlaceholder.tsx (1)
      • Route (43-69)
      examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx (2)
      examples/solid/start-large/src/routes/params/route.tsx (1)
      • Route (3-5)
      examples/solid/start-large/src/routes/search/searchPlaceholder.tsx (1)
      • Route (43-69)
      examples/solid/start-large/src/routes/search/route.tsx (2)
      examples/solid/start-large/src/routes/linkProps.tsx (1)
      • Route (9-23)
      examples/solid/start-large/src/routes/search/searchPlaceholder.tsx (1)
      • Route (43-69)
      examples/solid/start-large/src/routes/relative.tsx (2)
      examples/solid/start-large/src/routes/absolute.tsx (1)
      • Route (3-5)
      examples/solid/start-large/src/routes/index.tsx (1)
      • Route (3-5)
      examples/solid/start-large/src/routes/absolute.tsx (2)
      examples/solid/start-large/src/routes/index.tsx (1)
      • Route (3-5)
      examples/solid/start-large/src/routes/relative.tsx (1)
      • Route (3-5)
      examples/solid/start-large/src/routes/search/searchPlaceholder.tsx (4)
      examples/solid/start-large/src/createRoutes.mjs (1)
      • search (12-14)
      examples/solid/start-large/src/routes/linkProps.tsx (1)
      • Route (9-23)
      examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx (1)
      • Route (46-63)
      examples/solid/start-large/src/routes/search/route.tsx (1)
      • Route (8-11)
      examples/solid/start-large/src/routeTree.gen.ts (1)
      examples/solid/start-large/src/router.tsx (1)
      • getRouter (5-15)
      ⏰ 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)
      examples/solid/start-large/.vscode/settings.json (1)

      1-11: Best practice configuration for autogenerated files.

      The VSCode settings appropriately configure the workspace to protect the autogenerated routeTree.gen.ts file from accidental edits and reduce IDE noise. The glob pattern and three-pronged approach (excluding from file watching, search, and marking readonly) aligns with the guidance that autogenerated files should not be manually modified.

      examples/solid/start-large/postcss.config.mjs (1)

      1-5: LGTM!

      The PostCSS configuration correctly integrates the Tailwind CSS plugin with standard setup.

      examples/solid/start-large/vite.config.ts (1)

      1-17: LGTM!

      The Vite configuration correctly sets up Solid Start with SSR, TypeScript path resolution, and appropriate plugin ordering.

      examples/solid/start-large/src/typePrimitives.tsx (1)

      1-50: LGTM!

      The type-safe router primitive wrappers demonstrate proper usage of TypeScript generics and function overloads for type safety. The implementations correctly delegate to the underlying router primitives.

      examples/solid/start-large/src/router.tsx (1)

      1-15: LGTM!

      The router initialization correctly integrates Solid Query's QueryClient into the router context and follows standard patterns for TanStack Router setup.

      examples/solid/start-large/src/routes/search/route.tsx (1)

      1-11: LGTM!

      The route definition correctly integrates Valibot validation for search parameters and follows standard TanStack Router file-based routing patterns.

      examples/solid/start-large/.gitignore lines 1 to 19
      @@ -0,0 +1,19 @@
      1+node_modules
      2+.DS_Store
      3+dist
      4+dist-ssr
      5+*.local
      6+(gen)
      7+node_modules
      8+package-lock.json
      9+yarn.lock
      10+
      11+.DS_Store
      12+.cache
      13+.env
      14+.vercel
      15+.output
      16+/build/
      17+/api/
      18+/server/build
      19+/public/build

      ⚠️ Potential issue | 🟡 Minor

      Remove duplicate entries.

      The file contains duplicate entries for node_modules (lines 1 and 7) and .DS_Store (lines 2 and 11).

      Apply this diff to remove the duplicates:

       node_modules
       .DS_Store
       dist
       dist-ssr
       *.local
       (gen)
      -node_modules
       package-lock.json
       yarn.lock
      
      -.DS_Store
       .cache
       .env
       .vercel
       .output
       /build/
       /api/
       /server/build
       /public/build
      📝 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.

      node_modules
      .DS_Store
      dist
      dist-ssr
      *.local
      (gen)
      package-lock.json
      yarn.lock
      
      .cache
      .env
      .vercel
      .output
      /build/
      /api/
      /server/build
      /public/build
      🤖 Prompt for AI Agents
      In examples/solid/start-large/.gitignore around lines 1 to 19 there are
      duplicate entries for node_modules and .DS_Store; remove the repeated lines so
      each pattern appears only once (keep one node_modules and one .DS_Store entry)
      and ensure the remaining ordering is sensible, leaving the rest of the ignore
      patterns unchanged.
      examples/solid/start-large/package.json lines 13 to 21
      @@ -0,0 +1,21 @@
      1+{
      2+ "name": "tanstack-solid-start-example-large",
      3+ "private": true,
      4+ "sideEffects": false,
      5+ "type": "module",
      6+ "scripts": {
      7+ "dev": "vite dev",
      8+ "build": "vite build && tsc --noEmit",
      9+ "start": "vite start",
      10+ "gen": "node ./src/createRoutes.mjs",
      11+ "test:types": "tsc --extendedDiagnostics"
      12+ },
      13+ "dependencies": {
      14+ "@tanstack/solid-query": "^5.90.0",
      15+ "@tanstack/solid-router": "^1.135.2",
      16+ "@tanstack/solid-router-devtools": "^1.135.2",
      17+ "@tanstack/solid-start": "^1.135.2",
      18+ "solid-js": "^1.9.10",
      19+ "redaxios": "^0.5.1",
      20+ "tailwind-merge": "^2.6.0",
      21+ "valibot": "^1.0.0-beta.15"

      🛠️ Refactor suggestion | 🟠 Major

      Use workspace:* protocol for internal dependencies.

      Per the coding guidelines, internal TanStack packages should use the workspace:* protocol instead of pinned versions to ensure consistency across the monorepo.

      As per coding guidelines.

      Apply this diff:

         "dependencies": {
      -    "@tanstack/solid-query": "^5.90.0",
      -    "@tanstack/solid-router": "^1.135.2",
      -    "@tanstack/solid-router-devtools": "^1.135.2",
      -    "@tanstack/solid-start": "^1.135.2",
      +    "@tanstack/solid-query": "workspace:*",
      +    "@tanstack/solid-router": "workspace:*",
      +    "@tanstack/solid-router-devtools": "workspace:*",
      +    "@tanstack/solid-start": "workspace:*",
           "solid-js": "^1.9.10",
           "redaxios": "^0.5.1",
           "tailwind-merge": "^2.6.0",
           "valibot": "^1.0.0-beta.15"
         },
      🤖 Prompt for AI Agents
      In examples/solid/start-large/package.json around lines 13 to 21, change
      internal TanStack package dependency versions to use the workspace:* protocol;
      specifically replace the pinned versions for @tanstack/solid-query,
      @tanstack/solid-router, @tanstack/solid-router-devtools, and
      @tanstack/solid-start with "workspace:*" (leave external packages like solid-js,
      redaxios, tailwind-merge, valibot unchanged), then save the file.
      examples/solid/start-large/src/createRoutes.mjs lines 37 to 49
      @@ -0,0 +29,21 @@
      29+
      30+ if (!existsSync('./src/routes/(gen)/params')) {
      31+ await mkdir('./src/routes/(gen)/params')
      32+ }
      33+
      34+ await writeFile('./src/routes/(gen)/search/route.tsx', searchRoute)
      35+ await writeFile('./src/routes/(gen)/params/route.tsx', paramsRoute)
      36+
      37+ for (let y = 0; y < length; y = y + 1) {
      38+ const replacedAbsolute = absolute.replaceAll('/absolute', `/absolute${y}`)
      39+ const replacedRelative = relative.replaceAll('/relative', `/relative${y}`)
      40+ const replacedSearch = search.replaceAll('searchPlaceholder', `search${y}`)
      41+ const replacedParams = params.replaceAll('paramsPlaceholder', `param${y}`)
      42+ await writeFile(`./src/routes/(gen)/absolute${y}.tsx`, replacedAbsolute)
      43+ await writeFile(`./src/routes/(gen)/relative${y}.tsx`, replacedRelative)
      44+ await writeFile(`./src/routes/(gen)/search/search${y}.tsx`, replacedSearch)
      45+ await writeFile(`./src/routes/(gen)/params/$param${y}.tsx`, replacedParams)
      46+ }
      47+}
      48+
      49+main()

      🛠️ Refactor suggestion | 🟠 Major

      Handle main() rejections.

      main() is async and its errors currently surface as unhandled promise rejections. Wrap the call so failures exit cleanly. (tanstack.com)

      -main()
      +main().catch((err) => {
      +  console.error(err)
      +  process.exit(1)
      +})
      📝 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.

        for (let y = 0; y < length; y = y + 1) {
          const replacedAbsolute = absolute.replaceAll('/absolute', `/absolute${y}`)
          const replacedRelative = relative.replaceAll('/relative', `/relative${y}`)
          const replacedSearch = search.replaceAll('searchPlaceholder', `search${y}`)
          const replacedParams = params.replaceAll('paramsPlaceholder', `param${y}`)
          await writeFile(`./src/routes/(gen)/absolute${y}.tsx`, replacedAbsolute)
          await writeFile(`./src/routes/(gen)/relative${y}.tsx`, replacedRelative)
          await writeFile(`./src/routes/(gen)/search/search${y}.tsx`, replacedSearch)
          await writeFile(`./src/routes/(gen)/params/$param${y}.tsx`, replacedParams)
        }
      }
      
      main().catch((err) => {
        console.error(err)
        process.exit(1)
      })
      🤖 Prompt for AI Agents
      In examples/solid/start-large/src/createRoutes.mjs around lines 37 to 49, the
      top-level async main() call is unhandled and can produce unhandled promise
      rejections; update the invocation to handle rejections by either awaiting it
      inside an immediately-invoked async function with try/catch or by appending
      .catch(err => { console.error(err); process.exit(1); }) to main(), ensuring any
      thrown error is logged and the process exits with a non-zero code.
      examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx lines 33 to 37
      @@ -0,0 +17,21 @@
      17+ .inputValidator(params)
      18+ .client(({ next }) => {
      19+ const context = { client: { paramsPlaceholder: 'paramsPlaceholder' } }
      20+ return next({
      21+ context,
      22+ sendContext: context,
      23+ })
      24+ })
      25+ .server(({ next }) => {
      26+ const context = { server: { paramsPlaceholder: 'paramsPlaceholder' } }
      27+ return next({
      28+ context,
      29+ sendContext: context,
      30+ })
      31+ })
      32+
      33+const fn = createServerFn()
      34+ .middleware([middleware])
      35+ .handler(() => {
      36+ return v.parse(loaderResult, {})
      37+ })

      ⚠️ Potential issue | 🔴 Critical

      Server handler never returns valid data

      v.parse(loaderResult, {}) runs with an empty object, so Valibot throws before returning. Every call to fn(...) will therefore reject, and the route’s loader/context can never succeed. Return the validated payload from the middleware (e.g. wrap the validated params under the params key) instead of parsing {}.

       const fn = createServerFn()
         .middleware([middleware])
      -  .handler(() => {
      -    return v.parse(loaderResult, {})
      -  })
      +  .handler(({ data }) => v.parse(loaderResult, { params: data }))
      examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx lines 61 to 62
      @@ -0,0 +42,21 @@
      42+ return v.parse(loaderResult, {})
      43+ },
      44+})
      45+
      46+export const Route = createFileRoute('/params/$paramsPlaceholder')({
      47+ component: ParamsComponent,
      48+ context: () => ({
      49+ paramsQueryOptions: queryOptions({
      50+ queryKey: ['paramsPlaceholder'],
      51+ queryFn: async () =>
      52+ await fn({
      53+ data: {
      54+ oneParamsPlaceholder: 'oneParamsPlaceholder',
      55+ twoParamsPlaceholder: 'twoParamsPlaceholder',
      56+ threeParamsPlaceholder: 'threeParamsPlaceholder',
      57+ },
      58+ }),
      59+ }),
      60+ }),
      61+ loader: (opts) =>
      62+ opts.context.queryClient.ensureQueryData(paramsQueryOptions),

      ⚠️ Potential issue | 🔴 Critical

      Loader is using the wrong query options

      ensureQueryData points at the module-level paramsQueryOptions, whose queryFn still calls v.parse(loaderResult, {}) and never hits your server function. This throws immediately and bypasses the per-request options you placed in context. Call the query options from opts.context (and drop the broken global constant) so the loader reuses the server-backed query.

      -const paramsQueryOptions = queryOptions({
      -  queryKey: ['paramsPlaceholder'],
      -  queryFn: () => {
      -    return v.parse(loaderResult, {})
      -  },
      -})
      -
       export const Route = createFileRoute('/params/$paramsPlaceholder')({
         component: ParamsComponent,
         context: () => ({
      @@
         }),
         loader: (opts) =>
      -    opts.context.queryClient.ensureQueryData(paramsQueryOptions),
      +    opts.context.queryClient.ensureQueryData(
      +      opts.context.paramsQueryOptions,
      +    ),
       })

      Committable suggestion skipped: line range outside the PR's diff.

      🤖 Prompt for AI Agents
      In examples/solid/start-large/src/routes/params/$paramsPlaceholder.tsx around
      lines 61-62, the loader is calling ensureQueryData with the module-level
      paramsQueryOptions which contains a queryFn that calls v.parse(...) and never
      invokes the server-backed function; replace that call to use the per-request
      query options stored on opts.context (e.g. opts.context.paramsQueryOptions or
      opts.context.queryOptions) so the loader reuses the server-backed queryFn, and
      remove the broken module-level paramsQueryOptions constant to avoid accidentally
      referencing it elsewhere.
      examples/solid/start-large/src/routes/search/searchPlaceholder.tsx lines 6 to 84
      @@ -0,0 +64,21 @@
      64+
      65+ return {
      66+ search,
      67+ }
      68+ },
      69+})
      70+
      71+function SearchComponent() {
      72+ return (
      73+ <div class="p-2 space-y-2">
      74+ <Link
      75+ to="/search/searchPlaceholder"
      76+ class="block py-1 text-blue-800 hover:text-blue-600"
      77+ search={{
      78+ searchPlaceholder: 'searchPlaceholder',
      79+ page: 0,
      80+ offset: 10,
      81+ search: 'search',
      82+ rootSearch: 0,
      83+ }}
      84+ >

      ⚠️ Potential issue | 🟠 Major

      Search schema drops rootSearch.

      validateSearch uses v.object. That parser removes keys not declared in the schema, so the rootSearch you pass in the <Link> (and that upstream routes may rely on) gets stripped before loaders run. Either add rootSearch to this schema (with the right validator) or switch to v.objectWithRest if you intentionally need to forward unknown keys. (valibot.dev)

      🤖 Prompt for AI Agents
      In examples/solid/start-large/src/routes/search/searchPlaceholder.tsx around
      lines 6 to 84, the search schema (v.object) omits the rootSearch key so
      validateSearch strips it before loaders run; fix by either adding rootSearch to
      the schema with the correct validator (e.g., rootSearch: v.number() or whatever
      type upstream expects) or replace v.object(...) with v.objectWithRest(...) to
      allow unknown keys to pass through, then update any related types/usages to
      match the chosen validator.
      examples/solid/start-large/tsconfig.json lines 1 to 23
      @@ -0,0 +3,21 @@
      3+ "compilerOptions": {
      4+ "strict": true,
      5+ "esModuleInterop": true,
      6+ "jsx": "preserve",
      7+ "jsxImportSource": "solid-js",
      8+ "module": "ESNext",
      9+ "moduleResolution": "Bundler",
      10+ "lib": ["DOM", "DOM.Iterable", "ES2022"],
      11+ "isolatedModules": true,
      12+ "resolveJsonModule": true,
      13+ "skipLibCheck": true,
      14+ "target": "ES2022",
      15+ "allowJs": true,
      16+ "forceConsistentCasingInFileNames": true,
      17+ "baseUrl": ".",
      18+ "paths": {
      19+ "~/*": ["./src/*"]
      20+ },
      21+ "noEmit": true
      22+ }
      23+}

      ⚠️ Potential issue | 🔴 Critical

      🧩 Analysis chain

      TypeScript configuration is well-configured for Solid.js development.

      The configuration appropriately enables strict mode (line 4), preserves JSX for Solid.js (lines 6-7), sets modern compilation targets (ES2022), and includes helpful path aliases for cleaner imports. The setup follows best practices and aligns with the project's TypeScript guidelines.

      To ensure consistency across the example projects, could you verify that this configuration aligns with the TypeScript settings in other examples (e.g., examples/react/*/tsconfig.json or examples/solid/*/tsconfig.json)? Run the following to compare:


      🏁 Script executed:

      #!/bin/bash
      # Description: Compare tsconfig.json configurations across example projects
      
      echo "=== Solid examples tsconfig.json files ==="
      find examples/solid -name "tsconfig.json" -type f | head -10
      
      echo -e "\n=== React examples tsconfig.json files ==="
      find examples/react -name "tsconfig.json" -type f | head -10
      
      # Show if any other tsconfig.json files exist for comparison
      if [ -f "examples/solid/*/tsconfig.json" ]; then
        echo -e "\n=== Comparing strict and target settings ==="
        for file in $(find examples -name "tsconfig.json" -type f); do
          echo "$file:"
          grep -E '"strict"|"target"' "$file" | head -2
        done
      fi

      Length of output: 1150


      
      ---
      
      🏁 Script executed:
      
      ```shell
      #!/bin/bash
      # Verify start-large exists and compare TypeScript configurations
      
      echo "=== Checking if examples/solid/start-large exists ==="
      if [ -d "examples/solid/start-large" ]; then
        echo "✓ Directory exists"
        ls -la examples/solid/start-large/ | grep tsconfig
      else
        echo "✗ Directory does not exist"
      fi
      
      echo -e "\n=== Strict and Target settings across all examples ==="
      for file in $(find examples -name "tsconfig.json" -type f | sort); do
        strict=$(grep -o '"strict":\s*[^,}]*' "$file" 2>/dev/null | head -1)
        target=$(grep -o '"target":\s*"[^"]*' "$file" 2>/dev/null | head -1)
        echo "$file: $strict | $target"
      done | head -20
      
      echo -e "\n=== Sample: React basic-file-based tsconfig.json ==="
      cat examples/react/basic-file-based/tsconfig.json 2>/dev/null | head -20

      Length of output: 2101


      
      ---
      
      🏁 Script executed:
      
      ```shell
      #!/bin/bash
      # Compare Solid examples specifically and show existing configuration
      
      echo "=== Target settings for Solid examples only ==="
      for file in $(find examples/solid -name "tsconfig.json" -type f | sort); do
        target=$(grep -o '"target":\s*"[^"]*' "$file" 2>/dev/null | head -1)
        echo "$file: $target"
      done | head -15
      
      echo -e "\n=== Sample Solid example (basic-file-based) full config ==="
      cat examples/solid/basic-file-based/tsconfig.json 2>/dev/null
      
      echo -e "\n=== Sample Solid example (kitchen-sink) full config ==="
      cat examples/solid/kitchen-sink/tsconfig.json 2>/dev/null | head -25

      Length of output: 1769


      Change target to "ESNext" to align with other Solid examples.

      All other Solid examples use "target": "ESNext" (13 out of 14). The reviewed file uses "ES2022", creating an inconsistency. Change line 14 to match the project standard. Additionally, review whether the extra compiler options (isolatedModules, resolveJsonModule, allowJs, forceConsistentCasingInFileNames, baseUrl, paths, noEmit) are needed for this example or if they should be removed for consistency with simpler Solid examples like examples/solid/basic-file-based/tsconfig.json.

      🤖 Prompt for AI Agents
      In examples/solid/start-large/tsconfig.json lines 1-23, the compiler target is
      set to "ES2022" which is inconsistent with other Solid examples; change "target"
      to "ESNext" and update that line accordingly; then compare this file to
      examples/solid/basic-file-based/tsconfig.json and remove any extra
      compilerOptions that are not needed for the example (e.g., consider dropping
      isolatedModules, resolveJsonModule, allowJs, forceConsistentCasingInFileNames,
      baseUrl/paths, noEmit) so the file matches the simpler, consistent set used
      across other Solid examples.

Sign in to join this conversation.