Skip to content

Commit 09afbbe

Browse files
Merge pull request #117 from splitio/development
Release v0.14.0
2 parents d914434 + 6280063 commit 09afbbe

29 files changed

+182
-176
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
0.14.0 (May 6, 2024)
2+
- Updated @splitsoftware/splitio-commons package to version 1.14.0 that includes minor updates:
3+
- Added support for targeting rules based on semantic versions (https://semver.org/).
4+
- Added special impression label "targeting rule type unsupported by sdk" when the matcher type is not supported by the SDK, which returns 'control' treatment.
5+
- Updated Split API client to include the flags spec version query parameter for the `splitChanges` and `auth` endpoints.
6+
17
0.13.2 (March 26, 2024)
28
- Updated some transitive dependencies for vulnerability fixes.
39
- Bugfixing - Added tslib as an explicit dependency to avoid issues with some package managers that don't resolve it automatically as a transitive dependency from @splitsoftware/splitio-commons (Related to issue https://github.com/splitio/javascript-client/issues/795).

package-lock.json

Lines changed: 9 additions & 9 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-browserjs",
3-
"version": "0.13.2",
3+
"version": "0.14.0",
44
"description": "Split SDK for JavaScript on Browser",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",
@@ -64,7 +64,7 @@
6464
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
6565
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
6666
"dependencies": {
67-
"@splitsoftware/splitio-commons": "1.13.1",
67+
"@splitsoftware/splitio-commons": "1.14.0",
6868
"@types/google.analytics": "0.0.40",
6969
"tslib": "^2.3.1",
7070
"unfetch": "^4.2.0"

src/__tests__/browserSuites/events.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function withoutBindingTT(fetchMock, assert) {
6969
assert.ok(client.track, 'client.track should be defined.');
7070
assert.equal(typeof client.track, 'function', 'client.track should be a function.');
7171

72-
// Key binded as with getTreatment.
72+
// Key bound as with getTreatment.
7373
tsStart = Date.now();
7474
assert.ok(client.track('sometraffictype', 'someEvent', 10), 'client.track returns true if an event is added to the queue.');
7575
assert.ok(client.track('othertraffictype', 'genericEvent', 25), 'client.track returns true if event value is null and is added to the queue.');
@@ -96,7 +96,7 @@ export function withoutBindingTT(fetchMock, assert) {
9696
// Not for JS Browser SDK, because it doesn't let bind traffic types to clients
9797
export function bindingTT(fetchMock, assert) {
9898
const localSettings = Object.assign({}, baseSettings);
99-
localSettings.core.trafficType = 'binded_tt';
99+
localSettings.core.trafficType = 'bound_tt';
100100
const splitio = SplitFactory(localSettings);
101101
const client = splitio.client();
102102

@@ -113,20 +113,20 @@ export function bindingTT(fetchMock, assert) {
113113

114114
assert.equal(firstEvent.key, 'facundo@split.io', 'Key should match received value.');
115115
assert.equal(firstEvent.eventTypeId, 'someEvent', 'EventTypeId should match received value.');
116-
assert.equal(firstEvent.trafficTypeName, 'binded_tt', 'TrafficTypeName should match the binded value.');
116+
assert.equal(firstEvent.trafficTypeName, 'bound_tt', 'TrafficTypeName should match the bound value.');
117117
assert.equal(firstEvent.value, 10, 'Value should match the value received on the .track() function.');
118118
assert.equal(typeof firstEvent.timestamp, 'number', 'The timestamp should be a number.');
119119

120120
assert.equal(midEvent.key, 'facundo@split.io', 'Key should match received value.');
121121
assert.equal(midEvent.eventTypeId, 'genericEvent', 'EventTypeId should match received value.');
122-
assert.equal(midEvent.trafficTypeName, 'binded_tt', 'TrafficTypeName should match received value in lowercases.');
122+
assert.equal(midEvent.trafficTypeName, 'bound_tt', 'TrafficTypeName should match received value in lowercases.');
123123
assert.equal(midEvent.value, 24, 'Value should match the value received on the .track() function.');
124124
assert.true(midEvent.timestamp >= tsStart && midEvent.timestamp <= tsEnd, 'The timestamp should be a number with the right value.');
125125
assert.deepEqual(midEvent.properties, { prop1: true, prop2: 'a', prop3: 2, prop4: null, willBeNulled: null }, 'The properties should be correct.');
126126

127127
assert.equal(lastEvent.key, 'facundo@split.io', 'Key should match received value.');
128128
assert.equal(lastEvent.eventTypeId, 'my.checkout.event', 'EventTypeId should match received value.');
129-
assert.equal(lastEvent.trafficTypeName, 'binded_tt', 'TrafficTypeName should match the binded value.');
129+
assert.equal(lastEvent.trafficTypeName, 'bound_tt', 'TrafficTypeName should match the bound value.');
130130
assert.equal(lastEvent.value, null, 'Should have null as value.');
131131
assert.equal(typeof lastEvent.timestamp, 'number', 'The timestamp should be a number.');
132132

@@ -139,7 +139,7 @@ export function bindingTT(fetchMock, assert) {
139139
assert.ok(client.track, 'client.track should be defined.');
140140
assert.equal(typeof client.track, 'function', 'client.track should be a function.');
141141

142-
// Key binded as with getTreatment.
142+
// Key bound as with getTreatment.
143143
tsStart = Date.now();
144144
assert.ok(client.track('someEvent', 10), 'client.track returns true if an event is added to the queue.');
145145
assert.ok(client.track('genericEvent', 25), 'client.track returns true if an event is added to the queue');

src/__tests__/browserSuites/fetch-specific-splits.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export default function fetchSpecificSplits(fetchMock, assert) {
2424
const queryString = queryStrings[i] || '';
2525
let factory;
2626

27-
fetchMock.getOnce(urls.sdk + '/splitChanges?since=-1' + queryString, { status: 200, body: { splits: [], since: -1, till: 1457552620999 } });
28-
fetchMock.getOnce(urls.sdk + '/splitChanges?since=1457552620999' + queryString, { status: 200, body: { splits: [], since: 1457552620999, till: 1457552620999 } });
29-
fetchMock.getOnce(urls.sdk + '/splitChanges?since=1457552620999' + queryString, function () {
27+
fetchMock.getOnce(urls.sdk + '/splitChanges?s=1.1&since=-1' + queryString, { status: 200, body: { splits: [], since: -1, till: 1457552620999 } });
28+
fetchMock.getOnce(urls.sdk + '/splitChanges?s=1.1&since=1457552620999' + queryString, { status: 200, body: { splits: [], since: 1457552620999, till: 1457552620999 } });
29+
fetchMock.getOnce(urls.sdk + '/splitChanges?s=1.1&since=1457552620999' + queryString, function () {
3030
factory.client().destroy().then(() => {
3131
assert.pass(`splitFilters #${i}`);
3232
});

src/__tests__/browserSuites/ignore-ip-addresses-setting.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ export default function (fetchMock, assert) {
101101

102102
// Mock GET endpoints before creating the client
103103
const settings = settingsFactory(config);
104-
fetchMock.getOnce(url(settings, '/splitChanges?since=-1'), { status: 200, body: splitChangesMock1 });
105-
fetchMock.getOnce(url(settings, '/splitChanges?since=1457552620999'), { status: 200, body: { splits: [], since: 1457552620999, till: 1457552620999 } });
104+
fetchMock.getOnce(url(settings, '/splitChanges?s=1.1&since=-1'), { status: 200, body: splitChangesMock1 });
105+
fetchMock.getOnce(url(settings, '/splitChanges?s=1.1&since=1457552620999'), { status: 200, body: { splits: [], since: 1457552620999, till: 1457552620999 } });
106106
fetchMock.getOnce(url(settings, `/mySegments/${encodeURIComponent(config.core.key)}`), { status: 200, body: { mySegments: [] } });
107107

108108
// Init Split client

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const settings = settingsFactory({
2121

2222
export default function (fetchMock, assert) {
2323
// Mocking this specific route to make sure we only get the items we want to test from the handlers.
24-
fetchMock.getOnce(url(settings, '/splitChanges?since=-1'), { status: 200, body: splitChangesMock1 });
25-
fetchMock.get(url(settings, '/splitChanges?since=1457552620999'), { status: 200, body: splitChangesMock2 });
24+
fetchMock.getOnce(url(settings, '/splitChanges?s=1.1&since=-1'), { status: 200, body: splitChangesMock1 });
25+
fetchMock.get(url(settings, '/splitChanges?s=1.1&since=1457552620999'), { status: 200, body: splitChangesMock2 });
2626
fetchMock.get(url(settings, '/mySegments/facundo%40split.io'), { status: 200, body: mySegmentsFacundo });
2727

2828
const splitio = SplitFactory({

src/__tests__/browserSuites/impressions.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ let truncatedTimeFrame;
2424

2525
export default function (fetchMock, assert) {
2626
// Mocking this specific route to make sure we only get the items we want to test from the handlers.
27-
fetchMock.getOnce(url(settings, '/splitChanges?since=-1'), { status: 200, body: splitChangesMock1 });
28-
fetchMock.get(url(settings, '/splitChanges?since=1457552620999'), { status: 200, body: splitChangesMock2 });
27+
fetchMock.getOnce(url(settings, '/splitChanges?s=1.1&since=-1'), { status: 200, body: splitChangesMock1 });
28+
fetchMock.get(url(settings, '/splitChanges?s=1.1&since=1457552620999'), { status: 200, body: splitChangesMock2 });
2929
fetchMock.get(url(settings, '/mySegments/facundo%40split.io'), { status: 200, body: mySegmentsFacundo });
3030

3131
const splitio = SplitFactory({

src/__tests__/browserSuites/manager.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import map from 'lodash/map';
44
import { url } from '../testUtils';
55

66
export default async function (settings, fetchMock, assert) {
7-
fetchMock.getOnce({ url: url(settings, '/splitChanges?since=-1'), overwriteRoutes: true }, { status: 200, body: splitChangesMockReal });
7+
fetchMock.getOnce({ url: url(settings, '/splitChanges?s=1.1&since=-1'), overwriteRoutes: true }, { status: 200, body: splitChangesMockReal });
88

99
const mockSplits = splitChangesMockReal;
1010

src/__tests__/browserSuites/push-corner-cases.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ export function testSplitKillOnReadyFromCache(fetchMock, assert) {
7070
});
7171

7272
// 1 auth request
73-
fetchMock.getOnce(url(settings, `/v2/auth?users=${encodeURIComponent(userKey)}`), { status: 200, body: authPushEnabledNicolas });
73+
fetchMock.getOnce(url(settings, `/v2/auth?s=1.1&users=${encodeURIComponent(userKey)}`), { status: 200, body: authPushEnabledNicolas });
7474
// 2 mySegments requests: initial sync and after SSE opened
7575
fetchMock.get({ url: url(settings, '/mySegments/nicolas%40split.io'), repeat: 2 }, { status: 200, body: { mySegments: [] } });
7676

7777
// 2 splitChanges request: initial sync and after SSE opened. Sync after SPLIT_KILL is not performed because SplitsSyncTask is "executing"
78-
fetchMock.getOnce(url(settings, '/splitChanges?since=25'), { status: 200, body: splitChangesMock1 }, { delay: MILLIS_SPLIT_CHANGES_RESPONSE, /* delay response */ });
79-
fetchMock.getOnce(url(settings, `/splitChanges?since=${splitChangesMock1.till}`), { status: 200, body: { splits: [], since: splitChangesMock1.till, till: splitChangesMock1.till } }, { delay: MILLIS_SPLIT_CHANGES_RESPONSE - 100, /* delay response */ });
78+
fetchMock.getOnce(url(settings, '/splitChanges?s=1.1&since=25'), { status: 200, body: splitChangesMock1 }, { delay: MILLIS_SPLIT_CHANGES_RESPONSE, /* delay response */ });
79+
fetchMock.getOnce(url(settings, `/splitChanges?s=1.1&since=${splitChangesMock1.till}`), { status: 200, body: { splits: [], since: splitChangesMock1.till, till: splitChangesMock1.till } }, { delay: MILLIS_SPLIT_CHANGES_RESPONSE - 100, /* delay response */ });
8080

8181
fetchMock.get(new RegExp('.*'), function (url) {
8282
assert.fail('unexpected GET request with url: ' + url);

0 commit comments

Comments
 (0)