@splitsoftware/splitio-browserjs 0.15.1-rc.0 → 1.0.0-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 +8 -6
- package/cjs/full/index.js +1 -5
- package/cjs/full/umd.js +0 -4
- package/cjs/index.js +1 -5
- package/cjs/settings/defaults.js +1 -3
- package/esm/full/index.js +0 -2
- package/esm/full/umd.js +0 -4
- package/esm/index.js +0 -2
- package/esm/settings/defaults.js +1 -3
- package/package.json +3 -7
- package/src/full/index.ts +0 -2
- package/src/full/umd.ts +0 -4
- package/src/index.ts +0 -2
- package/src/settings/defaults.ts +1 -3
- package/types/full/index.d.ts +1 -15
- package/types/index.d.ts +1 -15
- package/types/splitio.d.ts +13 -161
- package/scripts/ga-to-split-autorequire.js +0 -1
package/CHANGES.txt
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
0.
|
|
2
|
-
- Added
|
|
3
|
-
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
1.0.0 (October XX, 2024)
|
|
2
|
+
- Added support for targeting rules based on large segments for browsers.
|
|
3
|
+
- Added `factory.destroy()` method, which invokes the `destroy` method of all clients created by the factory.
|
|
4
|
+
- Updated @splitsoftware/splitio-commons package to version 2.0.0 that includes major updates and updated some transitive dependencies for vulnerability fixes.
|
|
5
|
+
- BREAKING CHANGES:
|
|
6
|
+
- Removed internal ponyfills for the `Map` and `Set` global objects, dropping support for IE and other outdated browsers. The SDK now requires the runtime environment to support these features natively or provide a polyfill.
|
|
7
|
+
- Removed the deprecated `GoogleAnalyticsToSplit` and `SplitToGoogleAnalytics` pluggable integration modules, along with the related interfaces in the TypeScript definitions.
|
|
6
8
|
|
|
7
9
|
0.15.0 (September 13, 2024)
|
|
8
10
|
- Updated @splitsoftware/splitio-commons package to version 1.17.0 that includes minor updates:
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
- Updated some transitive dependencies for vulnerability fixes.
|
|
59
61
|
- Updated @splitsoftware/splitio-commons package to version 1.8.3 that includes:
|
|
60
62
|
- Updated SDK_READY_TIMED_OUT event to be emitted immediately when a connection error occurs using pluggable storage (i.e., when the wrapper `connect` promise is rejected) in consumer and partial consumer modes.
|
|
61
|
-
- Bugfixing - The `destroy` method has been updated to immediately flag the SDK client as destroyed, to prevent unexpected
|
|
63
|
+
- Bugfixing - The `destroy` method has been updated to immediately flag the SDK client as destroyed, to prevent unexpected behaviors when `getTreatment` and `track` methods are called synchronously after `destroy` method is called.
|
|
62
64
|
|
|
63
65
|
0.9.5 (May 15, 2023)
|
|
64
66
|
- Updated @splitsoftware/splitio-commons package to version 1.8.2 that includes minor improvements.
|
package/cjs/full/index.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PluggableStorage = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.
|
|
3
|
+
exports.PluggableStorage = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
4
4
|
var splitFactory_1 = require("./splitFactory");
|
|
5
5
|
Object.defineProperty(exports, "SplitFactory", { enumerable: true, get: function () { return splitFactory_1.SplitFactory; } });
|
|
6
6
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/storages/inLocalStorage/index");
|
|
7
7
|
Object.defineProperty(exports, "InLocalStorage", { enumerable: true, get: function () { return index_1.InLocalStorage; } });
|
|
8
|
-
var GoogleAnalyticsToSplit_1 = require("@splitsoftware/splitio-commons/cjs/integrations/ga/GoogleAnalyticsToSplit");
|
|
9
|
-
Object.defineProperty(exports, "GoogleAnalyticsToSplit", { enumerable: true, get: function () { return GoogleAnalyticsToSplit_1.GoogleAnalyticsToSplit; } });
|
|
10
|
-
var SplitToGoogleAnalytics_1 = require("@splitsoftware/splitio-commons/cjs/integrations/ga/SplitToGoogleAnalytics");
|
|
11
|
-
Object.defineProperty(exports, "SplitToGoogleAnalytics", { enumerable: true, get: function () { return SplitToGoogleAnalytics_1.SplitToGoogleAnalytics; } });
|
|
12
8
|
var ErrorLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/ErrorLogger");
|
|
13
9
|
Object.defineProperty(exports, "ErrorLogger", { enumerable: true, get: function () { return ErrorLogger_1.ErrorLogger; } });
|
|
14
10
|
var WarnLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/WarnLogger");
|
package/cjs/full/umd.js
CHANGED
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
var splitFactory_1 = require("./splitFactory");
|
|
5
5
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/storages/inLocalStorage/index");
|
|
6
|
-
var GoogleAnalyticsToSplit_1 = require("@splitsoftware/splitio-commons/cjs/integrations/ga/GoogleAnalyticsToSplit");
|
|
7
|
-
var SplitToGoogleAnalytics_1 = require("@splitsoftware/splitio-commons/cjs/integrations/ga/SplitToGoogleAnalytics");
|
|
8
6
|
var ErrorLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/ErrorLogger");
|
|
9
7
|
var WarnLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/WarnLogger");
|
|
10
8
|
var InfoLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/InfoLogger");
|
|
@@ -12,8 +10,6 @@ var DebugLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/D
|
|
|
12
10
|
// Include all pluggable modules as properties to expose at the global `splitio` object
|
|
13
11
|
splitFactory_1.SplitFactory.SplitFactory = splitFactory_1.SplitFactory;
|
|
14
12
|
splitFactory_1.SplitFactory.InLocalStorage = index_1.InLocalStorage;
|
|
15
|
-
splitFactory_1.SplitFactory.GoogleAnalyticsToSplit = GoogleAnalyticsToSplit_1.GoogleAnalyticsToSplit;
|
|
16
|
-
splitFactory_1.SplitFactory.SplitToGoogleAnalytics = SplitToGoogleAnalytics_1.SplitToGoogleAnalytics;
|
|
17
13
|
splitFactory_1.SplitFactory.ErrorLogger = ErrorLogger_1.ErrorLogger;
|
|
18
14
|
splitFactory_1.SplitFactory.WarnLogger = WarnLogger_1.WarnLogger;
|
|
19
15
|
splitFactory_1.SplitFactory.InfoLogger = InfoLogger_1.InfoLogger;
|
package/cjs/index.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PluggableStorage = exports.LocalhostFromObject = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.
|
|
3
|
+
exports.PluggableStorage = exports.LocalhostFromObject = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
4
4
|
var splitFactory_1 = require("./splitFactory");
|
|
5
5
|
Object.defineProperty(exports, "SplitFactory", { enumerable: true, get: function () { return splitFactory_1.SplitFactory; } });
|
|
6
6
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/storages/inLocalStorage/index");
|
|
7
7
|
Object.defineProperty(exports, "InLocalStorage", { enumerable: true, get: function () { return index_1.InLocalStorage; } });
|
|
8
|
-
var GoogleAnalyticsToSplit_1 = require("@splitsoftware/splitio-commons/cjs/integrations/ga/GoogleAnalyticsToSplit");
|
|
9
|
-
Object.defineProperty(exports, "GoogleAnalyticsToSplit", { enumerable: true, get: function () { return GoogleAnalyticsToSplit_1.GoogleAnalyticsToSplit; } });
|
|
10
|
-
var SplitToGoogleAnalytics_1 = require("@splitsoftware/splitio-commons/cjs/integrations/ga/SplitToGoogleAnalytics");
|
|
11
|
-
Object.defineProperty(exports, "SplitToGoogleAnalytics", { enumerable: true, get: function () { return SplitToGoogleAnalytics_1.SplitToGoogleAnalytics; } });
|
|
12
8
|
var ErrorLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/ErrorLogger");
|
|
13
9
|
Object.defineProperty(exports, "ErrorLogger", { enumerable: true, get: function () { return ErrorLogger_1.ErrorLogger; } });
|
|
14
10
|
var WarnLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/WarnLogger");
|
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.
|
|
6
|
+
var packageVersion = '1.0.0-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'.
|
|
@@ -29,8 +29,6 @@ exports.defaults = {
|
|
|
29
29
|
readyTimeout: 10,
|
|
30
30
|
// Amount of time we will wait before the first push of events.
|
|
31
31
|
eventsFirstPushWindow: 10,
|
|
32
|
-
// Wait for large segments to emit SDK_READY event.
|
|
33
|
-
waitForLargeSegments: true,
|
|
34
32
|
},
|
|
35
33
|
// Consent is considered granted by default
|
|
36
34
|
userConsent: constants_1.CONSENT_GRANTED,
|
package/esm/full/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { SplitFactory } from './splitFactory';
|
|
2
2
|
export { InLocalStorage } from '@splitsoftware/splitio-commons/esm/storages/inLocalStorage/index';
|
|
3
|
-
export { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/esm/integrations/ga/GoogleAnalyticsToSplit';
|
|
4
|
-
export { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/esm/integrations/ga/SplitToGoogleAnalytics';
|
|
5
3
|
export { ErrorLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/ErrorLogger';
|
|
6
4
|
export { WarnLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/WarnLogger';
|
|
7
5
|
export { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/InfoLogger';
|
package/esm/full/umd.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { SplitFactory } from './splitFactory';
|
|
3
3
|
import { InLocalStorage } from '@splitsoftware/splitio-commons/esm/storages/inLocalStorage/index';
|
|
4
|
-
import { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/esm/integrations/ga/GoogleAnalyticsToSplit';
|
|
5
|
-
import { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/esm/integrations/ga/SplitToGoogleAnalytics';
|
|
6
4
|
import { ErrorLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/ErrorLogger';
|
|
7
5
|
import { WarnLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/WarnLogger';
|
|
8
6
|
import { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/InfoLogger';
|
|
@@ -10,8 +8,6 @@ import { DebugLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/D
|
|
|
10
8
|
// Include all pluggable modules as properties to expose at the global `splitio` object
|
|
11
9
|
SplitFactory.SplitFactory = SplitFactory;
|
|
12
10
|
SplitFactory.InLocalStorage = InLocalStorage;
|
|
13
|
-
SplitFactory.GoogleAnalyticsToSplit = GoogleAnalyticsToSplit;
|
|
14
|
-
SplitFactory.SplitToGoogleAnalytics = SplitToGoogleAnalytics;
|
|
15
11
|
SplitFactory.ErrorLogger = ErrorLogger;
|
|
16
12
|
SplitFactory.WarnLogger = WarnLogger;
|
|
17
13
|
SplitFactory.InfoLogger = InfoLogger;
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { SplitFactory } from './splitFactory';
|
|
2
2
|
export { InLocalStorage } from '@splitsoftware/splitio-commons/esm/storages/inLocalStorage/index';
|
|
3
|
-
export { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/esm/integrations/ga/GoogleAnalyticsToSplit';
|
|
4
|
-
export { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/esm/integrations/ga/SplitToGoogleAnalytics';
|
|
5
3
|
export { ErrorLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/ErrorLogger';
|
|
6
4
|
export { WarnLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/WarnLogger';
|
|
7
5
|
export { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/InfoLogger';
|
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.
|
|
3
|
+
var packageVersion = '1.0.0-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'.
|
|
@@ -26,8 +26,6 @@ export var defaults = {
|
|
|
26
26
|
readyTimeout: 10,
|
|
27
27
|
// Amount of time we will wait before the first push of events.
|
|
28
28
|
eventsFirstPushWindow: 10,
|
|
29
|
-
// Wait for large segments to emit SDK_READY event.
|
|
30
|
-
waitForLargeSegments: true,
|
|
31
29
|
},
|
|
32
30
|
// Consent is considered granted by default
|
|
33
31
|
userConsent: CONSENT_GRANTED,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
4
|
"description": "Split SDK for JavaScript on Browser",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"esm",
|
|
15
15
|
"src",
|
|
16
16
|
"types",
|
|
17
|
-
"full"
|
|
18
|
-
"scripts/ga-to-split-autorequire.js"
|
|
17
|
+
"full"
|
|
19
18
|
],
|
|
20
19
|
"scripts": {
|
|
21
20
|
"check": "npm run check:lint && npm run check:types && npm run check:version",
|
|
@@ -27,7 +26,6 @@
|
|
|
27
26
|
"build:cjs": "rimraf cjs && tsc -outDir cjs -m CommonJS && ./scripts/build_cjs_replace_imports.sh",
|
|
28
27
|
"build:umd-visualizer": "rimraf umd && rollup --config rollup.visualizer.config.js",
|
|
29
28
|
"build:umd": "rimraf umd && rollup --config rollup.ci.config.js --branch=$BUILD_BRANCH",
|
|
30
|
-
"build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js",
|
|
31
29
|
"test": "npm run test:unit && npm run test:e2e",
|
|
32
30
|
"test:unit": "jest",
|
|
33
31
|
"test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errorCatching && npm run test:e2e-push && npm run test:e2e-consumer",
|
|
@@ -37,7 +35,6 @@
|
|
|
37
35
|
"test:e2e-destroy": "karma start karma/e2e.destroy.karma.conf.js",
|
|
38
36
|
"test:e2e-errorCatching": "karma start karma/e2e.errorCatching.karma.conf.js",
|
|
39
37
|
"test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
|
|
40
|
-
"test:e2e-gaIntegration": "karma start karma/e2e.gaIntegration.karma.conf.js",
|
|
41
38
|
"test:e2e-consumer": "karma start karma/e2e.consumer.karma.conf.js",
|
|
42
39
|
"pretest-ts-decls": "npm run build:esm && npm run build:cjs && npm link",
|
|
43
40
|
"test-ts-decls": "./scripts/ts-tests.sh",
|
|
@@ -64,8 +61,7 @@
|
|
|
64
61
|
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
|
|
65
62
|
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
|
|
66
63
|
"dependencies": {
|
|
67
|
-
"@splitsoftware/splitio-commons": "
|
|
68
|
-
"@types/google.analytics": "0.0.40",
|
|
64
|
+
"@splitsoftware/splitio-commons": "2.0.0-rc.2",
|
|
69
65
|
"tslib": "^2.3.1",
|
|
70
66
|
"unfetch": "^4.2.0"
|
|
71
67
|
},
|
package/src/full/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { SplitFactory } from './splitFactory';
|
|
2
2
|
export { InLocalStorage } from '@splitsoftware/splitio-commons/src/storages/inLocalStorage/index';
|
|
3
|
-
export { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/src/integrations/ga/GoogleAnalyticsToSplit';
|
|
4
|
-
export { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/src/integrations/ga/SplitToGoogleAnalytics';
|
|
5
3
|
export { ErrorLogger } from '@splitsoftware/splitio-commons/src/logger/browser/ErrorLogger';
|
|
6
4
|
export { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/WarnLogger';
|
|
7
5
|
export { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
|
package/src/full/umd.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { SplitFactory } from './splitFactory';
|
|
3
3
|
import { InLocalStorage } from '@splitsoftware/splitio-commons/src/storages/inLocalStorage/index';
|
|
4
|
-
import { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/src/integrations/ga/GoogleAnalyticsToSplit';
|
|
5
|
-
import { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/src/integrations/ga/SplitToGoogleAnalytics';
|
|
6
4
|
import { ErrorLogger } from '@splitsoftware/splitio-commons/src/logger/browser/ErrorLogger';
|
|
7
5
|
import { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/WarnLogger';
|
|
8
6
|
import { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
|
|
@@ -11,8 +9,6 @@ import { DebugLogger } from '@splitsoftware/splitio-commons/src/logger/browser/D
|
|
|
11
9
|
// Include all pluggable modules as properties to expose at the global `splitio` object
|
|
12
10
|
SplitFactory.SplitFactory = SplitFactory;
|
|
13
11
|
SplitFactory.InLocalStorage = InLocalStorage;
|
|
14
|
-
SplitFactory.GoogleAnalyticsToSplit = GoogleAnalyticsToSplit;
|
|
15
|
-
SplitFactory.SplitToGoogleAnalytics = SplitToGoogleAnalytics;
|
|
16
12
|
SplitFactory.ErrorLogger = ErrorLogger;
|
|
17
13
|
SplitFactory.WarnLogger = WarnLogger;
|
|
18
14
|
SplitFactory.InfoLogger = InfoLogger;
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { SplitFactory } from './splitFactory';
|
|
2
2
|
export { InLocalStorage } from '@splitsoftware/splitio-commons/src/storages/inLocalStorage/index';
|
|
3
|
-
export { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/src/integrations/ga/GoogleAnalyticsToSplit';
|
|
4
|
-
export { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/src/integrations/ga/SplitToGoogleAnalytics';
|
|
5
3
|
export { ErrorLogger } from '@splitsoftware/splitio-commons/src/logger/browser/ErrorLogger';
|
|
6
4
|
export { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/WarnLogger';
|
|
7
5
|
export { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
|
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.
|
|
5
|
+
const packageVersion = '1.0.0-rc.0';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
@@ -31,8 +31,6 @@ export const defaults = {
|
|
|
31
31
|
readyTimeout: 10,
|
|
32
32
|
// Amount of time we will wait before the first push of events.
|
|
33
33
|
eventsFirstPushWindow: 10,
|
|
34
|
-
// Wait for large segments to emit SDK_READY event.
|
|
35
|
-
waitForLargeSegments: true,
|
|
36
34
|
},
|
|
37
35
|
|
|
38
36
|
// Consent is considered granted by default
|
package/types/full/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export = JsSdk;
|
|
|
7
7
|
|
|
8
8
|
declare module JsSdk {
|
|
9
9
|
/**
|
|
10
|
-
* Full version of the Split.io
|
|
10
|
+
* Full version of the Split.io SDK factory function.
|
|
11
11
|
*
|
|
12
12
|
* Unlike the slim version, it doesn't require a 'fetch' polyfill to support old browsers @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#language-support}.
|
|
13
13
|
* and includes localhost mode out-of-the-box @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode}.
|
|
@@ -32,20 +32,6 @@ declare module JsSdk {
|
|
|
32
32
|
*/
|
|
33
33
|
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
|
37
|
-
*
|
|
38
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split}
|
|
39
|
-
*/
|
|
40
|
-
export function GoogleAnalyticsToSplit(options?: SplitIO.GoogleAnalyticsToSplitOptions): SplitIO.IntegrationFactory;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits.
|
|
44
|
-
*
|
|
45
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics}
|
|
46
|
-
*/
|
|
47
|
-
export function SplitToGoogleAnalytics(options?: SplitIO.SplitToGoogleAnalyticsOptions): SplitIO.IntegrationFactory;
|
|
48
|
-
|
|
49
35
|
/**
|
|
50
36
|
* Creates a logger instance that enables descriptive log messages with DEBUG log level when passed in the factory settings.
|
|
51
37
|
*
|
package/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export = JsSdk;
|
|
|
7
7
|
|
|
8
8
|
declare module JsSdk {
|
|
9
9
|
/**
|
|
10
|
-
* Slim version of the Split.io
|
|
10
|
+
* Slim version of the Split.io SDK factory function.
|
|
11
11
|
*
|
|
12
12
|
* Recommended to use for bundle size reduction in production, since it doesn't include a 'fetch' polyfill and localhost mode out-of-the-box
|
|
13
13
|
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode}.
|
|
@@ -32,20 +32,6 @@ declare module JsSdk {
|
|
|
32
32
|
*/
|
|
33
33
|
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
|
37
|
-
*
|
|
38
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split}
|
|
39
|
-
*/
|
|
40
|
-
export function GoogleAnalyticsToSplit(options?: SplitIO.GoogleAnalyticsToSplitOptions): SplitIO.IntegrationFactory;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits.
|
|
44
|
-
*
|
|
45
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics}
|
|
46
|
-
*/
|
|
47
|
-
export function SplitToGoogleAnalytics(options?: SplitIO.SplitToGoogleAnalyticsOptions): SplitIO.IntegrationFactory;
|
|
48
|
-
|
|
49
35
|
/**
|
|
50
36
|
* Creates a logger instance that enables descriptive log messages with DEBUG log level when passed in the factory settings.
|
|
51
37
|
*
|
package/types/splitio.d.ts
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Project: http://www.split.io/
|
|
3
3
|
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
4
|
|
|
5
|
-
/// <reference types="google.analytics" />
|
|
6
|
-
|
|
7
5
|
export as namespace SplitIO;
|
|
8
6
|
export = SplitIO;
|
|
9
7
|
|
|
@@ -61,7 +59,6 @@ interface ISettings {
|
|
|
61
59
|
impressionsQueueSize: number,
|
|
62
60
|
telemetryRefreshRate: number,
|
|
63
61
|
segmentsRefreshRate: number,
|
|
64
|
-
largeSegmentsRefreshRate: number,
|
|
65
62
|
offlineRefreshRate: number,
|
|
66
63
|
eventsPushRate: number,
|
|
67
64
|
eventsQueueSize: number,
|
|
@@ -71,8 +68,7 @@ interface ISettings {
|
|
|
71
68
|
readyTimeout: number,
|
|
72
69
|
requestTimeoutBeforeReady: number,
|
|
73
70
|
retriesOnFailureBeforeReady: number,
|
|
74
|
-
eventsFirstPushWindow: number
|
|
75
|
-
waitForLargeSegments: boolean
|
|
71
|
+
eventsFirstPushWindow: number
|
|
76
72
|
},
|
|
77
73
|
readonly storage?: SplitIO.StorageSyncFactory | SplitIO.StorageAsyncFactory,
|
|
78
74
|
readonly urls: {
|
|
@@ -234,7 +230,7 @@ interface ISharedSettings {
|
|
|
234
230
|
*
|
|
235
231
|
* NOTE: this is only required if using the slim entry point of the library to init the SDK in localhost mode.
|
|
236
232
|
*
|
|
237
|
-
* For more information
|
|
233
|
+
* For more information see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode}
|
|
238
234
|
*
|
|
239
235
|
* Example:
|
|
240
236
|
* ```typescript
|
|
@@ -304,9 +300,8 @@ interface IStatusInterface extends IEventEmitter {
|
|
|
304
300
|
*/
|
|
305
301
|
Event: EventConsts,
|
|
306
302
|
/**
|
|
307
|
-
* Returns a promise that resolves once the SDK has finished loading (SDK_READY event emitted) or rejected if the SDK has timedout (SDK_READY_TIMED_OUT event emitted).
|
|
308
|
-
* As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event,
|
|
309
|
-
* SDK had timed out will return a new promise that should eventually resolve if the SDK gets ready.
|
|
303
|
+
* Returns a promise that resolves once the SDK has finished loading (`SDK_READY` event emitted) or rejected if the SDK has timedout (`SDK_READY_TIMED_OUT` event emitted).
|
|
304
|
+
* As it's meant to provide similar flexibility to the event approach, given that the SDK might be eventually ready after a timeout event, the `ready` method will return a resolved promise once the SDK is ready.
|
|
310
305
|
*
|
|
311
306
|
* Caveats: the method was designed to avoid an unhandled Promise rejection if the rejection case is not handled, so that `onRejected` handler is optional when using promises.
|
|
312
307
|
* However, when using async/await syntax, the rejection should be explicitly propagated like in the following example:
|
|
@@ -372,8 +367,7 @@ interface IBasicSDK {
|
|
|
372
367
|
/****** Exposed namespace ******/
|
|
373
368
|
/**
|
|
374
369
|
* Types and interfaces for @splitsoftware/splitio-browserjs package for usage when integrating javascript browser sdk on typescript apps.
|
|
375
|
-
* For the SDK package information
|
|
376
|
-
* @see {@link https://www.npmjs.com/package/@splitsoftware/splitio-browserjs}
|
|
370
|
+
* For the SDK package information see {@link https://www.npmjs.com/package/@splitsoftware/splitio-browserjs}
|
|
377
371
|
*/
|
|
378
372
|
declare namespace SplitIO {
|
|
379
373
|
/**
|
|
@@ -683,62 +677,6 @@ declare namespace SplitIO {
|
|
|
683
677
|
key?: string;
|
|
684
678
|
timestamp?: number;
|
|
685
679
|
};
|
|
686
|
-
/**
|
|
687
|
-
* Configuration params for 'Google Analytics to Split' integration plugin, to track Google Analytics hits as Split events.
|
|
688
|
-
*
|
|
689
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split}
|
|
690
|
-
*/
|
|
691
|
-
interface GoogleAnalyticsToSplitOptions {
|
|
692
|
-
/**
|
|
693
|
-
* Optional flag to filter GA hits from being tracked as Split events.
|
|
694
|
-
* @property {boolean} hits
|
|
695
|
-
* @default true
|
|
696
|
-
*/
|
|
697
|
-
hits?: boolean,
|
|
698
|
-
/**
|
|
699
|
-
* Optional predicate used to define a custom filter for tracking GA hits as Split events.
|
|
700
|
-
* For example, the following filter allows to track only 'event' hits:
|
|
701
|
-
* `(model) => model.get('hitType') === 'event'`
|
|
702
|
-
* By default, all hits are tracked as Split events.
|
|
703
|
-
*/
|
|
704
|
-
filter?: (model: UniversalAnalytics.Model) => boolean,
|
|
705
|
-
/**
|
|
706
|
-
* Optional function useful when you need to modify the Split event before tracking it.
|
|
707
|
-
* This function is invoked with two arguments:
|
|
708
|
-
* 1. the GA model object representing the hit.
|
|
709
|
-
* 2. the default format of the mapped Split event instance.
|
|
710
|
-
* The return value must be a Split event, that can be the second argument or a new object.
|
|
711
|
-
*
|
|
712
|
-
* For example, the following mapper adds a custom property to events:
|
|
713
|
-
* `(model, defaultMapping) => {
|
|
714
|
-
* defaultMapping.properties.someProperty = SOME_VALUE;
|
|
715
|
-
* return defaultMapping;
|
|
716
|
-
* }`
|
|
717
|
-
*/
|
|
718
|
-
mapper?: (model: UniversalAnalytics.Model, defaultMapping: SplitIO.EventData) => SplitIO.EventData,
|
|
719
|
-
/**
|
|
720
|
-
* Optional prefix for EventTypeId, to prevent any kind of data collision between events.
|
|
721
|
-
* @property {string} prefix
|
|
722
|
-
* @default 'ga'
|
|
723
|
-
*/
|
|
724
|
-
prefix?: string,
|
|
725
|
-
/**
|
|
726
|
-
* List of Split identities (key & traffic type pairs) used to track events.
|
|
727
|
-
* If not provided, events are sent using the key and traffic type provided at SDK config.
|
|
728
|
-
*/
|
|
729
|
-
identities: Identity[],
|
|
730
|
-
/**
|
|
731
|
-
* Optional flag to log an error if the `auto-require` script is not detected.
|
|
732
|
-
* The auto-require script automatically requires the `splitTracker` plugin for created trackers,
|
|
733
|
-
* and should be placed right after your Google Analytics, Google Tag Manager or gtag.js script tag.
|
|
734
|
-
*
|
|
735
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js}
|
|
736
|
-
*
|
|
737
|
-
* @property {boolean} autoRequire
|
|
738
|
-
* @default false
|
|
739
|
-
*/
|
|
740
|
-
autoRequire?: boolean,
|
|
741
|
-
}
|
|
742
680
|
/**
|
|
743
681
|
* Object representing the data sent by Split (events and impressions).
|
|
744
682
|
* @typedef {Object} IntegrationData
|
|
@@ -746,67 +684,6 @@ declare namespace SplitIO {
|
|
|
746
684
|
* @property {ImpressionData | EventData} payload The data instance itself.
|
|
747
685
|
*/
|
|
748
686
|
type IntegrationData = { type: 'IMPRESSION', payload: SplitIO.ImpressionData } | { type: 'EVENT', payload: SplitIO.EventData };
|
|
749
|
-
/**
|
|
750
|
-
* Configuration params for 'Split to Google Analytics' integration plugin, to track Split impressions and events as Google Analytics hits.
|
|
751
|
-
*
|
|
752
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics}
|
|
753
|
-
*/
|
|
754
|
-
interface SplitToGoogleAnalyticsOptions {
|
|
755
|
-
/**
|
|
756
|
-
* Optional flag to filter Split impressions from being tracked as GA hits.
|
|
757
|
-
* @property {boolean} impressions
|
|
758
|
-
* @default true
|
|
759
|
-
*/
|
|
760
|
-
impressions?: boolean,
|
|
761
|
-
/**
|
|
762
|
-
* Optional flag to filter Split events from being tracked as GA hits.
|
|
763
|
-
* @property {boolean} events
|
|
764
|
-
* @default true
|
|
765
|
-
*/
|
|
766
|
-
events?: boolean,
|
|
767
|
-
/**
|
|
768
|
-
* Optional predicate used to define a custom filter for tracking Split data (events and impressions) as GA hits.
|
|
769
|
-
* For example, the following filter allows to track only impressions, equivalent to setting events to false:
|
|
770
|
-
* `(data) => data.type === 'IMPRESSION'`
|
|
771
|
-
*/
|
|
772
|
-
filter?: (data: SplitIO.IntegrationData) => boolean,
|
|
773
|
-
/**
|
|
774
|
-
* Optional function useful when you need to modify the GA hit before sending it.
|
|
775
|
-
* This function is invoked with two arguments:
|
|
776
|
-
* 1. the input data (Split event or impression).
|
|
777
|
-
* 2. the default format of the mapped FieldsObject instance (GA hit).
|
|
778
|
-
* The return value must be a FieldsObject, that can be the second argument or a new object.
|
|
779
|
-
*
|
|
780
|
-
* For example, the following mapper adds a custom dimension to hits:
|
|
781
|
-
* `(data, defaultMapping) => {
|
|
782
|
-
* defaultMapping.dimension1 = SOME_VALUE;
|
|
783
|
-
* return defaultMapping;
|
|
784
|
-
* }`
|
|
785
|
-
*
|
|
786
|
-
* Default FieldsObject instance for data.type === 'IMPRESSION':
|
|
787
|
-
* `{
|
|
788
|
-
* hitType: 'event',
|
|
789
|
-
* eventCategory: 'split-impression',
|
|
790
|
-
* eventAction: 'Evaluate ' + data.payload.impression.feature,
|
|
791
|
-
* eventLabel: 'Treatment: ' + data.payload.impression.treatment + '. Targeting rule: ' + data.payload.impression.label + '.',
|
|
792
|
-
* nonInteraction: true,
|
|
793
|
-
* }`
|
|
794
|
-
* Default FieldsObject instance for data.type === 'EVENT':
|
|
795
|
-
* `{
|
|
796
|
-
* hitType: 'event',
|
|
797
|
-
* eventCategory: 'split-event',
|
|
798
|
-
* eventAction: data.payload.eventTypeId,
|
|
799
|
-
* eventValue: data.payload.value,
|
|
800
|
-
* nonInteraction: true,
|
|
801
|
-
* }`
|
|
802
|
-
*/
|
|
803
|
-
mapper?: (data: SplitIO.IntegrationData, defaultMapping: UniversalAnalytics.FieldsObject) => UniversalAnalytics.FieldsObject,
|
|
804
|
-
/**
|
|
805
|
-
* List of tracker names to send the hit. An empty string represents the default tracker.
|
|
806
|
-
* If not provided, hits are only sent to default tracker.
|
|
807
|
-
*/
|
|
808
|
-
trackerNames?: string[],
|
|
809
|
-
}
|
|
810
687
|
/**
|
|
811
688
|
* Available URL settings for the SDKs.
|
|
812
689
|
*/
|
|
@@ -896,12 +773,14 @@ declare namespace SplitIO {
|
|
|
896
773
|
*/
|
|
897
774
|
core: {
|
|
898
775
|
/**
|
|
899
|
-
* Your SDK key.
|
|
776
|
+
* Your SDK key.
|
|
777
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360019916211-API-keys}
|
|
900
778
|
* @property {string} authorizationKey
|
|
901
779
|
*/
|
|
902
780
|
authorizationKey: string,
|
|
903
781
|
/**
|
|
904
|
-
* Customer identifier. Whatever this means to you.
|
|
782
|
+
* Customer identifier. Whatever this means to you.
|
|
783
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360019916311-Traffic-type}
|
|
905
784
|
* @property {SplitKey} key
|
|
906
785
|
*/
|
|
907
786
|
key: SplitKey,
|
|
@@ -921,13 +800,8 @@ declare namespace SplitIO {
|
|
|
921
800
|
/**
|
|
922
801
|
* Defines an optional list of factory functions used to instantiate SDK integrations.
|
|
923
802
|
*
|
|
924
|
-
*
|
|
925
|
-
*
|
|
926
|
-
* SplitFactory({
|
|
927
|
-
* ...
|
|
928
|
-
* integrations: [SplitToGoogleAnalytics(), GoogleAnalyticsToSplit()]
|
|
929
|
-
* })
|
|
930
|
-
* ```
|
|
803
|
+
* NOTE: at the moment there are not integrations to plug in Browser SDK.
|
|
804
|
+
*
|
|
931
805
|
* @property {Object} integrations
|
|
932
806
|
*/
|
|
933
807
|
integrations?: IntegrationFactory[],
|
|
@@ -959,7 +833,7 @@ declare namespace SplitIO {
|
|
|
959
833
|
*/
|
|
960
834
|
mode?: 'standalone',
|
|
961
835
|
/**
|
|
962
|
-
* Mocked features map. For testing
|
|
836
|
+
* Mocked features map. For testing purposes only. For using this you should specify "localhost" as authorizationKey on core settings.
|
|
963
837
|
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode}
|
|
964
838
|
*/
|
|
965
839
|
features?: MockedFeaturesMap,
|
|
@@ -1007,13 +881,6 @@ declare namespace SplitIO {
|
|
|
1007
881
|
* @default 10
|
|
1008
882
|
*/
|
|
1009
883
|
eventsFirstPushWindow?: number,
|
|
1010
|
-
/**
|
|
1011
|
-
* Whether the SDK should wait for large segments to be ready before emitting SDK_READY event.
|
|
1012
|
-
* It only applies if largeSegmentsEnabled is true.
|
|
1013
|
-
* @property {boolean} waitForLargeSegments
|
|
1014
|
-
* @default true
|
|
1015
|
-
*/
|
|
1016
|
-
waitForLargeSegments?: boolean
|
|
1017
884
|
},
|
|
1018
885
|
/**
|
|
1019
886
|
* SDK scheduler settings.
|
|
@@ -1051,13 +918,6 @@ declare namespace SplitIO {
|
|
|
1051
918
|
* @default 60
|
|
1052
919
|
*/
|
|
1053
920
|
segmentsRefreshRate?: number,
|
|
1054
|
-
/**
|
|
1055
|
-
* The SDK polls Split servers for changes to large segment definitions. This parameter controls this polling period in seconds.
|
|
1056
|
-
* It only applies if largeSegmentsEnabled is true.
|
|
1057
|
-
* @property {number} largeSegmentsRefreshRate
|
|
1058
|
-
* @default 60
|
|
1059
|
-
*/
|
|
1060
|
-
largeSegmentsRefreshRate?: number,
|
|
1061
921
|
/**
|
|
1062
922
|
* The SDK posts the queued events data in bulks. This parameter controls the posting rate in seconds.
|
|
1063
923
|
* @property {number} eventsPushRate
|
|
@@ -1073,7 +933,7 @@ declare namespace SplitIO {
|
|
|
1073
933
|
eventsQueueSize?: number,
|
|
1074
934
|
/**
|
|
1075
935
|
* For mocking/testing only. The SDK will refresh the features mocked data when mode is set to "localhost" by defining the key.
|
|
1076
|
-
* For more information
|
|
936
|
+
* For more information see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode}
|
|
1077
937
|
* @property {number} offlineRefreshRate
|
|
1078
938
|
* @default 15
|
|
1079
939
|
*/
|
|
@@ -1085,14 +945,6 @@ declare namespace SplitIO {
|
|
|
1085
945
|
* @default 1
|
|
1086
946
|
*/
|
|
1087
947
|
pushRetryBackoffBase?: number,
|
|
1088
|
-
},
|
|
1089
|
-
sync?: ISharedSettings['sync'] & {
|
|
1090
|
-
/**
|
|
1091
|
-
* Enables synchronization of large segments.
|
|
1092
|
-
* @property {boolean} largeSegmentsEnabled
|
|
1093
|
-
* @default false
|
|
1094
|
-
*/
|
|
1095
|
-
largeSegmentsEnabled?: boolean
|
|
1096
948
|
}
|
|
1097
949
|
}
|
|
1098
950
|
/**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(n,t,e){n[e]=n[e]||t;n[t]=n[t]||function(){n[t].q.push(arguments)};n[t].q=n[t].q||[];var r={};function i(n){return typeof n==="object"&&typeof n.name==="string"&&n.name}function o(e){if(e&&e[0]==="create"){var o=i(e[1])||i(e[2])||i(e[3])||(typeof e[3]==="string"?e[3]:undefined);if(!r[o]){r[o]=true;n[t]((o?o+".":"")+"require","splitTracker")}}}n[t].q.forEach(o);var u=n[t].q.push;n[t].q.push=function(n){var t=u.apply(this,arguments);o(n);return t}})(window,"ga","GoogleAnalyticsObject");
|