Repository navigation
feat: Add an opt-in fetch-based EventSource entry to the browser SDK - #2033
Merged
Merged
Conversation
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-3151/common-eventsource-node-consumers
branch
from
September 18, 2026 20:55
9c38ea8 to
724e94a
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
from
September 18, 2026 21:36
724e94a to
4fe3c92
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
from
September 21, 2026 13:44
4fe3c92 to
197417a
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
4 times, most recently
from
September 22, 2026 19:53
b1572a2 to
684ed50
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
from
September 22, 2026 20:36
684ed50 to
d5c5d4d
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
from
September 22, 2026 21:44
d5c5d4d to
039c061
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
from
September 23, 2026 16:32
039c061 to
cd08556
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
2 times, most recently
from
September 24, 2026 14:07
e73c276 to
8701dc9
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
from
September 24, 2026 14:23
8701dc9 to
e4e333c
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
from
September 24, 2026 15:20
e4e333c to
7164a19
Compare
joker23
force-pushed
the
skz/sdk-3151/common-eventsource-node-consumers
branch
from
October 7, 2026 15:55
02bfa05 to
4a7be4e
Compare
…ate some comments
…ract test and example docs
kinyoklion
approved these changes
Oct 30, 2026
Merged
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
Adds an opt-in
fetch()-basedEventSourceto the browser SDK behind its own@launchdarkly/js-client-sdk/fetch-eventsourceentry point, so neither the implementation nor its dependency reaches the default bundle. The native browserEventSourceremains the default. Includes theeventSourcefactory option plumbing. The example app moved to #2139 to keep this diff smaller.The browser contract-test entity can be opened with
?eventsource=fetch, which makes every client use the fetch-basedEventSourceand advertise theclient-use-postandclient-event-source-http-errorscapabilities. CI runs the fetch entity against both harnesses. The v2 run (withsuppressions_fetch_eventsource.txt) covers the FDv1 path, includingREPORTstreaming and the poll tags header tests; the stream tags assertions are skipped because the transport strips the tags header. The v3 run (withsuppressions_datamode_changes.txt) covers the FDv2 path, including theusePostPOST streaming variants.The transport does not send the
x-launchdarkly-tagsheader. The streaming service's CORS allow-list does not include it, and the browser preflight would fail.Replaces #2034 and #2048, which GitHub auto-marked merged during a stack reorder; their bot-review history lives there.
Note
Overview
Adds an optional
@launchdarkly/js-client-sdk/fetch-eventsourcesubpath andeventSourceclient option so apps can stream with afetch()-based EventSource instead of the native one, without pulling@launchdarkly/eventsourceinto the default bundle.BrowserRequestsdelegates creation to the configured factory and exposes capabilities (headers, custom method, read timeout) so REPORT / POST streaming can be enabled when the transport supports them;fetchBrowserEventSourcestripsx-launchdarkly-tagson stream requests to avoid CORS preflight failures.CI and contract tests restart the browser entity with
?eventsource=fetch, run extra harness passes (FDv1/FDv2, native vs fetch), and split skip lists (suppressions_fetch_eventsource.txt, tightenedsuppressions_datamode_changes.txt). The entity advertisesclient-use-postandclient-event-source-http-errorsin fetch mode and mapsusePostfrom harness config.StreamingFDv2Basenow classifies status-less filter failures as network errors, dedupes filter vsonerrorfor the same event object, and adds tests for those paths. React CI switches contract-test installs toyarn workspaces focus. Package-config baselines cover the new export.Reviewed by Cursor Bugbot for commit 6b2eac2. Bugbot is set up for automated code reviews on this repo. Configure here.