Re: [ServiceWorker] ServiceWorkerClient to Client (#588)

There is something else that irks me about this design. It does not considers workers fully (we've been seeing this a lot with service workers).

To create a worker, you use `new Worker`. This creates an environment `DedicatedWorkerGlobalScope` you can communicate with from your `Worker` object. In the service worker this is identified by a `Client` object with `type` set to "worker" (not by `Worker`, that would not work for messaging).

It seems weird therefore that for the equivalent case for `Window` (a worker's `DedicatedWorkerGlobalScope`), we would use `Client` for both constructing the environment and identifying it in service workers. And that does indeed fall apart the moment we'd allow `Client` outside of service workers (e.g. when a `Window` wants to create another `Window`), as `Client` works in conjunction with `ServiceWorker` objects in the environments only.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/588#issuecomment-66844862

Received on Friday, 12 December 2014 22:24:37 UTC