Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 77b68d2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
ben-reitz
force-pushed
the
browser/execution-context
branch
from
November 3, 2026 10:00
38a32b2 to
9431033
Compare
ben-reitz
marked this pull request as ready for review
November 3, 2026 10:02
ben-reitz
force-pushed
the
browser/execution-context
branch
2 times, most recently
from
November 3, 2026 11:31
2661e4e to
a8a565a
Compare
ben-reitz
force-pushed
the
browser/execution-context
branch
from
November 3, 2026 11:50
a8a565a to
aad50d5
Compare
aron-cf
force-pushed
the
browser/execution-context
branch
from
November 3, 2026 14:17
aad50d5 to
04b2aec
Compare
A host module that keeps state per run, such as a connection it opens
on a run's first call and closes when the run ends, needs to know
which run a call came from. The execution id was only reachable as
the undocumented prefix of `callId`.
Every host module call now gets `context.execution`, a frozen `{ id }`
that is the same for every call of one run. Ids are unique within one
backend, and a module's functions are per backend connection, so the
id alone tells the module's runs apart. The bridge takes the execution
in place of the bare call id prefix and still builds `callId` from its
id. A replayable run keeps its execution id when it resumes, so the
value stays the same across an interruption or an answer.
ben-reitz
force-pushed
the
browser/execution-context
branch
from
November 4, 2026 10:55
04b2aec to
77b68d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A host module can't tell which run a call came from. A module that keeps per-run state, such as one browser session per run, has nothing to key it on:
callIdchanges on every call.Every host module call now gets
context.execution, a frozen{ id }. Every call of one run gets the same value, and a replayable run keeps it when it resumes after a restart or an answer. A module's functions belong to one backend connection, so the id alone tells its runs apart.The bridge now takes the execution rather than a bare call id prefix and still builds
callIdfrom its id, so call ids don't change. A bridge test checks that every call of a run gets the same frozen value, and a workerd test restarts the object mid-run and checks that calls before and after the restart see the same execution. The host module context table indocs/17_isolate_javascript.mdlists the new field.