Search code examples
javascriptsveltesapper

How to disable SPA-like navigation in Sapper?


i want to disable SPA-like navigation in Sapper (kindly please let's not jump into discussion if it's a right thing to do). I followed https://stackoverflow.com/a/58645471/205747 recommendation and just commented out everything in client.js.

This gives the following requirements of mine satisfied:

[x] HTTP navigation;  
[x] HTML composition achieved with svelte components;  
[x] CSS classed from all components are extracted to single place;  

But the last requirement is not satisfied:

[ ] DOM manipulation logic is handled by svelte;

So the question is - how would I disable SPA-like navigation in favor of HTTP navigation and yet the dom manipulation would be handled by sapper/svelte?

To give another perspective - I'd love svelte/sapper to behave like reacts' renderToStaticMarkup for html and yet have the dom manipulation in a good-old jquery approach, just handled by svelte.

edit: I use https://github.com/beewee22/sapper-template-typescript template as a starting point.

Thanks!


Solution

  • Sapper doesn't support that out-of-the-box today. You'd have to build a custom version of Sapper. You might be able to accomplish that by commenting out init_router in rnutime/src/app/app.ts