@splitsoftware/splitio-browserjs 0.14.0 → 0.14.2-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.txt +9 -1
- package/cjs/settings/defaults.js +4 -2
- package/cjs/settings/full.js +6 -1
- package/cjs/settings/index.js +6 -1
- package/esm/settings/defaults.js +4 -2
- package/esm/settings/full.js +6 -1
- package/esm/settings/index.js +6 -1
- package/package.json +2 -2
- package/src/settings/defaults.ts +4 -2
- package/src/settings/full.ts +7 -1
- package/src/settings/index.ts +7 -1
- package/types/splitio.d.ts +27 -1
package/CHANGES.txt
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
0.14.2 (August XX, 2024)
|
|
2
|
+
- Updated some transitive dependencies for vulnerability fixes.
|
|
3
|
+
|
|
4
|
+
0.14.1 (June 14, 2024)
|
|
5
|
+
- Updated @splitsoftware/splitio-commons package to version 1.16.0 that includes some vulnerability and bug fixes.
|
|
6
|
+
- Bugfixing - Restored some input validation error logs that were removed in version 0.12.0. The logs inform the user when the `getTreatment(s)` methods are called with an invalid value as feature flag name or flag set name.
|
|
7
|
+
- Bugfixing - Fixed localhost mode to emit SDK_UPDATE when mocked feature flags are updated in the `features` object map of the config object (Related to issue https://github.com/splitio/javascript-browser-client/issues/119).
|
|
8
|
+
|
|
1
9
|
0.14.0 (May 6, 2024)
|
|
2
10
|
- Updated @splitsoftware/splitio-commons package to version 1.14.0 that includes minor updates:
|
|
3
11
|
- Added support for targeting rules based on semantic versions (https://semver.org/).
|
|
@@ -77,7 +85,7 @@
|
|
|
77
85
|
- Updated some dependencies for vulnerability fixes.
|
|
78
86
|
|
|
79
87
|
0.7.0 (June 29, 2022)
|
|
80
|
-
- Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config sync.enabled
|
|
88
|
+
- Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config `sync.enabled`. Running online, Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used.
|
|
81
89
|
- Updated telemetry logic to track the anonymous config for user consent flag set to declined or unknown.
|
|
82
90
|
- Updated submitters logic, to avoid duplicating the post of impressions to Split cloud when the SDK is destroyed while its periodic post of impressions is running.
|
|
83
91
|
- Bugfixing - Updated submitters logic, to avoid dropping impressions and events that are being tracked while POST request is pending.
|
package/cjs/settings/defaults.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.defaults = void 0;
|
|
4
4
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/logger/index");
|
|
5
5
|
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
6
|
-
var packageVersion = '0.14.0';
|
|
6
|
+
var packageVersion = '0.14.2-rc.0';
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
9
9
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
|
@@ -28,7 +28,9 @@ exports.defaults = {
|
|
|
28
28
|
// Maximum amount of time used before notifies me a timeout.
|
|
29
29
|
readyTimeout: 10,
|
|
30
30
|
// Amount of time we will wait before the first push of events.
|
|
31
|
-
eventsFirstPushWindow: 10
|
|
31
|
+
eventsFirstPushWindow: 10,
|
|
32
|
+
// Wait for large segments to emit SDK_READY event.
|
|
33
|
+
waitForLargeSegments: true,
|
|
32
34
|
},
|
|
33
35
|
// Consent is considered granted by default
|
|
34
36
|
userConsent: constants_1.CONSENT_GRANTED,
|
package/cjs/settings/full.js
CHANGED
|
@@ -9,6 +9,7 @@ var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsVali
|
|
|
9
9
|
var pluggableLogger_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/logger/pluggableLogger");
|
|
10
10
|
var builtin_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/localhost/builtin");
|
|
11
11
|
var consent_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/consent");
|
|
12
|
+
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
12
13
|
var params = {
|
|
13
14
|
defaults: defaults_1.defaults,
|
|
14
15
|
acceptKey: true,
|
|
@@ -20,6 +21,10 @@ var params = {
|
|
|
20
21
|
consent: consent_1.validateConsent,
|
|
21
22
|
};
|
|
22
23
|
function settingsFactory(config) {
|
|
23
|
-
|
|
24
|
+
var settings = (0, index_1.settingsValidation)(config, params);
|
|
25
|
+
// @ts-ignore, Override in localhost and consumer modes to properly emit SDK_READY
|
|
26
|
+
if (settings.mode !== constants_1.STANDALONE_MODE)
|
|
27
|
+
settings.sync.largeSegmentsEnabled = false;
|
|
28
|
+
return settings;
|
|
24
29
|
}
|
|
25
30
|
exports.settingsFactory = settingsFactory;
|
package/cjs/settings/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsVali
|
|
|
9
9
|
var pluggableLogger_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/logger/pluggableLogger");
|
|
10
10
|
var pluggable_2 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/localhost/pluggable");
|
|
11
11
|
var consent_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/consent");
|
|
12
|
+
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
12
13
|
var params = {
|
|
13
14
|
defaults: defaults_1.defaults,
|
|
14
15
|
acceptKey: true,
|
|
@@ -20,6 +21,10 @@ var params = {
|
|
|
20
21
|
consent: consent_1.validateConsent,
|
|
21
22
|
};
|
|
22
23
|
function settingsFactory(config) {
|
|
23
|
-
|
|
24
|
+
var settings = (0, index_1.settingsValidation)(config, params);
|
|
25
|
+
// @ts-ignore, Override in localhost and consumer modes to properly emit SDK_READY
|
|
26
|
+
if (settings.mode !== constants_1.STANDALONE_MODE)
|
|
27
|
+
settings.sync.largeSegmentsEnabled = false;
|
|
28
|
+
return settings;
|
|
24
29
|
}
|
|
25
30
|
exports.settingsFactory = settingsFactory;
|
package/esm/settings/defaults.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/esm/logger/index';
|
|
2
2
|
import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
3
|
-
var packageVersion = '0.14.0';
|
|
3
|
+
var packageVersion = '0.14.2-rc.0';
|
|
4
4
|
/**
|
|
5
5
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
6
6
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
|
@@ -25,7 +25,9 @@ export var defaults = {
|
|
|
25
25
|
// Maximum amount of time used before notifies me a timeout.
|
|
26
26
|
readyTimeout: 10,
|
|
27
27
|
// Amount of time we will wait before the first push of events.
|
|
28
|
-
eventsFirstPushWindow: 10
|
|
28
|
+
eventsFirstPushWindow: 10,
|
|
29
|
+
// Wait for large segments to emit SDK_READY event.
|
|
30
|
+
waitForLargeSegments: true,
|
|
29
31
|
},
|
|
30
32
|
// Consent is considered granted by default
|
|
31
33
|
userConsent: CONSENT_GRANTED,
|
package/esm/settings/full.js
CHANGED
|
@@ -6,6 +6,7 @@ import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/es
|
|
|
6
6
|
import { validateLogger } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/logger/pluggableLogger';
|
|
7
7
|
import { validateLocalhostWithDefault } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/localhost/builtin';
|
|
8
8
|
import { validateConsent } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/consent';
|
|
9
|
+
import { STANDALONE_MODE } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
9
10
|
var params = {
|
|
10
11
|
defaults: defaults,
|
|
11
12
|
acceptKey: true,
|
|
@@ -17,5 +18,9 @@ var params = {
|
|
|
17
18
|
consent: validateConsent,
|
|
18
19
|
};
|
|
19
20
|
export function settingsFactory(config) {
|
|
20
|
-
|
|
21
|
+
var settings = settingsValidation(config, params);
|
|
22
|
+
// @ts-ignore, Override in localhost and consumer modes to properly emit SDK_READY
|
|
23
|
+
if (settings.mode !== STANDALONE_MODE)
|
|
24
|
+
settings.sync.largeSegmentsEnabled = false;
|
|
25
|
+
return settings;
|
|
21
26
|
}
|
package/esm/settings/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/es
|
|
|
6
6
|
import { validateLogger } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/logger/pluggableLogger';
|
|
7
7
|
import { validateLocalhost } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/localhost/pluggable';
|
|
8
8
|
import { validateConsent } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/consent';
|
|
9
|
+
import { STANDALONE_MODE } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
9
10
|
var params = {
|
|
10
11
|
defaults: defaults,
|
|
11
12
|
acceptKey: true,
|
|
@@ -17,5 +18,9 @@ var params = {
|
|
|
17
18
|
consent: validateConsent,
|
|
18
19
|
};
|
|
19
20
|
export function settingsFactory(config) {
|
|
20
|
-
|
|
21
|
+
var settings = settingsValidation(config, params);
|
|
22
|
+
// @ts-ignore, Override in localhost and consumer modes to properly emit SDK_READY
|
|
23
|
+
if (settings.mode !== STANDALONE_MODE)
|
|
24
|
+
settings.sync.largeSegmentsEnabled = false;
|
|
25
|
+
return settings;
|
|
21
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.14.0",
|
|
3
|
+
"version": "0.14.2-rc.0",
|
|
4
4
|
"description": "Split SDK for JavaScript on Browser",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
|
|
65
65
|
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@splitsoftware/splitio-commons": "1.
|
|
67
|
+
"@splitsoftware/splitio-commons": "1.16.1-rc.5",
|
|
68
68
|
"@types/google.analytics": "0.0.40",
|
|
69
69
|
"tslib": "^2.3.1",
|
|
70
70
|
"unfetch": "^4.2.0"
|
package/src/settings/defaults.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/
|
|
|
2
2
|
import { ConsentStatus, LogLevel } from '@splitsoftware/splitio-commons/src/types';
|
|
3
3
|
import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
4
4
|
|
|
5
|
-
const packageVersion = '0.14.0';
|
|
5
|
+
const packageVersion = '0.14.2-rc.0';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
@@ -30,7 +30,9 @@ export const defaults = {
|
|
|
30
30
|
// Maximum amount of time used before notifies me a timeout.
|
|
31
31
|
readyTimeout: 10,
|
|
32
32
|
// Amount of time we will wait before the first push of events.
|
|
33
|
-
eventsFirstPushWindow: 10
|
|
33
|
+
eventsFirstPushWindow: 10,
|
|
34
|
+
// Wait for large segments to emit SDK_READY event.
|
|
35
|
+
waitForLargeSegments: true,
|
|
34
36
|
},
|
|
35
37
|
|
|
36
38
|
// Consent is considered granted by default
|
package/src/settings/full.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/sr
|
|
|
6
6
|
import { validateLogger } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/logger/pluggableLogger';
|
|
7
7
|
import { validateLocalhostWithDefault } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/localhost/builtin';
|
|
8
8
|
import { validateConsent } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/consent';
|
|
9
|
+
import { STANDALONE_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
9
10
|
|
|
10
11
|
const params = {
|
|
11
12
|
defaults,
|
|
@@ -19,5 +20,10 @@ const params = {
|
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export function settingsFactory(config: any) {
|
|
22
|
-
|
|
23
|
+
const settings = settingsValidation(config, params);
|
|
24
|
+
|
|
25
|
+
// @ts-ignore, Override in localhost and consumer modes to properly emit SDK_READY
|
|
26
|
+
if (settings.mode !== STANDALONE_MODE) settings.sync.largeSegmentsEnabled = false;
|
|
27
|
+
|
|
28
|
+
return settings;
|
|
23
29
|
}
|
package/src/settings/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/sr
|
|
|
6
6
|
import { validateLogger } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/logger/pluggableLogger';
|
|
7
7
|
import { validateLocalhost } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/localhost/pluggable';
|
|
8
8
|
import { validateConsent } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/consent';
|
|
9
|
+
import { STANDALONE_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
9
10
|
|
|
10
11
|
const params = {
|
|
11
12
|
defaults,
|
|
@@ -19,5 +20,10 @@ const params = {
|
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export function settingsFactory(config: any) {
|
|
22
|
-
|
|
23
|
+
const settings = settingsValidation(config, params);
|
|
24
|
+
|
|
25
|
+
// @ts-ignore, Override in localhost and consumer modes to properly emit SDK_READY
|
|
26
|
+
if (settings.mode !== STANDALONE_MODE) settings.sync.largeSegmentsEnabled = false;
|
|
27
|
+
|
|
28
|
+
return settings;
|
|
23
29
|
}
|
package/types/splitio.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ interface ISettings {
|
|
|
61
61
|
impressionsQueueSize: number,
|
|
62
62
|
telemetryRefreshRate: number,
|
|
63
63
|
segmentsRefreshRate: number,
|
|
64
|
+
largeSegmentsRefreshRate: number,
|
|
64
65
|
offlineRefreshRate: number,
|
|
65
66
|
eventsPushRate: number,
|
|
66
67
|
eventsQueueSize: number,
|
|
@@ -70,7 +71,8 @@ interface ISettings {
|
|
|
70
71
|
readyTimeout: number,
|
|
71
72
|
requestTimeoutBeforeReady: number,
|
|
72
73
|
retriesOnFailureBeforeReady: number,
|
|
73
|
-
eventsFirstPushWindow: number
|
|
74
|
+
eventsFirstPushWindow: number,
|
|
75
|
+
waitForLargeSegments: boolean
|
|
74
76
|
},
|
|
75
77
|
readonly storage?: SplitIO.StorageSyncFactory | SplitIO.StorageAsyncFactory,
|
|
76
78
|
readonly urls: {
|
|
@@ -92,6 +94,8 @@ interface ISettings {
|
|
|
92
94
|
splitFilters: SplitIO.SplitFilter[],
|
|
93
95
|
impressionsMode: SplitIO.ImpressionsMode,
|
|
94
96
|
enabled: boolean,
|
|
97
|
+
largeSegmentsEnabled: boolean,
|
|
98
|
+
flagSpecVersion: string,
|
|
95
99
|
localhostMode?: SplitIO.LocalhostFactory
|
|
96
100
|
},
|
|
97
101
|
readonly userConsent: SplitIO.ConsentStatus
|
|
@@ -963,6 +967,13 @@ declare namespace SplitIO {
|
|
|
963
967
|
* @default 10
|
|
964
968
|
*/
|
|
965
969
|
eventsFirstPushWindow?: number,
|
|
970
|
+
/**
|
|
971
|
+
* Whether the SDK should wait for large segments to be ready before emitting SDK_READY event.
|
|
972
|
+
* It only applies if largeSegmentsEnabled is true.
|
|
973
|
+
* @property {boolean} waitForLargeSegments
|
|
974
|
+
* @default true
|
|
975
|
+
*/
|
|
976
|
+
waitForLargeSegments?: boolean
|
|
966
977
|
},
|
|
967
978
|
/**
|
|
968
979
|
* SDK scheduler settings.
|
|
@@ -1000,6 +1011,13 @@ declare namespace SplitIO {
|
|
|
1000
1011
|
* @default 60
|
|
1001
1012
|
*/
|
|
1002
1013
|
segmentsRefreshRate?: number,
|
|
1014
|
+
/**
|
|
1015
|
+
* The SDK polls Split servers for changes to large segment definitions. This parameter controls this polling period in seconds.
|
|
1016
|
+
* It only applies if largeSegmentsEnabled is true.
|
|
1017
|
+
* @property {number} largeSegmentsRefreshRate
|
|
1018
|
+
* @default 60
|
|
1019
|
+
*/
|
|
1020
|
+
largeSegmentsRefreshRate?: number,
|
|
1003
1021
|
/**
|
|
1004
1022
|
* The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
|
|
1005
1023
|
* @property {number} eventsPushRate
|
|
@@ -1027,6 +1045,14 @@ declare namespace SplitIO {
|
|
|
1027
1045
|
* @default 1
|
|
1028
1046
|
*/
|
|
1029
1047
|
pushRetryBackoffBase?: number,
|
|
1048
|
+
},
|
|
1049
|
+
sync?: ISharedSettings['sync'] & {
|
|
1050
|
+
/**
|
|
1051
|
+
* Enables synchronization of large segments.
|
|
1052
|
+
* @property {boolean} largeSegmentsEnabled
|
|
1053
|
+
* @default false
|
|
1054
|
+
*/
|
|
1055
|
+
largeSegmentsEnabled?: boolean
|
|
1030
1056
|
}
|
|
1031
1057
|
}
|
|
1032
1058
|
/**
|