You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For large headless / static sites with a bit of api glue code, marking every single route with export const prerender = true is both unergonomic and unintuitive, considering other major serverless frameworks (eg: Next) automatically prerender all routes when possible.
A common pattern is to have all routes prerendered, and then an api/ route or similar for endpoints that would get translated to serverless functions you can request to.
Describe the proposed solution
There should be an option to make prerendering opt-out rather than opt-in for serverless adapters. Ideally an adapter like Vercel should attempt to prerender all routes by default, while keeping endpoints as serverless functions. That would be a fairly major breaking change, so making this a configuration option (false by default) would be a non-breaking and huge erganomic upgrade. Though I still think the default behaviour is odd, given kit's emphasis on performance and DX.
Alternatives considered
Mark every route with export const prerender = true, unintuitive and prone to user-error
Use adapter-static and manually deploy serverless functions for api routes / endpoints to provider of choice, largely negating the whole benefit of Sveltekit's deep serverless integration
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Describe the problem
For large headless / static sites with a bit of api glue code, marking every single route with
export const prerender = true
is both unergonomic and unintuitive, considering other major serverless frameworks (eg: Next) automatically prerender all routes when possible.A common pattern is to have all routes prerendered, and then an
api/
route or similar for endpoints that would get translated to serverless functions you can request to.Describe the proposed solution
There should be an option to make prerendering opt-out rather than opt-in for serverless adapters. Ideally an adapter like Vercel should attempt to prerender all routes by default, while keeping endpoints as serverless functions. That would be a fairly major breaking change, so making this a configuration option (false by default) would be a non-breaking and huge erganomic upgrade. Though I still think the default behaviour is odd, given kit's emphasis on performance and DX.
Alternatives considered
export const prerender = true
, unintuitive and prone to user-erroradapter-static
and manually deploy serverless functions for api routes / endpoints to provider of choice, largely negating the whole benefit of Sveltekit's deep serverless integrationImportance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: