Fix issues in Solid.js template #199
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, thank you for the development of TanStack, and as a Solid.js enthusiast, I'm very excited that TanStack Start supports Solid.js.
Following the docs, I ran
pnpm create @tanstack/start@latest --framework Solid
, and found some parts of the generated code emit errors.These errors occur from some differences between React vs Solid. Specifically:
frameworks/solid/add-ons/start/assets/src/routes/demo.start.server-funcs.tsx.ejs
:state
is a signal accessor and needs to be called as a function (likestate()
)frameworks/solid/add-ons/start/assets/src/routes/index.tsx.ejs
: In Solid, we use the<For>
component to loop over arrays. Also, we don't need thekey
attribute in Solid; worse, it gives a type error because it's not part of the standard HTMLDivElement attributes.I've fixes these issues, and updated a test snapshot accordingly.
I've checked that
pnpm build
andpnpm test
succeeds. I've also locally ran the cli command (cli/create-tsrouter-app/dist/index.js
) and verified that it produces corrected code.