Repository navigation
Retire the TS_EVENT_SOURCE autogate - #8695
Conversation
There was a problem hiding this comment.
Superseded by the review of
50838b6a.
This review, of bc31ddb7
✅ Approved — This is a clean removal of a fully rolled-out autogate and the C++ EventSource. The TypeScript global is installed the same way as before, the types are hand-declared, and no issues were found.
Not opened by the correctness review: 4 changed files it was meant to read
types/generated-snapshot/experimental/index.d.tstypes/generated-snapshot/experimental/index.tstypes/generated-snapshot/index.d.tstypes/generated-snapshot/index.ts
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
No security concerns. This change removes code and adds no new trust boundary or input-handling path.
📖 AGENTS.md: ✅ LGTM
The updated test-suite AGENTS.md files match the simplified layout of the test suite.
📋 Code Quality: ✅ LGTM
No issues found. All references to the C++ EventSource and the autogate are removed, the TypeScript global is installed the same way as before, and the hand-written type declarations replace the generated ones.
⚡ Performance: ✅ LGTM
No performance concerns.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: bc31ddb7
npaun
left a comment
There was a problem hiding this comment.
Pretty straightforward deletion
bc31ddb to
50838b6
Compare
There was a problem hiding this comment.
Superseded by the review of
a98f83bc.
This review, of 50838b6a
✅ Approved — This pull request cleanly retires a fully rolled-out autogate and removes the C++ EventSource. The TypeScript global is installed the same way as before, and the hand-written types match the updated snapshots. No issues were found.
Not opened by the correctness review: 4 changed files it was meant to read
types/generated-snapshot/experimental/index.d.tstypes/generated-snapshot/experimental/index.tstypes/generated-snapshot/index.d.tstypes/generated-snapshot/index.ts
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
This change only removes code. It adds no new trust boundary or input-handling path.
📖 AGENTS.md: ✅ LGTM
The updated test-suite AGENTS.md files match the simplified layout of the EventSource tests. The discussion on src/tests/events/AGENTS.md asked whether that guidance belongs in a higher-level directory. The author has said it will move as the work continues, and the file is accurate as written.
📋 Code Quality: ✅ LGTM
This is a clean retirement of the TS_EVENT_SOURCE autogate.
- No leftover references: nothing in the tree still uses
eventsource.h,api::EventSourceorTS_EVENT_SOURCE. - Global installation:
src/per_isolate/main.tsnow installs the TypeScript global unconditionally. It is the old gated block with the guard removed, and the property attributes are the same. - Types:
types/defines/eventsource.d.tskeeps theEventSourceEventSourceInitname. TheEventSource: typeof EventSourceoverride inglobal-scope.hkeeps the global typed now that the C++ nested type is gone. - Generated snapshots: the regenerated
types/generated-snapshot/files move the declaration to the hand-written block. They match the new defines file.
⚡ Performance: ✅ LGTM
No performance concerns.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: 50838b6a
The TS_EVENT_SOURCE autogate has fully rolled out. This removes the
gate and the C++ EventSource in api/eventsource.{h,c++}, leaving the
TypeScript class (src/per_isolate/eventsource/) as the only
implementation. Configs that still name the gate are unaffected:
unknown autogate names are ignored.
Every Worker now gets the class the gate gave, with the differences
from the C++ one that the suite's divergence ledger recorded and the
rollout accepted:
- The constructor inherits from EventTarget's, its `prototype` is
non-writable, and calling it without `new` throws the language's
TypeError.
- The event stream is parsed as the HTML standard specifies: an empty
`event` field dispatches a 'message', a BOM split across chunks is
stripped, an `id` field containing U+0000 is ignored, a `retry`
field counts only if it is all ASCII digits, a `data` field with an
empty value dispatches empty data, a CRLF split across chunks ends
one line, and a reconnection sends the last dispatched event's ID.
- A listener that closes the EventSource drops the rest of the
messages read with that one, and closing an EventSource.from()
source cancels its stream.
- A reconnection's Last-Event-ID is trimmed of HTTP whitespace.
The change itself:
- main.ts loads the module and defines the global in every context,
as it did with the gate on, where JSG_NESTED_TYPE defined the C++
class.
- EW_EVENTSOURCE_ISOLATE_TYPES and workerd/api/eventsource.h are gone;
an embedder that lists the types or includes the header must drop
them.
- With no C++ class to describe it, the TypeScript declaration moves
to types/defines/eventsource.d.ts, and ServiceWorkerGlobalScope
names it through its override. The generated declarations are
unchanged but for their order and the defines file's comment.
types/test/types/eventsource.ts covers them.
- src/tests/events/eventsource/ collapses to one set of cells:
which-impl.js becomes flags.js, each branch keeps its TypeScript
side, and the divergence ledger folds into the suite's
specification. src/tests/events/AGENTS.md describes what retiring a
gate does to a suite. eventsource-test.c++, a unit test of the C++
class's native pump, goes with it.
- The eventsource WPTs that failed only with the C++ class now pass.
format-field-event-empty.any.js, which hung with it, now runs, and
fails as format-field-event.any.js does.
- Comments that compared the TypeScript implementation with the C++
one now describe it on its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
50838b6 to
a98f83b
Compare
There was a problem hiding this comment.
✅ Approved — This pull request cleanly retires a fully rolled-out autogate and removes the C++ EventSource. The TypeScript global is installed the same way as before, and the hand-written types match the updated snapshots. No issues were found.
Not opened by the correctness review: 4 changed files it was meant to read
types/generated-snapshot/experimental/index.d.tstypes/generated-snapshot/experimental/index.tstypes/generated-snapshot/index.d.tstypes/generated-snapshot/index.ts
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
This change only removes code. It adds no new trust boundary or input-handling path.
📖 AGENTS.md: ✅ LGTM
The updated test-suite AGENTS.md files match the simplified layout of the EventSource tests. The discussion on src/tests/events/AGENTS.md asked whether that guidance belongs in a higher-level directory. The author has said it will move as the work continues, and the file is accurate as written.
📋 Code Quality: ✅ LGTM
This is a clean retirement of the TS_EVENT_SOURCE autogate.
- No leftover references: nothing in the tree still uses
eventsource.h,api::EventSourceorTS_EVENT_SOURCE. - Global installation:
src/per_isolate/main.tsnow installs the TypeScript global unconditionally. It is the old gated block with the guard removed, and the property attributes are the same. - Types:
types/defines/eventsource.d.tskeeps theEventSourceEventSourceInitname. TheEventSource: typeof EventSourceoverride inglobal-scope.hkeeps the global typed now that the C++ nested type is gone. - Generated snapshots: the regenerated
types/generated-snapshot/files move the declaration to the hand-written block. They match the new defines file.
⚡ Performance: ✅ LGTM
No performance concerns.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: a98f83bc — same changes as 50838b6a, so this is that commit's review (no new review was run; line numbers are as of 50838b6a)
Remove the C++
EventSourceimplementation