Skip to content

True SPA mode #754

@Rich-Harris

Description

@Rich-Harris

We now have the ssr: false option which gives us something close to SPA mode: https://kit.svelte.dev/docs#ssr-and-javascript

It doesn't get us all the way there though, because in a typical SPA you would likely want to generate a single fallback page that handles all requests — for example Surge lets you add a 200.html file, while Netlify allows you to add something like this to _redirects:

/*    /200.html   200

By contrast, SvelteKit expects to generate (whether at runtime or prerender time) an HTML page that includes no content, but does include information about the route that should be hydrated, since the router isn't invoked on load. To create a true SPA, SvelteKit needs to create a content-less file that doesn't contain any route information, and the router needs to figure out what JS to load and execute.

I'm not certain how best to do this in a provider-agnostic way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions