@splitsoftware/splitio-browserjs 0.15.1-rc.0 → 1.0.0-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 +12 -7
- package/cjs/index.js +1 -7
- package/cjs/platform/getModules.js +2 -1
- package/cjs/settings/defaults.js +1 -3
- package/cjs/settings/index.js +0 -6
- package/cjs/splitFactory.js +3 -4
- package/cjs/{full/umd.js → umd-full.js} +0 -4
- package/esm/index.js +0 -3
- package/esm/platform/getModules.js +2 -1
- package/esm/settings/defaults.js +1 -3
- package/esm/settings/index.js +0 -6
- package/esm/splitFactory.js +2 -3
- package/esm/{full/umd.js → umd-full.js} +0 -4
- package/package.json +5 -13
- package/src/index.ts +0 -3
- package/src/platform/getModules.ts +2 -2
- package/src/settings/defaults.ts +1 -3
- package/src/settings/index.ts +0 -6
- package/src/splitFactory.ts +4 -5
- package/src/{full/umd.ts → umd-full.ts} +0 -4
- package/types/index.d.ts +6 -30
- package/cjs/full/index.js +0 -21
- package/cjs/full/splitFactory.js +0 -28
- package/cjs/platform/getFetchFull.js +0 -9
- package/cjs/settings/full.js +0 -30
- package/esm/full/index.js +0 -9
- package/esm/full/splitFactory.js +0 -24
- package/esm/platform/getFetchFull.js +0 -4
- package/esm/settings/full.js +0 -26
- package/full/package.json +0 -6
- package/scripts/ga-to-split-autorequire.js +0 -1
- package/src/full/index.ts +0 -9
- package/src/full/splitFactory.ts +0 -27
- package/src/platform/getFetchFull.ts +0 -6
- package/src/settings/full.ts +0 -29
- package/types/full/index.d.ts +0 -76
- package/types/splitio.d.ts +0 -1734
- /package/cjs/platform/{getFetchSlim.js → getFetch.js} +0 -0
- /package/esm/platform/{getFetchSlim.js → getFetch.js} +0 -0
- /package/src/platform/{getFetchSlim.ts → getFetch.ts} +0 -0
package/esm/full/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { SplitFactory } from './splitFactory';
|
|
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
|
-
export { ErrorLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/ErrorLogger';
|
|
6
|
-
export { WarnLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/WarnLogger';
|
|
7
|
-
export { InfoLogger } from '@splitsoftware/splitio-commons/esm/logger/browser/InfoLogger';
|
|
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
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { settingsFactory } from '../settings/full';
|
|
2
|
-
import { getModules } from '../platform/getModules';
|
|
3
|
-
import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory/index';
|
|
4
|
-
import { getFetch } from '../platform/getFetchFull';
|
|
5
|
-
import { getEventSource } from '../platform/getEventSource';
|
|
6
|
-
import { EventEmitter } from '@splitsoftware/splitio-commons/esm/utils/MinEvents';
|
|
7
|
-
import { now } from '@splitsoftware/splitio-commons/esm/utils/timeTracker/now/browser';
|
|
8
|
-
var platform = { getFetch: getFetch, getEventSource: getEventSource, EventEmitter: EventEmitter, now: now };
|
|
9
|
-
/**
|
|
10
|
-
* SplitFactory with pluggable modules for Browser.
|
|
11
|
-
* Includes localhost mode and fetch polyfill out-of-the-box.
|
|
12
|
-
*
|
|
13
|
-
* @param config configuration object used to instantiate the SDK
|
|
14
|
-
* @param __updateModules optional function that lets redefine internal SDK modules. Use with
|
|
15
|
-
* caution since, unlike `config`, this param is not validated neither considered part of the public API.
|
|
16
|
-
* @throws Will throw an error if the provided config is invalid.
|
|
17
|
-
*/
|
|
18
|
-
export function SplitFactory(config, __updateModules) {
|
|
19
|
-
var settings = settingsFactory(config);
|
|
20
|
-
var modules = getModules(settings, platform);
|
|
21
|
-
if (__updateModules)
|
|
22
|
-
__updateModules(modules);
|
|
23
|
-
return sdkFactory(modules);
|
|
24
|
-
}
|
package/esm/settings/full.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { settingsValidation } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/index';
|
|
2
|
-
import { defaults } from './defaults';
|
|
3
|
-
import { validateRuntime } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/runtime';
|
|
4
|
-
import { validateStorageCS } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/storage/storageCS';
|
|
5
|
-
import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/integrations/pluggable';
|
|
6
|
-
import { validateLogger } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/logger/pluggableLogger';
|
|
7
|
-
import { validateLocalhostWithDefault } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/localhost/builtin';
|
|
8
|
-
import { validateConsent } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/consent';
|
|
9
|
-
import { STANDALONE_MODE } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
10
|
-
var params = {
|
|
11
|
-
defaults: defaults,
|
|
12
|
-
acceptKey: true,
|
|
13
|
-
runtime: validateRuntime,
|
|
14
|
-
storage: validateStorageCS,
|
|
15
|
-
integrations: validatePluggableIntegrations,
|
|
16
|
-
logger: validateLogger,
|
|
17
|
-
localhost: validateLocalhostWithDefault,
|
|
18
|
-
consent: validateConsent,
|
|
19
|
-
};
|
|
20
|
-
export function settingsFactory(config) {
|
|
21
|
-
var settings = settingsValidation(config, params);
|
|
22
|
-
// @ts-ignore, Override in localhost and consumer modes to emit SDK_READY event
|
|
23
|
-
if (settings.mode !== STANDALONE_MODE)
|
|
24
|
-
settings.sync.largeSegmentsEnabled = false;
|
|
25
|
-
return settings;
|
|
26
|
-
}
|
package/full/package.json
DELETED
|
@@ -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");
|
package/src/full/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { SplitFactory } from './splitFactory';
|
|
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
|
-
export { ErrorLogger } from '@splitsoftware/splitio-commons/src/logger/browser/ErrorLogger';
|
|
6
|
-
export { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/WarnLogger';
|
|
7
|
-
export { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
|
|
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
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { settingsFactory } from '../settings/full';
|
|
2
|
-
import { getModules } from '../platform/getModules';
|
|
3
|
-
import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory/index';
|
|
4
|
-
import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types';
|
|
5
|
-
import { getFetch } from '../platform/getFetchFull';
|
|
6
|
-
import { getEventSource } from '../platform/getEventSource';
|
|
7
|
-
import { EventEmitter } from '@splitsoftware/splitio-commons/src/utils/MinEvents';
|
|
8
|
-
import { now } from '@splitsoftware/splitio-commons/src/utils/timeTracker/now/browser';
|
|
9
|
-
import { IBrowserSettings } from '../../types/splitio';
|
|
10
|
-
|
|
11
|
-
const platform = { getFetch, getEventSource, EventEmitter, now };
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* SplitFactory with pluggable modules for Browser.
|
|
15
|
-
* Includes localhost mode and fetch polyfill out-of-the-box.
|
|
16
|
-
*
|
|
17
|
-
* @param config configuration object used to instantiate the SDK
|
|
18
|
-
* @param __updateModules optional function that lets redefine internal SDK modules. Use with
|
|
19
|
-
* caution since, unlike `config`, this param is not validated neither considered part of the public API.
|
|
20
|
-
* @throws Will throw an error if the provided config is invalid.
|
|
21
|
-
*/
|
|
22
|
-
export function SplitFactory(config: IBrowserSettings, __updateModules?: (modules: ISdkFactoryParams) => void) {
|
|
23
|
-
const settings = settingsFactory(config);
|
|
24
|
-
const modules = getModules(settings, platform);
|
|
25
|
-
if (__updateModules) __updateModules(modules);
|
|
26
|
-
return sdkFactory(modules);
|
|
27
|
-
}
|
package/src/settings/full.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { settingsValidation } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/index';
|
|
2
|
-
import { defaults } from './defaults';
|
|
3
|
-
import { validateRuntime } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/runtime';
|
|
4
|
-
import { validateStorageCS } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/storage/storageCS';
|
|
5
|
-
import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/integrations/pluggable';
|
|
6
|
-
import { validateLogger } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/logger/pluggableLogger';
|
|
7
|
-
import { validateLocalhostWithDefault } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/localhost/builtin';
|
|
8
|
-
import { validateConsent } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/consent';
|
|
9
|
-
import { STANDALONE_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
10
|
-
|
|
11
|
-
const params = {
|
|
12
|
-
defaults,
|
|
13
|
-
acceptKey: true, // Client with bound key
|
|
14
|
-
runtime: validateRuntime,
|
|
15
|
-
storage: validateStorageCS,
|
|
16
|
-
integrations: validatePluggableIntegrations,
|
|
17
|
-
logger: validateLogger,
|
|
18
|
-
localhost: validateLocalhostWithDefault, // Full SplitFactory provides a default localhost module, except a valid one is provided
|
|
19
|
-
consent: validateConsent,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export function settingsFactory(config: any) {
|
|
23
|
-
const settings = settingsValidation(config, params);
|
|
24
|
-
|
|
25
|
-
// @ts-ignore, Override in localhost and consumer modes to emit SDK_READY event
|
|
26
|
-
if (settings.mode !== STANDALONE_MODE) settings.sync.largeSegmentsEnabled = false;
|
|
27
|
-
|
|
28
|
-
return settings;
|
|
29
|
-
}
|
package/types/full/index.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Declaration file for JavaScript Browser Split Software SDK
|
|
2
|
-
// Project: http://www.split.io/
|
|
3
|
-
// Definitions by: Nico Zelaya <https://github.com/NicoZelaya/>
|
|
4
|
-
|
|
5
|
-
/// <reference path="../splitio.d.ts" />
|
|
6
|
-
export = JsSdk;
|
|
7
|
-
|
|
8
|
-
declare module JsSdk {
|
|
9
|
-
/**
|
|
10
|
-
* Full version of the Split.io sdk factory function.
|
|
11
|
-
*
|
|
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 out-of-the-box @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#localhost-mode}.
|
|
14
|
-
*
|
|
15
|
-
* The settings parameter should be an object that complies with the SplitIO.IBrowserSettings.
|
|
16
|
-
* For more information read the corresponding article: @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#configuration}
|
|
17
|
-
*/
|
|
18
|
-
export function SplitFactory(settings: SplitIO.IBrowserSettings): SplitIO.ISDK;
|
|
19
|
-
export function SplitFactory(settings: SplitIO.IBrowserAsyncSettings): SplitIO.IAsyncSDK;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Persistent storage based on the LocalStorage Web API for browsers.
|
|
23
|
-
*
|
|
24
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#storage}
|
|
25
|
-
*/
|
|
26
|
-
export function InLocalStorage(options?: SplitIO.InLocalStorageOptions): SplitIO.StorageSyncFactory;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Pluggable storage to use the SDK in consumer mode.
|
|
30
|
-
*
|
|
31
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#sharing-state-with-a-pluggable-storage}
|
|
32
|
-
*/
|
|
33
|
-
export function PluggableStorage(options: SplitIO.PluggableStorageOptions): SplitIO.StorageAsyncFactory;
|
|
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
|
-
/**
|
|
50
|
-
* Creates a logger instance that enables descriptive log messages with DEBUG log level when passed in the factory settings.
|
|
51
|
-
*
|
|
52
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
|
|
53
|
-
*/
|
|
54
|
-
export function DebugLogger(): SplitIO.ILogger;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Creates a logger instance that enables descriptive log messages with INFO log level when passed in the factory settings.
|
|
58
|
-
*
|
|
59
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
|
|
60
|
-
*/
|
|
61
|
-
export function InfoLogger(): SplitIO.ILogger;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Creates a logger instance that enables descriptive log messages with WARN log level when passed in the factory settings.
|
|
65
|
-
*
|
|
66
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
|
|
67
|
-
*/
|
|
68
|
-
export function WarnLogger(): SplitIO.ILogger;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Creates a logger instance that enables descriptive log messages with ERROR log level when passed in the factory settings.
|
|
72
|
-
*
|
|
73
|
-
* @see {@link https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK#logging}
|
|
74
|
-
*/
|
|
75
|
-
export function ErrorLogger(): SplitIO.ILogger;
|
|
76
|
-
}
|