@splitsoftware/splitio-browserjs 0.1.1-canary.2 → 0.2.1-rc.1
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 +10 -3
- package/README.md +2 -1
- package/cjs/full/index.js +7 -8
- package/cjs/full/splitFactory.js +1 -1
- package/cjs/index.js +9 -10
- package/cjs/platform/getModules.js +24 -5
- package/cjs/settings/defaults.js +1 -1
- package/cjs/settings/full.js +3 -3
- package/cjs/settings/index.js +2 -2
- package/cjs/splitFactory.js +1 -1
- package/esm/full/index.js +3 -2
- package/esm/full/splitFactory.js +1 -1
- package/esm/index.js +4 -3
- package/esm/platform/getModules.js +24 -5
- package/esm/settings/defaults.js +1 -1
- package/esm/settings/full.js +3 -3
- package/esm/settings/index.js +1 -1
- package/esm/splitFactory.js +1 -1
- package/package.json +4 -3
- package/src/full/index.ts +3 -2
- package/src/full/splitFactory.ts +1 -1
- package/src/index.ts +4 -3
- package/src/platform/getModules.ts +25 -5
- package/src/settings/defaults.ts +1 -1
- package/src/settings/full.ts +3 -3
- package/src/settings/index.ts +1 -1
- package/src/splitFactory.ts +1 -1
- package/types/full/index.d.ts +10 -2
- package/types/index.d.ts +10 -2
- package/types/splitio.d.ts +295 -89
package/CHANGES.txt
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
0.
|
|
2
|
-
-
|
|
3
|
-
- Updated
|
|
1
|
+
0.2.0 (October 20, 2021)
|
|
2
|
+
- Added localhost mode support (Read more in our docs here: https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode).
|
|
3
|
+
- Updated @splitsoftware/splitio-commons dependency to version 1.0.0, which includes:
|
|
4
|
+
- Updated localhost mode to emit SDK_READY_FROM_CACHE event in Browser when using localStorage (Related to issue https://github.com/splitio/react-client/issues/34).
|
|
5
|
+
- Updated streaming logic to use the newest version of our streaming service, including:
|
|
6
|
+
- Integration with Auth service V2, connecting to the new channels and applying the received connection delay.
|
|
7
|
+
- Implemented handling of the new MySegmentsV2 notification types (SegmentRemoval, KeyList, Bounded and Unbounded)
|
|
8
|
+
- New control notification for environment scoped streaming reset.
|
|
9
|
+
- Fix of some log messages typos, among other improvements.
|
|
10
|
+
- Updated some NPM dependencies for vulnerability fixes.
|
|
4
11
|
|
|
5
12
|
0.1.0 (March 30, 2021)
|
|
6
13
|
- Initial public release. Check the official documentation for details: https://help.split.io/hc/en-us/articles/360058730852
|
package/README.md
CHANGED
|
@@ -67,11 +67,12 @@ Split has built and maintains SDKs for:
|
|
|
67
67
|
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
|
|
68
68
|
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
|
|
69
69
|
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
|
|
70
|
+
* Javascript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
|
|
70
71
|
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
|
|
71
|
-
* Javascript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852)
|
|
72
72
|
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
|
|
73
73
|
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
|
|
74
74
|
* React [Github](https://github.com/splitio/react-client) [Docs](https://help.split.io/hc/en-us/articles/360038825091-React-SDK)
|
|
75
|
+
* React Native [Github](https://github.com/splitio/react-native-client) [Docs](https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK)
|
|
75
76
|
* Redux [Github](https://github.com/splitio/redux-client) [Docs](https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK)
|
|
76
77
|
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
|
|
77
78
|
|
package/cjs/full/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.SplitToGoogleAnalytics = exports.GoogleAnalyticsToSplit = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
3
|
+
exports.PluggableStorage = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.SplitToGoogleAnalytics = exports.GoogleAnalyticsToSplit = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
7
4
|
var splitFactory_1 = require("./splitFactory");
|
|
8
5
|
Object.defineProperty(exports, "SplitFactory", { enumerable: true, get: function () { return splitFactory_1.SplitFactory; } });
|
|
9
6
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/storages/inLocalStorage/index");
|
|
10
7
|
Object.defineProperty(exports, "InLocalStorage", { enumerable: true, get: function () { return index_1.InLocalStorage; } });
|
|
11
|
-
var
|
|
12
|
-
Object.defineProperty(exports, "GoogleAnalyticsToSplit", { enumerable: true, get: function () { return
|
|
13
|
-
var
|
|
14
|
-
Object.defineProperty(exports, "SplitToGoogleAnalytics", { enumerable: true, get: function () { return
|
|
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; } });
|
|
15
12
|
var ErrorLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/ErrorLogger");
|
|
16
13
|
Object.defineProperty(exports, "ErrorLogger", { enumerable: true, get: function () { return ErrorLogger_1.ErrorLogger; } });
|
|
17
14
|
var WarnLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/WarnLogger");
|
|
@@ -20,3 +17,5 @@ var InfoLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/In
|
|
|
20
17
|
Object.defineProperty(exports, "InfoLogger", { enumerable: true, get: function () { return InfoLogger_1.InfoLogger; } });
|
|
21
18
|
var DebugLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/DebugLogger");
|
|
22
19
|
Object.defineProperty(exports, "DebugLogger", { enumerable: true, get: function () { return DebugLogger_1.DebugLogger; } });
|
|
20
|
+
var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/storages/pluggable");
|
|
21
|
+
Object.defineProperty(exports, "PluggableStorage", { enumerable: true, get: function () { return pluggable_1.PluggableStorage; } });
|
package/cjs/full/splitFactory.js
CHANGED
|
@@ -12,7 +12,7 @@ var MinEvents_1 = tslib_1.__importDefault(require("@splitsoftware/splitio-common
|
|
|
12
12
|
var platform = { getFetch: getFetchFull_1.getFetch, getEventSource: getEventSource_1.getEventSource, EventEmitter: MinEvents_1.default };
|
|
13
13
|
/**
|
|
14
14
|
* SplitFactory with pluggable modules for Browser.
|
|
15
|
-
* Includes localhost mode
|
|
15
|
+
* Includes localhost mode and fetch polyfill out-of-the-box.
|
|
16
16
|
*
|
|
17
17
|
* @param config configuration object used to instantiates the SDK
|
|
18
18
|
* @param customModules optional object of SDK modules to overwrite default ones. Use with caution since, unlike `config`, this param is not validated.
|
package/cjs/index.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.LocalhostFromObject = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.SplitToGoogleAnalytics = exports.GoogleAnalyticsToSplit = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
3
|
+
exports.PluggableStorage = exports.LocalhostFromObject = exports.DebugLogger = exports.InfoLogger = exports.WarnLogger = exports.ErrorLogger = exports.SplitToGoogleAnalytics = exports.GoogleAnalyticsToSplit = exports.InLocalStorage = exports.SplitFactory = void 0;
|
|
7
4
|
var splitFactory_1 = require("./splitFactory");
|
|
8
5
|
Object.defineProperty(exports, "SplitFactory", { enumerable: true, get: function () { return splitFactory_1.SplitFactory; } });
|
|
9
6
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/storages/inLocalStorage/index");
|
|
10
7
|
Object.defineProperty(exports, "InLocalStorage", { enumerable: true, get: function () { return index_1.InLocalStorage; } });
|
|
11
|
-
var
|
|
12
|
-
Object.defineProperty(exports, "GoogleAnalyticsToSplit", { enumerable: true, get: function () { return
|
|
13
|
-
var
|
|
14
|
-
Object.defineProperty(exports, "SplitToGoogleAnalytics", { enumerable: true, get: function () { return
|
|
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; } });
|
|
15
12
|
var ErrorLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/ErrorLogger");
|
|
16
13
|
Object.defineProperty(exports, "ErrorLogger", { enumerable: true, get: function () { return ErrorLogger_1.ErrorLogger; } });
|
|
17
14
|
var WarnLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/WarnLogger");
|
|
@@ -20,5 +17,7 @@ var InfoLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/In
|
|
|
20
17
|
Object.defineProperty(exports, "InfoLogger", { enumerable: true, get: function () { return InfoLogger_1.InfoLogger; } });
|
|
21
18
|
var DebugLogger_1 = require("@splitsoftware/splitio-commons/cjs/logger/browser/DebugLogger");
|
|
22
19
|
Object.defineProperty(exports, "DebugLogger", { enumerable: true, get: function () { return DebugLogger_1.DebugLogger; } });
|
|
23
|
-
var
|
|
24
|
-
Object.defineProperty(exports, "LocalhostFromObject", { enumerable: true, get: function () { return
|
|
20
|
+
var LocalhostFromObject_1 = require("@splitsoftware/splitio-commons/cjs/sync/offline/LocalhostFromObject");
|
|
21
|
+
Object.defineProperty(exports, "LocalhostFromObject", { enumerable: true, get: function () { return LocalhostFromObject_1.LocalhostFromObject; } });
|
|
22
|
+
var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/storages/pluggable");
|
|
23
|
+
Object.defineProperty(exports, "PluggableStorage", { enumerable: true, get: function () { return pluggable_1.PluggableStorage; } });
|
|
@@ -12,20 +12,39 @@ var browser_1 = tslib_1.__importDefault(require("@splitsoftware/splitio-commons/
|
|
|
12
12
|
var impressionObserverCS_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/impressionObserverCS");
|
|
13
13
|
var pluggable_1 = tslib_1.__importDefault(require("@splitsoftware/splitio-commons/cjs/integrations/pluggable"));
|
|
14
14
|
var utils_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/utils");
|
|
15
|
-
var
|
|
15
|
+
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
16
|
+
var syncManagerStandaloneFactory;
|
|
17
|
+
var syncManagerSubmittersFactory;
|
|
16
18
|
function getModules(settings, platform) {
|
|
17
|
-
|
|
19
|
+
if (!syncManagerStandaloneFactory)
|
|
20
|
+
syncManagerStandaloneFactory = syncManagerOnline_1.syncManagerOnlineFactory(pollingManagerCS_1.default, pushManager_1.default);
|
|
21
|
+
var modules = {
|
|
18
22
|
settings: settings,
|
|
19
23
|
platform: platform,
|
|
20
24
|
storageFactory: settings.storage,
|
|
21
|
-
splitApiFactory:
|
|
22
|
-
syncManagerFactory:
|
|
25
|
+
splitApiFactory: splitApi_1.splitApiFactory,
|
|
26
|
+
syncManagerFactory: syncManagerStandaloneFactory,
|
|
23
27
|
sdkManagerFactory: index_1.sdkManagerFactory,
|
|
24
28
|
sdkClientMethodFactory: sdkClientMethodCS_1.sdkClientMethodCSFactory,
|
|
25
|
-
SignalListener:
|
|
29
|
+
SignalListener: browser_1.default,
|
|
26
30
|
impressionListener: settings.impressionListener,
|
|
27
31
|
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggable_1.default.bind(null, settings.integrations) : undefined,
|
|
28
32
|
impressionsObserverFactory: utils_1.shouldAddPt(settings) ? impressionObserverCS_1.impressionObserverCSFactory : undefined,
|
|
29
33
|
};
|
|
34
|
+
switch (settings.mode) {
|
|
35
|
+
case constants_1.LOCALHOST_MODE:
|
|
36
|
+
modules.splitApiFactory = undefined;
|
|
37
|
+
modules.syncManagerFactory = settings.sync.localhostMode;
|
|
38
|
+
modules.SignalListener = undefined;
|
|
39
|
+
break;
|
|
40
|
+
case constants_1.CONSUMER_MODE:
|
|
41
|
+
modules.syncManagerFactory = undefined;
|
|
42
|
+
break;
|
|
43
|
+
case constants_1.CONSUMER_PARTIAL_MODE:
|
|
44
|
+
if (!syncManagerSubmittersFactory)
|
|
45
|
+
syncManagerSubmittersFactory = syncManagerOnline_1.syncManagerOnlineFactory(undefined, undefined);
|
|
46
|
+
modules.syncManagerFactory = syncManagerSubmittersFactory;
|
|
47
|
+
}
|
|
48
|
+
return modules;
|
|
30
49
|
}
|
|
31
50
|
exports.getModules = getModules;
|
package/cjs/settings/defaults.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
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
|
-
var packageVersion = '0.
|
|
5
|
+
var packageVersion = '0.2.1-rc.1';
|
|
6
6
|
/**
|
|
7
7
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
8
8
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
package/cjs/settings/full.js
CHANGED
|
@@ -6,14 +6,14 @@ var defaults_1 = require("./defaults");
|
|
|
6
6
|
var storageCS_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/storage/storageCS");
|
|
7
7
|
var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/integrations/pluggable");
|
|
8
8
|
var pluggableLogger_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/logger/pluggableLogger");
|
|
9
|
-
var
|
|
9
|
+
var builtin_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/localhost/builtin");
|
|
10
10
|
var params = {
|
|
11
11
|
defaults: defaults_1.defaults,
|
|
12
12
|
storage: storageCS_1.validateStorageCS,
|
|
13
13
|
integrations: pluggable_1.validatePluggableIntegrations,
|
|
14
14
|
logger: pluggableLogger_1.validateLogger,
|
|
15
|
-
// Full SplitFactory
|
|
16
|
-
localhost:
|
|
15
|
+
// Full SplitFactory returns a default instance, except a valid one is provided
|
|
16
|
+
localhost: builtin_1.validateLocalhostWithDefault
|
|
17
17
|
};
|
|
18
18
|
function settingsValidator(config) {
|
|
19
19
|
return index_1.settingsValidation(config, params);
|
package/cjs/settings/index.js
CHANGED
|
@@ -6,14 +6,14 @@ var defaults_1 = require("./defaults");
|
|
|
6
6
|
var storageCS_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/storage/storageCS");
|
|
7
7
|
var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/integrations/pluggable");
|
|
8
8
|
var pluggableLogger_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/logger/pluggableLogger");
|
|
9
|
-
var
|
|
9
|
+
var pluggable_2 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/localhost/pluggable");
|
|
10
10
|
var params = {
|
|
11
11
|
defaults: defaults_1.defaults,
|
|
12
12
|
storage: storageCS_1.validateStorageCS,
|
|
13
13
|
integrations: pluggable_1.validatePluggableIntegrations,
|
|
14
14
|
logger: pluggableLogger_1.validateLogger,
|
|
15
15
|
// Slim SplitFactory validates that the localhost module is passed in localhost mode
|
|
16
|
-
localhost:
|
|
16
|
+
localhost: pluggable_2.validateLocalhost
|
|
17
17
|
};
|
|
18
18
|
function settingsValidator(config) {
|
|
19
19
|
return index_1.settingsValidation(config, params);
|
package/cjs/splitFactory.js
CHANGED
|
@@ -12,7 +12,7 @@ var MinEvents_1 = tslib_1.__importDefault(require("@splitsoftware/splitio-common
|
|
|
12
12
|
var platform = { getFetch: getFetchSlim_1.getFetch, getEventSource: getEventSource_1.getEventSource, EventEmitter: MinEvents_1.default };
|
|
13
13
|
/**
|
|
14
14
|
* Slim SplitFactory with pluggable modules for Browser.
|
|
15
|
-
* Doesn't include localhost mode
|
|
15
|
+
* Doesn't include localhost mode and fetch ponyfill out-of-the-box.
|
|
16
16
|
*
|
|
17
17
|
* @param config configuration object used to instantiates the SDK
|
|
18
18
|
* @param customModules optional object of SDK modules to overwrite default ones. Use with caution since, unlike `config`, this param is not validated.
|
package/esm/full/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { SplitFactory } from './splitFactory';
|
|
2
2
|
export { InLocalStorage } from '@splitsoftware/splitio-commons/esm/storages/inLocalStorage/index';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/esm/integrations/ga/GoogleAnalyticsToSplit';
|
|
4
|
+
export { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/esm/integrations/ga/SplitToGoogleAnalytics';
|
|
5
5
|
export { ErrorLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/ErrorLogger';
|
|
6
6
|
export { WarnLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/WarnLogger';
|
|
7
7
|
export { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/InfoLogger';
|
|
8
8
|
export { DebugLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/DebugLogger';
|
|
9
|
+
export { PluggableStorage } from '@splitsoftware/splitio-commons/esm/storages/pluggable';
|
package/esm/full/splitFactory.js
CHANGED
|
@@ -8,7 +8,7 @@ import EventEmitter from '@splitsoftware/splitio-commons/esm/utils/MinEvents';
|
|
|
8
8
|
var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitter: EventEmitter };
|
|
9
9
|
/**
|
|
10
10
|
* SplitFactory with pluggable modules for Browser.
|
|
11
|
-
* Includes localhost mode
|
|
11
|
+
* Includes localhost mode and fetch polyfill out-of-the-box.
|
|
12
12
|
*
|
|
13
13
|
* @param config configuration object used to instantiates the SDK
|
|
14
14
|
* @param customModules optional object of SDK modules to overwrite default ones. Use with caution since, unlike `config`, this param is not validated.
|
package/esm/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { SplitFactory } from './splitFactory';
|
|
2
2
|
export { InLocalStorage } from '@splitsoftware/splitio-commons/esm/storages/inLocalStorage/index';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/esm/integrations/ga/GoogleAnalyticsToSplit';
|
|
4
|
+
export { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/esm/integrations/ga/SplitToGoogleAnalytics';
|
|
5
5
|
export { ErrorLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/ErrorLogger';
|
|
6
6
|
export { WarnLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/WarnLogger';
|
|
7
7
|
export { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/InfoLogger';
|
|
8
8
|
export { DebugLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/DebugLogger';
|
|
9
|
-
export { LocalhostFromObject } from '@splitsoftware/splitio-commons/esm/sync/
|
|
9
|
+
export { LocalhostFromObject } from '@splitsoftware/splitio-commons/esm/sync/offline/LocalhostFromObject';
|
|
10
|
+
export { PluggableStorage } from '@splitsoftware/splitio-commons/esm/storages/pluggable';
|
|
@@ -8,19 +8,38 @@ import BrowserSignalListener from '@splitsoftware/splitio-commons/esm/listeners/
|
|
|
8
8
|
import { impressionObserverCSFactory } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/impressionObserverCS';
|
|
9
9
|
import integrationsManagerFactory from '@splitsoftware/splitio-commons/esm/integrations/pluggable';
|
|
10
10
|
import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/utils';
|
|
11
|
-
|
|
11
|
+
import { CONSUMER_MODE, CONSUMER_PARTIAL_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
12
|
+
var syncManagerStandaloneFactory;
|
|
13
|
+
var syncManagerSubmittersFactory;
|
|
12
14
|
export function getModules(settings, platform) {
|
|
13
|
-
|
|
15
|
+
if (!syncManagerStandaloneFactory)
|
|
16
|
+
syncManagerStandaloneFactory = syncManagerOnlineFactory(pollingManagerCSFactory, pushManagerFactory);
|
|
17
|
+
var modules = {
|
|
14
18
|
settings: settings,
|
|
15
19
|
platform: platform,
|
|
16
20
|
storageFactory: settings.storage,
|
|
17
|
-
splitApiFactory:
|
|
18
|
-
syncManagerFactory:
|
|
21
|
+
splitApiFactory: splitApiFactory,
|
|
22
|
+
syncManagerFactory: syncManagerStandaloneFactory,
|
|
19
23
|
sdkManagerFactory: sdkManagerFactory,
|
|
20
24
|
sdkClientMethodFactory: sdkClientMethodCSFactory,
|
|
21
|
-
SignalListener:
|
|
25
|
+
SignalListener: BrowserSignalListener,
|
|
22
26
|
impressionListener: settings.impressionListener,
|
|
23
27
|
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? integrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
24
28
|
impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
|
|
25
29
|
};
|
|
30
|
+
switch (settings.mode) {
|
|
31
|
+
case LOCALHOST_MODE:
|
|
32
|
+
modules.splitApiFactory = undefined;
|
|
33
|
+
modules.syncManagerFactory = settings.sync.localhostMode;
|
|
34
|
+
modules.SignalListener = undefined;
|
|
35
|
+
break;
|
|
36
|
+
case CONSUMER_MODE:
|
|
37
|
+
modules.syncManagerFactory = undefined;
|
|
38
|
+
break;
|
|
39
|
+
case CONSUMER_PARTIAL_MODE:
|
|
40
|
+
if (!syncManagerSubmittersFactory)
|
|
41
|
+
syncManagerSubmittersFactory = syncManagerOnlineFactory(undefined, undefined);
|
|
42
|
+
modules.syncManagerFactory = syncManagerSubmittersFactory;
|
|
43
|
+
}
|
|
44
|
+
return modules;
|
|
26
45
|
}
|
package/esm/settings/defaults.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/esm/logger/index';
|
|
2
|
-
var packageVersion = '0.
|
|
2
|
+
var packageVersion = '0.2.1-rc.1';
|
|
3
3
|
/**
|
|
4
4
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
5
5
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
package/esm/settings/full.js
CHANGED
|
@@ -3,14 +3,14 @@ import { defaults } from './defaults';
|
|
|
3
3
|
import { validateStorageCS } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/storage/storageCS';
|
|
4
4
|
import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/integrations/pluggable';
|
|
5
5
|
import { validateLogger } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/logger/pluggableLogger';
|
|
6
|
-
import {
|
|
6
|
+
import { validateLocalhostWithDefault } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/localhost/builtin';
|
|
7
7
|
var params = {
|
|
8
8
|
defaults: defaults,
|
|
9
9
|
storage: validateStorageCS,
|
|
10
10
|
integrations: validatePluggableIntegrations,
|
|
11
11
|
logger: validateLogger,
|
|
12
|
-
// Full SplitFactory
|
|
13
|
-
localhost:
|
|
12
|
+
// Full SplitFactory returns a default instance, except a valid one is provided
|
|
13
|
+
localhost: validateLocalhostWithDefault
|
|
14
14
|
};
|
|
15
15
|
export function settingsValidator(config) {
|
|
16
16
|
return settingsValidation(config, params);
|
package/esm/settings/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { defaults } from './defaults';
|
|
|
3
3
|
import { validateStorageCS } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/storage/storageCS';
|
|
4
4
|
import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/integrations/pluggable';
|
|
5
5
|
import { validateLogger } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/logger/pluggableLogger';
|
|
6
|
-
import { validateLocalhost } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/localhost';
|
|
6
|
+
import { validateLocalhost } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/localhost/pluggable';
|
|
7
7
|
var params = {
|
|
8
8
|
defaults: defaults,
|
|
9
9
|
storage: validateStorageCS,
|
package/esm/splitFactory.js
CHANGED
|
@@ -8,7 +8,7 @@ import EventEmitter from '@splitsoftware/splitio-commons/esm/utils/MinEvents';
|
|
|
8
8
|
var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitter: EventEmitter };
|
|
9
9
|
/**
|
|
10
10
|
* Slim SplitFactory with pluggable modules for Browser.
|
|
11
|
-
* Doesn't include localhost mode
|
|
11
|
+
* Doesn't include localhost mode and fetch ponyfill out-of-the-box.
|
|
12
12
|
*
|
|
13
13
|
* @param config configuration object used to instantiates the SDK
|
|
14
14
|
* @param customModules optional object of SDK modules to overwrite default ones. Use with caution since, unlike `config`, this param is not validated.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1-rc.1",
|
|
4
4
|
"description": "Split SDK for Javascript on Browser",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"build:umd": "rollup --config rollup.ci.config.js --branch=$BUILD_BRANCH --commit_hash=$BUILD_COMMIT",
|
|
29
29
|
"test": "npm run test:unit && npm run test:e2e",
|
|
30
30
|
"test:unit": "jest",
|
|
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-errors && npm run test:e2e-push && npm run test:e2e-gaintegration",
|
|
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-errors && npm run test:e2e-push && npm run test:e2e-gaintegration && npm run test:e2e-consumer",
|
|
32
32
|
"test:e2e-logger": "karma start karma/e2e.logger.karma.conf.js",
|
|
33
33
|
"test:e2e-offline": "karma start karma/e2e.offline.karma.conf.js",
|
|
34
34
|
"test:e2e-online": "karma start karma/e2e.online.karma.conf.js",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"test:e2e-errors": "karma start karma/e2e.errors.karma.conf.js",
|
|
37
37
|
"test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
|
|
38
38
|
"test:e2e-gaintegration": "karma start karma/e2e.gaintegration.karma.conf.js",
|
|
39
|
+
"test:e2e-consumer": "karma start karma/e2e.consumer.karma.conf.js",
|
|
39
40
|
"pretest-ts-decls": "npm run build:esm && npm run build:cjs && npm link",
|
|
40
41
|
"test-ts-decls": "./scripts/ts-tests.sh",
|
|
41
42
|
"posttest-ts-decls": "npm unlink && npm install",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
|
|
61
62
|
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
|
|
62
63
|
"dependencies": {
|
|
63
|
-
"@splitsoftware/splitio-commons": "0.1
|
|
64
|
+
"@splitsoftware/splitio-commons": "1.0.1-rc.4",
|
|
64
65
|
"@types/google.analytics": "0.0.40"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
package/src/full/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { SplitFactory } from './splitFactory';
|
|
2
2
|
export { InLocalStorage } from '@splitsoftware/splitio-commons/src/storages/inLocalStorage/index';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/src/integrations/ga/GoogleAnalyticsToSplit';
|
|
4
|
+
export { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/src/integrations/ga/SplitToGoogleAnalytics';
|
|
5
5
|
export { ErrorLogger } from '@splitsoftware/splitio-commons/src/logger/browser/ErrorLogger';
|
|
6
6
|
export { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/WarnLogger';
|
|
7
7
|
export { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
|
|
8
8
|
export { DebugLogger } from '@splitsoftware/splitio-commons/src/logger/browser/DebugLogger';
|
|
9
|
+
export { PluggableStorage } from '@splitsoftware/splitio-commons/src/storages/pluggable';
|
package/src/full/splitFactory.ts
CHANGED
|
@@ -11,7 +11,7 @@ const platform = { getFetch, getEventSource, EventEmitter };
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* SplitFactory with pluggable modules for Browser.
|
|
14
|
-
* Includes localhost mode
|
|
14
|
+
* Includes localhost mode and fetch polyfill out-of-the-box.
|
|
15
15
|
*
|
|
16
16
|
* @param config configuration object used to instantiates the SDK
|
|
17
17
|
* @param customModules optional object of SDK modules to overwrite default ones. Use with caution since, unlike `config`, this param is not validated.
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { SplitFactory } from './splitFactory';
|
|
2
2
|
export { InLocalStorage } from '@splitsoftware/splitio-commons/src/storages/inLocalStorage/index';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
3
|
+
export { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/src/integrations/ga/GoogleAnalyticsToSplit';
|
|
4
|
+
export { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/src/integrations/ga/SplitToGoogleAnalytics';
|
|
5
5
|
export { ErrorLogger } from '@splitsoftware/splitio-commons/src/logger/browser/ErrorLogger';
|
|
6
6
|
export { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/WarnLogger';
|
|
7
7
|
export { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
|
|
8
8
|
export { DebugLogger } from '@splitsoftware/splitio-commons/src/logger/browser/DebugLogger';
|
|
9
|
-
export { LocalhostFromObject } from '@splitsoftware/splitio-commons/src/sync/
|
|
9
|
+
export { LocalhostFromObject } from '@splitsoftware/splitio-commons/src/sync/offline/LocalhostFromObject';
|
|
10
|
+
export { PluggableStorage } from '@splitsoftware/splitio-commons/src/storages/pluggable';
|
|
@@ -11,27 +11,31 @@ import integrationsManagerFactory from '@splitsoftware/splitio-commons/src/integ
|
|
|
11
11
|
import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/utils';
|
|
12
12
|
import { IPlatform, ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
|
|
13
13
|
import { SplitIO, ISettings } from '@splitsoftware/splitio-commons/src/types';
|
|
14
|
+
import { CONSUMER_MODE, CONSUMER_PARTIAL_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
let syncManagerStandaloneFactory: ISdkFactoryParams['syncManagerFactory'];
|
|
17
|
+
let syncManagerSubmittersFactory: ISdkFactoryParams['syncManagerFactory'];
|
|
16
18
|
|
|
17
19
|
export function getModules(settings: ISettings, platform: IPlatform): ISdkFactoryParams {
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
if (!syncManagerStandaloneFactory) syncManagerStandaloneFactory = syncManagerOnlineFactory(pollingManagerCSFactory, pushManagerFactory);
|
|
22
|
+
|
|
23
|
+
const modules: ISdkFactoryParams = {
|
|
20
24
|
settings,
|
|
21
25
|
|
|
22
26
|
platform,
|
|
23
27
|
|
|
24
28
|
storageFactory: settings.storage,
|
|
25
29
|
|
|
26
|
-
splitApiFactory
|
|
30
|
+
splitApiFactory,
|
|
27
31
|
|
|
28
|
-
syncManagerFactory:
|
|
32
|
+
syncManagerFactory: syncManagerStandaloneFactory,
|
|
29
33
|
|
|
30
34
|
sdkManagerFactory,
|
|
31
35
|
|
|
32
36
|
sdkClientMethodFactory: sdkClientMethodCSFactory,
|
|
33
37
|
|
|
34
|
-
SignalListener:
|
|
38
|
+
SignalListener: BrowserSignalListener as ISdkFactoryParams['SignalListener'],
|
|
35
39
|
|
|
36
40
|
impressionListener: settings.impressionListener as SplitIO.IImpressionListener,
|
|
37
41
|
|
|
@@ -39,4 +43,20 @@ export function getModules(settings: ISettings, platform: IPlatform): ISdkFactor
|
|
|
39
43
|
|
|
40
44
|
impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
|
|
41
45
|
};
|
|
46
|
+
|
|
47
|
+
switch (settings.mode) {
|
|
48
|
+
case LOCALHOST_MODE:
|
|
49
|
+
modules.splitApiFactory = undefined;
|
|
50
|
+
modules.syncManagerFactory = settings.sync.localhostMode;
|
|
51
|
+
modules.SignalListener = undefined;
|
|
52
|
+
break;
|
|
53
|
+
case CONSUMER_MODE:
|
|
54
|
+
modules.syncManagerFactory = undefined;
|
|
55
|
+
break;
|
|
56
|
+
case CONSUMER_PARTIAL_MODE:
|
|
57
|
+
if (!syncManagerSubmittersFactory) syncManagerSubmittersFactory = syncManagerOnlineFactory(undefined, undefined);
|
|
58
|
+
modules.syncManagerFactory = syncManagerSubmittersFactory;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return modules;
|
|
42
62
|
}
|
package/src/settings/defaults.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/logger/index';
|
|
2
2
|
import { LogLevel } from '@splitsoftware/splitio-commons/src/types';
|
|
3
3
|
|
|
4
|
-
const packageVersion = '0.
|
|
4
|
+
const packageVersion = '0.2.1-rc.1';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
package/src/settings/full.ts
CHANGED
|
@@ -3,15 +3,15 @@ import { defaults } from './defaults';
|
|
|
3
3
|
import { validateStorageCS } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/storage/storageCS';
|
|
4
4
|
import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/integrations/pluggable';
|
|
5
5
|
import { validateLogger } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/logger/pluggableLogger';
|
|
6
|
-
import {
|
|
6
|
+
import { validateLocalhostWithDefault } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/localhost/builtin';
|
|
7
7
|
|
|
8
8
|
const params = {
|
|
9
9
|
defaults,
|
|
10
10
|
storage: validateStorageCS,
|
|
11
11
|
integrations: validatePluggableIntegrations,
|
|
12
12
|
logger: validateLogger,
|
|
13
|
-
// Full SplitFactory
|
|
14
|
-
localhost:
|
|
13
|
+
// Full SplitFactory returns a default instance, except a valid one is provided
|
|
14
|
+
localhost: validateLocalhostWithDefault
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export function settingsValidator(config: any) {
|
package/src/settings/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { defaults } from './defaults';
|
|
|
3
3
|
import { validateStorageCS } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/storage/storageCS';
|
|
4
4
|
import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/integrations/pluggable';
|
|
5
5
|
import { validateLogger } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/logger/pluggableLogger';
|
|
6
|
-
import { validateLocalhost } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/localhost';
|
|
6
|
+
import { validateLocalhost } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/localhost/pluggable';
|
|
7
7
|
|
|
8
8
|
const params = {
|
|
9
9
|
defaults,
|
package/src/splitFactory.ts
CHANGED
|
@@ -11,7 +11,7 @@ const platform = { getFetch, getEventSource, EventEmitter };
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Slim SplitFactory with pluggable modules for Browser.
|
|
14
|
-
* Doesn't include localhost mode
|
|
14
|
+
* Doesn't include localhost mode and fetch ponyfill out-of-the-box.
|
|
15
15
|
*
|
|
16
16
|
* @param config configuration object used to instantiates the SDK
|
|
17
17
|
* @param customModules optional object of SDK modules to overwrite default ones. Use with caution since, unlike `config`, this param is not validated.
|
package/types/full/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Declaration file for Javascript Browser Split Software SDK
|
|
1
|
+
// Declaration file for Javascript Browser Split Software SDK
|
|
2
2
|
// Project: http://www.split.io/
|
|
3
3
|
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
4
|
|
|
@@ -10,12 +10,13 @@ declare module JsSdk {
|
|
|
10
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
|
-
* and includes localhost mode
|
|
13
|
+
* and includes localhost mode out-of-the-box @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode}.
|
|
14
14
|
*
|
|
15
15
|
* The settings parameter should be an object that complies with the SplitIO.IBrowserSettings.
|
|
16
16
|
* For more information read the corresponding article: @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#configuration}
|
|
17
17
|
*/
|
|
18
18
|
export function SplitFactory(settings: SplitIO.IBrowserSettings): SplitIO.ISDK;
|
|
19
|
+
export function SplitFactory(settings: SplitIO.IBrowserAsyncSettings): SplitIO.IAsyncSDK;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Persistent storage based on the LocalStorage Web API for browsers.
|
|
@@ -24,6 +25,13 @@ declare module JsSdk {
|
|
|
24
25
|
*/
|
|
25
26
|
export function InLocalStorage(options?: SplitIO.InLocalStorageOptions): SplitIO.StorageSyncFactory;
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Pluggable storage to use the SDK in consumer mode.
|
|
30
|
+
*
|
|
31
|
+
* @see {@link @TODO}
|
|
32
|
+
*/
|
|
33
|
+
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
34
|
+
|
|
27
35
|
/**
|
|
28
36
|
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
|
29
37
|
*
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Declaration file for Javascript Browser Split Software SDK
|
|
1
|
+
// Declaration file for Javascript Browser Split Software SDK
|
|
2
2
|
// Project: http://www.split.io/
|
|
3
3
|
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
4
|
|
|
@@ -9,13 +9,14 @@ declare module JsSdk {
|
|
|
9
9
|
/**
|
|
10
10
|
* Slim version of the Split.io sdk factory function.
|
|
11
11
|
*
|
|
12
|
-
* Recommended to use for bundle size reduction in production, since it doesn't include localhost mode
|
|
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}.
|
|
14
14
|
*
|
|
15
15
|
* The settings parameter should be an object that complies with the SplitIO.IBrowserSettings.
|
|
16
16
|
* For more information read the corresponding article: @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#configuration}
|
|
17
17
|
*/
|
|
18
18
|
export function SplitFactory(settings: SplitIO.IBrowserSettings): SplitIO.ISDK;
|
|
19
|
+
export function SplitFactory(settings: SplitIO.IBrowserAsyncSettings): SplitIO.IAsyncSDK;
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Persistent storage based on the LocalStorage Web API for browsers.
|
|
@@ -24,6 +25,13 @@ declare module JsSdk {
|
|
|
24
25
|
*/
|
|
25
26
|
export function InLocalStorage(options?: SplitIO.InLocalStorageOptions): SplitIO.StorageSyncFactory;
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Pluggable storage to use the SDK in consumer mode.
|
|
30
|
+
*
|
|
31
|
+
* @see {@link @TODO}
|
|
32
|
+
*/
|
|
33
|
+
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
34
|
+
|
|
27
35
|
/**
|
|
28
36
|
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
|
29
37
|
*
|