@splitsoftware/splitio-commons 2.12.2 → 2.12.3-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
|
+
2.13.0 (September 23, 2026)
|
|
2
|
+
- Added support for ioredis v6 (Related to issue https://github.com/splitio/javascript-client/issues/951). Note that ioredis v6 requires Node.js 20 or above; stay on ioredis v4 or v5 for older Node.js versions.
|
|
3
|
+
|
|
1
4
|
2.12.2 (September 23, 2026)
|
|
2
5
|
- Updated some transitive dependencies for vulnerability fixes.
|
|
3
6
|
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RedisAdapter = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
// Dynamically require ioredis to prevent strict TypeScript binding
|
|
6
|
-
// and handle module export differences between v4 and
|
|
6
|
+
// and handle module export differences between v4 and later major versions.
|
|
7
7
|
var RedisConstructor;
|
|
8
8
|
try {
|
|
9
9
|
var ioredisLib = require('ioredis');
|
|
@@ -11,7 +11,7 @@ try {
|
|
|
11
11
|
}
|
|
12
12
|
catch (e) {
|
|
13
13
|
// If we reach here, the peer dependency is missing
|
|
14
|
-
throw new Error('ioredis is missing. Please install ioredis v4 or
|
|
14
|
+
throw new Error('ioredis is missing. Please install ioredis v4, v5 or v6.');
|
|
15
15
|
}
|
|
16
16
|
var lang_1 = require("../../utils/lang");
|
|
17
17
|
var thenable_1 = require("../../utils/promise/thenable");
|
|
@@ -31,13 +31,16 @@ var DEFAULT_LIBRARY_OPTIONS = {
|
|
|
31
31
|
enableOfflineQueue: false,
|
|
32
32
|
connectTimeout: DEFAULT_OPTIONS.connectionTimeout,
|
|
33
33
|
lazyConnect: false,
|
|
34
|
-
// CRITICAL: v5
|
|
35
|
-
// v4 defaulted to 5000. We explicitly set it here to ensure v5
|
|
34
|
+
// CRITICAL: v5 and v6 default this to 0 (disabled), which breaks dynamic clusters.
|
|
35
|
+
// v4 defaulted to 5000. We explicitly set it here to ensure v5 and v6 work like v4.
|
|
36
36
|
slotsRefreshInterval: 5000,
|
|
37
|
+
// v6 defaults to RESP3 (`protocol: 3`). The SDK doesn't use any RESP3 feature,
|
|
38
|
+
// so we stick to RESP2 to keep the v4 and v5 behavior. Ignored by v4 and v5.
|
|
39
|
+
protocol: 2,
|
|
37
40
|
};
|
|
38
41
|
/**
|
|
39
42
|
* Redis adapter on top of the library of choice (written with ioredis) for some extra control.
|
|
40
|
-
* Refactored to use Composition instead of Inheritance to support
|
|
43
|
+
* Refactored to use Composition instead of Inheritance to support v4, v5 and v6.
|
|
41
44
|
*/
|
|
42
45
|
var RedisAdapter = /** @class */ (function () {
|
|
43
46
|
function RedisAdapter(log, storageSettings) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __spreadArray } from "tslib";
|
|
2
2
|
// Dynamically require ioredis to prevent strict TypeScript binding
|
|
3
|
-
// and handle module export differences between v4 and
|
|
3
|
+
// and handle module export differences between v4 and later major versions.
|
|
4
4
|
var RedisConstructor;
|
|
5
5
|
try {
|
|
6
6
|
var ioredisLib = require('ioredis');
|
|
@@ -8,7 +8,7 @@ try {
|
|
|
8
8
|
}
|
|
9
9
|
catch (e) {
|
|
10
10
|
// If we reach here, the peer dependency is missing
|
|
11
|
-
throw new Error('ioredis is missing. Please install ioredis v4 or
|
|
11
|
+
throw new Error('ioredis is missing. Please install ioredis v4, v5 or v6.');
|
|
12
12
|
}
|
|
13
13
|
import { merge, isString } from '../../utils/lang';
|
|
14
14
|
import { thenable } from '../../utils/promise/thenable';
|
|
@@ -28,13 +28,16 @@ var DEFAULT_LIBRARY_OPTIONS = {
|
|
|
28
28
|
enableOfflineQueue: false,
|
|
29
29
|
connectTimeout: DEFAULT_OPTIONS.connectionTimeout,
|
|
30
30
|
lazyConnect: false,
|
|
31
|
-
// CRITICAL: v5
|
|
32
|
-
// v4 defaulted to 5000. We explicitly set it here to ensure v5
|
|
31
|
+
// CRITICAL: v5 and v6 default this to 0 (disabled), which breaks dynamic clusters.
|
|
32
|
+
// v4 defaulted to 5000. We explicitly set it here to ensure v5 and v6 work like v4.
|
|
33
33
|
slotsRefreshInterval: 5000,
|
|
34
|
+
// v6 defaults to RESP3 (`protocol: 3`). The SDK doesn't use any RESP3 feature,
|
|
35
|
+
// so we stick to RESP2 to keep the v4 and v5 behavior. Ignored by v4 and v5.
|
|
36
|
+
protocol: 2,
|
|
34
37
|
};
|
|
35
38
|
/**
|
|
36
39
|
* Redis adapter on top of the library of choice (written with ioredis) for some extra control.
|
|
37
|
-
* Refactored to use Composition instead of Inheritance to support
|
|
40
|
+
* Refactored to use Composition instead of Inheritance to support v4, v5 and v6.
|
|
38
41
|
*/
|
|
39
42
|
var RedisAdapter = /** @class */ (function () {
|
|
40
43
|
function RedisAdapter(log, storageSettings) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-commons",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.3-rc.0",
|
|
4
4
|
"description": "Split JavaScript SDK common components",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"tslib": "^2.3.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"ioredis": "^4.28.0 || ^5.0.0"
|
|
52
|
+
"ioredis": "^4.28.0 || ^5.0.0 || ^6.0.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"ioredis": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"eslint-plugin-import": "^2.25.3",
|
|
69
69
|
"eslint-plugin-tsdoc": "^0.3.0",
|
|
70
70
|
"fetch-mock": "^9.11.0",
|
|
71
|
-
"ioredis": "^
|
|
71
|
+
"ioredis": "^6.0.0",
|
|
72
72
|
"jest": "^27.2.3",
|
|
73
73
|
"jest-localstorage-mock": "^2.4.3",
|
|
74
74
|
"lodash": "^4.17.21",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Dynamically require ioredis to prevent strict TypeScript binding
|
|
2
|
-
// and handle module export differences between v4 and
|
|
2
|
+
// and handle module export differences between v4 and later major versions.
|
|
3
3
|
let RedisConstructor: any;
|
|
4
4
|
try {
|
|
5
5
|
const ioredisLib = require('ioredis');
|
|
6
6
|
RedisConstructor = ioredisLib.default || ioredisLib;
|
|
7
7
|
} catch (e) {
|
|
8
8
|
// If we reach here, the peer dependency is missing
|
|
9
|
-
throw new Error('ioredis is missing. Please install ioredis v4 or
|
|
9
|
+
throw new Error('ioredis is missing. Please install ioredis v4, v5 or v6.');
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
import { ILogger } from '../../logger/types';
|
|
@@ -31,9 +31,12 @@ const DEFAULT_LIBRARY_OPTIONS = {
|
|
|
31
31
|
enableOfflineQueue: false,
|
|
32
32
|
connectTimeout: DEFAULT_OPTIONS.connectionTimeout,
|
|
33
33
|
lazyConnect: false,
|
|
34
|
-
// CRITICAL: v5
|
|
35
|
-
// v4 defaulted to 5000. We explicitly set it here to ensure v5
|
|
34
|
+
// CRITICAL: v5 and v6 default this to 0 (disabled), which breaks dynamic clusters.
|
|
35
|
+
// v4 defaulted to 5000. We explicitly set it here to ensure v5 and v6 work like v4.
|
|
36
36
|
slotsRefreshInterval: 5000,
|
|
37
|
+
// v6 defaults to RESP3 (`protocol: 3`). The SDK doesn't use any RESP3 feature,
|
|
38
|
+
// so we stick to RESP2 to keep the v4 and v5 behavior. Ignored by v4 and v5.
|
|
39
|
+
protocol: 2,
|
|
37
40
|
};
|
|
38
41
|
|
|
39
42
|
interface IRedisCommand {
|
|
@@ -45,7 +48,7 @@ interface IRedisCommand {
|
|
|
45
48
|
|
|
46
49
|
/**
|
|
47
50
|
* Redis adapter on top of the library of choice (written with ioredis) for some extra control.
|
|
48
|
-
* Refactored to use Composition instead of Inheritance to support
|
|
51
|
+
* Refactored to use Composition instead of Inheritance to support v4, v5 and v6.
|
|
49
52
|
*/
|
|
50
53
|
export class RedisAdapter {
|
|
51
54
|
// eslint-disable-next-line no-undef -- Index signature to allow proxying dynamic ioredis methods without TS errors
|