Conversation
joker23
added this pull request to stack #2035
September 18, 2026 20:32
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
joker23
force-pushed
the
skz/sdk-3147/common-eventsource-scaffold-helpers
branch
from
September 18, 2026 20:54
31bbcc9 to
7973beb
Compare
joker23
force-pushed
the
skz/sdk-3147/common-eventsource-scaffold-helpers
branch
from
September 18, 2026 21:35
7973beb to
2052981
Compare
joker23
force-pushed
the
skz/sdk-3147/common-eventsource-scaffold-helpers
branch
from
September 21, 2026 13:43
2052981 to
d295aec
Compare
joker23
force-pushed
the
skz/sdk-3147/common-eventsource-scaffold-helpers
branch
2 times, most recently
from
September 22, 2026 14:11
898b24f to
1be3dfe
Compare
Base automatically changed from
skz/sdk-3073/common-eventsource-fdv2-error-handling
to
main
September 22, 2026 19:43
joker23
force-pushed
the
skz/sdk-3147/common-eventsource-scaffold-helpers
branch
5 times, most recently
from
September 23, 2026 16:32
545356d to
e258d54
Compare
joker23
marked this pull request as ready for review
September 23, 2026 16:46
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
joker23
force-pushed
the
skz/sdk-3147/common-eventsource-scaffold-helpers
branch
from
September 23, 2026 19:26
e258d54 to
bfbb399
Compare
joker23
force-pushed
the
skz/sdk-3147/common-eventsource-scaffold-helpers
branch
from
September 24, 2026 14:07
bfbb399 to
19c679b
Compare
This branch has not been deployed
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.
Summary
This PR scaffolds
@launchdarkly/eventsource, a new shared package that will hold a fetch-based EventSource (server-sent events) client for the LaunchDarkly SDKs. This first slice contains the package skeleton and the transport-independent core modules only; the client itself arrives in the next PR in the stack.Package scaffold:
packages/shared/eventsourceat version 0.0.1, with dual ESM/CJS output via tsup, jest, oxlint/oxfmt, and typedoc.Core modules (no client or transport logic yet):
httpHelpers.ts: structural types for the exact WHATWG fetch subset the client uses (FetchFn,FetchResponse, and friends). Any fetch-shaped transport can satisfy them, and the published declarations resolve without the DOM lib.Event.ts/types.ts: the event payload types (MessageEvent,ErrorEvent,OpenEvent,RetryingEvent,ClosedEvent), the typedEventSourceEventMap, and the pluggableEventListenerRegistrycontract. The payload shapes stay interchangeable with the platform types in@launchdarkly/js-sdk-common; thetypeCompatibilitysuite (added with the client) enforces this.listenerRegistry.ts: the default Map-backed registry. Its add/remove/dispatch semantics match Node'sEventEmitter, so an emitter-backed substitute stays interchangeable, except that dispatch of a listenerlesserrortype never throws.retryDelay.ts: the backoff/jitter retry-delay strategy, with a reset interval for connections that stay healthy.parsing.ts/capacity.ts: SSE byte constants, BOM handling, reconnect header-value validation, and buffer growth calculation.Unit tests cover the registry, retry delay, and capacity modules.
Note
Overview
Introduces
@launchdarkly/eventsource(packages/shared/eventsource) as a new shared workspace package (v0.0.1) with build/test/lint tooling, dual ESM/CJS output, TypeDoc, license/changelog, and a dedicated GitHub Actions workflow. The rootpackage.jsonworkspace list andtsconfig.jsonproject reference are updated to include the package.This slice is scaffolding plus transport-independent building blocks for a future fetch-based SSE client—the public
indexstill notes that the fullEventSourceimplementation is coming later. Added modules include fetch-shaped transport types (httpHelpers), W3C-aligned event payloads andEventSourceInitDict(Event,types), a defaultEventListenerRegistrywith EventEmitter-like semantics, reconnect retry delay (backoff/jitter/reset), SSE parsing constants and header validation (parsing), and stream buffer capacity growth (capacity).Unit tests cover the registry, retry strategy, and capacity logic; Jest is configured with
maxWorkers: 1to avoid port collisions from test helpers.Reviewed by Cursor Bugbot for commit 19c679b. Bugbot is set up for automated code reviews on this repo. Configure here.