visicraft / visicraft-web

0 stars 0 forks source link

Future: Convert to a SPA (Single-Page Application) #4

Open novacbn opened 4 years ago

novacbn commented 4 years ago

Description

Currently utilizing one of my favorite view technologies Svelte using their universal Sapper application framework. It meets all of the needs of Visicraft, except it doesn't currently have a SPA mode. Where the built application is fully client side. One of the goals of Visicraft is to support end-users being able to use by URL, use it as an offline-first SPA. And maybe even download the webapp and still use it.

So to that end, I'm not considering, as-of right now, to ditch Svelte's official Sapper framework. Especially when it's something they're working on it with sveltejs/sapper#383 and sveltejs/sapper!932. If you have any thoughts on this issue, please respond.

jakobrosenberg commented 4 years ago

Is there something you need from Sapper that you don't get with Svelte?

novacbn commented 4 years ago

(sorry for the late reply, didn't notice the notification)

I love Svelte and think it's perfect, same with Sapper. Sorry if I wasn't clear, I meant my issue is with Sapper. It currently doesn't do only clientside routing, with no SSR.

From my previous times messing around with sapper export, and reading the docs. It loads up the file system routes, calling any route's preload, and then renders them to .html files.

That doesn't seem to support my use case? Since my application isn't a blog or anything with static data, rather a dynamic application that uses RxDB on the client for storage.

novacbn commented 4 years ago

To give an example of how I'm loading data in routes, since it's clientside only. Here's an example route binding to a store. Which is get_races Store, which is then just a wrapper around the RaceCollection.query_races query.

jakobrosenberg commented 4 years ago

I meant my issue is with Sapper. It currently doesn't do only clientside routing, with no SSR.

I had the exact same issue and eventually wrote Svelte-filerouter. It uses the same syntax as Sapper so porting should be fairly easy.

https://github.com/jakobrosenberg/svelte-filerouter

novacbn commented 4 years ago

Neat! That's something I'll look into then later then when I circle back to tackling this.

JohnRSim commented 4 years ago

If you run npm run export - does that not generate support for SPA?