Releases: joshmossas/event-source-plus
v0.1.8
What's Changed
- chore: update dev dependencies and bump pnpm version by @joshmossas in #20
- feature: add option to customize retry strategy by @joshmossas in #21
Customizing Retry Strategy
Thanks to a suggestion from @alt1o an option has been added to allow you to customize the retry strategy to only retry when an error occurs. This is useful for short lived streams with a fixed length such those commonly used by LLM applications. Currently this option is marked as a beta feature to give time for further testing. For documentation see here
Full Changelog: v0.1.7...v0.1.8
v0.1.7
What's Changed
- docs: add comments to all of the properties in
EventSourcePlusOptions
by @joshmossas in #18
Shout out to @sgerke-1L who noticed a missplaced comment intended for the custom fetch option
Full Changelog: v0.1.6...v0.1.7
v0.1.6
v0.1.5
What's Changed
- feature: support injection of custom fetch implementation by @joshmossas in #15 (closes #9)
- chore: update libs + fix broken integration test by @joshmossas in #16
Full Changelog: v0.1.4...v0.1.5
v0.1.4
What's Changed
- Upgrade ofetch to
v1.4.0
- Upgrade dev dependencies to latest
Full Changelog: v0.1.3...v0.1.4
v0.1.3
What's Changed
- Bugfix: handle scenario when "Content-Type" is
undefined
by @joshmossas in #13
Prevents a potential infinite loop that occurs when the server returns a 200
status code but the Content-Type
header is not set (thanks to @PattaBov reporting)
Full Changelog: v0.1.2...v0.1.3
v0.1.2
What's Changed
- bugfix: add support for
\r\n
and\r
line delimiters by @joshmossas in #11
This gets the event-source-plus parser more compliant with the Server Sent Events specification as outlined in https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
Thanks to @teddybee for reporting the issue that led to discovering this bug.
Full Changelog: v0.1.1...v0.1.2
v0.1.1
What's Changed
- Bugfix: allow undefined values in header object by @joshmossas in #7
Full Changelog: v0.1.0...v0.1.1
v0.1.0
What's Changed
Aync header function support
The header function syntax can now return a promise.
new EventSourcePlus("https://example.com", {
headers: async () => {
// this works now
const token = await getSomeToken();
return {
Authorization: token
}
}
})
This should help remove boilerplate in places when your authentication library uses async functions to retrieve session tokens, and jwts.
Minor Version Bump
Version is being bumped to 0.1.0
this will allow for patches and bug fixes without it being treated as a breaking change. We'll stay on 0.1.x
until a breaking change occurs.