@splitsoftware/splitio 11.1.1-rc.0 → 11.2.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,5 +1,9 @@
1
1
  11.2.0 (March 28, 2025)
2
- - Added new optional argument to the client `getTreatment` methods to allow passing additional evaluation options, such as a map of properties to append to the generated impression object sent to Split's backend. Read more in our docs.
2
+ - Added a new optional argument to the client `getTreatment` methods to allow passing additional evaluation options, such as a map of properties to append to the generated impressions sent to Split backend. Read more in our docs.
3
+ - Added two new configuration options for the SDK's `LOCALSTORAGE` storage type to control the behavior of the persisted rollout plan cache in the browser:
4
+ - `storage.expirationDays` to specify the validity period of the rollout plan cache in days.
5
+ - `storage.clearOnInit` to clear the rollout plan cache on SDK initialization.
6
+ - Updated SDK_READY_FROM_CACHE event when using the `LOCALSTORAGE` storage type to be emitted alongside the SDK_READY event if it has not already been emitted.
3
7
 
4
8
  11.1.0 (January 17, 2025)
5
9
  - Added support for the new impressions tracking toggle available on feature flags, both respecting the setting and including the new field being returned on `SplitView` type objects. Read more in our docs.
@@ -20,10 +20,10 @@ var platform_1 = require("../platform");
20
20
  var syncManagerOnlineCSFactory = (0, syncManagerOnline_1.syncManagerOnlineFactory)(pollingManagerCS_1.pollingManagerCSFactory, pushManager_1.pushManagerFactory);
21
21
  function getStorage(settings) {
22
22
  return settings.storage.type === constants_1.STORAGE_LOCALSTORAGE ?
23
- (0, inLocalStorage_1.InLocalStorage)(settings.storage)
24
- : settings.storage.__originalType === constants_1.STORAGE_LOCALSTORAGE ?
25
- storageCS_1.__InLocalStorageMockFactory
26
- : InMemoryStorageCS_1.InMemoryStorageCSFactory;
23
+ (0, inLocalStorage_1.InLocalStorage)(settings.storage) :
24
+ settings.storage.__originalType === constants_1.STORAGE_LOCALSTORAGE ?
25
+ storageCS_1.__InLocalStorageMockFactory :
26
+ InMemoryStorageCS_1.InMemoryStorageCSFactory;
27
27
  }
28
28
  /**
29
29
  *
@@ -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 = '11.1.1-rc.0';
4
+ exports.packageVersion = '11.2.0';
@@ -5,7 +5,7 @@ var isLocalStorageAvailable_1 = require("@splitsoftware/splitio-commons/cjs/util
5
5
  var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
6
6
  var STORAGE_LOCALSTORAGE = 'LOCALSTORAGE';
7
7
  function validateStorage(settings) {
8
- var log = settings.log, mode = settings.mode, _a = settings.storage, _b = _a === void 0 ? { type: constants_1.STORAGE_MEMORY } : _a, type = _b.type, _c = _b.options, options = _c === void 0 ? {} : _c, prefix = _b.prefix;
8
+ var log = settings.log, mode = settings.mode, _a = settings.storage, _b = _a === void 0 ? { type: constants_1.STORAGE_MEMORY } : _a, type = _b.type, _c = _b.options, options = _c === void 0 ? {} : _c, prefix = _b.prefix, expirationDays = _b.expirationDays, clearOnInit = _b.clearOnInit;
9
9
  var __originalType;
10
10
  var fallbackToMemory = function () {
11
11
  __originalType = type;
@@ -27,6 +27,8 @@ function validateStorage(settings) {
27
27
  type: type,
28
28
  options: options,
29
29
  prefix: prefix,
30
+ expirationDays: expirationDays,
31
+ clearOnInit: clearOnInit,
30
32
  __originalType: __originalType
31
33
  };
32
34
  }
@@ -17,10 +17,10 @@ import { platform, SignalListener } from '../platform';
17
17
  var syncManagerOnlineCSFactory = syncManagerOnlineFactory(pollingManagerCSFactory, pushManagerFactory);
18
18
  function getStorage(settings) {
19
19
  return settings.storage.type === STORAGE_LOCALSTORAGE ?
20
- InLocalStorage(settings.storage)
21
- : settings.storage.__originalType === STORAGE_LOCALSTORAGE ?
22
- __InLocalStorageMockFactory
23
- : InMemoryStorageCSFactory;
20
+ InLocalStorage(settings.storage) :
21
+ settings.storage.__originalType === STORAGE_LOCALSTORAGE ?
22
+ __InLocalStorageMockFactory :
23
+ InMemoryStorageCSFactory;
24
24
  }
25
25
  /**
26
26
  *
@@ -1 +1 @@
1
- export var packageVersion = '11.1.1-rc.0';
1
+ export var packageVersion = '11.2.0';
@@ -2,7 +2,7 @@ import { isLocalStorageAvailable } from '@splitsoftware/splitio-commons/esm/util
2
2
  import { LOCALHOST_MODE, STORAGE_MEMORY } from '@splitsoftware/splitio-commons/esm/utils/constants';
3
3
  var STORAGE_LOCALSTORAGE = 'LOCALSTORAGE';
4
4
  export function validateStorage(settings) {
5
- var log = settings.log, mode = settings.mode, _a = settings.storage, _b = _a === void 0 ? { type: STORAGE_MEMORY } : _a, type = _b.type, _c = _b.options, options = _c === void 0 ? {} : _c, prefix = _b.prefix;
5
+ var log = settings.log, mode = settings.mode, _a = settings.storage, _b = _a === void 0 ? { type: STORAGE_MEMORY } : _a, type = _b.type, _c = _b.options, options = _c === void 0 ? {} : _c, prefix = _b.prefix, expirationDays = _b.expirationDays, clearOnInit = _b.clearOnInit;
6
6
  var __originalType;
7
7
  var fallbackToMemory = function () {
8
8
  __originalType = type;
@@ -24,6 +24,8 @@ export function validateStorage(settings) {
24
24
  type: type,
25
25
  options: options,
26
26
  prefix: prefix,
27
+ expirationDays: expirationDays,
28
+ clearOnInit: clearOnInit,
27
29
  __originalType: __originalType
28
30
  };
29
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio",
3
- "version": "11.1.1-rc.0",
3
+ "version": "11.2.0",
4
4
  "description": "Split SDK",
5
5
  "files": [
6
6
  "README.md",
@@ -38,7 +38,7 @@
38
38
  "node": ">=14.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@splitsoftware/splitio-commons": "2.1.1-rc.1",
41
+ "@splitsoftware/splitio-commons": "2.2.0",
42
42
  "bloom-filters": "^3.0.4",
43
43
  "ioredis": "^4.28.0",
44
44
  "js-yaml": "^3.13.1",
@@ -20,10 +20,10 @@ const syncManagerOnlineCSFactory = syncManagerOnlineFactory(pollingManagerCSFact
20
20
 
21
21
  function getStorage(settings) {
22
22
  return settings.storage.type === STORAGE_LOCALSTORAGE ?
23
- InLocalStorage(settings.storage)
24
- : settings.storage.__originalType === STORAGE_LOCALSTORAGE ?
25
- __InLocalStorageMockFactory
26
- : InMemoryStorageCSFactory;
23
+ InLocalStorage(settings.storage) :
24
+ settings.storage.__originalType === STORAGE_LOCALSTORAGE ?
25
+ __InLocalStorageMockFactory :
26
+ InMemoryStorageCSFactory;
27
27
  }
28
28
 
29
29
  /**
@@ -1 +1 @@
1
- export const packageVersion = '11.1.1-rc.0';
1
+ export const packageVersion = '11.2.0';
@@ -10,7 +10,9 @@ export function validateStorage(settings) {
10
10
  storage: {
11
11
  type,
12
12
  options = {},
13
- prefix
13
+ prefix,
14
+ expirationDays,
15
+ clearOnInit
14
16
  } = { type: STORAGE_MEMORY },
15
17
  } = settings;
16
18
  let __originalType;
@@ -38,6 +40,8 @@ export function validateStorage(settings) {
38
40
  type,
39
41
  options,
40
42
  prefix,
43
+ expirationDays,
44
+ clearOnInit,
41
45
  __originalType
42
46
  };
43
47
  }