Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/start/framework/solid/build-from-scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ replace:
'@tanstack/react-start': '@tanstack/solid-start',
'React': 'SolidJS',
'react-router': 'solid-router',
'react react-dom': 'solid-js',

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

'@vitejs/plugin-react': 'vite-plugin-solid',
'@types/react @types/react-dom ': '',

Copy link
Copy Markdown
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.

'"jsx": "react-jsx"': '"jsx": "preserve",\n "jsxImportSource": "solid-js"',
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
'react\'s': 'solid\'s'
Comment thread
jakst marked this conversation as resolved.
Outdated
}
---
Loading