docs: update build-from-scratch replacements for SolidJS #5216
main fromrefs/pull/5216/head·merged 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
github-actions[bot](GitHub profile, opens in a new tab) added labelsdocumentation
View your CI Pipeline Execution ↗ for commit baf13f696fa753fa8aab96cc6a752e00282e88cb
Command Status Duration Result nx affected --targets=test:eslint,test:unit,tes...✅ Succeeded <1s View ↗ nx run-many --target=build --exclude=examples/*...✅ Succeeded 3s View ↗
☁️ Nx Cloud last updated this comment at
2025-09-25 22:21:14UTCMore templates
- tanstack-router-solid-example-basic
- tanstack-router-solid-example-basic-devtools-panel
- tanstack-router-solid-example-basic-file-based
- tanstack-router-solid-example-basic-non-nested-devtools
- tanstack-router-solid-example-basic-solid-query
- tanstack-router-solid-example-basic-solid-query-file-based
- tanstack-router-solid-example-basic-ssr-streaming-file-based
- tanstack-router-solid-example-kitchen-sink-file-based
- tanstack-router-solid-example-quickstart-file-based
- tanstack-solid-start-example-bare
- tanstack-solid-start-example-basic
- tanstack-solid-start-example-basic-static
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-authenticated-routes-firebase
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-devtools-panel
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-non-nested-devtools
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-basic-virtual-file-based
- tanstack-router-react-example-basic-virtual-inside-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-esbuild-file-based
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- router-monorepo-react-query
- router-mono-simple
- router-mono-simple-lazy
- tanstack-router-react-example-scroll-restoration
- tanstack-search-validator-adapters
- tanstack-start-example-bare
- tanstack-start-example-basic
- tanstack-start-example-basic-auth
- tanstack-start-example-basic-react-query
- tanstack-start-example-basic-static
- tanstack-start-example-convex-trellaux
- tanstack-start-example-counter
- tanstack-start-example-large
- tanstack-start-example-material-ui
- tanstack-start-example-supabase-basic
- tanstack-start-tailwind-v4
- tanstack-start-example-trellaux
- tanstack-start-example-workos
- tanstack-router-react-example-view-transitions
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc
- tanstack-router-react-example-with-trpc-react-query
@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@5216commit:
baf13f6Actionable 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
@@ -5,3 +5,8 @@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 ': '',11+ '"jsx": "react-jsx"': '"jsx": "preserve",\n "jsxImportSource": "solid-js"',12+ 'react\'s': 'solid\'s'⚠️ Potential issue
Fix YAML quoting so the replacement actually runs.
Single-quoted YAML strings don’t accept backslash escapes, so this entry is currently matching the literal text
react\'sand the swap never fires. Use proper quoting (either double quotes or doubled single quotes) so the documentation actually replacesreact'swithsolid's.- 'react\'s': 'solid\'s' + "react's": "solid's"📝 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.
"react's": "solid's"🤖 Prompt for AI Agents
docs/start/framework/solid/build-from-scratch.md around line 12: the YAML replacement map uses a single-quoted string with a backslash-escaped apostrophe ('react\'s') which YAML treats literally so the replacement never runs; change the key (and value if needed) to use proper quoting (either double quotes like "react's": "solid's" or doubled single quotes like 'react''s': 'solid''s') so YAML parses the actual apostrophe and the swap will execute.✅ Addressed in commits e4d5671 to c406ffc
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'andplugins: [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-jscorrectly updates add/install lines.
12-12: Nice fix on quoting for possessives.Using double quotes ensures
react's→solid'sis 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.@@ -5,3 +5,7 @@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 ': '',11+ '"jsx": "react-jsx"': '"jsx": "preserve",\n "jsxImportSource": "solid-js"',⚠️ Potential issue
Fix YAML quoting so the newline is applied (not a literal "\n").
Single-quoted YAML scalars don’t interpret backslash escapes. Use a double-quoted YAML string and escape the inner quotes so the replacement inserts a real newline.
- '"jsx": "react-jsx"': '"jsx": "preserve",\n "jsxImportSource": "solid-js"', + '"jsx": "react-jsx"': "\"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\"",Optionally, for readability you can use a block scalar:
- '"jsx": "react-jsx"': '"jsx": "preserve",\n "jsxImportSource": "solid-js"', + '"jsx": "react-jsx"': | + "jsx": "preserve", + "jsxImportSource": "solid-js"📝 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.
'"jsx": "react-jsx"': "\"jsx\": \"preserve\",\n \"jsxImportSource\": \"solid-js\"",🤖 Prompt for AI Agents
In docs/start/framework/solid/build-from-scratch.md around line 11, the replacement currently uses a single-quoted YAML scalar that contains a literal "\n" so the newline is not applied; change the replacement to use a double-quoted YAML string and escape the inner quotes so the "\n" becomes a real newline (or alternatively use a YAML block scalar for readability) so the resulting YAML contains the two lines: "jsx": "preserve", followed by "jsxImportSource": "solid-js".✅ Addressed in commits e4d5671 to c406ffc
- 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 wellI think there are some bigger differences like not hydrating the whole html document
Problem seems to be in the
__root.tsxfilefunction 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.
jakst(GitHub profile, opens in a new tab)replied on
docs/start/framework/solid/build-from-scratch.mdline 8Yeah, it's not the most flexible solution. I couldn't figure out a way to fix the children prop types in __root.tsx either
nlynzaad(GitHub profile, opens in a new tab)replied on
docs/start/framework/solid/build-from-scratch.mdline 8Not pretty but could just add
'viteReact()': 'viteSolid({ssr:true})'into the replace array as wellbrenelz(GitHub profile, opens in a new tab)replied on
docs/start/framework/solid/build-from-scratch.mdline 8I think there are some bigger differences like not hydrating the whole html document
nlynzaad(GitHub profile, opens in a new tab)replied on
docs/start/framework/solid/build-from-scratch.mdline 8Problem seems to be in the
__root.tsxfilefunction 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.
nlynzaad(GitHub profile, opens in a new tab)replied on
docs/start/framework/solid/build-from-scratch.mdline 8I think this should all be resolved now. @jakst @brenelz please check if you are happy with the proposed changes.
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
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.
nlynzaad(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
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#
docs/start/framework/solid/build-from-scratch.mdreact react-dom→solid-js; swapped@vitejs/plugin-react→vite-plugin-solidandviteReact()→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-startandreact-router→solid-router.Estimated code review effort#
🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers#
Poem#
Pre-merge checks and finishing touches#
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 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)
Files:
docs/start/framework/solid/build-from-scratch.mddocs/{router,start}/**
📄 CodeRabbit inference engine (AGENTS.md)
Files:
docs/start/framework/solid/build-from-scratch.md🧠 Learnings (2)
📓 Common learnings
📚 Learning: 2025-09-23T17:36:12.598Z
Applied to files:
docs/start/framework/solid/build-from-scratch.md🔇 Additional comments (1)
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