@splitsoftware/splitio-browserjs 0.8.1-rc.0 → 0.8.1-rc.2
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 +3 -0
- package/cjs/platform/getModules.js +1 -2
- package/cjs/settings/defaults.js +1 -1
- package/esm/platform/getModules.js +1 -2
- package/esm/settings/defaults.js +1 -1
- package/package.json +6 -3
- package/src/full/splitFactory.ts +2 -1
- package/src/platform/getModules.ts +4 -5
- package/src/settings/defaults.ts +1 -1
- package/src/splitFactory.ts +2 -1
- package/types/full/index.d.ts +3 -2
- package/types/index.d.ts +2 -1
- package/types/splitio.d.ts +1411 -54
package/CHANGES.txt
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
0.8.1 (September XXX, 2022)
|
|
2
|
+
- Updated @splitsoftware/splitio-commons package to version 1.6.2, that improves the performance of split evaluations (i.e., `getTreatment(s)` method calls) when using the default storage in memory.
|
|
3
|
+
|
|
1
4
|
0.8.0 (July 22, 2022)
|
|
2
5
|
- Added `autoRequire` configuration option to the Google Analytics to Split integration, which takes care of requiring the splitTracker plugin on trackers dynamically created by Google tag managers (See https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js).
|
|
3
6
|
- Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in modern mobile and desktop Web browsers.
|
|
@@ -10,7 +10,6 @@ var sdkClientMethodCS_1 = require("@splitsoftware/splitio-commons/cjs/sdkClient/
|
|
|
10
10
|
var browser_1 = require("@splitsoftware/splitio-commons/cjs/listeners/browser");
|
|
11
11
|
var impressionObserverCS_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/impressionObserverCS");
|
|
12
12
|
var pluggable_1 = require("@splitsoftware/splitio-commons/cjs/integrations/pluggable");
|
|
13
|
-
var utils_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/utils");
|
|
14
13
|
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
15
14
|
var sdkUserConsent_1 = require("@splitsoftware/splitio-commons/cjs/consent/sdkUserConsent");
|
|
16
15
|
var syncManagerStandaloneFactory;
|
|
@@ -28,7 +27,7 @@ function getModules(settings, platform) {
|
|
|
28
27
|
sdkClientMethodFactory: sdkClientMethodCS_1.sdkClientMethodCSFactory,
|
|
29
28
|
SignalListener: browser_1.BrowserSignalListener,
|
|
30
29
|
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggable_1.pluggableIntegrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
31
|
-
impressionsObserverFactory:
|
|
30
|
+
impressionsObserverFactory: impressionObserverCS_1.impressionObserverCSFactory,
|
|
32
31
|
extraProps: function (params) {
|
|
33
32
|
return {
|
|
34
33
|
UserConsent: (0, sdkUserConsent_1.createUserConsentAPI)(params)
|
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.1-rc.
|
|
6
|
+
var packageVersion = '0.8.1-rc.2';
|
|
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'.
|
|
@@ -7,7 +7,6 @@ import { sdkClientMethodCSFactory } from '@splitsoftware/splitio-commons/esm/sdk
|
|
|
7
7
|
import { BrowserSignalListener } from '@splitsoftware/splitio-commons/esm/listeners/browser';
|
|
8
8
|
import { impressionObserverCSFactory } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/impressionObserverCS';
|
|
9
9
|
import { pluggableIntegrationsManagerFactory } from '@splitsoftware/splitio-commons/esm/integrations/pluggable';
|
|
10
|
-
import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/utils';
|
|
11
10
|
import { CONSUMER_MODE, CONSUMER_PARTIAL_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
12
11
|
import { createUserConsentAPI } from '@splitsoftware/splitio-commons/esm/consent/sdkUserConsent';
|
|
13
12
|
var syncManagerStandaloneFactory;
|
|
@@ -25,7 +24,7 @@ export function getModules(settings, platform) {
|
|
|
25
24
|
sdkClientMethodFactory: sdkClientMethodCSFactory,
|
|
26
25
|
SignalListener: BrowserSignalListener,
|
|
27
26
|
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggableIntegrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
28
|
-
impressionsObserverFactory:
|
|
27
|
+
impressionsObserverFactory: impressionObserverCSFactory,
|
|
29
28
|
extraProps: function (params) {
|
|
30
29
|
return {
|
|
31
30
|
UserConsent: createUserConsentAPI(params)
|
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.1-rc.
|
|
3
|
+
var packageVersion = '0.8.1-rc.2';
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.8.1-rc.
|
|
3
|
+
"version": "0.8.1-rc.2",
|
|
4
4
|
"description": "Split SDK for Javascript on Browser",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -39,7 +39,10 @@
|
|
|
39
39
|
"test:e2e-push": "karma start karma/e2e.push.karma.conf.js",
|
|
40
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
|
-
"
|
|
42
|
+
"pretest-ts-decls": "npm run build:esm && npm run build:cjs && npm link",
|
|
43
|
+
"test-ts-decls": "./scripts/ts-tests.sh",
|
|
44
|
+
"posttest-ts-decls": "npm unlink && npm install",
|
|
45
|
+
"all": "npm run check && npm run build && npm run test-ts-decls && npm run test",
|
|
43
46
|
"publish:rc": "npm run check && npm run build && npm publish --tag rc",
|
|
44
47
|
"publish:stable": "npm run check && npm run build && npm publish"
|
|
45
48
|
},
|
|
@@ -61,7 +64,7 @@
|
|
|
61
64
|
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
|
|
62
65
|
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
|
|
63
66
|
"dependencies": {
|
|
64
|
-
"@splitsoftware/splitio-commons": "1.6.2-rc.
|
|
67
|
+
"@splitsoftware/splitio-commons": "1.6.2-rc.13",
|
|
65
68
|
"@types/google.analytics": "0.0.40"
|
|
66
69
|
},
|
|
67
70
|
"devDependencies": {
|
package/src/full/splitFactory.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { getFetch } from '../platform/getFetchFull';
|
|
|
6
6
|
import { getEventSource } from '../platform/getEventSource';
|
|
7
7
|
import { EventEmitter } from '@splitsoftware/splitio-commons/src/utils/MinEvents';
|
|
8
8
|
import { now } from '@splitsoftware/splitio-commons/src/utils/timeTracker/now/browser';
|
|
9
|
+
import { IBrowserSettings } from '../../types/splitio';
|
|
9
10
|
|
|
10
11
|
const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
11
12
|
|
|
@@ -18,7 +19,7 @@ const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
|
18
19
|
* caution since, unlike `config`, this param is not validated neither considered part of the public API.
|
|
19
20
|
* @throws Will throw an error if the provided config is invalid.
|
|
20
21
|
*/
|
|
21
|
-
export function SplitFactory(config:
|
|
22
|
+
export function SplitFactory(config: IBrowserSettings, __updateModules?: (modules: ISdkFactoryParams) => void) {
|
|
22
23
|
const settings = settingsFactory(config);
|
|
23
24
|
const modules = getModules(settings, platform);
|
|
24
25
|
if (__updateModules) __updateModules(modules);
|
|
@@ -8,9 +8,8 @@ import { BrowserSignalListener } from '@splitsoftware/splitio-commons/src/listen
|
|
|
8
8
|
import { impressionObserverCSFactory } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/impressionObserverCS';
|
|
9
9
|
import { pluggableIntegrationsManagerFactory } from '@splitsoftware/splitio-commons/src/integrations/pluggable';
|
|
10
10
|
|
|
11
|
-
import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/utils';
|
|
12
11
|
import { IPlatform, ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
|
|
13
|
-
import {
|
|
12
|
+
import { ISettings } from '@splitsoftware/splitio-commons/src/types';
|
|
14
13
|
import { CONSUMER_MODE, CONSUMER_PARTIAL_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
15
14
|
import { createUserConsentAPI } from '@splitsoftware/splitio-commons/src/consent/sdkUserConsent';
|
|
16
15
|
|
|
@@ -26,7 +25,7 @@ export function getModules(settings: ISettings, platform: IPlatform): ISdkFactor
|
|
|
26
25
|
|
|
27
26
|
platform,
|
|
28
27
|
|
|
29
|
-
storageFactory: settings.storage
|
|
28
|
+
storageFactory: settings.storage,
|
|
30
29
|
|
|
31
30
|
splitApiFactory,
|
|
32
31
|
|
|
@@ -38,9 +37,9 @@ export function getModules(settings: ISettings, platform: IPlatform): ISdkFactor
|
|
|
38
37
|
|
|
39
38
|
SignalListener: BrowserSignalListener as ISdkFactoryParams['SignalListener'],
|
|
40
39
|
|
|
41
|
-
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggableIntegrationsManagerFactory.bind(null, settings.integrations
|
|
40
|
+
integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? pluggableIntegrationsManagerFactory.bind(null, settings.integrations) : undefined,
|
|
42
41
|
|
|
43
|
-
impressionsObserverFactory:
|
|
42
|
+
impressionsObserverFactory: impressionObserverCSFactory,
|
|
44
43
|
|
|
45
44
|
extraProps: (params) => {
|
|
46
45
|
return {
|
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.1-rc.
|
|
5
|
+
const packageVersion = '0.8.1-rc.2';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
package/src/splitFactory.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { getFetch } from './platform/getFetchSlim';
|
|
|
6
6
|
import { getEventSource } from './platform/getEventSource';
|
|
7
7
|
import { EventEmitter } from '@splitsoftware/splitio-commons/src/utils/MinEvents';
|
|
8
8
|
import { now } from '@splitsoftware/splitio-commons/src/utils/timeTracker/now/browser';
|
|
9
|
+
import { IBrowserSettings } from '../types/splitio';
|
|
9
10
|
|
|
10
11
|
const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
11
12
|
|
|
@@ -18,7 +19,7 @@ const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
|
18
19
|
* caution since, unlike `config`, this param is not validated neither considered part of the public API.
|
|
19
20
|
* @throws Will throw an error if the provided config is invalid.
|
|
20
21
|
*/
|
|
21
|
-
export function SplitFactory(config:
|
|
22
|
+
export function SplitFactory(config: IBrowserSettings, __updateModules?: (modules: ISdkFactoryParams) => void) {
|
|
22
23
|
const settings = settingsFactory(config);
|
|
23
24
|
const modules = getModules(settings, platform);
|
|
24
25
|
if (__updateModules) __updateModules(modules);
|
package/types/full/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
4
|
|
|
5
5
|
/// <reference path="../splitio.d.ts" />
|
|
6
|
+
export = JsSdk;
|
|
6
7
|
|
|
7
|
-
declare module
|
|
8
|
+
declare module JsSdk {
|
|
8
9
|
/**
|
|
9
10
|
* Full version of the Split.io sdk factory function.
|
|
10
11
|
*
|
|
@@ -29,7 +30,7 @@ declare module '@splitsoftware/splitio-browserjs/full' {
|
|
|
29
30
|
*
|
|
30
31
|
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
package/types/index.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
4
|
|
|
5
5
|
/// <reference path="./splitio.d.ts" />
|
|
6
|
+
export = JsSdk;
|
|
6
7
|
|
|
7
|
-
declare module
|
|
8
|
+
declare module JsSdk {
|
|
8
9
|
/**
|
|
9
10
|
* Slim version of the Split.io sdk factory function.
|
|
10
11
|
*
|