-
|
What is the state of SSG support for solid-start? Are there any examples or is it just not implemented yet? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
|
we have an adapter called import staticAdapter from 'solid-start-static'
export default defineConfig({
plugins: [solid({
prerenderRoutes: ['/index', '404']
adapter: staticAdapter()
})]
}); |
Beta Was this translation helpful? Give feedback.
-
|
Is SSG something we should report errors on, or should I just give it some time to get settled? I have been going through creating a template for myself with tailwind, mdx and publishing to netlify using this setup. |
Beta Was this translation helpful? Give feedback.
-
|
Hey.. I'm spiking several solutions recently. Unfortunately, none of them, i.e. Astro, Next.js, solid-start support combining adapters (SSR and SSG) aka. to pre-render routes alongside SSR. However, every hosting provider would have no problem in doing so. Static files generated become routes served; and severless functions can happy live alongside. This is a feature that would be extremely useful. I'd like to pre-render many pages and also trigger a CI when DB data changes. However, I also need SSR at times, but those requests are costly, also in performance, so I'd like to avoid that for most routes. It would be great if the core impl. would allow for multiple adapters or to automatically enable static/SSG when export default defineConfig({
plugins: [solid({
prerenderRoutes: ['static/*, '404']
})]
}); ...and Yes, I know, the sub path might not be desired, but all hosting providers allow for rewrite rules, if people want to get rid of the path element "static" in the final routing. Edit: Nevermind, the adapter architecture is pretty cool. I'm simply building a higher order adapter now that will support this. |
Beta Was this translation helpful? Give feedback.
-
|
A question; what's the approach for combining this with islands, like Astro's client:* ? An opinion; I'd love to replace the ceremony of Astro's HTML components with just tsx, but client:* doesn't work in tsx. Would love to have that in solidstart. A thought; Cilk (a parallel programming language) had a neat idea: It conceptually compiled two versions of every function and then picked at run time which one to call. I wonder if something like that would work here; that from a static route you keep calling the static version until you hit one marked "client", then from there you start doing regular solid/tsx. A vite plugin could potentially do something similar in dev mode so that build doesn't break things that work at dev time. Is that the sort of thing you have in mind? |
Beta Was this translation helpful? Give feedback.
we have an adapter called
solid-start-static. You can use that to do SSG. You will have to set it up like this: