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

[Impressions toggle] SDK Manager #375

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.1.0 (January XX, 2025)
- Added `trackImpressions` property to SDK Manager's `SplitView` type.
- Updated implementation of the impressions tracker and strategies to support feature flags with impressions tracking disabled.

2.0.2 (December 3, 2024)
- Updated the factory `init` and `destroy` methods to support re-initialization after destruction. This update ensures compatibility of the React SDK with React Strict Mode, where the factory's `init` and `destroy` effects are executed an extra time to validate proper resource cleanup.
- Bugfixing - Sanitize the `SplitSDKMachineName` header value to avoid exceptions on HTTP/S requests when it contains non ISO-8859-1 characters (Related to issue https://github.com/splitio/javascript-client/issues/847).
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-commons",
"version": "2.0.2",
"version": "2.0.3-rc.0",
"description": "Split JavaScript SDK common components",
"main": "cjs/index.js",
"module": "esm/index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/sdkManager/__tests__/mocks/output.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"on": "\"color\": \"green\""
},
"sets": ["set_a"],
"defaultTreatment": "off"
"defaultTreatment": "off",
"trackImpressions": true
}
3 changes: 2 additions & 1 deletion src/sdkManager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function objectToView(splitObject: ISplit | null): SplitIO.SplitView | null {
treatments: collectTreatments(splitObject),
configs: splitObject.configurations || {},
sets: splitObject.sets || [],
defaultTreatment: splitObject.defaultTreatment
defaultTreatment: splitObject.defaultTreatment,
trackImpressions: splitObject.trackImpressions !== false
};
}

Expand Down
4 changes: 4 additions & 0 deletions types/splitio.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,10 @@ declare namespace SplitIO {
* The default treatment of the feature flag.
*/
defaultTreatment: string;
/**
* Whether the feature flag has impressions tracking enabled or not.
*/
trackImpressions: boolean;
};
/**
* A promise that resolves to a feature flag view or null if the feature flag is not found.
Expand Down
Loading