-
Notifications
You must be signed in to change notification settings - Fork 9
feat: stream vardata #176
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
Draft
zhukaihan
wants to merge
14
commits into
main
Choose a base branch
from
stream-vardata
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: stream vardata #176
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds vardata streaming functionality to the Amplitude Experiment Javascript Client SDK. Key changes include:
- Introducing the SSEStream and related streaming components in the core package.
- Implementing the SdkStreamEvaluationApi for streaming variant data and updating tests accordingly.
- Integrating streaming functionality into the ExperimentClient with accompanying updates in configuration and updaters.
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/experiment-core/test/utils.ts | Added a sleep utility for test timing. |
packages/experiment-core/test/transport/stream.test.ts | New tests for verifying SSEStream connection, keepalive, and error handling. |
packages/experiment-core/test/api/evaluation-stream-api.test.ts | New tests for stream-based variant evaluation; note duplicate test descriptions. |
packages/experiment-core/src/transport/stream.ts | Added SSEStream implementation with keepalive and automatic reconnection logic. |
packages/experiment-core/src/api/evaluation-stream-api.ts | Implements the streaming evaluation API using SSEStream. |
packages/experiment-core/src/index.ts | Re-exports new streaming components. |
packages/experiment-browser/test/util/misc.ts | Added sleep utility for browser tests. |
packages/experiment-browser/test/client.test.ts | Updated tests to cover the new stream variants integration. |
packages/experiment-browser/src/util/updaters.ts | Added updaters for handling streaming and fallback for variant updates. |
packages/experiment-browser/src/transport/stream.ts | Introduces defaultSseProvider using EventSource. |
packages/experiment-browser/src/experimentClient.ts | Updated ExperimentClient to support streamVariants with new updater integration. |
packages/experiment-browser/src/config.ts | Added configuration options for streamVariants and its server URL. |
Files not reviewed (1)
- packages/experiment-browser/package.json: Language not supported
Comments suppressed due to low confidence (1)
packages/experiment-core/test/api/evaluation-stream-api.test.ts:140
- Duplicate test description 'stream error stops api' detected in evaluation-stream-api tests; consider renaming one test to clarify different error scenarios.
test('stream error stops api', async () => {
bgiori
approved these changes
Apr 23, 2025
8e10fe0
to
1417d7c
Compare
1417d7c
to
5a8f7e2
Compare
ad264c3
to
d1d1ea8
Compare
d1d1ea8
to
3e38058
Compare
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 vardata streaming feature.
Checklist