@splitsoftware/splitio-browserjs 0.8.0 → 0.8.1-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/cjs/full/splitFactory.js +1 -1
- package/cjs/settings/defaults.js +1 -1
- package/cjs/settings/full.js +3 -3
- package/cjs/settings/index.js +3 -3
- package/cjs/splitFactory.js +1 -1
- package/esm/full/splitFactory.js +2 -2
- package/esm/settings/defaults.js +1 -1
- package/esm/settings/full.js +1 -1
- package/esm/settings/index.js +1 -1
- package/esm/splitFactory.js +2 -2
- package/package.json +6 -8
- package/src/full/splitFactory.ts +2 -2
- package/src/platform/getModules.ts +3 -3
- package/src/settings/defaults.ts +1 -1
- package/src/settings/full.ts +1 -1
- package/src/settings/index.ts +1 -1
- package/src/splitFactory.ts +2 -2
- package/types/full/index.d.ts +2 -3
- package/types/index.d.ts +1 -2
- package/types/splitio.d.ts +54 -1411
package/cjs/full/splitFactory.js
CHANGED
|
@@ -19,7 +19,7 @@ var platform = { getFetch: getFetchFull_1.getFetch, getEventSource: getEventSour
|
|
|
19
19
|
* @throws Will throw an error if the provided config is invalid.
|
|
20
20
|
*/
|
|
21
21
|
function SplitFactory(config, __updateModules) {
|
|
22
|
-
var settings = (0, full_1.
|
|
22
|
+
var settings = (0, full_1.settingsFactory)(config);
|
|
23
23
|
var modules = (0, getModules_1.getModules)(settings, platform);
|
|
24
24
|
if (__updateModules)
|
|
25
25
|
__updateModules(modules);
|
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.8.0';
|
|
6
|
+
var packageVersion = '0.8.1-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'.
|
package/cjs/settings/full.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.settingsFactory = void 0;
|
|
4
4
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/index");
|
|
5
5
|
var defaults_1 = require("./defaults");
|
|
6
6
|
var runtime_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/runtime");
|
|
@@ -19,7 +19,7 @@ var params = {
|
|
|
19
19
|
localhost: builtin_1.validateLocalhostWithDefault,
|
|
20
20
|
consent: consent_1.validateConsent,
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function settingsFactory(config) {
|
|
23
23
|
return (0, index_1.settingsValidation)(config, params);
|
|
24
24
|
}
|
|
25
|
-
exports.
|
|
25
|
+
exports.settingsFactory = settingsFactory;
|
package/cjs/settings/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.settingsFactory = void 0;
|
|
4
4
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/index");
|
|
5
5
|
var defaults_1 = require("./defaults");
|
|
6
6
|
var runtime_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/runtime");
|
|
@@ -19,7 +19,7 @@ var params = {
|
|
|
19
19
|
localhost: pluggable_2.validateLocalhost,
|
|
20
20
|
consent: consent_1.validateConsent,
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function settingsFactory(config) {
|
|
23
23
|
return (0, index_1.settingsValidation)(config, params);
|
|
24
24
|
}
|
|
25
|
-
exports.
|
|
25
|
+
exports.settingsFactory = settingsFactory;
|
package/cjs/splitFactory.js
CHANGED
|
@@ -19,7 +19,7 @@ var platform = { getFetch: getFetchSlim_1.getFetch, getEventSource: getEventSour
|
|
|
19
19
|
* @throws Will throw an error if the provided config is invalid.
|
|
20
20
|
*/
|
|
21
21
|
function SplitFactory(config, __updateModules) {
|
|
22
|
-
var settings = (0, settings_1.
|
|
22
|
+
var settings = (0, settings_1.settingsFactory)(config);
|
|
23
23
|
var modules = (0, getModules_1.getModules)(settings, platform);
|
|
24
24
|
if (__updateModules)
|
|
25
25
|
__updateModules(modules);
|
package/esm/full/splitFactory.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { settingsFactory } from '../settings/full';
|
|
2
2
|
import { getModules } from '../platform/getModules';
|
|
3
3
|
import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory/index';
|
|
4
4
|
import { getFetch } from '../platform/getFetchFull';
|
|
@@ -16,7 +16,7 @@ var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitte
|
|
|
16
16
|
* @throws Will throw an error if the provided config is invalid.
|
|
17
17
|
*/
|
|
18
18
|
export function SplitFactory(config, __updateModules) {
|
|
19
|
-
var settings =
|
|
19
|
+
var settings = settingsFactory(config);
|
|
20
20
|
var modules = getModules(settings, platform);
|
|
21
21
|
if (__updateModules)
|
|
22
22
|
__updateModules(modules);
|
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.8.0';
|
|
3
|
+
var packageVersion = '0.8.1-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'.
|
package/esm/settings/full.js
CHANGED
package/esm/settings/index.js
CHANGED
package/esm/splitFactory.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { settingsFactory } from './settings';
|
|
2
2
|
import { getModules } from './platform/getModules';
|
|
3
3
|
import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory/index';
|
|
4
4
|
import { getFetch } from './platform/getFetchSlim';
|
|
@@ -16,7 +16,7 @@ var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitte
|
|
|
16
16
|
* @throws Will throw an error if the provided config is invalid.
|
|
17
17
|
*/
|
|
18
18
|
export function SplitFactory(config, __updateModules) {
|
|
19
|
-
var settings =
|
|
19
|
+
var settings = settingsFactory(config);
|
|
20
20
|
var modules = getModules(settings, platform);
|
|
21
21
|
if (__updateModules)
|
|
22
22
|
__updateModules(modules);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.8.0",
|
|
3
|
+
"version": "0.8.1-rc.0",
|
|
4
4
|
"description": "Split SDK for Javascript on Browser",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -30,18 +30,16 @@
|
|
|
30
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
31
|
"test": "npm run test:unit && npm run test:e2e",
|
|
32
32
|
"test:unit": "jest",
|
|
33
|
-
"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-
|
|
33
|
+
"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-gaIntegration && npm run test:e2e-consumer",
|
|
34
34
|
"test:e2e-logger": "karma start karma/e2e.logger.karma.conf.js",
|
|
35
35
|
"test:e2e-offline": "karma start karma/e2e.offline.karma.conf.js",
|
|
36
36
|
"test:e2e-online": "karma start karma/e2e.online.karma.conf.js",
|
|
37
37
|
"test:e2e-destroy": "karma start karma/e2e.destroy.karma.conf.js",
|
|
38
|
-
"test:e2e-
|
|
38
|
+
"test:e2e-errorCatching": "karma start karma/e2e.errorCatching.karma.conf.js",
|
|
39
39
|
"test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
|
|
40
|
-
"test:e2e-
|
|
40
|
+
"test:e2e-gaIntegration": "karma start karma/e2e.gaIntegration.karma.conf.js",
|
|
41
41
|
"test:e2e-consumer": "karma start karma/e2e.consumer.karma.conf.js",
|
|
42
|
-
"
|
|
43
|
-
"test-ts-decls": "./scripts/ts-tests.sh",
|
|
44
|
-
"posttest-ts-decls": "npm unlink && npm install",
|
|
42
|
+
"test-ts-decls": "tsc --build ts-tests",
|
|
45
43
|
"publish:rc": "npm run check && npm run build && npm publish --tag rc",
|
|
46
44
|
"publish:stable": "npm run check && npm run build && npm publish"
|
|
47
45
|
},
|
|
@@ -63,7 +61,7 @@
|
|
|
63
61
|
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
|
|
64
62
|
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
|
|
65
63
|
"dependencies": {
|
|
66
|
-
"@splitsoftware/splitio-commons": "1.6.
|
|
64
|
+
"@splitsoftware/splitio-commons": "1.6.2-rc.4",
|
|
67
65
|
"@types/google.analytics": "0.0.40"
|
|
68
66
|
},
|
|
69
67
|
"devDependencies": {
|
package/src/full/splitFactory.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { settingsFactory } from '../settings/full';
|
|
2
2
|
import { getModules } from '../platform/getModules';
|
|
3
3
|
import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory/index';
|
|
4
4
|
import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
|
|
@@ -19,7 +19,7 @@ const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
|
19
19
|
* @throws Will throw an error if the provided config is invalid.
|
|
20
20
|
*/
|
|
21
21
|
export function SplitFactory(config: any, __updateModules?: (modules: ISdkFactoryParams) => void) {
|
|
22
|
-
const settings =
|
|
22
|
+
const settings = settingsFactory(config);
|
|
23
23
|
const modules = getModules(settings, platform);
|
|
24
24
|
if (__updateModules) __updateModules(modules);
|
|
25
25
|
return sdkFactory(modules);
|
|
@@ -10,7 +10,7 @@ import { pluggableIntegrationsManagerFactory } from '@splitsoftware/splitio-comm
|
|
|
10
10
|
|
|
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
|
-
import { ISettings } from '@splitsoftware/splitio-commons/src/types';
|
|
13
|
+
import { IntegrationFactory, ISettings } from '@splitsoftware/splitio-commons/src/types';
|
|
14
14
|
import { CONSUMER_MODE, CONSUMER_PARTIAL_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
15
15
|
import { createUserConsentAPI } from '@splitsoftware/splitio-commons/src/consent/sdkUserConsent';
|
|
16
16
|
|
|
@@ -26,7 +26,7 @@ export function getModules(settings: ISettings, platform: IPlatform): ISdkFactor
|
|
|
26
26
|
|
|
27
27
|
platform,
|
|
28
28
|
|
|
29
|
-
storageFactory: settings.storage,
|
|
29
|
+
storageFactory: settings.storage as ISdkFactoryParams['storageFactory'],
|
|
30
30
|
|
|
31
31
|
splitApiFactory,
|
|
32
32
|
|
|
@@ -38,7 +38,7 @@ export function getModules(settings: ISettings, platform: IPlatform): ISdkFactor
|
|
|
38
38
|
|
|
39
39
|
SignalListener: BrowserSignalListener as ISdkFactoryParams['SignalListener'],
|
|
40
40
|
|
|
41
|
-
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggableIntegrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
41
|
+
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggableIntegrationsManagerFactory.bind(null, settings.integrations as IntegrationFactory[]) : undefined,
|
|
42
42
|
|
|
43
43
|
impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
|
|
44
44
|
|
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.8.0';
|
|
5
|
+
const packageVersion = '0.8.1-rc.0';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
package/src/settings/full.ts
CHANGED
package/src/settings/index.ts
CHANGED
package/src/splitFactory.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { settingsFactory } from './settings';
|
|
2
2
|
import { getModules } from './platform/getModules';
|
|
3
3
|
import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory/index';
|
|
4
4
|
import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
|
|
@@ -19,7 +19,7 @@ const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
|
19
19
|
* @throws Will throw an error if the provided config is invalid.
|
|
20
20
|
*/
|
|
21
21
|
export function SplitFactory(config: any, __updateModules?: (modules: ISdkFactoryParams) => void) {
|
|
22
|
-
const settings =
|
|
22
|
+
const settings = settingsFactory(config);
|
|
23
23
|
const modules = getModules(settings, platform);
|
|
24
24
|
if (__updateModules) __updateModules(modules);
|
|
25
25
|
return sdkFactory(modules);
|
package/types/full/index.d.ts
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
4
|
|
|
5
5
|
/// <reference path="../splitio.d.ts" />
|
|
6
|
-
export = JsSdk;
|
|
7
6
|
|
|
8
|
-
declare module
|
|
7
|
+
declare module '@splitsoftware/splitio-browserjs/full' {
|
|
9
8
|
/**
|
|
10
9
|
* Full version of the Split.io sdk factory function.
|
|
11
10
|
*
|
|
@@ -30,7 +29,7 @@ declare module JsSdk {
|
|
|
30
29
|
*
|
|
31
30
|
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
|
|
32
31
|
*/
|
|
33
|
-
|
|
32
|
+
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
34
33
|
|
|
35
34
|
/**
|
|
36
35
|
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
package/types/index.d.ts
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
4
|
|
|
5
5
|
/// <reference path="./splitio.d.ts" />
|
|
6
|
-
export = JsSdk;
|
|
7
6
|
|
|
8
|
-
declare module
|
|
7
|
+
declare module '@splitsoftware/splitio-browserjs' {
|
|
9
8
|
/**
|
|
10
9
|
* Slim version of the Split.io sdk factory function.
|
|
11
10
|
*
|