diff --git a/CHANGES.txt b/CHANGES.txt index 02a7bd61..e92cb38d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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). diff --git a/package-lock.json b/package-lock.json index 971d1486..616a6bd8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-commons", - "version": "2.0.2", + "version": "2.0.3-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-commons", - "version": "2.0.2", + "version": "2.0.3-rc.0", "license": "Apache-2.0", "dependencies": { "@types/ioredis": "^4.28.0", diff --git a/package.json b/package.json index 936c23bd..518beb20 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/sdkManager/__tests__/mocks/output.json b/src/sdkManager/__tests__/mocks/output.json index a2af9e81..ef956a69 100644 --- a/src/sdkManager/__tests__/mocks/output.json +++ b/src/sdkManager/__tests__/mocks/output.json @@ -8,5 +8,6 @@ "on": "\"color\": \"green\"" }, "sets": ["set_a"], - "defaultTreatment": "off" + "defaultTreatment": "off", + "trackImpressions": true } diff --git a/src/sdkManager/index.ts b/src/sdkManager/index.ts index 1246f16f..ef43335e 100644 --- a/src/sdkManager/index.ts +++ b/src/sdkManager/index.ts @@ -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 }; } diff --git a/types/splitio.d.ts b/types/splitio.d.ts index f2faa2df..fbae6da3 100644 --- a/types/splitio.d.ts +++ b/types/splitio.d.ts @@ -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.