Madaxen86
solid-primitives/storage help for a persistent user config store not loading properly on refresh/
If SSR is enabled the initial page load/render will be done on the server. Great from SEO optimisation, preview links in Meta and other social media apps.
11 replies
Cannot run React alongside SolidJS in Astro
Here's a minimal Astro setup. Check especially
1.
tsconfig.ts
2. astro.config.mjs
3. upgrade to latest versions of packages after project setup (in my case pnpm upgrade)
Note: I didn't even need the /** @jsxImportSource solid-js */
because probably astro adds this though its config.
https://github.com/madaxen86/astro-solid-react7 replies
Need help understanding preload and file conventions
Concepts in the docs you should look at:
1. Suspense
2. ErrorBoundaries
3. createAsync -> deferStream
4. query
In a nutshell. By default SolidStart streams responses. This means it is not waiting for async resource to resolve it will just fallback to the nearest Suspense boundary.
This means that preloading just starts to request the data. That request mights have not fully resolved when the new page is rendering -> resulting in fallback to Suspense.
I have also made a more detailed video about data fetching in SolidStart looking at all the concepts like suspense ErrorBoundaries query etc:
https://youtu.be/Qw9am5NL6AI?si=fPMFo0Rgc0H7kJRv
4 replies
Need help understanding preload and file conventions
I suggest this talk from Ryan showing the basics of SolidStart
https://youtu.be/ZVjXtfdKQ3g?si=monkC7XSNmDngA23
4 replies
Cannot run React alongside SolidJS in Astro
Try to add this a the top of your solidjs files:
/** @jsxImportSource solid-js */
https://docs.solidjs.com/configuration/typescript#configuring-typescript7 replies
Can't install or get a project started using SolidJs
There are some issues with bun. Maybe adding the
—bun
flag to the scripts in package.json helps.
Where does the command you use come from.
You‘ll usually just run
E.g. pnpm create solid
And the follow the instructions in the cli.4 replies
Preloading route data with context access
Well depends:
e.g. if the preload functions uses "use server" it cannot access the client's context, right?
That's why I prefer cookies which are included in requests from the client and can be accessed on the server.
10 replies
SSR blank page
That’s probably a bun thing.
There’s an issue :
https://github.com/oven-sh/bun/issues/11381
may be unrelated.
And I found this:
"Vinxi project such as solid-start doesn't work with Deno 2.0
Here is a repo: https://github.com/Ciantic/deno-solid-test
This most likely because Vinxi runs node.exe behind the scenes instead of deno.exe.
It's notable that bun also has same error, but it can be fixed by using a flag --bun that fakes bun.exe as node.exe."
58 replies
A question about server side rendering an <a> tag based on requestEvent.
Instead of request Event you can get the current route with
useLocation
which is isomorphic.
But couldn’t you just do construct the url with string concatenation?
Also if you look for a "typesafe" file routes there’s this package which helps to create valid routes.
https://www.npmjs.com/package/solid-start-typesafe-routes-plugin
https://docs.solidjs.com/solid-router/reference/primitives/use-location#uselocation
and if you have a dynamic route that has the lang as a route param you can get this with useParams
https://docs.solidjs.com/solid-router/reference/primitives/use-params14 replies
Preloading route data with context access
That won’t work (also with signal), because they will get initialised on the server and then again on the client with a different ref. This can lead to hydration issues.
Are you intending to use a server or are you creating a pure SPA with an external API?
10 replies