Re: [whatwg/fetch] Make a request's reserved client always be an environment (PR #1955)

shannonbooth left a comment (whatwg/fetch#1955)

> Just to make sure I understand correctly, we need this because while the top-level fetch for the worker will have an environment settings object (from the creator), the subsequent fetches need to use the worker's environment, which isn't yet an environment settings object as we need the full module graph?

Not quite, descendant fetches also use the creators ESO as the fetch client. Reserved client is here is for building the Worker ESO. And worker ESO is needed for the module map/parse realm.

I think Domenic's comment here: https://github.com/whatwg/html/issues/11340#issuecomment-2921215917 explains the intent of these changes are better than I could, it's pretty much exactly the direction I followed. Using environment instead of ESO here breaks the circular dependency of an ESO being needed for both the input of a worker fetch and the output of a worker fetch.

So this is really about fixing the top level fetch, the module script case is handled after the top level request is available, at which point the ESO can be built, and then write that ESO up through to "fetch a worklet/module worker script graph"  (but with a customisation that doesn't need to actually fetch, conceptually kind of like service workers do, since the top level fetch already has bytes). I think this part ties into the question here: https://github.com/whatwg/html/pull/12837#discussion_r3888690910

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1955#issuecomment-5482400210
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1955/c5482400210@github.com>

Received on Monday, 31 August 2026 18:03:27 UTC