1.6 KiB
1.6 KiB
CHANGELOG
2.0.1
This release adds support for esmodule imports (see #4).
2.0.0
This release improves the performance of parsing the response stream and fixes some corner cases to better match the spec.
Changed
-
The
id,event, anddatafields are now initialized to empty strings, per the spec (they were previouslyundefined) -
The
onmessagecallback is now called for all messages (it was previously triggered only for messages with adatafield) -
If a message contains multiple
datafields, they will be concatenated together into a single string. For example, the following message:data: Foo data:Bar data data: Bazwill result in
{ data: 'Foo\nBar\n\nBaz' } -
If the server sends an
idfield with an empty value, the last-event-id header will no longer be sent on the next reconnect.
Removed
- The internal
parseStreamfunction has been removed. The parse implementation was previously based on async generators, which required a lot of supporting code in both the typescript-generated polyfill as well as the javascript engine. The new implementation is based on simple callbacks, which should be much faster.
1.0.2
Changed
- Updated examples in readme to fix typos, added more comments.
- Changed
ifstatements in parse.ts to test for specific values instead of truthy/falsy values.
1.0.1
Changed
- Changed the default onOpen validator to allow charset and boundary directives in the content-type