-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Option to disable client-side routing #570
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that familiar with the new testing code, but if there's a way to write a simple test for this that'd probably be nice
Also, this should probably go in the docs at least in https://github.com/sveltejs/kit/blob/master/documentation/docs/13-configuration.md
@@ -5,6 +5,8 @@ module.exports = { | |||
// specifying a different adapter | |||
adapter: '@sveltejs/adapter-node', | |||
|
|||
clientSideRouting: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it might be better to make this routing: { client: false }
or something in case we want to add other routing options. I'm curious what other folks think about names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that maybe there should be an enum for routing, but Rich's original issue had it as clientSideRouting
so I decided it'd be simpler to leave it as that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can envisage cases where you might want to disable hydration on specific pages that you know to be purely static. Are there cases where you might want to disable client-side routing on specific pages as well? i.e. does this make sense? <script context="module">
export const prerender = true;
export const hydrate = false;
export const routing = false;
</script> The answer to that presumably influences whatever API we settle on. Separately, a Svelte-ish thing to do here would be to treeshake the router away if routing is disabled for a given app (or indeed page). |
Being able to disable hydration on purely static pages would be nice - having the whole "0kb js" on static pages like elderjs can do. My first thought is client side routing is all-or-nothing, but I guess someone could want authenticated pages with routing yet also static prerendered pages without it... I thought about wanting to tree-shake away the router, but then I'd assume we'd want a simple reimplementation of "goto" to still work, just without csr? |
Closing in favor of #713 |
@ConProgramming wrote to support JungleJS as a SvelteKit adapter
Related: #231