SSR Support #1167
Replies: 4 comments 1 reply
-
I think it does not really matter why people want SSR with starlight. It should work. Is it in the roadmap? FWIW: My usecase would be to restrict access to the documentation with auth0. I know that I can use vercels or netlifies user management, but they come at a hefty price tag, so I would like to use the free auth0 TIER. |
Beta Was this translation helpful? Give feedback.
-
Noting here that Starlight v0.18 includes preliminary support for using SSR adapters alongside Starlight. For now, Starlight pages themselves are always prerendered, but custom routes etc. can all be rendered on demand on the server. |
Beta Was this translation helpful? Give feedback.
-
Can we add an example of Starlight SSR, such as Starlight SSR Demo(it is from Astro Weekly)? |
Beta Was this translation helpful? Give feedback.
-
Starting with Starlight When building a project with export default defineConfig({
output: 'server',
integrations: [
starlight({
prerender: false,
}),
],
}); |
Beta Was this translation helpful? Give feedback.
-
What version of
starlight
are you using?^0.13.1
What is your idea?
Server side rendering support for StarLight
Why is this feature necessary?
Right now I am using lit components to render forms at https://evonytkrtips.net/generals/pair_picking/ and https://evonytkrtips.net/reference/generalyaml/ because the built in Astro forms support requires SSR adapters be enabled.
While I could probably figure out how to do the second one as a pure Astro component with Zod and simple HTML Elements, the first one is pulling an entire content collection using an API endpoint hosted by Astro then filtering it based on the values selected by the various toggles. I'm hitting a number of performance problems, many of which are almost certainly my own fault (there is no doubt a more efficient way to do many of the things I'm doing if I only knew how), but there it is.
With the server side rendering, my hope is that I can greater leverage native astro components and query the content collection in an intelligent manner based on the toggles rather than fetching, parsing, and resorting way too many generals for every change.
The challenge I have without the SSR support is that I do not know how to make the API endpoint such that it is flexible enough to support allowing the client side lit component do anything other than fetch either single generals or the entire collection. I do not know how to fetch an arbitrary subset of the collection.
With SSR support, I can filter the collection based on the values that an Astro form (instead of a Lit form) receives as its post data.
Do you have examples of this feature in other projects?
I would like a table that filters and sorts the way https://element-plus.org/en-US/component/table.html#filter does, but I don't want to learn Vue.
Participation
Beta Was this translation helpful? Give feedback.
All reactions