SvelteKit scaffold should not prerender by default (SPA mode makes important patterns easier). #13178
Ruben-Kruepper
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I think i agree (didn't look into sveltekit for ages). would you be open to create a pr? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I run SvelteKit on the server and on multiple Tauri production apps. And I think that setting
prerender = true
is probably needlessly confusing to people starting out.The key reason: Load functions. I don't know if anyone on the core team is well acquainted with SvelteKit, but here's the general pattern:
The load functions are run at build time. That means we don't have a window, or tauri APIs. For websites, that makes perfect sense, since I will never rely on anything in the browser for
SSR
orSSG
(duh). And prerendering is a valuable way to avoid paying my cloud provider for static content.But in Tauri-land prerendering comes with little to no benefit.
At the same time, it makes very valuable patterns hard to do. I want to load files project files from disk, I want to access the native keychain, I want to provide my pages with a
store
plugin instance for persistence etc. etc. All those require the tauri / window! And we don't have that when pre-rendering!@lorenzolewis Recommends a setup in this discussion that is far more intuitive imho, and could easily be made the default.
Does anyone see a good reason to prerender by default?
Beta Was this translation helpful? Give feedback.
All reactions