Skip to content

Commit d83c0ad

Browse files
Merge pull request #375 from splitio/impressions_toggle_manager
[Impressions toggle] SDK Manager
2 parents 0d3b71b + 045e38b commit d83c0ad

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.1.0 (January XX, 2025)
2+
- Added `trackImpressions` property to SDK Manager's `SplitView` type.
3+
- Updated implementation of the impressions tracker and strategies to support feature flags with impressions tracking disabled.
4+
15
2.0.2 (December 3, 2024)
26
- 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.
37
- 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).

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-commons",
3-
"version": "2.0.2",
3+
"version": "2.0.3-rc.0",
44
"description": "Split JavaScript SDK common components",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

src/sdkManager/__tests__/mocks/output.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"on": "\"color\": \"green\""
99
},
1010
"sets": ["set_a"],
11-
"defaultTreatment": "off"
11+
"defaultTreatment": "off",
12+
"trackImpressions": true
1213
}

src/sdkManager/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ function objectToView(splitObject: ISplit | null): SplitIO.SplitView | null {
3131
treatments: collectTreatments(splitObject),
3232
configs: splitObject.configurations || {},
3333
sets: splitObject.sets || [],
34-
defaultTreatment: splitObject.defaultTreatment
34+
defaultTreatment: splitObject.defaultTreatment,
35+
trackImpressions: splitObject.trackImpressions !== false
3536
};
3637
}
3738

types/splitio.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,10 @@ declare namespace SplitIO {
862862
* The default treatment of the feature flag.
863863
*/
864864
defaultTreatment: string;
865+
/**
866+
* Whether the feature flag has impressions tracking enabled or not.
867+
*/
868+
trackImpressions: boolean;
865869
};
866870
/**
867871
* A promise that resolves to a feature flag view or null if the feature flag is not found.

0 commit comments

Comments
 (0)