- From: Domenic Denicola <notifications@github.com>
- Date: Mon, 16 Jun 2025 21:34:38 -0700
- To: w3ctag/design-reviews <design-reviews@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3ctag/design-reviews/issues/1089/2978903968@github.com>
domenic left a comment (w3ctag/design-reviews#1089) > What if developers set `extendedLifetime: true` to every shared worker just to be "safe" (as it won't break any app) without realizing the resource cost of doing so? I'm not sure how to address that concern, to be honest. It doesn't seem realistic to me that a developer would change the semantics of their application "just in case", in such a dramatic way. If it helps, we haven't seen a mass switch from `fetch()` to `fetch(..., { keepalive: true })` for similar "just in case" reasons. Additionally, the idea that an extended lifetime shared worker won't break any app doesn't seem correct. Just making an existing worker into an extended lifetime worker is somewhat likely to cause bugs in an unprepared application, if the existing worker code assumes that there's an active client. > Since using a shared worker causes so many detailed issues (like mismatching options, reconnection, etc), should we instead introduce a new type of worker that is designed for this use case? Namely, a worker dedicated to one page but has extended lifetime. I think we may have given a false impression of how difficult these issues are to solve, by taking the time to discuss them in detail. The solutions are pretty simple, from what we can see. (Also, despite your "etc", I think there are only 2 such issues listed in the explainer?) A new type of worker would probably have to solve analogous issues, and the complexity of introducing a new global scope type onto the web platform is pretty high, so it doesn't seem worth it to me. Additionally, if we are concerned about waste (as per the first part of your reply), the sharing between multiple clients is a benefit, which your proposal of a new type of worker that's tied to a single page would lose. -- Reply to this email directly or view it on GitHub: https://github.com/w3ctag/design-reviews/issues/1089#issuecomment-2978903968 You are receiving this because you are subscribed to this thread. Message ID: <w3ctag/design-reviews/issues/1089/2978903968@github.com>
Received on Tuesday, 17 June 2025 04:34:43 UTC