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

Service worker runtime environment #13

Open
mfulton26 opened this issue Apr 8, 2024 · 1 comment
Open

Service worker runtime environment #13

mfulton26 opened this issue Apr 8, 2024 · 1 comment

Comments

@mfulton26
Copy link

Can browser service worker runtime be included?

Hono can run in Node, Deno, Bun, Cloudflare Workers, Pages, and can also run in a service worker to power an offline web app.

I'd like to see more things target/support service workers too (e.g. Next.js, Deno Fresh, and HonoX could all be made to work in various runtime environments and could then easily be ran in a service worker).

@pi0
Copy link

pi0 commented Apr 8, 2024

It seems an interesting idea for service-worker to be considered as an standard runtime. Especially because SW is a "vendor-agnostic" variant of edge runtimes.

One point to mention though, SW support at least used to be inconsistent between browser vendors like top-level await behavior between Chrome and FF. I hope it is better now but only mentioning because we might also consider browser vendors for runtime-key specifically like chrome-sw.


For reference, Nitro also allows building servers for service-worker targets (for Nuxt, SolidStart, Analog, or any other fw) offline. This target was under the experimental flag for 3+ years and supporting virtually any server to run on SW not sure if anyone used it in the real-world scenarios though, i think merits more weight in the standard side for me at least than offline usage.

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

No branches or pull requests

2 participants