Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Add option to disable SPA-like navigation #1614

Closed
toinbis opened this issue Oct 23, 2020 · 2 comments
Closed

Add option to disable SPA-like navigation #1614

toinbis opened this issue Oct 23, 2020 · 2 comments

Comments

@toinbis
Copy link

toinbis commented Oct 23, 2020

Is your feature request related to a problem? Please describe.
My project bussiness requirements strictly forbids SPA-like navigation.

Describe the solution you'd like
An option to allow sapper to behave on the 2nd, 3rd. etc. request the same way it does on the first - i.e. a standard http request->response cycle.

Describe alternatives you've considered
Alternative is to use express.js and svelte and reinvent the other sapper features which i'd otherwise love using.

How important is this feature to you?
TBH(as the issue template suggested to be) and not to be flamed about - i'm not sure everyone understands all the risks involved in having a website with two states (initial HTTPish response vs 2nd javascript'ish response). SPA-like navigation also potentially might hurt UX in many ways(though that might sound counterintuitive at first sight). Not having an option to disable SPA-like navigation suggests that it's the standard default and recommended practice though in many bussiness domains(i.e. ecommerce) that might be completely the opposite. Having an option to revert to HTTP based navigation at least signals that such architectural choice/decision exists and is therefore worth consideration.

Additional context
I've elaborated a bit more on requirements here: https://stackoverflow.com/questions/64507516/how-to-disable-spa-like-navigation-in-sapper/64508343#64508343 , the question has been answered with a recommendation how to hack sapper to achive what I need, though I'd prefer to get such option out of box.

@toinbis toinbis changed the title Option to disable SPA-like navigation Add option to disable SPA-like navigation Oct 23, 2020
@antony
Copy link
Member

antony commented Oct 25, 2020

You can also achieve this behaviour by marking every route as rel=external.

Allowing this mode in Sapper would remove most of what Sapper provides to you as a user, result in a very slow site in comparison, and as such, is unlikely to ever be supported.

@antony antony closed this as completed Oct 25, 2020
@RayRemnant
Copy link

RayRemnant commented Mar 12, 2021

Hey, I've began to have the same concerns recently, mostly by the dimension of my JS and the fact that the hydration process is beginning to consume a lot of CPU resources (based on what Lighthouse is telling me).

Anyway, I think it should be mentioned that with SvelteKit you can supposedly disable client side rendering / routing.

I was thinking that the best approach for a pure static site, in my case a blog, would be to hydrate with the HTML needed, and not with the JSON data. Just leaving my 2 cents.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants