Skip to content

Conversation

@birkskyum
Copy link
Member

@birkskyum birkskyum commented Nov 12, 2025

Summary by CodeRabbit

New Features

  • Added a new "Solid with tRPC" example project showcasing a complete dashboard application with posts listing and detail views.
  • Demonstrates integration of Solid.js routing, server-client communication, and URL-based state management.
  • Includes navigation between summary and posts sections with dynamic detail views and real-time data loading indicators.

@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 new Solid.js example application demonstrating TanStack Router integration with tRPC. The example includes a complete project setup with route definitions, a Node.js Express server with tRPC procedures, client-side TRPC configuration, and UI components. A documentation entry is added to index this example.

Changes

Cohort / File(s) Summary
Documentation
docs/router/config.json
Adds new "With tRPC" example entry to Solid framework examples section
Configuration & Setup
examples/solid/with-trpc/.gitignore, .vscode/settings.json, tsconfig.json, package.json, postcss.config.mjs, vite.config.ts
Project configuration files: dependency manifests, TypeScript and Vite settings, PostCSS for Tailwind, VSCode workspace exclusions
Documentation
examples/solid/with-trpc/README.md, index.html
Example README and HTML entry point with standard Vite app skeleton
Client Setup
examples/solid/with-trpc/src/main.tsx, src/trpc.ts, src/styles.css
Application entry point with RouterProvider and TRPC context setup; TRPC client configuration; base stylesheet with Tailwind
Route Tree & Components
examples/solid/with-trpc/src/routeTree.gen.ts, src/routes/-components/spinner.tsx
Generated route tree with full type mappings and metadata; reusable Spinner component for loading states
Root & Layout Routes
examples/solid/with-trpc/src/routes/__root.tsx, src/routes/dashboard.tsx
Root route with navigation layout and TRPC context provider; dashboard layout with nested route support
Dashboard & Posts Routes
examples/solid/with-trpc/src/routes/index.tsx, src/routes/dashboard.index.tsx, src/routes/dashboard.posts.tsx, src/routes/dashboard.posts.index.tsx, src/routes/dashboard.posts.$postId.tsx
Route modules: home page, dashboard index, posts list with loader, posts detail view with dynamic parameters and URL-synced state
Server & TRPC
examples/solid/with-trpc/src/server/server.ts, src/server/trpc.ts
Express server with Vite middleware integration in dev mode; TRPC router with procedures (hello, posts, post) and middleware

Sequence Diagram(s)

sequenceDiagram
    participant App as SolidJS App
    participant Router as TanStack Router
    participant Context as Router Context
    participant TRPC as TRPC Client
    participant Server as Express Server
    
    App->>Router: Initialize RouterProvider with routeTree
    Router->>Context: Create router context with trpc instance
    
    Note over App: User navigates to /dashboard/posts
    Router->>Router: Match route, execute loader
    Router->>Context: Access trpc from context
    Context->>TRPC: Call trpc.posts.query()
    TRPC->>Server: HTTP request to /trpc
    Server->>Server: Execute posts procedure (1s delay)
    Server-->>TRPC: Return posts array
    TRPC-->>Context: Resolve data promise
    Router->>App: Render DashboardPostsComponent with loader data
    
    Note over App: User clicks post link to /dashboard/posts/$postId
    Router->>Router: Match dynamic route, execute loader
    Router->>Context: Extract $postId param
    Context->>TRPC: Call trpc.post.query(postId)
    TRPC->>Server: HTTP request to /trpc with postId
    Server->>Server: Execute post procedure (500ms delay)
    Server-->>TRPC: Return post object
    TRPC-->>Router: Resolve data
    Router->>App: Render DashboardPostsPostIdComponent with post data
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Server setup complexity: src/server/server.ts requires understanding of Vite middleware integration, Express routing, and dev/prod mode switching
  • Route tree generation: src/routeTree.gen.ts is large and complex with extensive type mappings and module augmentations, though auto-generated
  • Route patterns: Multiple route files follow similar patterns but have subtle differences (loaders, parameters, state management) that warrant verification
  • File scope: 20+ new files requires scanning for consistency and correctness across the example structure

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • brenelz

Poem

🐰 A tRPC tale takes shape today,
With Solid routes and types at play,
Dashboards dance with posts in tow,
Router trees and loaders flow,
Clean example for all to see! ✨

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 summarizes the main change: adding a new with-trpc example to the Solid router documentation, which is confirmed by the changeset adding example files and a config entry.
✨ 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)--add-with-trpc-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.

@nx-cloud
Copy link

nx-cloud bot commented Nov 12, 2025

View your CI Pipeline Execution ↗ for commit 8c90117

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

☁️ Nx Cloud last updated this comment at 2025-11-12 01:27: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@5829

@tanstack/directive-functions-plugin

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/nitro-v2-vite-plugin

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

@tanstack/react-router

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

@tanstack/react-router-devtools

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

@tanstack/react-router-ssr-query

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

@tanstack/react-start

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

@tanstack/react-start-client

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

@tanstack/react-start-server

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

@tanstack/router-cli

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

@tanstack/router-core

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

@tanstack/router-devtools

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

@tanstack/router-devtools-core

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-ssr-query-core

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

@tanstack/router-utils

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

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

@tanstack/solid-router

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

@tanstack/solid-router-devtools

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

@tanstack/solid-router-ssr-query

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

@tanstack/solid-start

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

@tanstack/solid-start-client

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

@tanstack/solid-start-server

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

@tanstack/start-client-core

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

@tanstack/start-plugin-core

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

@tanstack/start-server-core

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

@tanstack/start-static-server-functions

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

@tanstack/start-storage-context

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 8c90117

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: 5

🧹 Nitpick comments (2)
examples/solid/with-trpc/index.html (1)

6-6: Consider updating the page title to reflect the example.

The generic title "Vite App" could be more descriptive. Consider changing it to something like "Solid Router + tRPC Example" to better represent the purpose of this demo.

-    <title>Vite App</title>
+    <title>Solid Router + tRPC Example</title>
examples/solid/with-trpc/README.md (1)

1-6: Consider expanding the README with more context.

The README is quite minimal. Consider adding:

  • A brief description of what this example demonstrates (Solid Router with tRPC integration)
  • Key features showcased (route loaders with tRPC, nested routes, URL-based state)
  • Project structure overview
  • Any prerequisites or additional setup steps

Also, verify that npm start and yarn start scripts are defined in package.json (not visible in this PR).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34f475e and 8c90117.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • docs/router/config.json (1 hunks)
  • examples/solid/with-trpc/.gitignore (1 hunks)
  • examples/solid/with-trpc/.vscode/settings.json (1 hunks)
  • examples/solid/with-trpc/README.md (1 hunks)
  • examples/solid/with-trpc/index.html (1 hunks)
  • examples/solid/with-trpc/package.json (1 hunks)
  • examples/solid/with-trpc/postcss.config.mjs (1 hunks)
  • examples/solid/with-trpc/src/main.tsx (1 hunks)
  • examples/solid/with-trpc/src/routeTree.gen.ts (1 hunks)
  • examples/solid/with-trpc/src/routes/-components/spinner.tsx (1 hunks)
  • examples/solid/with-trpc/src/routes/__root.tsx (1 hunks)
  • examples/solid/with-trpc/src/routes/dashboard.index.tsx (1 hunks)
  • examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx (1 hunks)
  • examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx (1 hunks)
  • examples/solid/with-trpc/src/routes/dashboard.posts.tsx (1 hunks)
  • examples/solid/with-trpc/src/routes/dashboard.tsx (1 hunks)
  • examples/solid/with-trpc/src/routes/index.tsx (1 hunks)
  • examples/solid/with-trpc/src/server/server.ts (1 hunks)
  • examples/solid/with-trpc/src/server/trpc.ts (1 hunks)
  • examples/solid/with-trpc/src/styles.css (1 hunks)
  • examples/solid/with-trpc/src/trpc.ts (1 hunks)
  • examples/solid/with-trpc/tsconfig.json (1 hunks)
  • examples/solid/with-trpc/vite.config.ts (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/with-trpc/README.md
  • examples/solid/with-trpc/src/routes/index.tsx
  • examples/solid/with-trpc/src/trpc.ts
  • examples/solid/with-trpc/src/server/trpc.ts
  • examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.tsx
  • examples/solid/with-trpc/src/main.tsx
  • examples/solid/with-trpc/src/routes/__root.tsx
  • examples/solid/with-trpc/vite.config.ts
  • examples/solid/with-trpc/src/routes/dashboard.tsx
  • examples/solid/with-trpc/src/server/server.ts
  • examples/solid/with-trpc/package.json
  • examples/solid/with-trpc/tsconfig.json
  • examples/solid/with-trpc/src/routes/-components/spinner.tsx
  • examples/solid/with-trpc/index.html
  • examples/solid/with-trpc/src/routes/dashboard.index.tsx
  • examples/solid/with-trpc/postcss.config.mjs
  • examples/solid/with-trpc/src/routeTree.gen.ts
  • examples/solid/with-trpc/src/styles.css
  • examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • examples/solid/with-trpc/src/routes/index.tsx
  • examples/solid/with-trpc/src/trpc.ts
  • examples/solid/with-trpc/src/server/trpc.ts
  • examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.tsx
  • examples/solid/with-trpc/src/main.tsx
  • examples/solid/with-trpc/src/routes/__root.tsx
  • examples/solid/with-trpc/vite.config.ts
  • examples/solid/with-trpc/src/routes/dashboard.tsx
  • examples/solid/with-trpc/src/server/server.ts
  • examples/solid/with-trpc/src/routes/-components/spinner.tsx
  • examples/solid/with-trpc/src/routes/dashboard.index.tsx
  • examples/solid/with-trpc/src/routeTree.gen.ts
  • examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx
**/src/routes/**

📄 CodeRabbit inference engine (AGENTS.md)

Place file-based routes under src/routes/ directories

Files:

  • examples/solid/with-trpc/src/routes/index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.tsx
  • examples/solid/with-trpc/src/routes/__root.tsx
  • examples/solid/with-trpc/src/routes/dashboard.tsx
  • examples/solid/with-trpc/src/routes/-components/spinner.tsx
  • examples/solid/with-trpc/src/routes/dashboard.index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx
**/package.json

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • examples/solid/with-trpc/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 (10)
📓 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 examples/{react,solid}/** : Keep example applications under examples/react/ and examples/solid/
Learnt from: FatahChan
Repo: TanStack/router PR: 5475
File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
Timestamp: 2025-10-14T18:59:33.990Z
Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.
📚 Learning: 2025-09-23T17:36:12.598Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-09-23T17:36:12.598Z
Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/

Applied to files:

  • examples/solid/with-trpc/src/routes/index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.tsx
  • examples/solid/with-trpc/src/main.tsx
  • examples/solid/with-trpc/src/routes/__root.tsx
  • examples/solid/with-trpc/src/routes/dashboard.tsx
  • examples/solid/with-trpc/package.json
  • examples/solid/with-trpc/src/routes/-components/spinner.tsx
  • examples/solid/with-trpc/src/routes/dashboard.index.tsx
  • examples/solid/with-trpc/src/routeTree.gen.ts
  • examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx
📚 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/with-trpc/src/routes/index.tsx
📚 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/with-trpc/src/routes/index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx
  • examples/solid/with-trpc/src/routes/dashboard.posts.tsx
  • examples/solid/with-trpc/src/main.tsx
  • examples/solid/with-trpc/src/routes/__root.tsx
  • examples/solid/with-trpc/src/routes/dashboard.tsx
  • examples/solid/with-trpc/src/routes/dashboard.index.tsx
  • examples/solid/with-trpc/src/routeTree.gen.ts
  • examples/solid/with-trpc/.vscode/settings.json
  • examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx
📚 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/with-trpc/src/main.tsx
  • examples/solid/with-trpc/src/routes/__root.tsx
📚 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/with-trpc/src/main.tsx
  • examples/solid/with-trpc/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 **/*.{ts,tsx} : Use TypeScript in strict mode with extensive type safety across the codebase

Applied to files:

  • examples/solid/with-trpc/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 examples/{react,solid}/** : Keep example applications under examples/react/ and examples/solid/

Applied to files:

  • examples/solid/with-trpc/index.html
  • examples/solid/with-trpc/.gitignore
  • docs/router/config.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/with-trpc/src/routes/dashboard.index.tsx
  • examples/solid/with-trpc/src/routeTree.gen.ts
  • examples/solid/with-trpc/.vscode/settings.json
  • examples/solid/with-trpc/.gitignore
📚 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/with-trpc/src/routeTree.gen.ts
  • examples/solid/with-trpc/.gitignore
🧬 Code graph analysis (11)
examples/solid/with-trpc/src/routes/index.tsx (4)
examples/solid/with-trpc/src/routes/__root.tsx (1)
  • Route (16-18)
examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx (1)
  • Route (5-16)
examples/solid/with-trpc/src/routes/dashboard.posts.tsx (1)
  • Route (11-14)
examples/solid/with-trpc/src/routes/dashboard.tsx (1)
  • Route (3-5)
examples/solid/with-trpc/src/trpc.ts (1)
examples/solid/with-trpc/src/server/trpc.ts (1)
  • AppRouter (41-41)
examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx (2)
examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx (1)
  • Route (5-16)
examples/solid/with-trpc/src/routes/dashboard.posts.tsx (1)
  • Route (11-14)
examples/solid/with-trpc/src/routes/dashboard.posts.tsx (5)
examples/solid/with-trpc/src/routes/__root.tsx (1)
  • Route (16-18)
examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx (1)
  • Route (5-16)
examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx (1)
  • Route (3-5)
examples/solid/with-trpc/src/trpc.ts (1)
  • trpc (4-13)
examples/solid/with-trpc/src/routes/-components/spinner.tsx (1)
  • Spinner (1-17)
examples/solid/with-trpc/src/main.tsx (1)
examples/solid/with-trpc/src/routes/-components/spinner.tsx (1)
  • Spinner (1-17)
examples/solid/with-trpc/src/routes/__root.tsx (5)
examples/solid/with-trpc/src/trpc.ts (1)
  • trpc (4-13)
examples/solid/with-trpc/src/routes/dashboard.index.tsx (1)
  • Route (3-6)
examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx (1)
  • Route (5-16)
examples/solid/with-trpc/src/routes/dashboard.posts.tsx (1)
  • Route (11-14)
examples/solid/with-trpc/src/routes/-components/spinner.tsx (1)
  • Spinner (1-17)
examples/solid/with-trpc/vite.config.ts (1)
examples/solid/basic-ssr-streaming-file-based/vite.config.js (1)
  • clientBuildConfig (28-41)
examples/solid/with-trpc/src/routes/dashboard.tsx (7)
examples/solid/with-trpc/src/routes/__root.tsx (1)
  • Route (16-18)
examples/solid/with-trpc/src/routes/dashboard.index.tsx (1)
  • Route (3-6)
examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx (1)
  • Route (5-16)
examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx (1)
  • Route (3-5)
examples/solid/with-trpc/src/routes/dashboard.posts.tsx (1)
  • Route (11-14)
examples/solid/with-trpc/src/routes/index.tsx (1)
  • Route (3-5)
packages/router-core/src/route.ts (1)
  • to (1543-1545)
examples/solid/with-trpc/src/server/server.ts (1)
examples/solid/with-trpc/src/server/trpc.ts (1)
  • trpcMiddleWare (36-39)
examples/solid/with-trpc/src/routes/dashboard.index.tsx (3)
examples/solid/with-trpc/src/routes/__root.tsx (1)
  • Route (16-18)
examples/solid/with-trpc/src/routes/dashboard.posts.tsx (1)
  • Route (11-14)
examples/solid/with-trpc/src/trpc.ts (1)
  • trpc (4-13)
examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx (2)
examples/solid/with-trpc/src/routes/__root.tsx (1)
  • Route (16-18)
examples/solid/with-trpc/src/trpc.ts (1)
  • trpc (4-13)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test
  • GitHub Check: Preview
🔇 Additional comments (8)
examples/solid/with-trpc/.vscode/settings.json (1)

1-11: Appropriate DevX configuration for managing generated files.

The VSCode workspace settings correctly exclude and protect the autogenerated routeTree.gen.ts file from unwanted interactions (watching, searching, manual editing). This is a best practice for managing generated artifacts in development environments.

examples/solid/with-trpc/vite.config.ts (1)

1-47: LGTM!

The Vite configuration correctly sets up separate client and server builds. The client build uses the default Vite behavior (index.html entry), while the server build properly targets the SSR entry point at src/server/server.ts. The plugin configuration for TanStack Router and Solid is appropriate.

examples/solid/with-trpc/src/routes/-components/spinner.tsx (1)

1-17: LGTM!

The Spinner component is well-structured with support for both controlled visibility (via show prop) and customizable animation delays. The conditional class application correctly handles the different animation states.

examples/solid/with-trpc/src/routes/dashboard.index.tsx (1)

1-19: LGTM!

The dashboard index route correctly implements the Solid Router pattern with tRPC integration. The loader fetches posts data via the tRPC client from context, and the component properly uses Route.useLoaderData() to access the reactive signal.

examples/solid/with-trpc/src/routes/dashboard.posts.index.tsx (1)

1-9: LGTM!

This index route appropriately serves as a placeholder, prompting users to select a post. The minimal implementation is suitable for this use case.

examples/solid/with-trpc/src/routes/dashboard.posts.$postId.tsx (3)

5-16: LGTM!

The route definition correctly integrates search validation with Zod, loads post data via tRPC, and properly types the loader return value to handle the possibility of a missing post.


23-33: Well-implemented URL-based state synchronization.

The notes state management elegantly syncs local state to the URL using Solid's reactive primitives. The effect correctly:

  • Watches the notes signal for changes
  • Uses replace: true to avoid polluting browser history
  • Clears the notes param when empty (line 28)
  • Preserves route params with params: true

This is a great demonstration of URL-based state management in Solid Router.


35-37: Good defensive error handling.

The early return for missing posts provides a clear user experience and prevents potential runtime errors in the component body.

/build/
/api/
/server/build
/public/build# Sentry Config 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

Fix malformed .gitignore pattern: comment on same line as pattern.

Line 13 has a comment on the same line as the ignore pattern, which is invalid .gitignore syntax. The pattern will be interpreted literally as /public/build# Sentry Config File rather than ignoring /public/build. Move the comment to the line above or separate it.

Apply this diff to fix the syntax error:

-/public/build# Sentry Config File
+/public/build
+# Sentry Config File
📝 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
/public/build# Sentry Config File
/public/build
# Sentry Config File
🤖 Prompt for AI Agents
In examples/solid/with-trpc/.gitignore around line 13, the ignore pattern
"/public/build# Sentry Config File" has an inline comment causing the entire
line to be treated as a literal pattern; remove the inline comment by placing
the comment on the previous line or on its own line and keep the pattern as
"/public/build" so the directory is correctly ignored.

Comment on lines +12 to +24
"dependencies": {
"@tailwindcss/postcss": "^4.1.15",
"@tanstack/solid-router": "^1.135.2",
"@tanstack/solid-router-devtools": "^1.135.2",
"@tanstack/router-plugin": "^1.135.2",
"@trpc/client": "^11.4.3",
"@trpc/server": "^11.4.3",
"express": "^4.21.2",
"postcss": "^8.5.1",
"solid-js": "^1.9.10",
"redaxios": "^0.5.1",
"tailwindcss": "^4.1.15",
"zod": "^3.24.2"
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

Switch internal TanStack deps to workspace: protocol.

Per the monorepo guidelines, local packages must resolve via workspace: so they never fall back to the registry. Please flip the TanStack dependencies here to workspace:* (or an appropriate range) before we land this example.

-    "@tanstack/solid-router": "^1.135.2",
-    "@tanstack/solid-router-devtools": "^1.135.2",
-    "@tanstack/router-plugin": "^1.135.2",
+    "@tanstack/solid-router": "workspace:*",
+    "@tanstack/solid-router-devtools": "workspace:*",
+    "@tanstack/router-plugin": "workspace:*",

(pnpm.io)

📝 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
"dependencies": {
"@tailwindcss/postcss": "^4.1.15",
"@tanstack/solid-router": "^1.135.2",
"@tanstack/solid-router-devtools": "^1.135.2",
"@tanstack/router-plugin": "^1.135.2",
"@trpc/client": "^11.4.3",
"@trpc/server": "^11.4.3",
"express": "^4.21.2",
"postcss": "^8.5.1",
"solid-js": "^1.9.10",
"redaxios": "^0.5.1",
"tailwindcss": "^4.1.15",
"zod": "^3.24.2"
"dependencies": {
"@tailwindcss/postcss": "^4.1.15",
"@tanstack/solid-router": "workspace:*",
"@tanstack/solid-router-devtools": "workspace:*",
"@tanstack/router-plugin": "workspace:*",
"@trpc/client": "^11.4.3",
"@trpc/server": "^11.4.3",
"express": "^4.21.2",
"postcss": "^8.5.1",
"solid-js": "^1.9.10",
"redaxios": "^0.5.1",
"tailwindcss": "^4.1.15",
"zod": "^3.24.2"
🤖 Prompt for AI Agents
In examples/solid/with-trpc/package.json around lines 12-24, the TanStack
packages are currently pinned to registry versions; change
"@tanstack/solid-router", "@tanstack/solid-router-devtools", and
"@tanstack/router-plugin" dependency versions to use the workspace protocol
(e.g. "workspace:*" or "workspace:^1.135.2") so they resolve to local monorepo
packages; update those three entries and run your workspace package manager
(pnpm install) to verify no registry fallback.

Comment on lines +9 to +14
import { Spinner } from './-components/spinner'
import type { trpc } from '../trpc'

export interface RouterAppContext {
trpc: typeof trpc
}
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

import type { trpc } fails – no type export exists.

trpc is exported as a value, so the type-only import raises “Module has no exported member” during the build. Swap to a pure type expression instead of importing the value as a type, e.g.:

-import type { trpc } from '../trpc'
+import type { AppRouter } from '../server/trpc'
+import type { TRPCClient } from '@trpc/client'
 
 export interface RouterAppContext {
-  trpc: typeof trpc
+  trpc: TRPCClient<AppRouter>
 }

(or use typeof import('../trpc').trpc if you prefer). This keeps the file type-safe without triggering a compile-time error.

(typescriptlang.org)

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

🤖 Prompt for AI Agents
In examples/solid/with-trpc/src/routes/__root.tsx around lines 9 to 14, the file
uses "import type { trpc } from '../trpc'" but trpc is exported as a value,
causing a build error; replace the type-only import by referencing the type via
a type expression instead (for example set RouterAppContext.trpc to typeof
import('../trpc').trpc) and remove the invalid "import type { trpc }" line so
the file stays type-safe without importing a non-existent type export.

Comment on lines +30 to +33
post: t.procedure.input(String).query(async (req) => {
await new Promise((resolve) => setTimeout(resolve, 500))
return POSTS.find((p) => p.id === req.input)
}),
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 invalid tRPC input schema

t.procedure.input(String) passes the built‑in String constructor where tRPC expects a parser with a parse method (e.g. a Zod schema). At runtime this throws (input.parse is not a function), breaking the post query. Switch to a real schema such as z.string().

-import { initTRPC } from '@trpc/server'
-import { createExpressMiddleware } from '@trpc/server/adapters/express'
-import type { CreateExpressContextOptions } from '@trpc/server/adapters/express'
+import { initTRPC } from '@trpc/server'
+import { createExpressMiddleware } from '@trpc/server/adapters/express'
+import type { CreateExpressContextOptions } from '@trpc/server/adapters/express'
+import { z } from 'zod'
@@
-  post: t.procedure.input(String).query(async (req) => {
+  post: t.procedure.input(z.string()).query(async (req) => {
📝 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
post: t.procedure.input(String).query(async (req) => {
await new Promise((resolve) => setTimeout(resolve, 500))
return POSTS.find((p) => p.id === req.input)
}),
post: t.procedure.input(z.string()).query(async (req) => {
await new Promise((resolve) => setTimeout(resolve, 500))
return POSTS.find((p) => p.id === req.input)
}),
🤖 Prompt for AI Agents
In examples/solid/with-trpc/src/server/trpc.ts around lines 30 to 33, the post
procedure uses t.procedure.input(String) which passes the built-in String
constructor instead of a parser with a parse method, causing runtime errors;
replace it with a proper Zod schema (e.g. z.string()) and ensure z is imported
(import { z } from "zod") and the input type matches the handler (req.input will
be a string).

"lib": ["DOM", "DOM.Iterable", "ES2022"],
"types": ["node", "vite/client"]
},
"include": ["src", "vite.config.ts", "tsup.config.ts"]
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

Verify the inclusion of tsup.config.ts.

The includes array references tsup.config.ts, but this file doesn't appear to be added in this PR. If this file is not needed for the example, consider removing it from the includes array.


🏁 Script executed:

#!/bin/bash
# Check if tsup.config.ts exists in the example directory
fd -t f "^tsup\.config\.ts$" examples/solid/with-trpc/

Length of output: 0


🏁 Script executed:

#!/bin/bash
# List all files in the example directory to see what exists
echo "=== Files in examples/solid/with-trpc/ ==="
fd -t f . examples/solid/with-trpc/ | head -20

echo -e "\n=== Checking for config files ==="
fd -t f "(config|tsup|vite)" examples/solid/with-trpc/

echo -e "\n=== Check package.json for tsup ==="
if [ -f examples/solid/with-trpc/package.json ]; then
  cat examples/solid/with-trpc/package.json | grep -i tsup
fi

Length of output: 1161


🏁 Script executed:

#!/bin/bash
# Show the full tsconfig.json to verify current state
cat examples/solid/with-trpc/tsconfig.json

Length of output: 387


Remove tsup.config.ts from the includes array in tsconfig.json.

The file tsup.config.ts does not exist in the example directory and tsup is not a dependency. This example uses Vite, not tsup. The includes array should only contain ["src", "vite.config.ts"].

🤖 Prompt for AI Agents
In examples/solid/with-trpc/tsconfig.json at line 14, the "include" array
incorrectly lists "tsup.config.ts" which does not exist and is not used; remove
"tsup.config.ts" so the include array becomes ["src", "vite.config.ts"] to match
this example's Vite setup and avoid stale/nonexistent file references.

@birkskyum birkskyum merged commit 9727eb4 into main Nov 12, 2025
6 checks passed
@birkskyum birkskyum deleted the docs(solid-router)--add-with-trpc-example branch November 12, 2025 01:30
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