-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
Describe the problem
People enable SPA without prerendering and their sites are much slower as a result because it results in an extra round trip to the server before anything can be rendered. I found tons of examples of this in the wild. E.g. appwrite/console#722
Describe the proposed solution
Check if fetch is called. If it's not, then automatically prerender the page even if prerender = true is not set
For this to work, pages would need to be crawled and rendered even if prerender = true is not set, which I think is the case today though I'm not certain
We'll also need to add an isStatic check to the adapter and do it only when true so that we don't have to worry about losing headers.
Alternatives considered
- Deprecate SPA mode. It's often used as a shortcut rather than addressing issues when they're hit. People just opt out of SSR as a quick and dirty fix, but users suffer for it. However, it can ease deployment to hosts that offer static deployment, so this may be a bit of a drastic measure
- Tell users to turn on prerendering in cases where
fetchis not called, SSR is disabled, and prerendering is not enabled. We could either throw an error or log a big nasty warning rather than just automatically prerendering the page
Importance
nice to have
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels