@splitsoftware/splitio 11.8.1-rc.1 → 11.9.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,11 @@
1
+ 11.9.1 (December XX, 2025)
2
+ - Updated node-fetch to version 3.3.2, which fixes some issues with the Fetch API implementation.
3
+
4
+ 11.9.0 (November 26, 2025)
5
+ - Updated @splitsoftware/splitio-commons package to version 2.9.0, which:
6
+ - updates the SDK’s initial synchronization in Node.js (server-side) to use the `startup.requestTimeoutBeforeReady` and `startup.retriesOnFailureBeforeReady` options to control the timeout and retry behavior of segment requests.
7
+ - updates the order of storage operations to prevent inconsistent states when using the `LOCALSTORAGE` storage type and the browser’s `localStorage` fails due to quota limits.
8
+
1
9
  11.8.0 (October 30, 2025)
2
10
  - Added new configuration for Fallback Treatments, which allows setting a treatment value and optional config to be returned in place of "control", either globally or by flag. Read more in our docs.
3
11
  - Added `client.getStatus()` method to retrieve the client readiness status properties (`isReady`, `isReadyFromCache`, etc).
@@ -1,19 +1,57 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
2
21
  Object.defineProperty(exports, "__esModule", { value: true });
3
22
  exports.getFetch = exports.__setFetch = void 0;
4
- var nodeFetch;
5
- try {
6
- nodeFetch = require('node-fetch');
7
- // Handle node-fetch issue https://github.com/node-fetch/node-fetch/issues/1037
8
- if (typeof nodeFetch !== 'function')
9
- nodeFetch = nodeFetch.default;
10
- }
11
- catch (error) {
12
- // Try to access global fetch if `node-fetch` package couldn't be imported (e.g., not in a Node environment)
13
- nodeFetch = typeof fetch === 'function' ? fetch : undefined;
14
- }
23
+ var __setFetchCalled = false;
24
+ var nodeFetchImport;
25
+ var nodeFetch = function (url, options) {
26
+ try {
27
+ if (!nodeFetchImport) {
28
+ // lazy import, recommended for other runtimes than Node.js
29
+ nodeFetchImport = Promise.resolve().then(function () { return import('node-fetch'); }).then(function (_a) {
30
+ var fetch = _a.default;
31
+ if (!__setFetchCalled)
32
+ nodeFetch = fetch;
33
+ }).catch(function () {
34
+ if (!__setFetchCalled)
35
+ nodeFetch = typeof fetch === 'function' ? fetch : undefined;
36
+ });
37
+ }
38
+ return nodeFetchImport.then(function () {
39
+ if (!nodeFetch)
40
+ throw new Error('Fetch API not available');
41
+ return nodeFetch(url, options);
42
+ });
43
+ }
44
+ catch (error) {
45
+ if (!__setFetchCalled)
46
+ nodeFetch = typeof fetch === 'function' ? fetch : undefined;
47
+ if (!nodeFetch)
48
+ throw new Error('Fetch API not available');
49
+ return nodeFetch(url, options);
50
+ }
51
+ };
15
52
  // This function is only exposed for testing purposes.
16
53
  function __setFetch(fetch) {
54
+ __setFetchCalled = true;
17
55
  nodeFetch = fetch;
18
56
  }
19
57
  exports.__setFetch = __setFetch;
@@ -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.8.1-rc.1';
4
+ exports.packageVersion = '11.9.1-rc.0';
@@ -1,16 +1,35 @@
1
- var nodeFetch;
2
- try {
3
- nodeFetch = require('node-fetch');
4
- // Handle node-fetch issue https://github.com/node-fetch/node-fetch/issues/1037
5
- if (typeof nodeFetch !== 'function')
6
- nodeFetch = nodeFetch.default;
7
- }
8
- catch (error) {
9
- // Try to access global fetch if `node-fetch` package couldn't be imported (e.g., not in a Node environment)
10
- nodeFetch = typeof fetch === 'function' ? fetch : undefined;
11
- }
1
+ var __setFetchCalled = false;
2
+ var nodeFetchImport;
3
+ var nodeFetch = function (url, options) {
4
+ try {
5
+ if (!nodeFetchImport) {
6
+ // lazy import, recommended for other runtimes than Node.js
7
+ nodeFetchImport = import('node-fetch').then(function (_a) {
8
+ var fetch = _a.default;
9
+ if (!__setFetchCalled)
10
+ nodeFetch = fetch;
11
+ }).catch(function () {
12
+ if (!__setFetchCalled)
13
+ nodeFetch = typeof fetch === 'function' ? fetch : undefined;
14
+ });
15
+ }
16
+ return nodeFetchImport.then(function () {
17
+ if (!nodeFetch)
18
+ throw new Error('Fetch API not available');
19
+ return nodeFetch(url, options);
20
+ });
21
+ }
22
+ catch (error) {
23
+ if (!__setFetchCalled)
24
+ nodeFetch = typeof fetch === 'function' ? fetch : undefined;
25
+ if (!nodeFetch)
26
+ throw new Error('Fetch API not available');
27
+ return nodeFetch(url, options);
28
+ }
29
+ };
12
30
  // This function is only exposed for testing purposes.
13
31
  export function __setFetch(fetch) {
32
+ __setFetchCalled = true;
14
33
  nodeFetch = fetch;
15
34
  }
16
35
  /**
@@ -1 +1 @@
1
- export var packageVersion = '11.8.1-rc.1';
1
+ export var packageVersion = '11.9.1-rc.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio",
3
- "version": "11.8.1-rc.1",
3
+ "version": "11.9.1-rc.0",
4
4
  "description": "Split SDK",
5
5
  "files": [
6
6
  "README.md",
@@ -38,11 +38,11 @@
38
38
  "node": ">=14.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@splitsoftware/splitio-commons": "2.8.1-rc.1",
41
+ "@splitsoftware/splitio-commons": "2.9.0",
42
42
  "bloom-filters": "^3.0.4",
43
43
  "ioredis": "^4.28.0",
44
44
  "js-yaml": "^3.13.1",
45
- "node-fetch": "^2.7.0",
45
+ "node-fetch": "^3.3.2",
46
46
  "tslib": "^2.3.1",
47
47
  "unfetch": "^4.2.0"
48
48
  },
@@ -107,7 +107,7 @@
107
107
  "test-node-e2e-destroy": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/destroy/node.spec.js | tap-min",
108
108
  "test-node-e2e-errorCatching": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/errorCatching/node.spec.js | tap-min",
109
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",
110
+ "test-node-e2e-redis": "cross-env NODE_ENV=test tape -r ./ts-node.register src/__tests__/consumer/node_redis.spec.js | tap-min",
111
111
  "test-ts-decls": "tsc --build ts-tests",
112
112
  "test": "npm run test-node && npm run test-browser",
113
113
  "all": "npm run check && npm run build && npm run test-ts-decls && npm run test",
@@ -1,18 +1,31 @@
1
- let nodeFetch;
1
+ let __setFetchCalled = false;
2
+ let nodeFetchImport;
2
3
 
3
- try {
4
- nodeFetch = require('node-fetch');
4
+ let nodeFetch = (url, options) => {
5
+ try {
6
+ if (!nodeFetchImport) {
7
+ // lazy import, recommended for other runtimes than Node.js
8
+ nodeFetchImport = import('node-fetch').then(({ default: fetch }) => {
9
+ if (!__setFetchCalled) nodeFetch = fetch;
10
+ }).catch(() => {
11
+ if (!__setFetchCalled) nodeFetch = typeof fetch === 'function' ? fetch : undefined;
12
+ });
13
+ }
5
14
 
6
- // Handle node-fetch issue https://github.com/node-fetch/node-fetch/issues/1037
7
- if (typeof nodeFetch !== 'function') nodeFetch = nodeFetch.default;
8
-
9
- } catch (error) {
10
- // Try to access global fetch if `node-fetch` package couldn't be imported (e.g., not in a Node environment)
11
- nodeFetch = typeof fetch === 'function' ? fetch : undefined;
12
- }
15
+ return nodeFetchImport.then(() => {
16
+ if (!nodeFetch) throw new Error('Fetch API not available');
17
+ return nodeFetch(url, options);
18
+ });
19
+ } catch (error) {
20
+ if (!__setFetchCalled) nodeFetch = typeof fetch === 'function' ? fetch : undefined;
21
+ if (!nodeFetch) throw new Error('Fetch API not available');
22
+ return nodeFetch(url, options);
23
+ }
24
+ };
13
25
 
14
26
  // This function is only exposed for testing purposes.
15
27
  export function __setFetch(fetch) {
28
+ __setFetchCalled = true;
16
29
  nodeFetch = fetch;
17
30
  }
18
31
 
@@ -1 +1 @@
1
- export const packageVersion = '11.8.1-rc.1';
1
+ export const packageVersion = '11.9.1-rc.0';