sveltesveltekit

With SvelteKit, what will happen if I disable both ssr and csr?


In the doc, there's a comment in the code snippet, saying:

// If both ssr and csr are false, nothing will be rendered!

What does it mean by "nothing will be rendered"? In my understanding, ssr determines whether the page could be rendered from the server side, and csr determines whether the page involves JavaScript (thus is interactive). When I disable both ssr and csr, I think I will still get a static page, instead of a blank page or white screen. Is my understanding correct?

If I'm correct, then what does it mean by "nothing will be rendered"? Since I still get a rendered page. If I'm wrong, please point out what I have misunderstood?


Solution

  • csr determines whether the page involves JavaScript

    CSR means client-side rendering, which is more than that.

    If there is no SSR, then CSR creates the entire page on the client.
    If there is SSR as well, it will hydrate the page (adding event listeners, etc.).

    The docs are not lying, you get nothing if both options are off.