Skip to content
Source
Sign inSign up
TanStack/router

docs: update build-from-scratch replacements for SolidJS #5216

Mergedjakst(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/5216/headmerged by nlynzaad(GitHub profile, opens in a new tab)

The docs make references to react in a lot of places. I updated the ones I could find in the build-from-scratch guide to use proper solid-js package names and other references.

Summary by CodeRabbit

  • Documentation
    • Expanded "build from scratch" guide for migrating from React to SolidJS.
    • Added comprehensive mapping of React libraries, tooling, and plugins to Solid equivalents.
    • Documents alternative React tooling options and Solid-compatible plugin recommendations.
    • Clarifies updating JSX runtime and project configuration for SolidJS.
    • Describes import/usage changes and fragment/JSX differences needed for Solid.
    • Notes removal of React-specific type artifacts during migration.
    1. Walkthrough

      Updated documentation mapping in the Solid build-from-scratch guide to replace React packages, plugins, JSX runtime settings, import shims, type references, and wording with SolidJS equivalents; retained some existing mappings to Solid-specific packages.

      Changes

      Cohort / File(s)Summary
      Docs: Solid build-from-scratch mapping updates
      docs/start/framework/solid/build-from-scratch.md
      Expanded and revised replacement map: replaced react react-dom → solid-js; swapped @vitejs/plugin-react → vite-plugin-solid and viteReact() → viteSolid({ssr:true}); removed @types/react @types/react-dom; changed JSX config "jsx": "react-jsx" → "jsx": "preserve", "jsxImportSource": "solid-js"; adjusted import/type mappings (e.g., type { ReactNode } → type * as Solid from 'solid-js', ReactNode → Solid.JSX.Element, {state} → {state()}); updated wording from "react's"/"React" to "solid's"/"SolidJS"; preserved prior Solid mappings like @tanstack/react-start → @tanstack/solid-start and react-router → solid-router.

      Estimated code review effort

      🎯 2 (Simple) | ⏱️ ~10 minutes

      Suggested reviewers

      • brenelz
      • Insik-Han

      Poem

      Thump-thump, I hop through docs at night, Swapping React for Solid with gentle light. JSX preserved, imports set right, Plugins and types take flight in sight. A rabbit's nibble, mapping done—what a delight! 🐇✨

      Pre-merge checks and finishing touches

      ✅ Passed checks (3 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title Check✅ PassedThe title succinctly reflects the core change by indicating that documentation in the “build-from-scratch” guide is being updated to use SolidJS replacements. It is specific, concise, and accurately conveys the primary purpose of the pull request without unnecessary detail. The conventional “docs:” prefix correctly categorizes the change.
      Docstring Coverage✅ PassedNo functions found in the changes. Docstring coverage check skipped.
      ✨ Finishing touches
      🧪 Generate unit tests
      • Create PR with unit tests
      • Post copyable unit tests in a comment

      📜 Recent review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 71591b2aa4769bb5aec7be94579256b7e737d630 and baf13f696fa753fa8aab96cc6a752e00282e88cb.

      📒 Files selected for processing (1)
      • docs/start/framework/solid/build-from-scratch.md (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (2)
      docs/**/*.{md,mdx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

      Files:

      • docs/start/framework/solid/build-from-scratch.md
      docs/{router,start}/**

      📄 CodeRabbit inference engine (AGENTS.md)

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

      Files:

      • docs/start/framework/solid/build-from-scratch.md
      🧠 Learnings (2)
      📓 Common learnings
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.598Z
      Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
      📚 Learning: 2025-09-23T17:36:12.598Z
      Learnt from: CR
      PR: TanStack/router#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:

      • docs/start/framework/solid/build-from-scratch.md
      🔇 Additional comments (1)
      docs/start/framework/solid/build-from-scratch.md (1)

      10-10: Remove the trailing space in the replace key.

      The key currently ends with a space, so the replacement never matches the original text. Trim the key to ensure the transform actually runs.

      -    '@types/react @types/react-dom ': '',
      +    '@types/react @types/react-dom': '',

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. View your CI Pipeline Execution ↗ for commit baf13f696fa753fa8aab96cc6a752e00282e88cb

      CommandStatusDurationResult
      nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded<1sView ↗
      nx run-many --target=build --exclude=examples/*...✅ Succeeded3sView ↗

      ☁️ Nx Cloud last updated this comment at 2025-09-25 22:21:14 UTC

    3. More templates

      @tanstack/arktype-adapter

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

      @tanstack/directive-functions-plugin

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

      @tanstack/eslint-plugin-router

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

      @tanstack/history

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

      @tanstack/nitro-v2-vite-plugin

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

      @tanstack/react-router

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

      @tanstack/react-router-devtools

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

      @tanstack/react-router-ssr-query

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

      @tanstack/react-start

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

      @tanstack/react-start-client

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

      @tanstack/react-start-server

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

      @tanstack/router-cli

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

      @tanstack/router-core

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

      @tanstack/router-devtools

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

      @tanstack/router-devtools-core

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

      @tanstack/router-generator

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

      @tanstack/router-plugin

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

      @tanstack/router-ssr-query-core

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

      @tanstack/router-utils

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

      @tanstack/router-vite-plugin

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

      @tanstack/server-functions-plugin

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

      @tanstack/solid-router

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

      @tanstack/solid-router-devtools

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

      @tanstack/solid-start

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

      @tanstack/solid-start-client

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

      @tanstack/solid-start-server

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

      @tanstack/start-client-core

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

      @tanstack/start-plugin-core

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

      @tanstack/start-server-core

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

      @tanstack/start-static-server-functions

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

      @tanstack/start-storage-context

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

      @tanstack/valibot-adapter

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

      @tanstack/virtual-file-routes

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

      @tanstack/zod-adapter

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

      commit: baf13f6

    4. Actionable comments posted: 1

      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 06839407b9246f406615ba529c35b8fed8e753c1 and 4b510114594f22cf954d7558fc5bfbcfb8ec80f9.

      📒 Files selected for processing (1)
      • docs/start/framework/solid/build-from-scratch.md (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (2)
      docs/**/*.{md,mdx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

      Files:

      • docs/start/framework/solid/build-from-scratch.md
      docs/{router,start}/**

      📄 CodeRabbit inference engine (AGENTS.md)

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

      Files:

      • docs/start/framework/solid/build-from-scratch.md
      🧠 Learnings (2)
      📓 Common learnings
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.589Z
      Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
      📚 Learning: 2025-09-23T17:36:12.589Z
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.589Z
      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:

      • docs/start/framework/solid/build-from-scratch.md
      OutdatedResolvedby jakst(GitHub profile, opens in a new tab)
    5. Actionable comments posted: 2

      🧹 Nitpick comments (1)
      docs/start/framework/solid/build-from-scratch.md (1)

      9-9: Add replacements for the plugin identifier and call site.

      Changing only the package specifier will leave code like import react from 'vite-plugin-solid' and plugins: [react()]. Add mappings for the identifier and invocation.

           '@vitejs/plugin-react': 'vite-plugin-solid',
      +    'import react from': 'import solid from',
      +    'react()': 'solid()',
      📜 Review details

      Configuration used: CodeRabbit UI

      Review profile: CHILL

      Plan: Pro

      📥 Commits

      Reviewing files that changed from the base of the PR and between 4b510114594f22cf954d7558fc5bfbcfb8ec80f9 and 71591b2aa4769bb5aec7be94579256b7e737d630.

      📒 Files selected for processing (1)
      • docs/start/framework/solid/build-from-scratch.md (1 hunks)
      🧰 Additional context used
      📓 Path-based instructions (2)
      docs/**/*.{md,mdx}

      📄 CodeRabbit inference engine (AGENTS.md)

      Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

      Files:

      • docs/start/framework/solid/build-from-scratch.md
      docs/{router,start}/**

      📄 CodeRabbit inference engine (AGENTS.md)

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

      Files:

      • docs/start/framework/solid/build-from-scratch.md
      🧠 Learnings (2)
      📓 Common learnings
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.589Z
      Learning: Applies to packages/{react-router,solid-router}/** : Implement React and Solid bindings/components only in packages/react-router/ and packages/solid-router/
      📚 Learning: 2025-09-23T17:36:12.589Z
      Learnt from: CR
      PR: TanStack/router#0
      File: AGENTS.md:0-0
      Timestamp: 2025-09-23T17:36:12.589Z
      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:

      • docs/start/framework/solid/build-from-scratch.md
      🔇 Additional comments (2)
      docs/start/framework/solid/build-from-scratch.md (2)

      8-8: LGTM on package replacement for install commands.

      Mapping react react-dom → solid-js correctly updates add/install lines.


      12-12: Nice fix on quoting for possessives.

      Using double quotes ensures react's → solid's is parsed and applied.

      docs/start/framework/solid/build-from-scratch.md line 10Outdated
      @@ -5,3 +5,6 @@
      55 '@tanstack/react-start': '@tanstack/solid-start',
      66 'React': 'SolidJS',
      77 'react-router': 'solid-router',
      8+ 'react react-dom': 'solid-js',
      9+ '@vitejs/plugin-react': 'vite-plugin-solid',
      10+ '@types/react @types/react-dom ': '',

      ⚠️ Potential issue

      Remove the trailing space in the key so the replacement actually matches.

      The key has a trailing space, which will prevent matches in most occurrences.

      -    '@types/react @types/react-dom ': '',
      +    '@types/react @types/react-dom': '',
      📝 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.

          '@types/react @types/react-dom': '',
      🤖 Prompt for AI Agents
      In docs/start/framework/solid/build-from-scratch.md around line 10, the
      replacement key "'@types/react @types/react-dom '": '' contains a trailing space
      which prevents matches; remove the trailing space so the key reads
      "'@types/react @types/react-dom'": '' to ensure replacements match correctly
      across occurrences.
      OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)
    6. docs/start/framework/solid/build-from-scratch.md line 8Outdated
      @@ -5,3 +5,4 @@
      55 '@tanstack/react-start': '@tanstack/solid-start',
      66 'React': 'SolidJS',
      77 'react-router': 'solid-router',
      8+ 'react react-dom': 'solid-js',

      so i guess it just string replaces the docs? I wonder how we would add the viteSolid({ssr: true}) part

      Yeah, it's not the most flexible solution. I couldn't figure out a way to fix the children prop types in __root.tsx either

      Not pretty but could just add 'viteReact()': 'viteSolid({ssr:true})' into the replace array as well

      I think there are some bigger differences like not hydrating the whole html document

      Problem seems to be in the __root.tsx file

      function RootDocument({ children }: Readonly<{ children: Solid.JSX.Element }>) {
      	return (
      		<html>
      			<head>
      				<HeadContent />
      			</head>
      			<body>
      				{children}
      				<Scripts />
      			</body>
      		</html>
      	);
      }

      from looking at the start-bare and start-basic examples it seems like it should be:

      function RootDocument({ children }: Readonly<{ children: Solid.JSX.Element }>) {
      	return (
      		<>
      			<HeadContent />
      			{children}
      			<Scripts />
      		</>
      	);
      }

      at least this got it as far running under development mode.

      will see if I can push to this PR.

      I think this should all be resolved now. @jakst @brenelz please check if you are happy with the proposed changes.

    7. jakst(GitHub profile, opens in a new tab)replied on docs/start/framework/solid/build-from-scratch.md line 8

      Yeah, it's not the most flexible solution. I couldn't figure out a way to fix the children prop types in __root.tsx either

    8. nlynzaad(GitHub profile, opens in a new tab)replied on docs/start/framework/solid/build-from-scratch.md line 8

      Not pretty but could just add 'viteReact()': 'viteSolid({ssr:true})' into the replace array as well

    9. brenelz(GitHub profile, opens in a new tab)replied on docs/start/framework/solid/build-from-scratch.md line 8

      I think there are some bigger differences like not hydrating the whole html document

    10. nlynzaad(GitHub profile, opens in a new tab)replied on docs/start/framework/solid/build-from-scratch.md line 8

      Problem seems to be in the __root.tsx file

      function RootDocument({ children }: Readonly<{ children: Solid.JSX.Element }>) {
      	return (
      		<html>
      			<head>
      				<HeadContent />
      			</head>
      			<body>
      				{children}
      				<Scripts />
      			</body>
      		</html>
      	);
      }

      from looking at the start-bare and start-basic examples it seems like it should be:

      function RootDocument({ children }: Readonly<{ children: Solid.JSX.Element }>) {
      	return (
      		<>
      			<HeadContent />
      			{children}
      			<Scripts />
      		</>
      	);
      }

      at least this got it as far running under development mode.

      will see if I can push to this PR.

    11. nlynzaad(GitHub profile, opens in a new tab)replied on docs/start/framework/solid/build-from-scratch.md line 8

      I think this should all be resolved now. @jakst @brenelz please check if you are happy with the proposed changes.

    12. brenelz(GitHub profile, opens in a new tab) approved these changes

      I guess can't really preview what this would output but overall looks good

    13. I guess can't really preview what this would output but overall looks good

      used a local instance of tanstack.com to test, seems fine. will continue with the merge then.

      @jakst thanks for working on this.

Sign in to join this conversation.