Solidstart with CSR, SSR and SSG?
How to separately implement below methods in SolidStart project? I mean, I wonder how code is different below methods. Example: I saw
"use server";
add to run SSR.
Client-side rendering (CSR)
Server-side rendering (SSR)
Static site generation (SSG)5 Replies
"use server";
is not directly related to ssr. you can use it in a client side app too: it will then just be an rpc call to the server.
you can enable/disable ssr in the app.config.(js|ts)
.
ssg I actually don't know
my guess is that it's defineConfig({ server: { presets: 'static' }})
So Just use solidJS package is CSR and set SSR in config file will be SSR even when we use SolidJS package.
no, I was talking about
solid-start
not solid-js
. solid-start
has an app.config.ts
file: https://docs.solidjs.com/solid-start/reference/entrypoints/app-configI found the details. Thank you for support. Default ssr is ture in app.config.ts https://docs.solidjs.com/solid-start/reference/config/define-config when I change it, it is CSR. When set
defineConfig({ server: { presets: 'static' }})
it will be SSG. crawlLinks: true
will generate routes. https://docs.solidjs.com/solid-start/building-your-application/route-prerendering, https://nitro.unjs.io/config#prerendernice!
didn't know about
crawlLinks: true
!