Skip to content

Commit

Permalink
Merge pull request #375 from splitio/impressions_toggle_manager
Browse files Browse the repository at this point in the history
[Impressions toggle] SDK Manager
  • Loading branch information
EmilianoSanchez authored Dec 26, 2024
2 parents 0d3b71b + 045e38b commit d83c0ad
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
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

0 comments on commit d83c0ad

Please sign in to comment.