Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples to use Vita PWA for full offline support in the browser. #2004

Open
thruflo opened this issue Nov 20, 2024 · 6 comments
Open
Labels
example good first issue Good for newcomers help wanted Extra attention is needed

Comments

@thruflo
Copy link
Contributor

thruflo commented Nov 20, 2024

We switched to Vita as the bundler for our examples partly because then it's trivial to use https://vite-pwa-org.netlify.app to make them work fully offline (i.e.: the page loads even when refreshed / loaded when offline).

We haven't done this yet, as per:

image

Let's do it.

@thruflo thruflo added good first issue Good for newcomers help wanted Extra attention is needed example labels Nov 20, 2024
@KyleAMathews
Copy link
Contributor

👀 I have a bit of phobia of service workers from a lot of painful scars in the past. Maybe just keep the examples bare bones to avoid extra layers that we need to debug?

@thruflo
Copy link
Contributor Author

thruflo commented Nov 20, 2024

The benefit is fairly large here: we can demonstrate working offline systems which is a key benefit of Electric sync.

I'm under the impression that https://vite-pwa-org.netlify.app/guide/ abstracts this for us and we just include their generated manifest etc. and it just works. Do you think that it won't / will we hit issues because of this?

@KyleAMathews
Copy link
Contributor

We had a lot of issues with service workers at Gatsby and while Google pushed the various PWA technologies really hard in the mid 2010s, they by and large haven't been adopted by the industry as they can cause a lot of trouble as SW are permanently installed on clients and almost impossible to get rid of if you make certain mistakes.

Perhaps vite-pwa has solved all the problems and it's trivial to use but... I suspect not.

That being said, I agree it'd be nice to demo as people will want to see it — how about we just add it to one example and see how it goes? E.g. the tanstack one as that's the only one that has offline write support atm as well.

@thruflo
Copy link
Contributor Author

thruflo commented Nov 20, 2024

Yup, maybe the big linearlite that Sam's working on merging instead / as well? That's a key one that we demo and would be nice to show working fully offline (unlike Linear!).

@KyleAMathews
Copy link
Contributor

😂 we'll rename it to linear-better 😎

@thruflo
Copy link
Contributor Author

thruflo commented Nov 20, 2024

@samwillis fancy vite-pwaing up big linearlite whilst you're there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants