Re: [w3ctag/design-reviews] Extended lifetime shared workers (Issue #1089)

xiaochengh left a comment (w3ctag/design-reviews#1089)

Hi @domenic, the TAG discussed extendedLifetime today. The major concern is that it might be a footgun option, as developers might always set it to true just to be "safe" without realizing its cost to the users. And even in legit use cases it might extend the lifetime more than needed.

We are also concerned that allowing too much work after the page is closed might be against the user's expectation, and share the same concern (with https://github.com/WebKit/standards-positions/issues/492#issuecomment-2889954945) that 10 seconds might be too much. However, we agree with this proposal that services workers are inappropriate for the intended use cases, as they are much heavier than a shared worker and are not designed for such types of workload.

Have you considered the alternatives below?
- Make shared workers more [permissible](https://html.spec.whatwg.org/multipage/workers.html#permissible-worker) without any new API: allow UA to keep a SW alive if there are certain pending async operations
- Introduce a SharedWorkerGlobalScope.extendLifetimeUntil(Promise) API (as suggested https://github.com/whatwg/html/issues/10997#issuecomment-2895223470) to explicitly extend the lifetime to a certain point

Thanks!

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1089#issuecomment-2933165460
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1089/2933165460@github.com>

Received on Tuesday, 3 June 2025 02:37:42 UTC