-
Notifications
You must be signed in to change notification settings - Fork 313
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 ID - remove? #1076
Comments
We might use it internally, but its probably safe to remove from the spec. |
This would actually be useful if we could expose it to developers. We need something like this to correctly track upgrades and it's useful to help installing worker not mess with activating workers. Right now we need to do some things to basically fake this, but it's slow so if the browser could just provide developers with the id that it already has that would make things a bit better for developers. |
We used to have the id exposed but removed it in favor of ServiceWorker object equality, if I remember correctly. |
Hmm, it'd be nice if we could bring it back. There are quite a few use cases that we have for it now. Similarly there's no clean way for a specific service worker to get it's own service worker object which would also make using the id much easier. |
Kind of a tangent, but if we bring this back, it would be nice to align it with |
@wanderview that'd be a change from how client ID works now, as the ID wouldn't change between termination & running the next time. @n8schloss I've generated version IDs using hashes before - https://jakearchibald.com/sw.js. Can you talk a little bit on how an ID is better than this? |
Right. Good point. Carry on. |
@jakearchibald, that's our current hack here. It works fine, but like @wanderview said, there's an argument to be made that having it allows for a better level of consistency between SWs and Clients. Also, if the browser is already storing an ID like this it wouldn't be much more work to expose it? Besides that, it really would be nice to have a way for a SW to get it's own ServiceWorker object so it can tell what state it's currently in. I'll file a separate issue for that though. |
F2F: We can remove this - #1077 solves the use case. |
TODO: remove from spec |
So there's no possibility to mention the service worker ID in log entries? :-( |
https://w3c.github.io/ServiceWorker/#dfn-service-worker-id - we don't appear to use this. Does anyone? If not we should remove it.
The text was updated successfully, but these errors were encountered: