withastro / roadmap

Ideas, suggestions, and formal RFC proposals for the Astro project.
320 stars 30 forks source link

Hybrid rendering stage 3 proposal #565

Closed matthewp closed 1 year ago

matthewp commented 1 year ago

Summary

Provide a output: 'hybrid' mode to allow static sites to opt-in certain pages to be dynamic (not prerendered).

Links

jamesli2021 commented 1 year ago

As opposite to 'server', using 'hybrid' is confusing, I prefer 'defaultstatic' or 'defaultprerender' as it's more meaningful in the docs.

matthewp commented 1 year ago

This has been out as experimental since 2.5. I'm moving to have this RFC merged in and experimental label removed. We'll now enter the final comment period. If anyone has issue with this RFC being merged please voice now, thanks!

zadeviggers commented 1 year ago

Again, I'm still mainly in favor of not introducing a "hybrid" option, and instead going for an object configuration. But I can see how this way is simpler for the user, if less future-proof and more confusing, so I don't feel too strongly either way.

matthewp commented 1 year ago

@zadeviggers Did I miss this idea? Could you link to it? The object configuration I mean.

zadeviggers commented 1 year ago

@matthewp here are the relevant comments: https://github.com/withastro/roadmap/issues/539#issuecomment-1492673941 https://github.com/withastro/roadmap/issues/539#issuecomment-1492895619

matthewp commented 1 year ago

Ah yeah. I see what you mean. Personally I would keep output as a string and then have a separate option for the default:

output: 'server',
build: {
  prerenderDefault: false
}

I think there's still some perception problem with this approach where people see the default being false as being the wrong choice.

I think we should proceed with the current 'hybrid' option for now. 3.0 is coming up so we can still make this better in the future. Since this is mostly about bikeshedding the config name and not how exactly it works. Sound fair?

matthewp commented 1 year ago

We're going to go with this approach for now. Happy to continue refining it as we approach 3.0.

zadeviggers commented 1 year ago

Awesome, that sounds good.