Skip to content

Conversation

@jakst
Copy link
Contributor

@jakst jakst commented Sep 24, 2025

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

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-domsolid-js; swapped @vitejs/plugin-reactvite-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', ReactNodeSolid.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-routersolid-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 name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The 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 ✅ Passed No 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 71591b2 and baf13f6.

📒 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.

@github-actions github-actions bot added the documentation Everything documentation related label Sep 24, 2025
@nx-cloud
Copy link

nx-cloud bot commented Sep 24, 2025

View your CI Pipeline Execution ↗ for commit baf13f6

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:14 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 24, 2025

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

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: 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 0683940 and 4b51011.

📒 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

jakst and others added 2 commits September 24, 2025 21:56
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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: 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 4b51011 and 71591b2.

📒 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-domsolid-js correctly updates add/install lines.


12-12: Nice fix on quoting for possessives.

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

'react-router': 'solid-router',
'react react-dom': 'solid-js',
'@vitejs/plugin-react': 'vite-plugin-solid',
'@types/react @types/react-dom ': '',
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

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.

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

'@tanstack/react-start': '@tanstack/solid-start',
'React': 'SolidJS',
'react-router': 'solid-router',
'react react-dom': 'solid-js',
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor

@brenelz brenelz left a comment

Choose a reason for hiding this comment

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

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

@nlynzaad
Copy link
Contributor

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 nlynzaad merged commit e216127 into TanStack:main Sep 25, 2025
6 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 3, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 24, 2025
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.

3 participants