Skip to content

Commit 976509a

Browse files
Merge pull request #866 from splitio/development
Release v11.2.0
2 parents 732bc1f + 01eca47 commit 976509a

23 files changed

+287
-167
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ permissions:
1919
jobs:
2020
build:
2121
name: Build
22-
# @TODO rollback to ubuntu-latest eventually. ATM, `npm run test-browser` fails when using ubuntu-latest (ubuntu-22.04) with "ERROR [launcher]: Cannot start ChromeHeadless"
23-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-latest
2423
steps:
2524
- name: Checkout code
2625
uses: actions/checkout@v4

.github/workflows/sonar-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
build:
1414
name: Build
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v4

.github/workflows/update-license-year.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
test:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4

CHANGES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
11.2.0 (March 28, 2025)
2+
- Added a new optional argument to the client `getTreatment` methods to allow passing additional evaluation options, such as a map of properties to append to the generated impressions sent to Split backend. Read more in our docs.
3+
- Added two new configuration options for the SDK's `LOCALSTORAGE` storage type to control the behavior of the persisted rollout plan cache in the browser:
4+
- `storage.expirationDays` to specify the validity period of the rollout plan cache in days.
5+
- `storage.clearOnInit` to clear the rollout plan cache on SDK initialization.
6+
- Updated SDK_READY_FROM_CACHE event when using the `LOCALSTORAGE` storage type to be emitted alongside the SDK_READY event if it has not already been emitted.
7+
18
11.1.0 (January 17, 2025)
29
- Added support for the new impressions tracking toggle available on feature flags, both respecting the setting and including the new field being returned on `SplitView` type objects. Read more in our docs.
310
- Updated @splitsoftware/splitio-commons package to version 2.1.0.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Split has built and maintains SDKs for:
6565
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
6666
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
6767
* Angular [Github](https://github.com/splitio/angular-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/6495326064397-Angular-utilities)
68+
* Elixir thin-client [Github](https://github.com/splitio/elixir-thin-client) [Docs](https://help.split.io/hc/en-us/articles/26988707417869-Elixir-Thin-Client-SDK)
6869
* Flutter [Github](https://github.com/splitio/flutter-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/8096158017165-Flutter-plugin)
6970
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
7071
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)

karma/config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@ module.exports = {
1515
],
1616

1717
// Run on Chrome Headless
18-
browsers: [
19-
'ChromeHeadless'
20-
],
18+
customLaunchers: {
19+
ChromeHeadlessNoSandbox: {
20+
base: 'ChromeHeadless',
21+
// Flags required to run in ubuntu-22.04 or above (https://chromium.googlesource.com/chromium/src/+/master/docs/linux/suid_sandbox_development.md)
22+
flags: ['--no-sandbox', '--disable-setuid-sandbox']
23+
}
24+
},
25+
browsers: ['ChromeHeadlessNoSandbox'],
2126

2227
// list of files / patterns to load in the browser
2328
files: [

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio",
3-
"version": "11.1.0",
3+
"version": "11.2.0",
44
"description": "Split SDK",
55
"files": [
66
"README.md",
@@ -38,7 +38,7 @@
3838
"node": ">=14.0.0"
3939
},
4040
"dependencies": {
41-
"@splitsoftware/splitio-commons": "2.1.0",
41+
"@splitsoftware/splitio-commons": "2.2.0",
4242
"bloom-filters": "^3.0.4",
4343
"ioredis": "^4.28.0",
4444
"js-yaml": "^3.13.1",

src/__tests__/browserSuites/impressions-listener.spec.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function (assert) {
4646
const testAttrs = { is_test: true };
4747

4848
// Impression listener is shared across all client instances and does not get affected by configurations.
49-
client.getTreatment('hierarchical_splits_test');
49+
client.getTreatment('hierarchical_splits_test', undefined, { properties: { prop1: 'prop-value' } });
5050
client2.getTreatment('qc_team');
5151
client2.getTreatmentWithConfig('qc_team'); // Validate that the impression is the same.
5252
client3.getTreatment('qc_team', testAttrs);
@@ -58,7 +58,8 @@ export default function (assert) {
5858
treatment: 'no',
5959
bucketingKey: 'impr_bucketing_2',
6060
label: 'default rule',
61-
pt: undefined
61+
pt: undefined,
62+
properties: undefined
6263
};
6364

6465
assert.equal(listener.logImpression.callCount, 4, 'Impression listener logImpression method should be called after we call client.getTreatment, once per each impression generated.');
@@ -71,7 +72,7 @@ export default function (assert) {
7172
bucketingKey: undefined,
7273
label: 'expected label',
7374
changeNumber: 2828282828,
74-
pt: undefined
75+
properties: '{"prop1":"prop-value"}'
7576
},
7677
attributes: undefined,
7778
...metaData

src/__tests__/browserSuites/impressions.debug.spec.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ export default function (fetchMock, assert) {
6363
k: '[email protected]', t: 'o.n', m: data[0].i[1].m, c: 828282828282, r: 'another expected label', pt: data[0].i[0].m,
6464
}, {
6565
k: '[email protected]', t: 'o.n', m: data[0].i[2].m, c: 828282828282, r: 'another expected label', pt: data[0].i[1].m
66+
}, {
67+
k: '[email protected]', t: 'o.n', m: data[0].i[3].m, c: 828282828282, r: 'another expected label', properties: '{"prop1":"value1"}'
68+
}, {
69+
k: '[email protected]', t: 'o.n', m: data[0].i[4].m, c: 828282828282, r: 'another expected label', properties: '{"prop1":"value2"}'
70+
}, {
71+
k: '[email protected]', t: 'o.n', m: data[0].i[5].m, c: 828282828282, r: 'another expected label', properties: '{"prop1":"value3"}'
72+
}, {
73+
k: '[email protected]', t: 'o.n', m: data[0].i[6].m, c: 828282828282, r: 'another expected label', properties: '{"prop1":"value4"}'
6674
}]
6775
}]);
6876

@@ -75,15 +83,15 @@ export default function (fetchMock, assert) {
7583

7684
fetchMock.postOnce(url(settings, '/testImpressions/count'), (url, opts) => {
7785
assert.deepEqual(JSON.parse(opts.body), {
78-
pf: [{ f: 'always_on_track_impressions_false', m: truncatedTimeFrame, rc: 1 }]
86+
pf: [{ f: 'always_on_impressions_disabled_true', m: truncatedTimeFrame, rc: 1 }]
7987
}, 'We should generate impression count for the feature with track impressions disabled.');
8088

8189
return 200;
8290
});
8391

8492
fetchMock.postOnce(url(settings, '/v1/keys/cs'), (url, opts) => {
8593
assert.deepEqual(JSON.parse(opts.body), {
86-
keys: [{ fs: ['always_on_track_impressions_false'], k: '[email protected]' }]
94+
keys: [{ fs: ['always_on_impressions_disabled_true'], k: '[email protected]' }]
8795
}, 'We should track unique keys for the feature with track impressions disabled.');
8896

8997
return 200;
@@ -95,6 +103,12 @@ export default function (fetchMock, assert) {
95103
client.getTreatment('split_with_config');
96104
client.getTreatment('split_with_config');
97105
client.getTreatment('split_with_config');
98-
assert.equal(client.getTreatment('always_on_track_impressions_false'), 'on');
106+
assert.equal(client.getTreatment('always_on_impressions_disabled_true'), 'on');
107+
108+
// with properties
109+
assert.equal(client.getTreatment('split_with_config', undefined, { properties: { prop1: 'value1' } }), 'o.n');
110+
assert.equal(client.getTreatments(['split_with_config'], undefined, { properties: { prop1: 'value2' } }).split_with_config, 'o.n');
111+
assert.equal(client.getTreatmentWithConfig('split_with_config', undefined, { properties: { prop1: 'value3' } }).treatment, 'o.n');
112+
assert.equal(client.getTreatmentsWithConfig(['split_with_config'], undefined, { properties: { prop1: 'value4' } }).split_with_config.treatment, 'o.n');
99113
});
100114
}

0 commit comments

Comments
 (0)