Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hybrid rendering #3226

Closed
matthewp opened this issue May 10, 2023 · 5 comments · Fixed by #3259
Closed

Hybrid rendering #3226

matthewp opened this issue May 10, 2023 · 5 comments · Fixed by #3259
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah!

Comments

@matthewp
Copy link
Contributor

matthewp commented May 10, 2023

Needs

Note that this feature will likely be released as experimental at first.

The config reference page will include details on about how to turn on this feature.

Currently prerendering is explained on the server-side rendering page. Since this new feature is for SSG it wouldn't work well there.

How it works

See the RFC for full details. In short:

defineConfig({
  output: 'hybrid'
})

Then you can opt-out of prerendering on a per-page basis, for ex:

index.astro

---
export const prerender = false;
---
@sarah11918
Copy link
Member

Thanks @matthewp ! Just to confirm, this will release as experimental next Wednesday, right? in 2.5? We'll get started on some docs in prep for that!

@sarah11918 sarah11918 added add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) labels May 12, 2023
@matthewp
Copy link
Contributor Author

The plan is experimental in 2.5, yes.

Where's the right place to document this, do you think? Currently prerendering is explain on the SSR page, but this new feature is for SSG.

@sarah11918
Copy link
Member

I'm going to have to think about this one. We've talked as a longer-term goal of SSR eventually not having its own page, but more SSR and SSG interwoven as appropriate throughout Docs as just two different options when discussing other topics. This is another reason why that would make sense.

I'll come up with some thoughts!

@sarah11918
Copy link
Member

OK, so to figure out where to place this (maybe something about rendering added to our routing page?):

  • when you configure server: hybrid, I'm checking that this does not require the user to also install an adapter integration in order to make use of some pre-rendering? Because I don't see mention of needing to do that. (i.e. Is hybrid actually a sneaky way of setting server but with default rendering set to false?) If it requires an adapter, and is "stealth server" mode, then we could add it to SSR for now to augment the existing pre-rendering content, and I make a note (maybe on the routing page?) that pre-rendering for some pages is available for your routes using server: hybrid and link to SSR page for more details.
  • We could consider a new "rendering" page that will include everything about SSR vs SSG, pre-rendering etc. to replace the existing SSR page. This is a little more ambitious and not necessary for this 2.5 release (but, I could accomplish it on my end if we felt it was high enough priority). BUT, that would also lead me to want to include this information on the existing SSR page, because then it will be right there for when I redesign the page.

So, I think the answer I seem to be converging on is, it's least disruptive to what we have now and probably most convenient for you to add your docs to the SSR page.

And it'll be on me to first, make a logical link from elsewhere in the docs (again, I'm thinking routing or endpoints or something... I'll discuss with @delucis, too). And then, maybe in time for 2.5 release, maybe not, I'll repurpose the SSR page into a "rendering" page where we can also have better SSG vs SSR content, all the options etc. We knew that the SSR page was outgrowing its use, and now's as good a time as any to tackle that!

@matthewp
Copy link
Contributor Author

@sarah11918 Good point, hybrid does also require an adapter. I'll update the RFC to convey that. Given that, I like option A here, for now anyways, it becomes a secondary way to do SSR and can be documented there.

@sarah11918 sarah11918 added the minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah! label Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) minor-release For the next minor release; in the milestone, "merge queue" when approved by Sarah!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants