fix(deps): update dependency eventsource to v5 - #264
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
renovate
Bot
force-pushed
the
renovate/eventsource-5.x
branch
from
August 14, 2026 04:15
6438a11 to
27baced
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.
This PR contains the following updates:
^2.0.2→^5.0.0Release Notes
EventSource/eventsource (eventsource)
v5.1.0Compare Source
Minor Changes
#355
d8370e4Thanks @rexxars! - Typed response body chunks as buffers instead ofunknownReaderLiketyped chunks read off the response body asunknown, but they are handed to aTextDecoder, which only accepts buffers and throws on anything else. So a reader yielding anything else was never usable, and the type said otherwise. It also hid a type error in the client itself, which only surfaces when compiling against TypeScript'sdomlibrary: the node typings resolve the chunk toany, while thedomlibrary resolves it to{}.Chunks are now typed as
Uint8Array | DataView | ArrayBuffer, which is what both the node and DOM typings accept, and which everyfetch()implementation yields. Nothing changes at runtime.If you pass a custom
fetch()that returns a hand-rolled body, and your reader's chunk type is wider than the above, egunknownorany, it will no longer be assignable. Returning a realResponse, or a reader that yieldsUint8Arraychunks, is unaffected.#355
008f07eThanks @rexxars! - Declared thethistype for theonerror,onmessageandonopenpropertiesaddEventListener()already declared that listeners are called with the EventSource instance asthis, but theon*properties did not, sothiswas an implicitanyin handlers assigned to them (an error undernoImplicitThis). They now matchaddEventListener()and the nativeEventSource:Handlers that declare an incompatible
this, eg an unbound class method typed withthis: MyClass, will now be rejected where they were previously accepted. Arrow functions and handlers that ignorethisare unaffected.#355
3512addThanks @rexxars! - Made the exportedEventSourcetype structural, so other implementations can satisfy itEventSourcewas exported as a class holding hard-private (#) fields, which makes TypeScript emit a#privatebrand into the declaration file and turns the exported type nominal. A consumer writingfunction connect(es: EventSource)against this package could not pass the nativeEventSource, a mock, or any other implementation, even when the shape matched exactly.The implementation class is now internal, and
EventSourceis exported as aninterfaceplus a const holding the constructor. As a result:EventSource, along with mocks and stubs, is assignable to the exportedEventSourcetypeglobalThis.EventSourceare interchangeable in both directions, which helps libraries that accept an EventSource implementation to constructEventSourceConstructortype is exported for that caseNothing changes at runtime:
new EventSource(...),instanceof, subclassing, the readyState statics,EventSource.name, inspected output and theeventsource.supports-fetch-overridesymbol all behave as before, and the internal state is still held in real#privatefields.Patch Changes
#357
8e5c691Thanks @rexxars! - FixedoriginandlastEventIdbeing empty on Cloudflare Workersworkerd accepts
datafrom theMessageEventconstructor's init dictionary but silently dropsoriginandlastEventId, so message events dispatched on Cloudflare Workers arrived withoriginset tonullandlastEventIdto an empty string. Both are now assigned explicitly when the constructor did not take them, which leaves every other runtime untouched.v5.0.0Compare Source
Major Changes
b195e70Thanks @rexxars! - - BREAKING CHANGE: The client now fails the connection, emitting an error without reconnecting, if the parser buffers 100 MB without receiving a valid, complete EventSource line. Configure a different limit withmaxBufferSize; ideally, servers should emit smaller chunks or newlines more frequently.require()of ESM, so most CommonJS consumers should continue to work. This removes the dual-package hazard.on*property handler and anaddEventListener()listener are registered for the same event, they now run in registration order instead of always running theon*handler first. Code that relied on the old order can observe a different callback sequence.v4.1.1Compare Source
Patch Changes
6127f40Thanks @rexxars! - Allow avalueof any type inReaderLikedone-results. TypeScript 5.9's DOM lib typesReadableStreamDefaultReader.read()'s done-result as{done: true, value: T | undefined}, so a customfetchreturning aResponse-shaped body no longer satisfiedFetchLikeResponseon TypeScript 5.9 and newer, forcing consumers to hand-wrap the reader.v4.1.0Compare Source
Features
v4.0.0Compare Source
⚠ BREAKING CHANGES
FetchLikeInitis now removed. UseEventSourceFetchInit.Features
Bug Fixes
FetchLikeInittype. UseEventSourceFetchInitinstead. (6786e46)v3.0.7Compare Source
Bug Fixes
v3.0.6Compare Source
Bug Fixes
v3.0.5Compare Source
Bug Fixes
messageandcodeon errors when logging in node.js and deno (f2596b3)v3.0.4Compare Source
Bug Fixes
messageis set on ErrorEvent on network errors (d1dc711)v3.0.3Compare Source
Bug Fixes
v3.0.2Compare Source
Bug Fixes
v3.0.1Compare Source
Bug Fixes
v3.0.0Compare Source
⚠ BREAKING CHANGES
headersin init dict dropped, pass a customfetchfunction instead.fetchfunction instead.https.*options dropped. Pass a customfetchfunction that provides an agent/dispatcher instead.Features
fetch, WebStreams, TypeScript, ESM (#330) (40655f7)Bug Fixes
dispatchEventnow emits entire event object (eb430c0)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.