Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: provide onError, onComment, and onRetry callbacks #15

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

rexxars
Copy link
Owner

@rexxars rexxars commented Oct 19, 2024

BREAKING CHANGE: 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.

BREAKING CHANGE: The ParsedEvent type has been renamed to EventSourceMessage and the type attribute has been removed.

BREAKING CHANGE: The EventSourceCallback type has been removed in favor of the ParserCallbacks interface.

BREAKING CHNAGE: The ReconnectInterval type has been removed in favor of providing the interval directly to the onRetry callback.

BREAKING CHANGE: The ParseEvent type has been removed in favor of providing separate callbacks for each event type.

BREAKING CHANGE: 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.

BREAKING CHANGE: 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.

BREAKING CHANGE: The `ParsedEvent` type has been renamed to `EventSourceMessage` and the `type` attribute has been removed.

BREAKING CHANGE: The `EventSourceCallback` type has been removed in favor of the `ParserCallbacks` interface.

BREAKING CHNAGE: The `ReconnectInterval` type has been removed in favor of providing the interval directly to the `onRetry` callback.

BREAKING CHANGE: The `ParseEvent` type has been removed in favor of providing separate callbacks for each event type.

BREAKING CHANGE: 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.
@rexxars rexxars force-pushed the feat/parser-callbacks branch from d76aeb9 to 2127326 Compare October 19, 2024 22:05
@rexxars rexxars merged commit c544729 into main Oct 19, 2024
6 checks passed
@rexxars rexxars deleted the feat/parser-callbacks branch October 19, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant