denoland / denoland/deploy_feedback

Remote service workers

Open
#83 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
79
Forks
5
PR merge metrics
No merged PRs in 30d

Description

First, some things I love about Deno Deploy for context:

- it implements the `FetchEvent` for handling incoming requests just like service workers do inside a web browser
- `setInterval` can be used to do some task periodically (e.g. check some API that doesn't support pushing updates)
- code running in different regions can communicate with one another via `BroadcastChannel`
- some KV store is on the roadmap (see #76) and [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache) is [planned](https://deno.com/deploy/docs/runtime-api/#future-support) (I could see supporting an `IndexedDB` implementation down the road too)

What I feel is missing and that I suspect will become more important as a KV store and other things becomes available:

- `install` event for setting things up prior to replacing a prior deployment
- `activate` event for cleaning up things from a prior deployment
- `periodicsync` event if that helps in better managing background tasks (using `setInterval` may mean a deployment is never truly idle enough to be replaced by a new deployment)
- programmatic removal of prior deployments

I want to be able to use Deno Deploy a lot like local service workers (and with the same API where possible) except ran in a trusted environment (not in a user agent where code and application data can be modified).

I think that implementing more of the service worker API and events should enable stopping tasks in a prior deployment like periodic syncs, transfering data and/or upgrading caches/data/etc., and transitioning traffic to a new deployment while removing/disabling the prior one (allowing traffic to old ones could be problematic if an install of a new version changes cache/data schemas, etc.).

i.e. I want to be able to manage the life cycle of my deployments more and treat them more like service workers so that I can better transition tasks and data from deployment to deployment.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.