@splitsoftware/splitio 10.21.0 → 10.21.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/CHANGES.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 10.21.1 (July 25, 2022)
2
+ - Bugfixing - Added missed type definitions `enabled` from `sync`.
3
+
1
4
  10.21.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.
@@ -11,7 +11,6 @@ import { integrationsManagerFactory } from '@splitsoftware/splitio-commons/esm/i
11
11
  import { __InLocalStorageMockFactory } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/storage/storageCS';
12
12
  import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory';
13
13
  import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE } from '@splitsoftware/splitio-commons/esm/utils/constants';
14
- import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/utils';
15
14
  import { createUserConsentAPI } from '@splitsoftware/splitio-commons/esm/consent/sdkUserConsent';
16
15
  import { settingsFactory } from '../settings/browser';
17
16
  import { platform, SignalListener } from '../platform';
@@ -38,7 +37,7 @@ function getModules(settings) {
38
37
  sdkClientMethodFactory: sdkClientMethodCSFactory,
39
38
  SignalListener: SignalListener,
40
39
  integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? integrationsManagerFactory.bind(null, settings.integrations) : undefined,
41
- impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
40
+ impressionsObserverFactory: impressionObserverCSFactory,
42
41
  extraProps: function (params) {
43
42
  return {
44
43
  UserConsent: createUserConsentAPI(params)
@@ -9,9 +9,9 @@ import { sdkClientMethodFactory } from '@splitsoftware/splitio-commons/esm/sdkCl
9
9
  import { impressionObserverSSFactory } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/impressionObserverSS';
10
10
  import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory';
11
11
  import { CONSUMER_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/esm/utils/constants';
12
- import { shouldAddPt } from '@splitsoftware/splitio-commons/esm/trackers/impressionObserver/utils';
13
12
  import { settingsFactory } from '../settings/node';
14
13
  import { platform, SignalListener } from '../platform';
14
+ import { bloomFilterFactory } from '../platform/filter/bloomFilter';
15
15
  var syncManagerOnlineSSFactory = syncManagerOnlineFactory(pollingManagerSSFactory, pushManagerFactory);
16
16
  function getStorage(settings) {
17
17
  return settings.storage.type === 'REDIS' ?
@@ -32,7 +32,8 @@ function getModules(settings) {
32
32
  sdkManagerFactory: sdkManagerFactory,
33
33
  sdkClientMethodFactory: sdkClientMethodFactory,
34
34
  SignalListener: SignalListener,
35
- impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverSSFactory : undefined,
35
+ impressionsObserverFactory: impressionObserverSSFactory,
36
+ filterAdapterFactory: bloomFilterFactory
36
37
  };
37
38
  switch (settings.mode) {
38
39
  case LOCALHOST_MODE:
@@ -0,0 +1,25 @@
1
+ import { BloomFilter } from '@ably/bloomit';
2
+ var EXPECTED_INSERTIONS = 10000000;
3
+ var ERROR_RATE = 0.01;
4
+ export function bloomFilterFactory(expectedInsertions, errorRate) {
5
+ if (expectedInsertions === void 0) { expectedInsertions = EXPECTED_INSERTIONS; }
6
+ if (errorRate === void 0) { errorRate = ERROR_RATE; }
7
+ var filter = BloomFilter.create(expectedInsertions, errorRate);
8
+ return {
9
+ add: function (key, value) {
10
+ var data = key + ":" + value;
11
+ if (filter.has(data)) {
12
+ return false;
13
+ }
14
+ filter.add(data);
15
+ return true;
16
+ },
17
+ contains: function (key, value) {
18
+ var data = key + ":" + value;
19
+ return filter.has(data);
20
+ },
21
+ clear: function () {
22
+ filter = BloomFilter.create(expectedInsertions, errorRate);
23
+ }
24
+ };
25
+ }
@@ -1 +1 @@
1
- export var packageVersion = '10.21.0';
1
+ export var packageVersion = '10.21.1-rc.0';
@@ -14,7 +14,6 @@ var browser_1 = require("@splitsoftware/splitio-commons/cjs/integrations/browser
14
14
  var storageCS_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/storage/storageCS");
15
15
  var sdkFactory_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory");
16
16
  var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
17
- var utils_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/utils");
18
17
  var sdkUserConsent_1 = require("@splitsoftware/splitio-commons/cjs/consent/sdkUserConsent");
19
18
  var browser_2 = require("../settings/browser");
20
19
  var platform_1 = require("../platform");
@@ -41,7 +40,7 @@ function getModules(settings) {
41
40
  sdkClientMethodFactory: sdkClientMethodCSWithTT_1.sdkClientMethodCSFactory,
42
41
  SignalListener: platform_1.SignalListener,
43
42
  integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? browser_1.integrationsManagerFactory.bind(null, settings.integrations) : undefined,
44
- impressionsObserverFactory: (0, utils_1.shouldAddPt)(settings) ? impressionObserverCS_1.impressionObserverCSFactory : undefined,
43
+ impressionsObserverFactory: impressionObserverCS_1.impressionObserverCSFactory,
45
44
  extraProps: function (params) {
46
45
  return {
47
46
  UserConsent: (0, sdkUserConsent_1.createUserConsentAPI)(params)
@@ -12,9 +12,9 @@ var sdkClientMethod_1 = require("@splitsoftware/splitio-commons/cjs/sdkClient/sd
12
12
  var impressionObserverSS_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/impressionObserverSS");
13
13
  var sdkFactory_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory");
14
14
  var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
15
- var utils_1 = require("@splitsoftware/splitio-commons/cjs/trackers/impressionObserver/utils");
16
15
  var node_1 = require("../settings/node");
17
16
  var platform_1 = require("../platform");
17
+ var bloomFilter_1 = require("../platform/filter/bloomFilter");
18
18
  var syncManagerOnlineSSFactory = (0, syncManagerOnline_1.syncManagerOnlineFactory)(pollingManagerSS_1.pollingManagerSSFactory, pushManager_1.pushManagerFactory);
19
19
  function getStorage(settings) {
20
20
  return settings.storage.type === 'REDIS' ?
@@ -35,7 +35,8 @@ function getModules(settings) {
35
35
  sdkManagerFactory: sdkManager_1.sdkManagerFactory,
36
36
  sdkClientMethodFactory: sdkClientMethod_1.sdkClientMethodFactory,
37
37
  SignalListener: platform_1.SignalListener,
38
- impressionsObserverFactory: (0, utils_1.shouldAddPt)(settings) ? impressionObserverSS_1.impressionObserverSSFactory : undefined,
38
+ impressionsObserverFactory: impressionObserverSS_1.impressionObserverSSFactory,
39
+ filterAdapterFactory: bloomFilter_1.bloomFilterFactory
39
40
  };
40
41
  switch (settings.mode) {
41
42
  case constants_1.LOCALHOST_MODE:
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bloomFilterFactory = void 0;
4
+ var bloomit_1 = require("@ably/bloomit");
5
+ var EXPECTED_INSERTIONS = 10000000;
6
+ var ERROR_RATE = 0.01;
7
+ function bloomFilterFactory(expectedInsertions, errorRate) {
8
+ if (expectedInsertions === void 0) { expectedInsertions = EXPECTED_INSERTIONS; }
9
+ if (errorRate === void 0) { errorRate = ERROR_RATE; }
10
+ var filter = bloomit_1.BloomFilter.create(expectedInsertions, errorRate);
11
+ return {
12
+ add: function (key, value) {
13
+ var data = key + ":" + value;
14
+ if (filter.has(data)) {
15
+ return false;
16
+ }
17
+ filter.add(data);
18
+ return true;
19
+ },
20
+ contains: function (key, value) {
21
+ var data = key + ":" + value;
22
+ return filter.has(data);
23
+ },
24
+ clear: function () {
25
+ filter = bloomit_1.BloomFilter.create(expectedInsertions, errorRate);
26
+ }
27
+ };
28
+ }
29
+ exports.bloomFilterFactory = bloomFilterFactory;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageVersion = void 0;
4
- exports.packageVersion = '10.21.0';
4
+ exports.packageVersion = '10.21.1-rc.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio",
3
- "version": "10.21.0",
3
+ "version": "10.21.1-rc.0",
4
4
  "description": "Split SDK",
5
5
  "files": [
6
6
  "README.md",
@@ -33,7 +33,8 @@
33
33
  "node": ">=6"
34
34
  },
35
35
  "dependencies": {
36
- "@splitsoftware/splitio-commons": "1.6.1",
36
+ "@ably/bloomit": "^1.4.2",
37
+ "@splitsoftware/splitio-commons": "1.6.2-rc.2",
37
38
  "@types/google.analytics": "0.0.40",
38
39
  "@types/ioredis": "^4.28.0",
39
40
  "ioredis": "^4.28.0",
@@ -89,24 +90,24 @@
89
90
  "check": "npm run check:lint && npm run check:version",
90
91
  "check:lint": "eslint src",
91
92
  "check:version": "cross-env NODE_ENV=test tape -r ./ts-node.register src/settings/__tests__/defaults.spec.js",
92
- "test-browser-local": "cross-env NODE_ENV=test karma start karma/local.karma.conf.js",
93
- "test-browser-e2e-local": "cross-env NODE_ENV=test karma start karma/e2e.local.karma.conf.js",
94
- "test-browser": "npm run test-browser-unit && npm run test-browser-online && npm run test-browser-offline && npm run test-browser-destroy && npm run test-browser-errors && npm run test-browser-push && npm run test-browser-gaintegration",
95
- "test-browser-unit": "cross-env NODE_ENV=test karma start karma/ci.karma.conf.js",
96
- "test-browser-online": "cross-env NODE_ENV=test karma start karma/e2e.ci.karma.conf.js",
97
- "test-browser-offline": "cross-env NODE_ENV=test karma start karma/offline.karma.conf.js",
98
- "test-browser-destroy": "cross-env NODE_ENV=test karma start karma/destroy.ci.karma.conf.js",
99
- "test-browser-errors": "cross-env NODE_ENV=test karma start karma/errors.ci.karma.conf.js",
100
- "test-browser-gaintegration": "cross-env NODE_ENV=test karma start karma/gaintegration.ci.karma.conf.js",
101
- "test-browser-push": "cross-env NODE_ENV=test karma start karma/push.ci.karma.conf.js",
102
- "test-node": "npm run test-node-unit && npm run test-node-online && npm run test-node-redis && npm run test-node-offline && npm run test-node-destroy && npm run test-node-errors && npm run test-node-push",
93
+ "test-browser": "npm run test-browser-unit && npm run test-browser-e2e",
94
+ "test-browser-unit": "cross-env NODE_ENV=test karma start karma/unit.karma.conf.js",
95
+ "test-browser-e2e": "npm run test-browser-e2e-online && npm run test-browser-e2e-offline && npm run test-browser-e2e-destroy && npm run test-browser-e2e-errorCatching && npm run test-browser-e2e-push && npm run test-browser-e2e-gaIntegration",
96
+ "test-browser-e2e-online": "cross-env NODE_ENV=test karma start karma/e2e.online.karma.conf.js",
97
+ "test-browser-e2e-offline": "cross-env NODE_ENV=test karma start karma/e2e.offline.karma.conf.js",
98
+ "test-browser-e2e-destroy": "cross-env NODE_ENV=test karma start karma/e2e.destroy.karma.conf.js",
99
+ "test-browser-e2e-errorCatching": "cross-env NODE_ENV=test karma start karma/e2e.errorCatching.karma.conf.js",
100
+ "test-browser-e2e-push": "cross-env NODE_ENV=test karma start karma/e2e.push.karma.conf.js",
101
+ "test-browser-e2e-gaIntegration": "cross-env NODE_ENV=test karma start karma/e2e.gaIntegration.karma.conf.js",
102
+ "test-node": "npm run test-node-unit && npm run test-node-e2e",
103
103
  "test-node-unit": "cross-env NODE_ENV=test tape -r ./ts-node.register \"src/*/**/__tests__/**/!(browser).spec.js\" | tap-min",
104
- "test-node-online": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/node.spec.js | tap-min",
105
- "test-node-destroy": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/destroy/node.spec.js | tap-min",
106
- "test-node-errors": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/errorCatching/node.spec.js | tap-min",
107
- "test-node-offline": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/offline/node.spec.js | tap-min",
108
- "test-node-redis": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/node_redis.spec.js | tap-min",
109
- "test-node-push": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/push/node.spec.js | tap-min",
104
+ "test-node-e2e": "npm run test-node-e2e-online && npm run test-node-e2e-offline && npm run test-node-e2e-destroy && npm run test-node-e2e-errorCatching && npm run test-node-e2e-push && npm run test-node-e2e-redis",
105
+ "test-node-e2e-online": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/online/node.spec.js | tap-min",
106
+ "test-node-e2e-offline": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/offline/node.spec.js | tap-min",
107
+ "test-node-e2e-destroy": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/destroy/node.spec.js | tap-min",
108
+ "test-node-e2e-errorCatching": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/errorCatching/node.spec.js | tap-min",
109
+ "test-node-e2e-push": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/push/node.spec.js | tap-min",
110
+ "test-node-e2e-redis": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/consumer/node_redis.spec.js | tap-min",
110
111
  "pretest-ts-decls": "npm run build-esm && npm run build-cjs && npm link",
111
112
  "test-ts-decls": "./scripts/ts-tests.sh",
112
113
  "posttest-ts-decls": "npm unlink && npm install",
package/src/.DS_Store CHANGED
Binary file
@@ -11,7 +11,6 @@ import { integrationsManagerFactory } from '@splitsoftware/splitio-commons/src/i
11
11
  import { __InLocalStorageMockFactory } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/storage/storageCS';
12
12
  import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory';
13
13
  import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE } from '@splitsoftware/splitio-commons/src/utils/constants';
14
- import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/utils';
15
14
  import { createUserConsentAPI } from '@splitsoftware/splitio-commons/src/consent/sdkUserConsent';
16
15
 
17
16
  import { settingsFactory } from '../settings/browser';
@@ -52,7 +51,7 @@ function getModules(settings) {
52
51
 
53
52
  integrationsManagerFactory: settings.integrations && settings.integrations.length > 0 ? integrationsManagerFactory.bind(null, settings.integrations) : undefined,
54
53
 
55
- impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined,
54
+ impressionsObserverFactory: impressionObserverCSFactory,
56
55
 
57
56
  extraProps: (params) => {
58
57
  return {
@@ -9,10 +9,10 @@ import { sdkClientMethodFactory } from '@splitsoftware/splitio-commons/src/sdkCl
9
9
  import { impressionObserverSSFactory } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/impressionObserverSS';
10
10
  import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory';
11
11
  import { CONSUMER_MODE, LOCALHOST_MODE } from '@splitsoftware/splitio-commons/src/utils/constants';
12
- import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impressionObserver/utils';
13
12
 
14
13
  import { settingsFactory } from '../settings/node';
15
14
  import { platform, SignalListener } from '../platform';
15
+ import { bloomFilterFactory } from '../platform/filter/bloomFilter';
16
16
 
17
17
  const syncManagerOnlineSSFactory = syncManagerOnlineFactory(pollingManagerSSFactory, pushManagerFactory);
18
18
 
@@ -45,7 +45,9 @@ function getModules(settings) {
45
45
 
46
46
  SignalListener,
47
47
 
48
- impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverSSFactory : undefined,
48
+ impressionsObserverFactory: impressionObserverSSFactory,
49
+
50
+ filterAdapterFactory: bloomFilterFactory
49
51
  };
50
52
 
51
53
  switch (settings.mode) {
@@ -0,0 +1,30 @@
1
+ import { BloomFilter } from '@ably/bloomit';
2
+
3
+ const EXPECTED_INSERTIONS = 10000000;
4
+ const ERROR_RATE = 0.01;
5
+
6
+ export function bloomFilterFactory(expectedInsertions = EXPECTED_INSERTIONS, errorRate = ERROR_RATE) {
7
+ let filter = BloomFilter.create(expectedInsertions, errorRate);
8
+
9
+ return {
10
+
11
+ add(key, value) {
12
+ const data = `${key}:${value}`;
13
+ if (filter.has(data)) {
14
+ return false;
15
+ }
16
+ filter.add(data);
17
+ return true;
18
+ },
19
+
20
+ contains(key, value) {
21
+ const data = `${key}:${value}`;
22
+ return filter.has(data);
23
+ },
24
+
25
+ clear() {
26
+ filter = BloomFilter.create(expectedInsertions, errorRate);
27
+ }
28
+
29
+ };
30
+ }
@@ -1 +1 @@
1
- export const packageVersion = '10.21.0';
1
+ export const packageVersion = '10.21.1-rc.0';
@@ -110,6 +110,7 @@ interface ISettings {
110
110
  readonly sync: {
111
111
  splitFilters: SplitIO.SplitFilter[],
112
112
  impressionsMode: SplitIO.ImpressionsMode,
113
+ enabled: boolean
113
114
  }
114
115
  /**
115
116
  * User consent status if using in browser. Undefined if using in NodeJS.
@@ -234,6 +235,16 @@ interface ISharedSettings {
234
235
  * @default 'OPTIMIZED'
235
236
  */
236
237
  impressionsMode?: SplitIO.ImpressionsMode,
238
+ /**
239
+ * Controls the SDK continuous synchronization flags.
240
+ *
241
+ * When `true` a running SDK will process rollout plan updates performed on the UI (default).
242
+ * When false it'll just fetch all data upon init
243
+ *
244
+ * @property {boolean} enabled
245
+ * @default true
246
+ */
247
+ enabled?: boolean
237
248
  }
238
249
  }
239
250
  /**
@@ -903,7 +914,7 @@ declare namespace SplitIO {
903
914
  * ImpressionsMode type
904
915
  * @typedef {string} ImpressionsMode
905
916
  */
906
- type ImpressionsMode = 'OPTIMIZED' | 'DEBUG';
917
+ type ImpressionsMode = 'OPTIMIZED' | 'DEBUG' | 'NONE';
907
918
  /**
908
919
  * User consent status.
909
920
  * @typedef {string} ConsentStatus
Binary file