chore(deps): update dependency eventsource to v5.1.0 - #4304
Merged
Conversation
BundleMon (elements)Unchanged files (3)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
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:
5.0.0→5.1.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.Configuration
📅 Schedule: (in timezone Europe/Amsterdam)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, 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.