kobweb icon indicating copy to clipboard operation
kobweb copied to clipboard

Support PWA apps

Open bitspittle opened this issue 1 year ago • 2 comments

This is likely going to need a tweak to the worker module to support service workers. After that, we should create an examples/pwa template (or maybe app/pwa?) to showcase it.

bitspittle avatar Apr 02 '24 19:04 bitspittle

Is there an estimate when PWA apps will get supported with Kobweb?

Flavelloni avatar Apr 10 '25 09:04 Flavelloni

@Flavelloni It is not prioritized at the moment, unfortunately. Not even near term.

I'm a bit frustrated with myself that I wrote "This is likely going to need a tweak to the worker module to support service workers." but didn't add more detail. It looks like I did some initial investigation but have since forgotten what that was.

Here is a link to the Service Worker API: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API

And here's an article on service workers in the context of PWAs: https://web.dev/learn/pwa/service-workers

But it's still not yet clear to me how I would even begin to solve this. Would it be part of the worker support in Kobweb or would I need a new pwa plugin?

If someone is interested in taking a look, I can help them navigate the current codebase, but full disclosure I suspect this might be a tricky first-time issue that might require a fair bit of back and forth.

Of course, you could always write your service worker logic in raw JS and include it inside your Kobweb project today, so that might be a useful workaround if needed. Sorry I don't have a better answer here.

bitspittle avatar Apr 10 '25 18:04 bitspittle