Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Nov 12, 2025

Summary by CodeRabbit

  • New Features
    • Added a comprehensive Solid.js router monorepo example with separate workspace packages for routing, data queries, and application features. Demonstrates type-safe route configuration, query-based data preloading, error handling patterns, query client integration, developer tooling, Tailwind CSS styling, TypeScript strict mode, and recommended architectural patterns for organizing and building scalable applications.

@github-actions github-actions bot added the documentation Everything documentation related label Nov 12, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Walkthrough

Adds a comprehensive monorepo example for TanStack Solid Router with Solid Query integration across four packages (app, router, post-feature, post-query). Includes route definitions, data fetching utilities, feature components, and configuration files for development and production builds.

Changes

Cohort / File(s) Summary
Configuration & Documentation
docs/router/config.json, README.md, pnpm-workspace.yaml.example
Adds config entry for new monorepo example and workspace definition. Includes setup instructions and architecture documentation.
Monorepo Root Configuration
.gitignore, .stackblitzrc, .vscode/settings.json, package.json
Establishes monorepo workspace with build/dev scripts, root dependencies, VSCode settings to exclude generated routeTree, and StackBlitz CI configuration.
App Package
packages/app/package.json, packages/app/tsconfig.json, packages/app/vite.config.ts, packages/app/index.html, packages/app/src/main.tsx, packages/app/src/rootComponent.tsx, packages/app/src/style.css
Configures the main application that renders routes, wires route-to-component mappings, integrates QueryClientProvider and RouterProvider, and includes devtools.
Post-Query Package
packages/post-query/package.json, packages/post-query/tsconfig.json, packages/post-query/vite.config.ts, packages/post-query/src/index.ts, packages/post-query/src/posts.tsx, packages/post-query/src/postQueryOptions.tsx, packages/post-query/src/postsQueryOptions.tsx
Defines data layer with fetch functions (fetchPost, fetchPosts), PostType and PostNotFoundError, and query options exports.
Post-Feature Package
packages/post-feature/package.json, packages/post-feature/tsconfig.json, packages/post-feature/vite.config.ts, packages/post-feature/src/index.ts, packages/post-feature/src/PostList.tsx, packages/post-feature/src/PostIdPage.tsx, packages/post-feature/src/PostError.tsx
Contains feature components (PostsListComponent, PostIdComponent, PostErrorComponent) that consume query data and handle routing/errors.
Router Package
packages/router/package.json, packages/router/tsconfig.json, packages/router/vite.config.ts, packages/router/src/index.ts, packages/router/src/router.tsx, packages/router/src/routeTree.gen.ts, packages/router/src/routes/__root.tsx, packages/router/src/routes/$postId.ts, packages/router/src/routes/index.ts
Configures TanStack Solid Router with QueryClient integration, exports route tree, route definitions, and type-safe router/component APIs with module augmentation.

Sequence Diagram

sequenceDiagram
    participant User
    participant App
    participant Router
    participant QueryClient
    participant PostQueryPkg as post-query
    participant PostFeaturePkg as post-feature

    User->>App: Load app
    App->>Router: Initialize with context
    Router->>Router: Register QueryClient
    Router->>Router: Generate routeTree
    
    User->>Router: Navigate to /
    Router->>Router: Load index route
    Router->>QueryClient: ensureQueryData(postsQueryOptions)
    QueryClient->>PostQueryPkg: fetchPosts()
    PostQueryPkg-->>QueryClient: Post[] data
    
    Router->>PostFeaturePkg: Render PostsListComponent
    PostFeaturePkg->>QueryClient: useQuery(postsQueryOptions)
    PostFeaturePkg-->>User: Render posts list

    User->>Router: Click post link
    Router->>Router: Load $postId route
    Router->>QueryClient: ensureQueryData(postQueryOptions(id))
    QueryClient->>PostQueryPkg: fetchPost(id)
    PostQueryPkg-->>QueryClient: Post data
    
    Router->>PostFeaturePkg: Render PostIdComponent
    PostFeaturePkg->>QueryClient: useQuery(postQueryOptions(id))
    PostFeaturePkg-->>User: Render post details
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Router type augmentation & routeTree.gen.ts: The generated route tree file and module augmentation for @tanstack/solid-router require careful verification of type safety and generated structure correctness.
  • App wiring logic (main.tsx): The route-to-component mapping and error-component mapping logic uses type assertions and dynamic updates that warrant careful inspection.
  • Data flow integration: The QueryClient context wiring, preloading patterns (ensureQueryData), and component-level query consumption across packages should be reviewed for consistency.
  • Package interdependencies: Verify workspace references, external dependency marking, and build output configurations across all four packages are correct.

Possibly related PRs

Suggested reviewers

  • birkskyum
  • brenelz

Poem

🐰 Monorepo dreams in packages neat,
Solid routes and queries meet,
Types cascade through the air,
Posts and features everywhere!
Router trees and QueryClients dance,
Giving developers a fighting chance!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a monorepo example for Solid Router with Solid Query integration, which is reflected throughout the changeset with new example files and documentation.
✨ 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-router)--monorepo-solid-query-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.

@birkskyum birkskyum force-pushed the docs(solid-router)--monorepo-solid-query-example branch from d56d58c to 2f5656a Compare November 12, 2025 22:52
@nx-cloud
Copy link

nx-cloud bot commented Nov 12, 2025

View your CI Pipeline Execution ↗ for commit cf45528

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

☁️ Nx Cloud last updated this comment at 2025-11-12 22:58:17 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 12, 2025

More templates

@tanstack/arktype-adapter

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

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: cf45528

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (10)
examples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.json (1)

1-13: Consider adding "include" field for consistency.

The router/tsconfig.json includes an "include": ["src"] field, but this configuration omits it. While both approaches work, having consistent tsconfig structure across packages improves maintainability.

Apply this diff to add the include field:

     "lib": ["DOM", "DOM.Iterable", "ES2022"],
     "skipLibCheck": true
-  }
+  },
+  "include": ["src"]
 }
examples/solid/router-monorepo-solid-query/packages/app/tsconfig.json (1)

1-13: Consider adding "include" field for consistency.

For consistency with router/tsconfig.json, consider adding an "include": ["src"] field to explicitly scope TypeScript compilation.

Apply this diff:

     "lib": ["DOM", "DOM.Iterable", "ES2022"],
     "skipLibCheck": true
-  }
+  },
+  "include": ["src"]
 }
examples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.json (1)

1-13: Consider adding "include" field for consistency.

Like the router package, adding an "include": ["src"] field would ensure consistent tsconfig structure across all packages in the monorepo.

Apply this diff:

     "lib": ["DOM", "DOM.Iterable", "ES2022"],
     "skipLibCheck": true
-  }
+  },
+  "include": ["src"]
 }
examples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsx (1)

1-8: LGTM! Standard TanStack Query pattern.

The query options factory follows the standard TanStack Query pattern correctly.

Optional: Consider .ts extension instead of .tsx.

Since this file contains no JSX, the .ts extension would be more semantically accurate, though this is purely a stylistic preference.

examples/solid/router-monorepo-solid-query/package.json (1)

10-10: Consider simplifying build orchestration.

The dev script manually sequences package builds, which works but duplicates the build orchestration already specified in the app package's nx configuration (dependsOn: ["^build"]). While the explicit approach is clear for an example, you might consider either:

  1. Relying solely on the nx configuration and simplifying to "dev": "pnpm app dev"
  2. Adding a comment explaining why manual sequencing is preferred

The current approach is functional, so this is more about maintainability and avoiding redundant configuration.

examples/solid/router-monorepo-solid-query/packages/post-query/src/postsQueryOptions.tsx (1)

4-7: Consider simplifying the queryFn.

The arrow function wrapper around fetchPosts() is unnecessary since it takes no arguments and can be passed directly.

Apply this diff:

 export const postsQueryOptions = queryOptions({
   queryKey: ['posts'],
-  queryFn: () => fetchPosts(),
+  queryFn: fetchPosts,
 })
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostIdPage.tsx (1)

8-18: Consider adding error handling for the query.

While the component handles undefined data with optional chaining, it doesn't handle query error states. If the post fetch fails (e.g., network error), users will see an empty component without feedback.

Consider adding error handling:

 export function PostIdComponent() {
   const postId = route.useParams()().postId
-  const { data: post } = useQuery(() => postQueryOptions(postId))
+  const { data: post, error, isError } = useQuery(() => postQueryOptions(postId))

+  if (isError) {
+    return <div class="text-red-600">Error loading post: {error?.message}</div>
+  }
+
   return (
     <div class="space-y-2">
       <h4 class="text-xl font-bold underline">{post?.title}</h4>
       <div class="text-sm">{post?.body}</div>
     </div>
   )
 }
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostList.tsx (2)

6-7: Consider wrapping derived data in createMemo.

While direct assignment works, other examples in the codebase wrap query data in createMemo for better reactivity tracking. This ensures the posts list re-renders efficiently when the query data updates.

Apply this diff:

+import { createMemo } from 'solid-js'
 import { useQuery } from '@tanstack/solid-query'
 import { postsQueryOptions } from '@router-solid-mono-solid-query/post-query'
 import { Link, Outlet } from '@router-solid-mono-solid-query/router'

 export function PostsListComponent() {
   const postsQuery = useQuery(() => postsQueryOptions)
-  const posts = postsQuery.data
+  const posts = createMemo(() => postsQuery.data || [])

Then update line 13 to use posts() instead of posts || []:

-        {[
-          ...(posts || []),
-          { id: 'i-do-not-exist', title: 'Non-existent Post' },
-        ].map((post) => {
+        {[...posts(), { id: 'i-do-not-exist', title: 'Non-existent Post' }].map(
+          (post) => {

5-36: Consider adding error and loading states.

The component doesn't handle query errors or provide loading feedback. While the router loader preloads data, handling these states improves user experience during refetches or errors.

Consider adding error and loading handling:

 export function PostsListComponent() {
   const postsQuery = useQuery(() => postsQueryOptions)
-  const posts = postsQuery.data
+  const posts = createMemo(() => postsQuery.data || [])

   return (
     <div class="p-2 flex gap-2">
+      {postsQuery.isError && (
+        <div class="text-red-600">Error loading posts: {postsQuery.error?.message}</div>
+      )}
       <ul class="list-disc pl-4">
         {[
-          ...(posts || []),
+          ...posts(),
           { id: 'i-do-not-exist', title: 'Non-existent Post' },
         ].map((post) => {
examples/solid/router-monorepo-solid-query/packages/post-query/vite.config.ts (1)

26-26: Update library name to match package.

The library name is set to 'router' but this is the 'post-query' package. While this doesn't affect functionality in ES module format, it improves clarity.

Apply this diff:

     lib: {
       entry: 'src/index.ts',
-      name: 'router',
+      name: 'post-query',
       fileName: 'index',
       formats: ['es'],
     },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ecd9312 and cf45528.

⛔ Files ignored due to path filters (2)
  • examples/solid/router-monorepo-solid-query/assets/graph.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (37)
  • docs/router/config.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/.gitignore (1 hunks)
  • examples/solid/router-monorepo-solid-query/.stackblitzrc (1 hunks)
  • examples/solid/router-monorepo-solid-query/.vscode/settings.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/README.md (1 hunks)
  • examples/solid/router-monorepo-solid-query/package.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/app/index.html (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/app/package.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/app/src/style.css (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/app/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/app/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-feature/package.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostIdPage.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostList.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/index.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-query/package.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/index.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/postsQueryOptions.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/post-query/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/package.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/src/index.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/tsconfig.json (1 hunks)
  • examples/solid/router-monorepo-solid-query/packages/router/vite.config.ts (1 hunks)
  • examples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.example (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
examples/{react,solid}/**

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • examples/solid/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/postsQueryOptions.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostIdPage.tsx
  • examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-feature/package.json
  • examples/solid/router-monorepo-solid-query/packages/router/vite.config.ts
  • examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/index.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-solid-query/package.json
  • examples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/app/src/style.css
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostList.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-query/vite.config.ts
  • examples/solid/router-monorepo-solid-query/README.md
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsx
  • examples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.example
  • examples/solid/router-monorepo-solid-query/packages/app/package.json
  • examples/solid/router-monorepo-solid-query/packages/app/index.html
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/index.ts
  • examples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-solid-query/packages/post-query/package.json
  • examples/solid/router-monorepo-solid-query/packages/router/package.json
  • examples/solid/router-monorepo-solid-query/packages/app/vite.config.ts
  • examples/solid/router-monorepo-solid-query/packages/app/tsconfig.json
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • examples/solid/router-monorepo-solid-query/packages/post-query/src/postsQueryOptions.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostIdPage.tsx
  • examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/vite.config.ts
  • examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/index.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostList.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-query/vite.config.ts
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-query/src/index.ts
  • examples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-solid-query/packages/app/vite.config.ts
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • examples/solid/router-monorepo-solid-query/packages/post-feature/package.json
  • examples/solid/router-monorepo-solid-query/package.json
  • examples/solid/router-monorepo-solid-query/packages/app/package.json
  • examples/solid/router-monorepo-solid-query/packages/post-query/package.json
  • examples/solid/router-monorepo-solid-query/packages/router/package.json
docs/{router,start}/**

📄 CodeRabbit inference engine (AGENTS.md)

Place router docs under docs/router/ and start framework docs under docs/start/

Files:

  • docs/router/config.json
🧠 Learnings (14)
📓 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: 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
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/
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-plugin/** : Use unplugin for universal bundler plugins in the router-plugin package
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-devtools,*-router-devtools}/** : Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/
📚 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/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/app/tsconfig.json
📚 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/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/.stackblitzrc
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-feature/package.json
  • examples/solid/router-monorepo-solid-query/packages/router/vite.config.ts
  • examples/solid/router-monorepo-solid-query/.vscode/settings.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/index.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/src/index.ts
  • examples/solid/router-monorepo-solid-query/package.json
  • examples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/app/src/style.css
  • examples/solid/router-monorepo-solid-query/packages/post-query/vite.config.ts
  • examples/solid/router-monorepo-solid-query/README.md
  • examples/solid/router-monorepo-solid-query/.gitignore
  • examples/solid/router-monorepo-solid-query/packages/app/package.json
  • examples/solid/router-monorepo-solid-query/packages/app/index.html
  • docs/router/config.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-solid-query/packages/post-query/package.json
  • examples/solid/router-monorepo-solid-query/packages/router/package.json
  • examples/solid/router-monorepo-solid-query/packages/app/tsconfig.json
📚 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/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/.stackblitzrc
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts
  • examples/solid/router-monorepo-solid-query/.vscode/settings.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
  • examples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/index.ts
  • examples/solid/router-monorepo-solid-query/README.md
  • examples/solid/router-monorepo-solid-query/.gitignore
  • docs/router/config.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-solid-query/packages/router/package.json
  • examples/solid/router-monorepo-solid-query/packages/app/tsconfig.json
📚 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-devtools,*-router-devtools}/** : Keep router devtools packages in packages/router-devtools/ and packages/*-router-devtools/

Applied to files:

  • examples/solid/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/post-feature/package.json
  • examples/solid/router-monorepo-solid-query/package.json
  • examples/solid/router-monorepo-solid-query/README.md
  • examples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.example
  • examples/solid/router-monorepo-solid-query/packages/app/package.json
  • docs/router/config.json
  • examples/solid/router-monorepo-solid-query/packages/router/package.json
📚 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/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/.stackblitzrc
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/package.json
  • examples/solid/router-monorepo-solid-query/packages/router/vite.config.ts
  • examples/solid/router-monorepo-solid-query/.vscode/settings.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/index.ts
  • examples/solid/router-monorepo-solid-query/package.json
  • examples/solid/router-monorepo-solid-query/packages/post-query/vite.config.ts
  • examples/solid/router-monorepo-solid-query/README.md
  • examples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.example
  • examples/solid/router-monorepo-solid-query/packages/app/package.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts
  • examples/solid/router-monorepo-solid-query/packages/post-query/package.json
  • examples/solid/router-monorepo-solid-query/packages/router/package.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/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/index.ts
  • examples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.json
  • examples/solid/router-monorepo-solid-query/README.md
  • examples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-solid-query/packages/app/tsconfig.json
📚 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/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
  • examples/solid/router-monorepo-solid-query/packages/router/src/index.ts
  • examples/solid/router-monorepo-solid-query/package.json
  • examples/solid/router-monorepo-solid-query/README.md
  • examples/solid/router-monorepo-solid-query/packages/app/package.json
  • docs/router/config.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.ts
  • examples/solid/router-monorepo-solid-query/packages/router/package.json
📚 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/router-monorepo-solid-query/packages/router/tsconfig.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/.vscode/settings.json
  • examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
  • examples/solid/router-monorepo-solid-query/.gitignore
  • examples/solid/router-monorepo-solid-query/packages/router/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/router-monorepo-solid-query/packages/router/src/routes/index.ts
  • examples/solid/router-monorepo-solid-query/packages/router/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 examples/{react,solid}/** : Keep example applications under examples/react/ and examples/solid/

Applied to files:

  • examples/solid/router-monorepo-solid-query/.gitignore
  • docs/router/config.json
📚 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 **/package.json : Use workspace:* protocol for internal dependencies in package.json files

Applied to files:

  • examples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.example
  • examples/solid/router-monorepo-solid-query/packages/app/package.json
📚 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/{*-start,start-*}/** : Name and place Start framework packages under packages/*-start/ or packages/start-*/

Applied to files:

  • examples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.example
📚 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:

  • docs/router/config.json
🧬 Code graph analysis (16)
examples/solid/router-monorepo-solid-query/packages/post-query/src/postsQueryOptions.tsx (1)
examples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsx (1)
  • fetchPosts (27-33)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx (2)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts (1)
  • Route (4-8)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts (1)
  • Route (4-8)
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsx (3)
examples/solid/router-monorepo-solid-query/packages/router/src/index.ts (4)
  • ErrorComponentProps (25-25)
  • router (12-12)
  • useRouter (20-20)
  • ErrorComponent (23-23)
examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx (1)
  • router (12-27)
examples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsx (1)
  • PostNotFoundError (9-9)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts (4)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts (1)
  • Route (4-8)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx (1)
  • Route (4-15)
examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx (1)
  • queryClient (9-9)
examples/solid/router-monorepo-solid-query/packages/post-query/src/postsQueryOptions.tsx (1)
  • postsQueryOptions (4-7)
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostIdPage.tsx (2)
examples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsx (1)
  • postQueryOptions (4-8)
examples/solid/basic-solid-query/src/main.tsx (1)
  • PostRouteComponent (152-163)
examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx (5)
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostList.tsx (1)
  • PostsListComponent (5-36)
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostIdPage.tsx (1)
  • PostIdComponent (8-18)
examples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsx (1)
  • RootComponent (5-25)
examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx (3)
  • RouterIds (30-30)
  • router (12-27)
  • queryClient (9-9)
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsx (1)
  • PostErrorComponent (10-28)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts (4)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx (1)
  • Route (4-15)
examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts (1)
  • Route (4-8)
examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx (1)
  • queryClient (9-9)
examples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsx (1)
  • postQueryOptions (4-8)
examples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsx (3)
examples/solid/router-monorepo-solid-query/packages/router/src/index.ts (2)
  • Link (18-18)
  • Outlet (17-17)
examples/solid/quickstart-file-based/src/routes/__root.tsx (1)
  • RootComponent (13-41)
e2e/solid-router/basic-solid-query/src/main.tsx (1)
  • RootComponent (39-85)
examples/solid/router-monorepo-solid-query/packages/router/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx (1)
examples/solid/router-monorepo-solid-query/packages/router/src/index.ts (4)
  • queryClient (12-12)
  • router (12-12)
  • RouterType (3-3)
  • RouterIds (3-3)
examples/solid/router-monorepo-solid-query/packages/router/src/index.ts (1)
examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx (1)
  • router (12-27)
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostList.tsx (3)
examples/solid/router-monorepo-solid-query/packages/post-query/src/postsQueryOptions.tsx (1)
  • postsQueryOptions (4-7)
examples/solid/basic-solid-query-file-based/src/routes/posts.tsx (1)
  • PostsComponent (12-48)
examples/solid/start-basic-solid-query/src/routes/posts.route.tsx (1)
  • PostsComponent (15-45)
examples/solid/router-monorepo-solid-query/packages/post-query/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsx (1)
examples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsx (1)
  • fetchPost (11-25)
examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
examples/solid/router-monorepo-solid-query/packages/app/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • __filename (7-7)
⏰ 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: Preview
🔇 Additional comments (32)
examples/solid/router-monorepo-solid-query/README.md (4)

3-6: Documentation is clear and accessible.

The setup instructions are concise and appropriately placed at the beginning of the README, making it easy for users to get started with the example.


8-21: Monorepo architecture explanation is well-structured.

The documentation effectively explains the TypeScript type augmentation challenge in monorepos and articulates the solution (separate router library with re-exports) in a way that's easy to follow. The flow from problem → solution → implementation is logical and helpful for developers unfamiliar with this pattern.


27-31: StackBlitz limitation is clearly documented.

The note about TypeScript IDE feedback limitations on StackBlitz and the workaround (forking) is helpful context for users attempting to run this example on that platform.


1-31: All referenced files and assets are present.

Verification confirms that both ./packages/app/src/main.tsx and ./assets/graph.png exist relative to the README location. The documentation is complete and all links are valid.

examples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.example (1)

1-2: LGTM!

The workspace configuration correctly defines the packages structure. The .example extension works well with the StackBlitz setup that copies this to pnpm-workspace.yaml.

examples/solid/router-monorepo-solid-query/.stackblitzrc (1)

1-3: LGTM!

The StackBlitz configuration correctly sets up the workspace by copying the example file before running install and dev commands.

examples/solid/router-monorepo-solid-query/.vscode/settings.json (1)

1-11: LGTM!

The VSCode settings appropriately handle the generated routeTree.gen.ts file by excluding it from watching/search and marking it readonly, preventing accidental modifications.

examples/solid/router-monorepo-solid-query/packages/router/tsconfig.json (1)

1-14: LGTM!

The TypeScript configuration is well-structured with strict mode enabled and appropriate Solid.js settings. The "include": ["src"] field explicitly scopes compilation to the src directory.

examples/solid/router-monorepo-solid-query/packages/post-feature/package.json (1)

1-22: LGTM!

The package configuration correctly follows monorepo best practices:

  • Uses workspace:* protocol for internal dependencies (lines 12-13)
  • Appropriate build script with type-checking
  • Properly configured entry points for distribution
examples/solid/router-monorepo-solid-query/packages/router/package.json (1)

1-26: LGTM! Correct use of workspace protocol.

The package manifest correctly uses the workspace:* protocol for the internal dependency on line 15, aligning with the coding guidelines. The dependency versions and build configuration are appropriate for a monorepo router package.

docs/router/config.json (1)

684-687: LGTM! Documentation entry correctly added.

The new example entry is correctly structured and consistently placed alongside other Solid Router examples.

examples/solid/router-monorepo-solid-query/packages/app/src/style.css (1)

1-13: LGTM! Standard Tailwind CSS configuration.

The stylesheet correctly configures Tailwind layers and provides sensible global styles with dark mode support.

examples/solid/router-monorepo-solid-query/packages/app/index.html (1)

1-12: LGTM! Standard Vite entry point.

The HTML file provides a proper entry point for the Vite-based Solid application.

examples/solid/router-monorepo-solid-query/packages/post-query/package.json (1)

1-20: LGTM! Clean package manifest.

The package manifest is well-structured with appropriate dependencies for a query utilities package.

examples/solid/router-monorepo-solid-query/packages/app/package.json (1)

1-36: LGTM! Correct use of workspace protocol and nx configuration.

The package manifest correctly uses the workspace:* protocol for internal dependencies (lines 13-14), following the coding guidelines. The nx configuration appropriately specifies build dependencies for the dev target.

examples/solid/router-monorepo-solid-query/package.json (1)

1-31: Overall structure looks good.

The monorepo structure and dependencies are well-organized for a comprehensive Solid Router + Solid Query example.

examples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsx (1)

5-25: LGTM!

The root component follows established patterns from other Solid Router examples and correctly integrates both devtools. The navigation structure and layout are appropriate for this example.

examples/solid/router-monorepo-solid-query/packages/post-query/src/index.ts (1)

1-3: LGTM!

The barrel export pattern correctly centralizes the package's public API surface for consumers.

examples/solid/router-monorepo-solid-query/packages/router/src/routes/index.ts (1)

4-8: LGTM!

The route loader correctly preloads posts data using ensureQueryData, following the established pattern used in the $postId route.

examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx (2)

17-29: LGTM: Type-safe component mapping.

The routerMap with satisfies Record<RouterIds, () => JSX.Element> provides excellent type safety, ensuring all route IDs are mapped to valid components. The dynamic update pattern allows component definitions to remain in the app package while route definitions live in the router package, which is a clean separation for this monorepo architecture.


51-51: Verify the render guard logic.

The !rootElement.innerHTML check prevents re-rendering if content already exists. This pattern typically protects against hot-reload double-mounting in development, but verify that it doesn't interfere with expected re-render scenarios.

examples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.ts (1)

4-8: LGTM: Clean loader implementation.

The loader correctly prefetches post data using ensureQueryData, which prevents waterfalls and aligns with the pattern established in the index route.

examples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsx (2)

11-25: LGTM: Proper error handling for 404s.

The fetchPost function correctly distinguishes between 404 errors (throwing PostNotFoundError) and other errors, enabling specific UI handling in the error component. The artificial 500ms delay is appropriate for demonstrating loading states in an example.


27-33: LGTM: Clean data fetching.

The fetchPosts function is straightforward and limits results to 10 posts, which is reasonable for an example application.

examples/solid/router-monorepo-solid-query/packages/post-feature/src/index.ts (1)

1-3: LGTM: Clean barrel exports.

Standard re-export pattern for the package public API.

examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsx (1)

10-28: LGTM: Effective error handling with retry.

The component properly distinguishes between PostNotFoundError (showing just the message) and other errors (providing a retry mechanism via router.invalidate()). This pattern gives users a way to recover from transient errors while gracefully handling expected 404s.

examples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsx (1)

4-15: LGTM: Well-typed root route.

The root route correctly types the context with QueryClient and provides a user-friendly 404 page with navigation back to the home route.

examples/solid/router-monorepo-solid-query/packages/router/vite.config.ts (1)

11-45: LGTM: Proper library build configuration.

The Vite config correctly:

  • Generates TypeScript declarations via vite-plugin-dts
  • Integrates the TanStack Router plugin with target: 'solid'
  • Externalizes dependencies to avoid bundling framework code
  • Builds as an ES module for modern consumption

This setup is appropriate for a monorepo package that will be consumed by the app package.

examples/solid/router-monorepo-solid-query/packages/app/vite.config.ts (2)

12-12: Verify cacheDir path.

The cacheDir is set to '../../node_modules/.vite/packages/router', which references "router" but this is the "app" package. This might be a copy-paste issue.

Consider using:

-  cacheDir: '../../node_modules/.vite/packages/router',
+  cacheDir: '../../node_modules/.vite/packages/app',

23-29: LGTM: Appropriate plugin setup for app package.

The app package correctly uses dts and solid plugins. Note that the tanstackRouter plugin is only needed in the router package where routes are defined, not in the consuming app package.

examples/solid/router-monorepo-solid-query/packages/router/src/index.ts (1)

5-24: Type registration wiring looks solid.

Nice job centralizing the router exports and augmenting @tanstack/solid-router; this guarantees consumers of the example pick up the registered router and type-safe APIs from a single entry point.

examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts (1)

7-8: LGTM!

The ES module approach for obtaining __dirname is correct and follows best practices.

dist
dist-ssr
*.local
*.js
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Avoid overly broad *.js pattern.

Ignoring all .js files at the top level could unintentionally exclude source code or configuration files. Narrow this to specific directories (e.g., /dist/*.js or /packages/*/dist/) where compiled output lives, or remove it if the monorepo is TypeScript-only.

If this is a pure TypeScript monorepo with no committed .js source files, consider removing this line entirely. Otherwise, scope it to build output directories.


🏁 Script executed:

#!/bin/bash
# Retrieve the full .gitignore file
echo "=== Full .gitignore content ==="
cat examples/solid/router-monorepo-solid-query/.gitignore

echo -e "\n=== Project structure ==="
fd --type f -e json -e ts -e tsx examples/solid/router-monorepo-solid-query/ --max-depth 3 | head -20

echo -e "\n=== Check for package.json and tsconfig ==="
ls -la examples/solid/router-monorepo-solid-query/ | grep -E '(package\.json|tsconfig)'

echo -e "\n=== Look for build output directories ==="
fd --type d -e dist -e build -e out examples/solid/router-monorepo-solid-query/

Length of output: 1304


🏁 Script executed:

#!/bin/bash
# Check package.json to understand project configuration
echo "=== package.json content ==="
cat examples/solid/router-monorepo-solid-query/package.json

echo -e "\n=== Check for any .js source files (not in dist) ==="
fd --type f -name '*.js' examples/solid/router-monorepo-solid-query/ --exclude 'dist*' --exclude 'node_modules' 2>/dev/null | head -10 || echo "No .js source files found outside dist"

Length of output: 1156


Remove pnpm-workspace.yaml from .gitignore (critical for monorepo).

Workspace configuration files must be committed to version control so all developers and CI systems can access the monorepo structure. Line 12 should be removed entirely.

Additionally, line 6 (*.js) is acceptable for a TypeScript-only project but largely redundant since dist and dist-ssr are already explicitly ignored. Consider removing it unless you're also ignoring .js files in the root directory intentionally.

🤖 Prompt for AI Agents
In examples/solid/router-monorepo-solid-query/.gitignore around line 6 (and also
remove the entry at line 12), remove the pnpm-workspace.yaml entry so the
monorepo workspace config is committed, and delete the standalone "*.js" ignore
at line 6 unless you intentionally want to ignore .js files at the repo root; if
you do need to ignore built JS artifacts, prefer keeping explicit dist/ and
dist-ssr ignores and drop the general "*.js" rule.

/playwright-report/
/blob-report/
/playwright/.cache/
pnpm-workspace.yaml No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove pnpm-workspace.yaml from .gitignore.

The workspace configuration file must be committed to the repository so that developers and CI systems can work with the monorepo structure. This should not be ignored.

Apply this diff:

- pnpm-workspace.yaml
📝 Committable suggestion

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

Suggested change
pnpm-workspace.yaml
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-solid-query/.gitignore around line 12, the
workspace config file pnpm-workspace.yaml is currently ignored; remove that
entry from .gitignore and commit pnpm-workspace.yaml to the repo so the monorepo
workspace configuration is tracked and available to developers and CI systems.

Comment on lines +14 to +16
// Not lazy loaded for simplicity, but you could expose from your library component
// individually, and enforce here to use react lazy components via typings
// so that you have code splitting
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Update comment to reference Solid instead of React.

The comment mentions "react lazy components," but this is a Solid example.

Apply this diff:

-// Not lazy loaded for simplicity, but you could expose from your library component
-// individually, and enforce here to use react lazy components via typings
-// so that you have code splitting
+// Not lazy loaded for simplicity, but you could expose components from your library
+// individually, and enforce here to use Solid's lazy() components via typings
+// for code splitting
📝 Committable suggestion

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

Suggested change
// Not lazy loaded for simplicity, but you could expose from your library component
// individually, and enforce here to use react lazy components via typings
// so that you have code splitting
// Not lazy loaded for simplicity, but you could expose components from your library
// individually, and enforce here to use Solid's lazy() components via typings
// for code splitting
🤖 Prompt for AI Agents
examples/solid/router-monorepo-solid-query/packages/app/src/main.tsx around
lines 14 to 16: update the inline comment to reference Solid instead of React;
replace "react lazy components" wording with "Solid lazy components" or "Solid's
lazy-loading" and adjust surrounding text to mention Solid-specific code
splitting (e.g., Solid's lazy helpers) so the comment accurately reflects this
Solid example.

Comment on lines +1 to +3
// import { createEffect } from 'solid-js'
import { PostNotFoundError } from '@router-solid-mono-solid-query/post-query'
// import { useQueryErrorResetBoundary } from '@tanstack/solid-query'
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove commented-out imports.

Dead code should be removed to keep the codebase clean.

Apply this diff:

-// import { createEffect } from 'solid-js'
 import { PostNotFoundError } from '@router-solid-mono-solid-query/post-query'
-// import { useQueryErrorResetBoundary } from '@tanstack/solid-query'
 import {
📝 Committable suggestion

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

Suggested change
// import { createEffect } from 'solid-js'
import { PostNotFoundError } from '@router-solid-mono-solid-query/post-query'
// import { useQueryErrorResetBoundary } from '@tanstack/solid-query'
import { PostNotFoundError } from '@router-solid-mono-solid-query/post-query'
🤖 Prompt for AI Agents
In
examples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsx
around lines 1 to 3, remove the commented-out import lines (// import {
createEffect } from 'solid-js' and // import { useQueryErrorResetBoundary } from
'@tanstack/solid-query') so the file only keeps the active import (import {
PostNotFoundError } from '@router-solid-mono-solid-query/post-query'); delete
those dead-code comment lines to clean up the file.


export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/packages/router',
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix incorrect cache directory path.

The cache directory references packages/router but this configuration is for the post-feature package. This appears to be a copy-paste error that could cause cache conflicts between packages.

Apply this diff to fix the cache directory path:

-  cacheDir: '../../node_modules/.vite/packages/router',
+  cacheDir: '../../node_modules/.vite/packages/post-feature',
📝 Committable suggestion

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

Suggested change
cacheDir: '../../node_modules/.vite/packages/router',
cacheDir: '../../node_modules/.vite/packages/post-feature',
🤖 Prompt for AI Agents
In
examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts
at line 12, the cacheDir path incorrectly points to
'../../node_modules/.vite/packages/router' which is from another package. Update
the cacheDir to reference the correct directory for the current 'post-feature'
package by adjusting the path accordingly to avoid cache conflicts.

Comment on lines +26 to +30
lib: {
entry: 'src/index.ts',
name: 'router',
fileName: 'index',
formats: ['es'],
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix incorrect library name.

The library name is set to 'router' but this configuration is for the post-feature package. This appears to be a copy-paste error from another package's configuration.

Apply this diff to fix the library name:

     lib: {
       entry: 'src/index.ts',
-      name: 'router',
+      name: 'post-feature',
       fileName: 'index',
       formats: ['es'],
📝 Committable suggestion

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

Suggested change
lib: {
entry: 'src/index.ts',
name: 'router',
fileName: 'index',
formats: ['es'],
lib: {
entry: 'src/index.ts',
name: 'post-feature',
fileName: 'index',
formats: ['es'],
🤖 Prompt for AI Agents
In
examples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.ts
around lines 26 to 30, the library name is incorrectly set to 'router'; update
the lib.name to 'post-feature' to match this package (leave entry, fileName and
formats as-is) so the build artifact and UMD/global name reflect the package
identity.


export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/packages/router',
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix cacheDir to reference correct package.

The cache directory path references 'packages/router' but this config is for the 'post-query' package.

Apply this diff:

-  cacheDir: '../../node_modules/.vite/packages/router',
+  cacheDir: '../../node_modules/.vite/packages/post-query',
📝 Committable suggestion

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

Suggested change
cacheDir: '../../node_modules/.vite/packages/router',
cacheDir: '../../node_modules/.vite/packages/post-query',
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-solid-query/packages/post-query/vite.config.ts
around line 11, the cacheDir path incorrectly points to
'../../node_modules/.vite/packages/router'; update that value to reference the
current package by replacing 'packages/router' with 'packages/post-query' so the
line reads '../../node_modules/.vite/packages/post-query'.

@@ -0,0 +1,30 @@
import React from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove incorrect React import.

This is a Solid.js example and should not import React. This import is unnecessary and could cause confusion or potential bundling issues.

Apply this diff:

-import React from 'react'
 import { createRouter } from '@tanstack/solid-router'
📝 Committable suggestion

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

Suggested change
import React from 'react'
import { createRouter } from '@tanstack/solid-router'
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
around line 1, the file incorrectly imports React; remove the line "import React
from 'react'" from the top of the file. If any Solid APIs are needed, import
them from "solid-js" instead (e.g., import { createSignal } from 'solid-js'),
otherwise delete the import entirely so the file uses the Solid JSX runtime
without pulling React into the bundle.

Comment on lines +23 to +24
// Since we're using React Query, we don't want loader calls to ever be stale
// This will ensure that the loader is always called when the route is preloaded or visited
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Update comment to reference Solid Query instead of React Query.

The comment incorrectly references "React Query" when this example uses Solid Query.

Apply this diff:

-  // Since we're using React Query, we don't want loader calls to ever be stale
+  // Since we're using Solid Query, we don't want loader calls to ever be stale
   // This will ensure that the loader is always called when the route is preloaded or visited
📝 Committable suggestion

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

Suggested change
// Since we're using React Query, we don't want loader calls to ever be stale
// This will ensure that the loader is always called when the route is preloaded or visited
// Since we're using Solid Query, we don't want loader calls to ever be stale
// This will ensure that the loader is always called when the route is preloaded or visited
🤖 Prompt for AI Agents
In examples/solid/router-monorepo-solid-query/packages/router/src/router.tsx
around lines 23 to 24, the inline comment incorrectly references "React Query";
update the comment text to reference "Solid Query" (or Solid Query specifically)
so it accurately describes the library in use—replace "React Query" with "Solid
Query" and keep the rest of the comment intact.

@birkskyum birkskyum merged commit 606dd19 into main Nov 12, 2025
6 checks passed
@birkskyum birkskyum deleted the docs(solid-router)--monorepo-solid-query-example branch November 12, 2025 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Everything documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants