Skip to content

v3.0.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 19 Oct 22:09
· 1 commit to main since this release

3.0.0 (2024-10-19)

⚠ BREAKING CHANGES

  • The parser now takes an object of callbacks instead of an onParse callback. This means you do not have to check the type of the event in the onEvent callback, but instead provide separate callbacks for each event type.
  • The ParsedEvent type has been renamed to EventSourceMessage and the type attribute has been removed.
  • The EventSourceCallback type has been removed in favor of the ParserCallbacks interface.
  • The ReconnectInterval type has been removed in favor of providing the interval directly to the onRetry callback.
  • The ParseEvent type has been removed in favor of providing separate callbacks for each event type.
  • The parser has been rewritten to be more specification compliant. Certain rare edge cases may now be handled differently. Mixed CRLF and LF line endings will now be handled correctly. retry fields now have to be completely valid integers to be parsed.

Features

  • provide onError, onComment, and onRetry callbacks (#15) (c544729)

Migration guide

See migration guide: https://github.com/rexxars/eventsource-parser/blob/main/MIGRATE-v3.md


This release is also available on: