[w3c/ServiceWorker] Adding a developer-provided name (#1121)

This is a spinoff of https://github.com/whatwg/html/issues/2477 designed specifically to gather feedback from the service worker community.

There we're contemplating adding a web-dev-supplied name:

```js
const w = new Worker(url, { name });
w.name
```

This is anticipated to mostly be used by devtools.

Service workers have an id, but I guess that isn't developer-exposed, and is slated to be removed? https://github.com/w3c/ServiceWorker/issues/1076

For service workers a name seems less important since there's only going to be one per page (right?) and they're pretty identifiable already by their scope. So maybe we should do nothing for service workers? On the other hand @n8schloss mentioned in https://github.com/w3c/ServiceWorker/issues/1076#issuecomment-280767116 that this might be useful for certain use cases.

I guess there's also a bunch of questions about id and clients there that I don't understand.

I'd like some clarity on which path we want to take. Here are the options I see:

- Add `name` to workers and omit it from service workers as they are already distinguishable in the debugger.
- Add `name` to workers and service workers as a developer-helper, but with no tie to service-worker concepts like clients or IDs
- Wait and see if we can figure out a story for service worker IDs/clients and then copy that over to workers.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1121

Received on Monday, 17 April 2017 20:52:09 UTC