Skip to content

Make a request's reserved client always be an environment - #1955

Merged
annevk merged 1 commit into
whatwg:mainfrom
shannonbooth:worker-html-integration
Sep 1, 2026
Merged

Make a request's reserved client always be an environment#1955
annevk merged 1 commit into
whatwg:mainfrom
shannonbooth:worker-html-integration

Conversation

@shannonbooth

Copy link
Copy Markdown
Member

@annevk
annevk force-pushed the worker-html-integration branch from e13be1f to 6d7f22d Compare August 31, 2026 06:22
@annevk

annevk commented Aug 31, 2026

Copy link
Copy Markdown
Member

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?

@shannonbooth

shannonbooth commented Aug 31, 2026

Copy link
Copy Markdown
Member Author

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: whatwg/html#11340 (comment) explains the intent of these changes much 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 wire 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: whatwg/html#12837 (comment)

@annevk
annevk merged commit 6089fa1 into whatwg:main Sep 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants