-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
docs(solid-router): monorepo-solid-query example #5850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(solid-router): monorepo-solid-query example #5850
Conversation
WalkthroughAdds 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
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
d56d58c to
2f5656a
Compare
|
View your CI Pipeline Execution ↗ for commit cf45528
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 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.jsonincludes 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
.tsextension 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:
- Relying solely on the nx configuration and simplifying to
"dev": "pnpm app dev"- 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
createMemofor 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 ofposts || []:- {[ - ...(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
⛔ Files ignored due to path filters (2)
examples/solid/router-monorepo-solid-query/assets/graph.pngis excluded by!**/*.pngpnpm-lock.yamlis 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.jsonexamples/solid/router-monorepo-solid-query/packages/post-query/src/postsQueryOptions.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsxexamples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsxexamples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/index.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/src/PostIdPage.tsxexamples/solid/router-monorepo-solid-query/packages/app/src/main.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.tsexamples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsxexamples/solid/router-monorepo-solid-query/packages/post-feature/package.jsonexamples/solid/router-monorepo-solid-query/packages/router/vite.config.tsexamples/solid/router-monorepo-solid-query/packages/router/src/router.tsxexamples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/index.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/src/index.tsexamples/solid/router-monorepo-solid-query/package.jsonexamples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.jsonexamples/solid/router-monorepo-solid-query/packages/app/src/style.cssexamples/solid/router-monorepo-solid-query/packages/post-feature/src/PostList.tsxexamples/solid/router-monorepo-solid-query/packages/post-query/vite.config.tsexamples/solid/router-monorepo-solid-query/README.mdexamples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsxexamples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.exampleexamples/solid/router-monorepo-solid-query/packages/app/package.jsonexamples/solid/router-monorepo-solid-query/packages/app/index.htmlexamples/solid/router-monorepo-solid-query/packages/post-query/src/index.tsexamples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.tsexamples/solid/router-monorepo-solid-query/packages/post-query/package.jsonexamples/solid/router-monorepo-solid-query/packages/router/package.jsonexamples/solid/router-monorepo-solid-query/packages/app/vite.config.tsexamples/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.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsxexamples/solid/router-monorepo-solid-query/packages/post-query/src/posts.tsxexamples/solid/router-monorepo-solid-query/packages/post-feature/src/PostError.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/index.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/src/PostIdPage.tsxexamples/solid/router-monorepo-solid-query/packages/app/src/main.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.tsexamples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsxexamples/solid/router-monorepo-solid-query/packages/router/vite.config.tsexamples/solid/router-monorepo-solid-query/packages/router/src/router.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/index.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/src/index.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/src/PostList.tsxexamples/solid/router-monorepo-solid-query/packages/post-query/vite.config.tsexamples/solid/router-monorepo-solid-query/packages/post-query/src/postQueryOptions.tsxexamples/solid/router-monorepo-solid-query/packages/post-query/src/index.tsexamples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.tsexamples/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.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/index.tsexamples/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.jsonexamples/solid/router-monorepo-solid-query/package.jsonexamples/solid/router-monorepo-solid-query/packages/app/package.jsonexamples/solid/router-monorepo-solid-query/packages/post-query/package.jsonexamples/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.jsonexamples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.jsonexamples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.jsonexamples/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.jsonexamples/solid/router-monorepo-solid-query/.stackblitzrcexamples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/index.tsexamples/solid/router-monorepo-solid-query/packages/app/src/main.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.tsexamples/solid/router-monorepo-solid-query/packages/app/src/rootComponent.tsxexamples/solid/router-monorepo-solid-query/packages/post-feature/package.jsonexamples/solid/router-monorepo-solid-query/packages/router/vite.config.tsexamples/solid/router-monorepo-solid-query/.vscode/settings.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/router.tsxexamples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/index.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/src/index.tsexamples/solid/router-monorepo-solid-query/package.jsonexamples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.jsonexamples/solid/router-monorepo-solid-query/packages/app/src/style.cssexamples/solid/router-monorepo-solid-query/packages/post-query/vite.config.tsexamples/solid/router-monorepo-solid-query/README.mdexamples/solid/router-monorepo-solid-query/.gitignoreexamples/solid/router-monorepo-solid-query/packages/app/package.jsonexamples/solid/router-monorepo-solid-query/packages/app/index.htmldocs/router/config.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.tsexamples/solid/router-monorepo-solid-query/packages/post-query/package.jsonexamples/solid/router-monorepo-solid-query/packages/router/package.jsonexamples/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.jsonexamples/solid/router-monorepo-solid-query/.stackblitzrcexamples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/index.tsexamples/solid/router-monorepo-solid-query/packages/router/src/routes/$postId.tsexamples/solid/router-monorepo-solid-query/.vscode/settings.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/router.tsxexamples/solid/router-monorepo-solid-query/packages/post-feature/tsconfig.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/index.tsexamples/solid/router-monorepo-solid-query/README.mdexamples/solid/router-monorepo-solid-query/.gitignoredocs/router/config.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.tsexamples/solid/router-monorepo-solid-query/packages/router/package.jsonexamples/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.jsonexamples/solid/router-monorepo-solid-query/packages/post-feature/package.jsonexamples/solid/router-monorepo-solid-query/package.jsonexamples/solid/router-monorepo-solid-query/README.mdexamples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.exampleexamples/solid/router-monorepo-solid-query/packages/app/package.jsondocs/router/config.jsonexamples/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.jsonexamples/solid/router-monorepo-solid-query/.stackblitzrcexamples/solid/router-monorepo-solid-query/packages/router/src/routes/index.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/package.jsonexamples/solid/router-monorepo-solid-query/packages/router/vite.config.tsexamples/solid/router-monorepo-solid-query/.vscode/settings.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/router.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/index.tsexamples/solid/router-monorepo-solid-query/package.jsonexamples/solid/router-monorepo-solid-query/packages/post-query/vite.config.tsexamples/solid/router-monorepo-solid-query/README.mdexamples/solid/router-monorepo-solid-query/pnpm-workspace.yaml.exampleexamples/solid/router-monorepo-solid-query/packages/app/package.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.tsexamples/solid/router-monorepo-solid-query/packages/post-feature/vite.config.tsexamples/solid/router-monorepo-solid-query/packages/post-query/package.jsonexamples/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.jsonexamples/solid/router-monorepo-solid-query/packages/app/src/main.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/index.tsexamples/solid/router-monorepo-solid-query/packages/post-query/tsconfig.jsonexamples/solid/router-monorepo-solid-query/README.mdexamples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.tsexamples/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.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/routes/__root.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/routes/index.tsexamples/solid/router-monorepo-solid-query/packages/app/src/main.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/router.tsxexamples/solid/router-monorepo-solid-query/packages/router/src/index.tsexamples/solid/router-monorepo-solid-query/package.jsonexamples/solid/router-monorepo-solid-query/README.mdexamples/solid/router-monorepo-solid-query/packages/app/package.jsondocs/router/config.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/routeTree.gen.tsexamples/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.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/routes/index.tsexamples/solid/router-monorepo-solid-query/.vscode/settings.jsonexamples/solid/router-monorepo-solid-query/packages/router/src/router.tsxexamples/solid/router-monorepo-solid-query/.gitignoreexamples/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.tsexamples/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/.gitignoredocs/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.exampleexamples/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.tsxand./assets/graph.pngexist 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
.exampleextension works well with the StackBlitz setup that copies this topnpm-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.tsfile 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$postIdroute.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.innerHTMLcheck 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
fetchPostfunction correctly distinguishes between 404 errors (throwingPostNotFoundError) 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
fetchPostsfunction 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 viarouter.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
QueryClientand 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
cacheDiris 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
dtsandsolidplugins. Note that thetanstackRouterplugin 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
__dirnameis correct and follows best practices.
| dist | ||
| dist-ssr | ||
| *.local | ||
| *.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
| // 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| // 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.
| // import { createEffect } from 'solid-js' | ||
| import { PostNotFoundError } from '@router-solid-mono-solid-query/post-query' | ||
| // import { useQueryErrorResetBoundary } from '@tanstack/solid-query' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| // 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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
| lib: { | ||
| entry: 'src/index.ts', | ||
| name: 'router', | ||
| fileName: 'index', | ||
| formats: ['es'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
| // 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| // 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.
Summary by CodeRabbit