From 60e08391b0847b05d555f62afe6ee777781d7f21 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 20 Apr 2022 21:43:35 -0300 Subject: [PATCH 01/14] update build and typescript config --- .gitignore | 1 + package-lock.json | 6 +++--- package.json | 9 +++++---- tsconfig.json | 14 ++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 93c7ab3..a8e1a7e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules lib es +types coverage examples .vscode \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a95840e..54ce49d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6334,9 +6334,9 @@ } }, "typescript": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", - "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index 4fce4a6..6dd221e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js", - "types": "lib/index.d.ts", + "types": "types/index.d.ts", "files": [ "README.md", "CONTRIBUTORS-GUIDE.md", @@ -12,10 +12,11 @@ "CHANGES.txt", "src", "lib", - "es" + "es", + "types" ], "scripts": { - "build": "rimraf lib/* es/* && tsc && tsc -m es2015 -d false --outDir es", + "build": "rimraf lib/* es/* types/* && tsc && tsc -m commonjs --outDir lib -d true --declarationDir types", "postbuild": "./version_replace.sh", "check": "npm run check:lint && npm run check:types", "check:lint": "tslint -p tsconfig.json", @@ -81,7 +82,7 @@ "rimraf": "^3.0.0", "ts-jest": "^27.0.5", "tslint": "^5.20.1", - "typescript": "^4.0.2" + "typescript": "4.4.4" }, "peerDependencies": { "redux": "^2.0.0 || ^3.0.0 || ^4.0.0-0", diff --git a/tsconfig.json b/tsconfig.json index 645e5e1..63475f2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,24 +3,22 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ - "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "module": "es6", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ - // "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": false, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ + "sourceMap": false, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ - "outDir": "lib", /* Redirect output structure to the directory. */ + "outDir": "es", /* Redirect output structure to the directory. */ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ - - // @TODO uncomment the following when migrating to JS-commons and Rollup, to avoid duplicated helpers code in builds. - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ From 1b468934b401f1e60c7253edf2e75456b0bc45b1 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 26 Mar 2024 13:29:38 -0300 Subject: [PATCH 02/14] Update JS SDK --- CHANGES.txt | 3 +++ package-lock.json | 60 +++++++++++++++++++++++++++++------------------ package.json | 2 +- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 365c02b..32c7c10 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +1.10.1 (March 26, 2023) + - Updated @splitsoftware/splitio package to version 10.25.2 that includes vulnerability fixes and other improvements. + 1.10.0 (December 18, 2023) - Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation): - Added a new optional `flagSets` property to the param object of the `getTreatments` action creator, to support evaluating flags in given flag set/s. Either `splitNames` or `flagSets` must be provided to the function. If both are provided, `splitNames` will be used. diff --git a/package-lock.json b/package-lock.json index 8fb3d00..dcf9e88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.10.0", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio": "10.24.1" + "@splitsoftware/splitio": "10.25.2" }, "devDependencies": { "@testing-library/jest-dom": "^5.16.5", @@ -1504,17 +1504,18 @@ } }, "node_modules/@splitsoftware/splitio": { - "version": "10.24.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-10.24.1.tgz", - "integrity": "sha512-WzVZrP2IAqzNBywNXgmLxiS60qumkcnu6u1lUPlNgdVek82TzWeqyqW+htKmDMJ/ifsJPWrgT1VLMZJvOnBsVA==", + "version": "10.25.2", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-10.25.2.tgz", + "integrity": "sha512-lX06PSoA+hcw66c889RxK9t9cd8evguBFk+x1pw2L4J/58+7XHxp/z1Nnbtb3AOw8s/sX4h87qlTiZqMGPmcmA==", "dependencies": { - "@splitsoftware/splitio-commons": "1.12.1", + "@splitsoftware/splitio-commons": "1.13.1", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "bloom-filters": "^3.0.0", "ioredis": "^4.28.0", "js-yaml": "^3.13.1", - "node-fetch": "^2.6.7", + "node-fetch": "^2.7.0", + "tslib": "^2.3.1", "unfetch": "^4.2.0" }, "engines": { @@ -1526,9 +1527,9 @@ } }, "node_modules/@splitsoftware/splitio-commons": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.12.1.tgz", - "integrity": "sha512-EkCcqlYvVafazs9c5i+pmhf6rIyj3A70dqQ4U3BKE646t7tf6mxGzqZz1sAl540xNyYI7CA/iIqisEWvDtJc0A==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.13.1.tgz", + "integrity": "sha512-xGu94sLx+tJb6PeM26vH8/LEElsaVbh2BjoLvL5twR4gKsVezie5ZtHhejWT1+iCVCtJuhjZxKwOm4HGYoVIHQ==", "dependencies": { "tslib": "^2.3.1" }, @@ -1546,6 +1547,11 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/@splitsoftware/splitio/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, "node_modules/@testing-library/dom": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.0.1.tgz", @@ -7885,9 +7891,9 @@ "dev": true }, "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -11105,25 +11111,33 @@ } }, "@splitsoftware/splitio": { - "version": "10.24.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-10.24.1.tgz", - "integrity": "sha512-WzVZrP2IAqzNBywNXgmLxiS60qumkcnu6u1lUPlNgdVek82TzWeqyqW+htKmDMJ/ifsJPWrgT1VLMZJvOnBsVA==", + "version": "10.25.2", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-10.25.2.tgz", + "integrity": "sha512-lX06PSoA+hcw66c889RxK9t9cd8evguBFk+x1pw2L4J/58+7XHxp/z1Nnbtb3AOw8s/sX4h87qlTiZqMGPmcmA==", "requires": { - "@splitsoftware/splitio-commons": "1.12.1", + "@splitsoftware/splitio-commons": "1.13.1", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "bloom-filters": "^3.0.0", "eventsource": "^1.1.2", "ioredis": "^4.28.0", "js-yaml": "^3.13.1", - "node-fetch": "^2.6.7", + "node-fetch": "^2.7.0", + "tslib": "^2.3.1", "unfetch": "^4.2.0" + }, + "dependencies": { + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + } } }, "@splitsoftware/splitio-commons": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.12.1.tgz", - "integrity": "sha512-EkCcqlYvVafazs9c5i+pmhf6rIyj3A70dqQ4U3BKE646t7tf6mxGzqZz1sAl540xNyYI7CA/iIqisEWvDtJc0A==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.13.1.tgz", + "integrity": "sha512-xGu94sLx+tJb6PeM26vH8/LEElsaVbh2BjoLvL5twR4gKsVezie5ZtHhejWT1+iCVCtJuhjZxKwOm4HGYoVIHQ==", "requires": { "tslib": "^2.3.1" }, @@ -15884,9 +15898,9 @@ "dev": true }, "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "requires": { "whatwg-url": "^5.0.0" }, diff --git a/package.json b/package.json index a27c6a1..449178f 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ }, "homepage": "https://github.com/splitio/redux-client#readme", "dependencies": { - "@splitsoftware/splitio": "10.24.1" + "@splitsoftware/splitio": "10.25.2" }, "devDependencies": { "@testing-library/jest-dom": "^5.16.5", From 80fac0fe1c869a768ec857ef05da5744488605be Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 26 Mar 2024 13:44:15 -0300 Subject: [PATCH 03/14] Using importHelpers TypeScript option to avoid duplicated helpers in output files --- CHANGES.txt | 3 ++- package-lock.json | 55 +++++++++++++++++++---------------------------- package.json | 3 ++- tsconfig.json | 2 +- 4 files changed, 27 insertions(+), 36 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 32c7c10..e54a397 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,6 @@ 1.10.1 (March 26, 2023) - - Updated @splitsoftware/splitio package to version 10.25.2 that includes vulnerability fixes and other improvements. +- Updated the build process and added the `tslib` package as an explicit dependency to import TypeScript helpers, thereby avoiding duplicated helper code in the output files. +- Updated @splitsoftware/splitio package to version 10.25.2, which includes vulnerability fixes and other improvements. 1.10.0 (December 18, 2023) - Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation): diff --git a/package-lock.json b/package-lock.json index dcf9e88..24c0507 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "version": "1.10.0", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio": "10.25.2" + "@splitsoftware/splitio": "10.25.2", + "tslib": "^2.3.1" }, "devDependencies": { "@testing-library/jest-dom": "^5.16.5", @@ -1542,16 +1543,6 @@ } } }, - "node_modules/@splitsoftware/splitio-commons/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - }, - "node_modules/@splitsoftware/splitio/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - }, "node_modules/@testing-library/dom": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.0.1.tgz", @@ -9499,10 +9490,9 @@ } }, "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -9519,6 +9509,12 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -11125,13 +11121,6 @@ "node-fetch": "^2.7.0", "tslib": "^2.3.1", "unfetch": "^4.2.0" - }, - "dependencies": { - "tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - } } }, "@splitsoftware/splitio-commons": { @@ -11140,13 +11129,6 @@ "integrity": "sha512-xGu94sLx+tJb6PeM26vH8/LEElsaVbh2BjoLvL5twR4gKsVezie5ZtHhejWT1+iCVCtJuhjZxKwOm4HGYoVIHQ==", "requires": { "tslib": "^2.3.1" - }, - "dependencies": { - "tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - } } }, "@testing-library/dom": { @@ -17101,10 +17083,9 @@ } }, "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "tsutils": { "version": "3.21.0", @@ -17113,6 +17094,14 @@ "dev": true, "requires": { "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } } }, "type-check": { diff --git a/package.json b/package.json index 449178f..4643ee9 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ }, "homepage": "https://github.com/splitio/redux-client#readme", "dependencies": { - "@splitsoftware/splitio": "10.25.2" + "@splitsoftware/splitio": "10.25.2", + "tslib": "^2.3.1" }, "devDependencies": { "@testing-library/jest-dom": "^5.16.5", diff --git a/tsconfig.json b/tsconfig.json index d807e1d..47a496f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,7 @@ // "noEmit": true, /* Do not emit outputs. */ // @TODO uncomment the following when migrating to JS-commons and Rollup, to avoid duplicated helpers code in builds. - // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ From dbaf306fc357bf04bad9450dafeca05b6201bcb2 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 26 Mar 2024 13:45:21 -0300 Subject: [PATCH 04/14] rc --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24c0507..d3dd36a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.0", + "version": "1.10.1-rc.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-redux", - "version": "1.10.0", + "version": "1.10.1-rc.0", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.2", diff --git a/package.json b/package.json index 4643ee9..ebf1e84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.0", + "version": "1.10.1-rc.0", "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js", From 1e39855a6dac1ba8136524119d3cb4078f599bd1 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 26 Mar 2024 19:07:34 -0300 Subject: [PATCH 05/14] stable version --- CHANGES.txt | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e54a397..7f40216 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -1.10.1 (March 26, 2023) +1.10.1 (March 27, 2023) - Updated the build process and added the `tslib` package as an explicit dependency to import TypeScript helpers, thereby avoiding duplicated helper code in the output files. - Updated @splitsoftware/splitio package to version 10.25.2, which includes vulnerability fixes and other improvements. diff --git a/package-lock.json b/package-lock.json index d3dd36a..74acfc8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.0", + "version": "1.10.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.0", + "version": "1.10.1", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.2", diff --git a/package.json b/package.json index ebf1e84..3edf99d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.0", + "version": "1.10.1", "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js", From 7b2c8261772bc2580c3532636fe44e0837a2f7e9 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 26 Mar 2024 19:41:59 -0300 Subject: [PATCH 06/14] Update redux-thunk peer dependency --- CHANGES.txt | 5 +++-- package-lock.json | 6 +++--- package.json | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 7f40216..ce10260 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,7 @@ 1.10.1 (March 27, 2023) -- Updated the build process and added the `tslib` package as an explicit dependency to import TypeScript helpers, thereby avoiding duplicated helper code in the output files. -- Updated @splitsoftware/splitio package to version 10.25.2, which includes vulnerability fixes and other improvements. + - Updated the build process and added the `tslib` package as an explicit dependency to import TypeScript helpers, thereby avoiding duplicated helper code in the output files. + - Updated @splitsoftware/splitio package to version 10.25.2, which includes vulnerability fixes and other improvements. + - Updated Redux-Thunk peer dependency range to include redux-thunk@3.x.x. 1.10.0 (December 18, 2023) - Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation): diff --git a/package-lock.json b/package-lock.json index 74acfc8..19dd4e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1", + "version": "1.10.1-rc.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1", + "version": "1.10.1-rc.1", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.2", @@ -43,7 +43,7 @@ "peerDependencies": { "react-redux": ">=4.0.0", "redux": ">=2.0.0", - "redux-thunk": "^2.0.0" + "redux-thunk": ">=2.0.0" }, "peerDependenciesMeta": { "react-redux": { diff --git a/package.json b/package.json index 3edf99d..c94030d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1", + "version": "1.10.1-rc.1", "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js", @@ -93,7 +93,7 @@ "peerDependencies": { "react-redux": ">=4.0.0", "redux": ">=2.0.0", - "redux-thunk": "^2.0.0" + "redux-thunk": ">=2.0.0" }, "peerDependenciesMeta": { "react-redux": { From 632843761b54e5a64adf65d2bea1ebe343f7bd4f Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 26 Mar 2024 20:49:51 -0300 Subject: [PATCH 07/14] Update dev dependencies to run check, build and test scripts with redux v5, redux-thunk v3, and react-redux v9 --- package-lock.json | 227 +++++++++---------------------- package.json | 8 +- src/__tests__/utils/mockStore.ts | 5 +- src/reducer.ts | 18 +-- 4 files changed, 78 insertions(+), 180 deletions(-) diff --git a/package-lock.json b/package-lock.json index 19dd4e4..ec5bd01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,9 +18,7 @@ "@types/jest": "^27.0.0", "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", - "@types/react-redux": "^7.1.5", "@types/redux-mock-store": "^1.0.1", - "@types/redux-thunk": "^2.1.0", "@typescript-eslint/eslint-plugin": "^5.55.0", "@typescript-eslint/parser": "^5.55.0", "eslint": "^8.36.0", @@ -31,10 +29,10 @@ "jest": "^27.2.3", "react": "^18.0.0", "react-dom": "^18.0.0", - "react-redux": "^8.0.0", - "redux": "^4.2.0", + "react-redux": "^9.0.0", + "redux": "^5.0.1", "redux-mock-store": "^1.5.4", - "redux-thunk": "^2.3.0", + "redux-thunk": "^3.1.0", "replace": "^1.2.1", "rimraf": "^3.0.0", "ts-jest": "^27.0.5", @@ -1809,16 +1807,6 @@ "@types/node": "*" } }, - "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", - "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", - "dev": true, - "dependencies": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "node_modules/@types/ioredis": { "version": "4.28.10", "resolved": "https://registry.npmjs.org/@types/ioredis/-/ioredis-4.28.10.tgz", @@ -1897,37 +1885,24 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.0.28", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz", - "integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==", + "version": "18.2.72", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.72.tgz", + "integrity": "sha512-/e7GWxGzXQF7OJAua7UAYqYi/4VpXEfbGtmYQcAQwP3SjjjAXfybTf/JK5S+SaetB/ChXl8Y2g1hCsj7jDXxcg==", "dev": true, "dependencies": { "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, "node_modules/@types/react-dom": { - "version": "18.0.11", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.11.tgz", - "integrity": "sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==", + "version": "18.2.22", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", + "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", "dev": true, "dependencies": { "@types/react": "*" } }, - "node_modules/@types/react-redux": { - "version": "7.1.25", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.25.tgz", - "integrity": "sha512-bAGh4e+w5D8dajd6InASVIyCo4pZLJ66oLb80F9OBLO1gKESbZcRCJpTT6uLXX+HAB57zw1WTdwJdAsewuTweg==", - "dev": true, - "dependencies": { - "@types/hoist-non-react-statics": "^3.3.0", - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0", - "redux": "^4.0.0" - } - }, "node_modules/@types/redux-mock-store": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/redux-mock-store/-/redux-mock-store-1.0.1.tgz", @@ -1937,22 +1912,15 @@ "redux": "^4.0.0" } }, - "node_modules/@types/redux-thunk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/redux-thunk/-/redux-thunk-2.1.0.tgz", - "integrity": "sha1-vCtulylhgxr7gqm/TwZybjUflBY=", - "deprecated": "This is a stub types definition for Redux Thunk (https://github.com/gaearon/redux-thunk). Redux Thunk provides its own type definitions, so you don't need @types/redux-thunk installed!", + "node_modules/@types/redux-mock-store/node_modules/redux": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", + "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", "dev": true, "dependencies": { - "redux-thunk": "*" + "@babel/runtime": "^7.9.2" } }, - "node_modules/@types/scheduler": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", - "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", - "dev": true - }, "node_modules/@types/semver": { "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", @@ -4779,15 +4747,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, - "dependencies": { - "react-is": "^16.7.0" - } - }, "node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -8486,25 +8445,21 @@ "dev": true }, "node_modules/react-redux": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", - "integrity": "sha512-Q2f6fCKxPFpkXt1qNRZdEDLlScsDWyrgSj0mliK59qU6W5gvBiKkdMEG2lJzhd1rCctf0hb6EtePPLZ2e0m1uw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.0.0.tgz", + "integrity": "sha512-/X/wiza+G2IXbz1Ow9Gs5qK7KNdoEnzzsR7ne7jcOWJMBOx9wvraPZwFddCs84xqwilvYaoENHowQMiW0axbsQ==", "dev": true, "dependencies": { - "@babel/runtime": "^7.12.1", - "@types/hoist-non-react-statics": "^3.3.1", "@types/use-sync-external-store": "^0.0.3", - "hoist-non-react-statics": "^3.3.2", - "react-is": "^18.0.0", "use-sync-external-store": "^1.0.0" }, "peerDependencies": { - "@types/react": "^16.8 || ^17.0 || ^18.0", - "@types/react-dom": "^16.8 || ^17.0 || ^18.0", - "react": "^16.8 || ^17.0 || ^18.0", - "react-dom": "^16.8 || ^17.0 || ^18.0", - "react-native": ">=0.59", - "redux": "^4" + "@types/react": "^18.2.41", + "@types/react-dom": "^18.2.17", + "react": "^18.0", + "react-dom": "^18.0", + "react-native": ">=0.71", + "redux": "^5.0.0-rc" }, "peerDependenciesMeta": { "@types/react": { @@ -8524,12 +8479,6 @@ } } }, - "node_modules/react-redux/node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - }, "node_modules/redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -8568,13 +8517,10 @@ } }, "node_modules/redux": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", - "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.9.2" - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "dev": true }, "node_modules/redux-mock-store": { "version": "1.5.4", @@ -8586,10 +8532,13 @@ } }, "node_modules/redux-thunk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz", - "integrity": "sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==", - "dev": true + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz", + "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==", + "dev": true, + "peerDependencies": { + "redux": "^5.0.0" + } }, "node_modules/reflect-metadata": { "version": "0.1.13", @@ -11344,16 +11293,6 @@ "@types/node": "*" } }, - "@types/hoist-non-react-statics": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", - "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", - "dev": true, - "requires": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "@types/ioredis": { "version": "4.28.10", "resolved": "https://registry.npmjs.org/@types/ioredis/-/ioredis-4.28.10.tgz", @@ -11432,37 +11371,24 @@ "dev": true }, "@types/react": { - "version": "18.0.28", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.28.tgz", - "integrity": "sha512-RD0ivG1kEztNBdoAK7lekI9M+azSnitIn85h4iOiaLjaTrMjzslhaqCGaI4IyCJ1RljWiLCEu4jyrLLgqxBTew==", + "version": "18.2.72", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.72.tgz", + "integrity": "sha512-/e7GWxGzXQF7OJAua7UAYqYi/4VpXEfbGtmYQcAQwP3SjjjAXfybTf/JK5S+SaetB/ChXl8Y2g1hCsj7jDXxcg==", "dev": true, "requires": { "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, "@types/react-dom": { - "version": "18.0.11", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.11.tgz", - "integrity": "sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==", + "version": "18.2.22", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", + "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", "dev": true, "requires": { "@types/react": "*" } }, - "@types/react-redux": { - "version": "7.1.25", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.25.tgz", - "integrity": "sha512-bAGh4e+w5D8dajd6InASVIyCo4pZLJ66oLb80F9OBLO1gKESbZcRCJpTT6uLXX+HAB57zw1WTdwJdAsewuTweg==", - "dev": true, - "requires": { - "@types/hoist-non-react-statics": "^3.3.0", - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0", - "redux": "^4.0.0" - } - }, "@types/redux-mock-store": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@types/redux-mock-store/-/redux-mock-store-1.0.1.tgz", @@ -11470,23 +11396,19 @@ "dev": true, "requires": { "redux": "^4.0.0" + }, + "dependencies": { + "redux": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", + "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", + "dev": true, + "requires": { + "@babel/runtime": "^7.9.2" + } + } } }, - "@types/redux-thunk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/redux-thunk/-/redux-thunk-2.1.0.tgz", - "integrity": "sha1-vCtulylhgxr7gqm/TwZybjUflBY=", - "dev": true, - "requires": { - "redux-thunk": "*" - } - }, - "@types/scheduler": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", - "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", - "dev": true - }, "@types/semver": { "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", @@ -13574,15 +13496,6 @@ "has-symbols": "^1.0.2" } }, - "hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, - "requires": { - "react-is": "^16.7.0" - } - }, "hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", @@ -16328,25 +16241,13 @@ "dev": true }, "react-redux": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.0.5.tgz", - "integrity": "sha512-Q2f6fCKxPFpkXt1qNRZdEDLlScsDWyrgSj0mliK59qU6W5gvBiKkdMEG2lJzhd1rCctf0hb6EtePPLZ2e0m1uw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.0.0.tgz", + "integrity": "sha512-/X/wiza+G2IXbz1Ow9Gs5qK7KNdoEnzzsR7ne7jcOWJMBOx9wvraPZwFddCs84xqwilvYaoENHowQMiW0axbsQ==", "dev": true, "requires": { - "@babel/runtime": "^7.12.1", - "@types/hoist-non-react-statics": "^3.3.1", "@types/use-sync-external-store": "^0.0.3", - "hoist-non-react-statics": "^3.3.2", - "react-is": "^18.0.0", "use-sync-external-store": "^1.0.0" - }, - "dependencies": { - "react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true - } } }, "redent": { @@ -16378,13 +16279,10 @@ } }, "redux": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", - "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", - "dev": true, - "requires": { - "@babel/runtime": "^7.9.2" - } + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", + "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==", + "dev": true }, "redux-mock-store": { "version": "1.5.4", @@ -16396,10 +16294,11 @@ } }, "redux-thunk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz", - "integrity": "sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==", - "dev": true + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz", + "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==", + "dev": true, + "requires": {} }, "reflect-metadata": { "version": "0.1.13", diff --git a/package.json b/package.json index c94030d..faa9043 100644 --- a/package.json +++ b/package.json @@ -68,9 +68,7 @@ "@types/jest": "^27.0.0", "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", - "@types/react-redux": "^7.1.5", "@types/redux-mock-store": "^1.0.1", - "@types/redux-thunk": "^2.1.0", "@typescript-eslint/eslint-plugin": "^5.55.0", "@typescript-eslint/parser": "^5.55.0", "eslint": "^8.36.0", @@ -81,10 +79,10 @@ "jest": "^27.2.3", "react": "^18.0.0", "react-dom": "^18.0.0", - "react-redux": "^8.0.0", - "redux": "^4.2.0", + "react-redux": "9.0.0", + "redux": "^5.0.1", "redux-mock-store": "^1.5.4", - "redux-thunk": "^2.3.0", + "redux-thunk": "^3.1.0", "replace": "^1.2.1", "rimraf": "^3.0.0", "ts-jest": "^27.0.5", diff --git a/src/__tests__/utils/mockStore.ts b/src/__tests__/utils/mockStore.ts index 7758742..48c720c 100644 --- a/src/__tests__/utils/mockStore.ts +++ b/src/__tests__/utils/mockStore.ts @@ -1,6 +1,7 @@ -import thunk from 'redux-thunk'; +import { thunk } from 'redux-thunk'; import configureMockStore from 'redux-mock-store'; -const middlewares = [thunk]; + +const middlewares: any[] = [thunk]; /** * Utils to not call requires files every time that we need mock the store diff --git a/src/reducer.ts b/src/reducer.ts index 1bb80e4..2b930de 100644 --- a/src/reducer.ts +++ b/src/reducer.ts @@ -73,49 +73,49 @@ export const splitReducer: Reducer = function ( ) { switch (action.type) { case SPLIT_READY: - return setReady(state, action.payload.timestamp); + return setReady(state, (action as any).payload.timestamp); case SPLIT_READY_FROM_CACHE: - return setReadyFromCache(state, action.payload.timestamp); + return setReadyFromCache(state, (action as any).payload.timestamp); case SPLIT_TIMEDOUT: return { ...state, isTimedout: true, hasTimedout: true, - lastUpdate: action.payload.timestamp, + lastUpdate: (action as any).payload.timestamp, }; case SPLIT_UPDATE: - return setUpdated(state, action.payload.timestamp); + return setUpdated(state, (action as any).payload.timestamp); case SPLIT_DESTROY: return { ...state, isDestroyed: true, - lastUpdate: action.payload.timestamp, + lastUpdate: (action as any).payload.timestamp, }; case ADD_TREATMENTS: { - const { key, treatments } = action.payload; + const { key, treatments } = (action as any).payload; const result = { ...state }; return assignTreatments(result, key, treatments); } case SPLIT_READY_WITH_EVALUATIONS: { - const { key, treatments, timestamp } = action.payload; + const { key, treatments, timestamp } = (action as any).payload; const result = setReady(state, timestamp); return assignTreatments(result, key, treatments); } case SPLIT_READY_FROM_CACHE_WITH_EVALUATIONS: { - const { key, treatments, timestamp } = action.payload; + const { key, treatments, timestamp } = (action as any).payload; const result = setReadyFromCache(state, timestamp); return assignTreatments(result, key, treatments); } case SPLIT_UPDATE_WITH_EVALUATIONS: { - const { key, treatments, timestamp } = action.payload; + const { key, treatments, timestamp } = (action as any).payload; const result = setUpdated(state, timestamp); return assignTreatments(result, key, treatments); } From 623d2527d8c001086aece88b2a79e7ffd54dca42 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 26 Mar 2024 20:58:00 -0300 Subject: [PATCH 08/14] rc --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec5bd01..21e6a07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.1", + "version": "1.10.1-rc.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.1", + "version": "1.10.1-rc.2", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.2", @@ -29,7 +29,7 @@ "jest": "^27.2.3", "react": "^18.0.0", "react-dom": "^18.0.0", - "react-redux": "^9.0.0", + "react-redux": "9.0.0", "redux": "^5.0.1", "redux-mock-store": "^1.5.4", "redux-thunk": "^3.1.0", diff --git a/package.json b/package.json index faa9043..94db814 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.1", + "version": "1.10.1-rc.2", "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js", From 267ae2db2948e103b22d7c7d3c85b23f9cee43c4 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 26 Mar 2024 22:17:57 -0300 Subject: [PATCH 09/14] Add sideEffects false in package.json file --- CHANGES.txt | 5 +++-- package-lock.json | 4 ++-- package.json | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ce10260..a4b6980 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,7 +1,8 @@ -1.10.1 (March 27, 2023) +1.11.0 (March 27, 2023) + - Added `sideEffects: false` property in the package.json file to allow tree shaking. + - Updated Redux-Thunk peer dependency range to include redux-thunk@3.x.x. - Updated the build process and added the `tslib` package as an explicit dependency to import TypeScript helpers, thereby avoiding duplicated helper code in the output files. - Updated @splitsoftware/splitio package to version 10.25.2, which includes vulnerability fixes and other improvements. - - Updated Redux-Thunk peer dependency range to include redux-thunk@3.x.x. 1.10.0 (December 18, 2023) - Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation): diff --git a/package-lock.json b/package-lock.json index 21e6a07..11764dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.2", + "version": "1.10.1-rc.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.2", + "version": "1.10.1-rc.3", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.2", diff --git a/package.json b/package.json index 94db814..2ead7a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.2", + "version": "1.10.1-rc.3", "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js", @@ -103,5 +103,6 @@ "pre-commit": "npm run check", "pre-push": "npm test && npm run build" } - } + }, + "sideEffects": false } From ae51bd0895d5fc36a90d653b1e8f7e61b01d09a8 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 27 Mar 2024 13:37:20 -0300 Subject: [PATCH 10/14] Stable version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 11764dd..76d7aff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.3", + "version": "1.11.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.3", + "version": "1.11.0", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.2", diff --git a/package.json b/package.json index 2ead7a3..87d07c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.3", + "version": "1.11.0", "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js", From 9b6011d3466ee02f8554435229848f64a2e2aab8 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 27 Mar 2024 14:00:01 -0300 Subject: [PATCH 11/14] Stop tracking changes in 'types' folder, which is automatically generated --- tsconfig.json | 8 +- types/actions.d.ts | 61 ---------- types/asyncActions.d.ts | 69 ------------ types/constants.d.ts | 23 ---- types/helpers.d.ts | 35 ------ types/index.d.ts | 7 -- types/react-redux/connectSplit.d.ts | 16 --- types/react-redux/connectToggler.d.ts | 40 ------- types/reducer.d.ts | 7 -- types/selectors.d.ts | 21 ---- types/types.d.ts | 156 -------------------------- types/utils.d.ts | 25 ----- 12 files changed, 6 insertions(+), 462 deletions(-) delete mode 100644 types/actions.d.ts delete mode 100644 types/asyncActions.d.ts delete mode 100644 types/constants.d.ts delete mode 100644 types/helpers.d.ts delete mode 100644 types/index.d.ts delete mode 100644 types/react-redux/connectSplit.d.ts delete mode 100644 types/react-redux/connectToggler.d.ts delete mode 100644 types/reducer.d.ts delete mode 100644 types/selectors.d.ts delete mode 100644 types/types.d.ts delete mode 100644 types/utils.d.ts diff --git a/tsconfig.json b/tsconfig.json index 63475f2..52a0e77 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -60,6 +60,10 @@ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ }, - "include": ["src"], - "exclude": ["./src/__tests__"] + "include": [ + "src" + ], + "exclude": [ + "./src/__tests__" + ] } diff --git a/types/actions.d.ts b/types/actions.d.ts deleted file mode 100644 index 50a97c6..0000000 --- a/types/actions.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -export declare function splitReady(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function splitReadyWithEvaluations(key: SplitIO.SplitKey, treatments: SplitIO.TreatmentsWithConfig): { - type: string; - payload: { - timestamp: number; - key: string; - treatments: import("@splitsoftware/splitio/types/splitio").TreatmentsWithConfig; - }; -}; -export declare function splitReadyFromCache(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function splitReadyFromCacheWithEvaluations(key: SplitIO.SplitKey, treatments: SplitIO.TreatmentsWithConfig): { - type: string; - payload: { - timestamp: number; - key: string; - treatments: import("@splitsoftware/splitio/types/splitio").TreatmentsWithConfig; - }; -}; -export declare function splitUpdate(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function splitUpdateWithEvaluations(key: SplitIO.SplitKey, treatments: SplitIO.TreatmentsWithConfig): { - type: string; - payload: { - timestamp: number; - key: string; - treatments: import("@splitsoftware/splitio/types/splitio").TreatmentsWithConfig; - }; -}; -export declare function splitTimedout(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function splitDestroy(): { - type: string; - payload: { - timestamp: number; - }; -}; -export declare function addTreatments(key: SplitIO.SplitKey, treatments: SplitIO.TreatmentsWithConfig): { - type: string; - payload: { - key: string; - treatments: import("@splitsoftware/splitio/types/splitio").TreatmentsWithConfig; - }; -}; diff --git a/types/asyncActions.d.ts b/types/asyncActions.d.ts deleted file mode 100644 index 1498a97..0000000 --- a/types/asyncActions.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { Dispatch, Action } from 'redux'; -import { IInitSplitSdkParams, IGetTreatmentsParams, IDestroySplitSdkParams, ISplitFactoryBuilder } from './types'; -/** - * Internal object SplitSdk. This object should not be accessed or - * modified by the user, since it is not considered part of the public API - * and may break without notice. It is used by the library for its operation. - */ -export interface ISplitSdk { - config: SplitIO.IBrowserSettings | SplitIO.INodeSettings; - splitio: ISplitFactoryBuilder; - factory: SplitIO.ISDK; - sharedClients: { - [stringKey: string]: SplitIO.IClient; - }; - isDetached: boolean; - dispatch: Dispatch; -} -export declare const splitSdk: ISplitSdk; -/** - * This action creator initializes the Split SDK. It dispatches a Thunk (async) action. - * - * @param {IInitSplitSdkParams} params - */ -export declare function initSplitSdk(params: IInitSplitSdkParams): (dispatch: Dispatch) => Promise; -/** - * This action creator performs a treatment evaluation, i.e., it invokes the actual `client.getTreatment*` methods. - * - * @param {IGetTreatmentsParams} params - */ -export declare function getTreatments(params: IGetTreatmentsParams): Action | (() => void); -/** - * Interface of SDK client for not detached execution (browser). - */ -interface IClientNotDetached extends SplitIO.IClient { - _trackingStatus?: boolean; - /** - * stored evaluations to execute on SDK update. It is an object because we might - * want to change the evaluation parameters (i.e. attributes) per each feature flag name or flag set. - */ - evalOnUpdate: { - [name: string]: IGetTreatmentsParams; - }; - /** - * stored evaluations to execute when the SDK is ready. It is an array, so if multiple evaluations - * are set with the same feature flag name, the result (i.e. treatment) of the last one is the stored one. - */ - evalOnReady: IGetTreatmentsParams[]; - /** - * Similar to evalOnReady: stored evaluations to execute when the SDK is ready from cache. - */ - evalOnReadyFromCache: IGetTreatmentsParams[]; -} -/** - * Used in not detached version (browser). It gets an SDK client and enhances it with `evalOnUpdate`, `evalOnReady` and `evalOnReadyFromCache` lists. - * These lists are used by `getTreatments` action creator to schedule evaluation of feature flags on SDK_UPDATE, SDK_READY and SDK_READY_FROM_CACHE events. - * It is exported for testing purposes only. - * - * @param splitSdk it contains the Split factory, the store dispatch function, and other internal properties - * @param key optional user key - * @returns SDK client with `evalOnUpdate`, `evalOnReady` and `evalOnReadyFromCache` action lists. - */ -export declare function getClient(splitSdk: ISplitSdk, key?: SplitIO.SplitKey): IClientNotDetached; -/** - * This action creator destroy the Split SDK. It dispatches a Thunk (async) action. - * Once the action is resolved, any subsequent dispatch of `getTreatments` - * will update your treatments at the store with the `control` value. - */ -export declare function destroySplitSdk(params?: IDestroySplitSdkParams): (dispatch: Dispatch) => Promise; -export {}; diff --git a/types/constants.d.ts b/types/constants.d.ts deleted file mode 100644 index 9817bac..0000000 --- a/types/constants.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export declare const DEFAULT_SPLIT_STATE_SLICE = "splitio"; -export declare const VERSION: string; -export declare const ON: SplitIO.Treatment; -export declare const OFF: SplitIO.Treatment; -export declare const CONTROL: SplitIO.Treatment; -export declare const CONTROL_WITH_CONFIG: SplitIO.TreatmentWithConfig; -export declare const getControlTreatmentsWithConfig: (featureFlagNames: string[]) => SplitIO.TreatmentsWithConfig; -export declare const SPLIT_READY = "SPLIT_READY"; -export declare const SPLIT_READY_WITH_EVALUATIONS = "SPLIT_READY_WITH_EVALUATIONS"; -export declare const SPLIT_READY_FROM_CACHE = "SPLIT_READY_FROM_CACHE"; -export declare const SPLIT_READY_FROM_CACHE_WITH_EVALUATIONS = "SPLIT_READY_FROM_CACHE_WITH_EVALUATIONS"; -export declare const SPLIT_UPDATE = "SPLIT_UPDATE"; -export declare const SPLIT_UPDATE_WITH_EVALUATIONS = "SPLIT_UPDATE_WITH_EVALUATIONS"; -export declare const SPLIT_TIMEDOUT = "SPLIT_TIMEDOUT"; -export declare const SPLIT_DESTROY = "SPLIT_DESTROY"; -export declare const ADD_TREATMENTS = "ADD_TREATMENTS"; -export declare const ERROR_GETT_NO_INITSPLITSDK = "[ERROR] To use \"getTreatments\" the SDK must be first initialized with an \"initSplitSdk\" action"; -export declare const ERROR_DESTROY_NO_INITSPLITSDK = "[ERROR] To use \"destroySplitSdk\" the SDK must be first initialized with an \"initSplitSdk\" action"; -export declare const ERROR_TRACK_NO_INITSPLITSDK = "[ERROR] To use \"track\" the SDK must be first initialized with an \"initSplitSdk\" action"; -export declare const ERROR_MANAGER_NO_INITSPLITSDK = "[ERROR] To use the manager, the SDK must be first initialized with an \"initSplitSdk\" action"; -export declare const ERROR_SELECTOR_NO_SPLITSTATE = "[ERROR] When using selectors, \"splitState\" value must be a proper splitio piece of state"; -export declare const ERROR_GETT_NO_PARAM_OBJECT = "[ERROR] \"getTreatments\" must be called with a param object containing a valid splitNames or flagSets properties"; -export declare const WARN_FEATUREFLAGS_AND_FLAGSETS = "[WARN] Both splitNames and flagSets properties were provided. flagSets will be ignored"; diff --git a/types/helpers.d.ts b/types/helpers.d.ts deleted file mode 100644 index 344c8da..0000000 --- a/types/helpers.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { ITrackParams } from './types'; -/** - * This function track events, i.e., it invokes the actual `client.track*` methods. - * This function is not an action creator, but rather a simple access to `client.track()`. - * - * @param {ITrackParams} params - * - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#track} - */ -export declare function track(params: ITrackParams): boolean; -/** - * Get the array of feature flag names. - * - * @returns {string[]} The list of feature flag names. The list might be empty if the SDK was not initialized or if it's not ready yet. - * - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#manager} - */ -export declare function getSplitNames(): string[]; -/** - * Get the data of a split in SplitView format. - * - * @param {string} featureFlagName The name of the split we wan't to get info of. - * @returns {SplitView} The SplitIO.SplitView of the given split, or null if split does not exist or the SDK was not initialized or is not ready. - * - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#manager} - */ -export declare function getSplit(featureFlagName: string): SplitIO.SplitView; -/** - * Get the array of feature flags data in SplitView format. - * - * @returns {SplitViews} The list of SplitIO.SplitView. The list might be empty if the SDK was not initialized or if it's not ready yet - * - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#manager} - */ -export declare function getSplits(): SplitIO.SplitViews; diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index 797a995..0000000 --- a/types/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { splitReducer } from './reducer'; -export { initSplitSdk, getTreatments, destroySplitSdk, splitSdk } from './asyncActions'; -export { track, getSplitNames, getSplit, getSplits } from './helpers'; -export { selectTreatmentValue, selectTreatmentWithConfig } from './selectors'; -export { connectSplit } from './react-redux/connectSplit'; -export { connectToggler, mapTreatmentToProps, mapIsFeatureOnToProps } from './react-redux/connectToggler'; -export { ISplitState } from './types'; diff --git a/types/react-redux/connectSplit.d.ts b/types/react-redux/connectSplit.d.ts deleted file mode 100644 index 12309f8..0000000 --- a/types/react-redux/connectSplit.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { getTreatments } from '../asyncActions'; -import { ISplitState, IGetSplitState } from '../types'; -/** - * This decorator connects your components with: - * - The Split state at Redux, under the prop key `split`. - * - The action creator `getTreatments`, binded to the `dispatch` of your store. - * - * @param {IGetSplitState} getSplitState optional function that takes the entire Redux state and returns - * the state slice which corresponds to where the Split reducer was mounted. This functionality is rarely - * needed, and defaults to assuming that the reducer is mounted under the `splitio` key. - */ -export declare function connectSplit(getSplitState?: IGetSplitState): import("react-redux").InferableComponentEnhancerWithProps<{ - splitio: ISplitState; -} & { - getTreatments: typeof getTreatments; -}, {}>; diff --git a/types/react-redux/connectToggler.d.ts b/types/react-redux/connectToggler.d.ts deleted file mode 100644 index 49e354e..0000000 --- a/types/react-redux/connectToggler.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/// -import { IGetSplitState } from '../types'; -/** - * Looks on the features of the Split piece of state, and maps to isFeatureOn - * depending if this feature is ON or not - * - * @param {string} featureFlagName feature flag name - * @param {SplitIO.SplitKey} key user key - * @param {IGetSplitState} getSplitState function that extract the Split piece of state from the Redux state. - */ -export declare function mapIsFeatureOnToProps(featureFlagName: string, key?: SplitIO.SplitKey, getSplitState?: IGetSplitState): (state: any) => { - isFeatureOn: boolean; -}; -/** - * Looks on the features of the Split piece of state, and maps to feature - * the value of this feature - * - * @param {string} featureFlagName feature flag name - * @param {SplitIO.SplitKey} key user key - * @param {IGetSplitState} getSplitState function that extract the Split piece of state from the Redux state. - */ -export declare function mapTreatmentToProps(featureFlagName: string, key?: SplitIO.SplitKey, getSplitState?: IGetSplitState): (state: any) => { - feature: string; -}; -/** - * - * Returns a connected component that wraps the toggler - * The idea of this is to send the isFeatureOn prop to the toggler - * - * So connect send the global state and the toggler decide which to render - * - * @param {string} featureFlagtName feature flag name - * @param {SplitIO.SplitKey} key user key - * @param {IGetSplitState} getSplitState function that extract the Split piece of state from the Redux state. - */ -export declare function connectToggler(featureFlagName: string, key?: SplitIO.SplitKey, getSplitState?: IGetSplitState): (ComponentOn: React.ComponentType, ComponentDefault?: React.ComponentType) => import("react-redux").ConnectedComponent<({ isFeatureOn, ...props }: { - isFeatureOn: boolean; -}) => import("react").ReactElement<{}, string | import("react").JSXElementConstructor>, { - [x: string]: any; -}>; diff --git a/types/reducer.d.ts b/types/reducer.d.ts deleted file mode 100644 index 667ef80..0000000 --- a/types/reducer.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Reducer } from 'redux'; -import { ISplitState } from './types'; -/** - * Split reducer. - * It updates the Split's slice of state. - */ -export declare const splitReducer: Reducer; diff --git a/types/selectors.d.ts b/types/selectors.d.ts deleted file mode 100644 index 4984e59..0000000 --- a/types/selectors.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ISplitState } from './types'; -export declare const getStateSlice: (sliceName: string) => (state: any) => any; -export declare const defaultGetSplitState: (state: any) => any; -/** - * Selector function to extract a treatment evaluation from the Split state. It returns the treatment string value. - * - * @param {ISplitState} splitState - * @param {string} featureFlagName - * @param {SplitIO.SplitKey} key - * @param {string} defaultValue - */ -export declare function selectTreatmentValue(splitState: ISplitState, featureFlagName: string, key?: SplitIO.SplitKey, defaultValue?: string): string; -/** - * Selector function to extract a treatment evaluation from the Split state. It returns a treatment object containing its value and configuration. - * - * @param {ISplitState} splitState - * @param {string} featureFlagName - * @param {SplitIO.SplitKey} key - * @param {TreatmentWithConfig} defaultValue - */ -export declare function selectTreatmentWithConfig(splitState: ISplitState, featureFlagName: string, key?: SplitIO.SplitKey, defaultValue?: SplitIO.TreatmentWithConfig): SplitIO.TreatmentWithConfig; diff --git a/types/types.d.ts b/types/types.d.ts deleted file mode 100644 index 56b5b79..0000000 --- a/types/types.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -/** Type for Split reducer's slice of state */ -export interface ISplitState { - /** - * isReady indicates if Split SDK is ready, i.e., if it has emitted an SDK_READY event. - * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-subscribe-to-events-and-changes} - */ - isReady: boolean; - /** - * isReadyFromCache indicates if Split SDK has emitted an SDK_READY_FROM_CACHE event, what means that the SDK is ready to - * evaluate using LocalStorage cached data (which might be stale). - * This flag only applies for the Browser if using LOCALSTORAGE as storage type. - * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-subscribe-to-events-and-changes} - */ - isReadyFromCache: boolean; - /** - * isTimedout indicates if the Split SDK has emitted an SDK_READY_TIMED_OUT event and is not ready. - * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-subscribe-to-events-and-changes} - */ - isTimedout: boolean; - /** - * hasTimedout indicates if the Split SDK has ever emitted an SDK_READY_TIMED_OUT event. - * It's meant to keep a reference that the SDK emitted a timeout at some point, not the current state. - * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-subscribe-to-events-and-changes} - */ - hasTimedout: boolean; - /** - * isDestroyed indicates if the Split SDK has been destroyed by dispatching a `destroySplitSdk` action. - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#shutdown} - */ - isDestroyed: boolean; - /** - * lastUpdate is the timestamp of the last Split SDK event (SDK_READY, SDK_READY_TIMED_OUT or SDK_UPDATE). - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#advanced-subscribe-to-events-and-changes} - */ - lastUpdate: number; - /** - * `treatments` is a nested object property that contains the evaluations of feature flags. - * Each evaluation (treatment) is associated with a feature flag name and a key (e.g., unique user identifier, such as a user id). - * Thus the property has 3 levels: feature flag name, key, and finally the treatment that was evaluated for that specific feature flag and key. - */ - treatments: { - [featureFlagName: string]: { - [key: string]: SplitIO.TreatmentWithConfig; - }; - }; -} -export declare type IGetSplitState = (state: any) => ISplitState; -/** - * Type of the param object passed to `initSplitSdk` action creator. - */ -export interface IInitSplitSdkParams { - /** - * Setting object used to initialize the Split factory. - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#configuration} - */ - config: SplitIO.IBrowserSettings | SplitIO.INodeSettings; - /** - * Optional param to provide a Split factory initializer to use instead of SplitFactory from '@splitsoftware/splitio'. - * It can be useful when the Split factory is imported from the UMD bundle in a HTML script. - */ - splitio?: ISplitFactoryBuilder; - /** - * optional callback to be invoked on SDK_READY event - */ - onReady?: () => any; - /** - * optional callback to be invoked on SDK_READY_FROM_CACHE event - */ - onReadyFromCache?: () => any; - /** - * optional callback to be invoked on SDK_READY_TIMED_OUT event - */ - onTimedout?: () => any; - /** - * optional callback to be invoked on SDK_UPDATE event - */ - onUpdate?: () => any; -} -/** - * Type of the param object passed to `getTreatments` action creator. - */ -export declare type IGetTreatmentsParams = { - /** - * user key used to evaluate. It is mandatory for node but optional for browser. If not provided in browser, - * it defaults to the key defined in the SDK config, i.e., the config object passed to `initSplitSdk`. - */ - key?: SplitIO.SplitKey; - /** - * optional map of attributes passed to the actual `client.getTreatment*` methods. - * @see {@link https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#attribute-syntax} - */ - attributes?: SplitIO.Attributes; - /** - * This param indicates to re-evaluate the feature flags if the SDK is updated. For example, a `true` value might be - * the desired behaviour for permission toggles or operation toggles, such as a kill switch, that you want to - * inmediately reflect in your app. A `false` value might be useful for experiment or release toggles, where - * you want to keep the treatment unchanged during the sesion of the user. - * @default false - */ - evalOnUpdate?: boolean; - /** - * This param indicates to evaluate the feature flags if the SDK is ready from cache (i.e., it emits SDK_READY_FROM_CACHE event). - * This params is only relevant when using 'LOCALSTORAGE' as storage type, since otherwise the event is never emitted. - * @default false - */ - evalOnReadyFromCache?: boolean; -} & ({ - /** - * Feature flag name or array of feature flag names to evaluate. Either this or the `flagSets` property must be provided. If both are provided, the `flagSets` option is ignored. - */ - splitNames: string[] | string; - flagSets?: undefined; -} | { - /** - * Feature flag set or array of feature flag sets to evaluate. Either this or the `splitNames` property must be provided. If both are provided, the `flagSets` option is ignored. - */ - flagSets: string[] | string; - splitNames?: undefined; -}); -/** - * Type of the param object passed to `destroySplitSdk` action creator. - */ -export interface IDestroySplitSdkParams { - /** - * optional callback to be invoked once the SDK has gracefully shut down - */ - onDestroy?: () => any; -} -/** - * Type of the param object passed to `track` function helper. - */ -export interface ITrackParams { - /** - * user key used to track event. It is mandatory for node but optional for browser. If not provided in browser, - * it defaults to the key defined in the SDK config object. - */ - key?: SplitIO.SplitKey; - /** - * the traffic type of the key in the track call. If not provided, it defaults to the traffic type defined in the SDK - * config object. If not provided either in the SDK setting, the function logs an error message and returns false. - */ - trafficType?: string; - /** - * The event type that this event should correspond to. The expected data type is String. - */ - eventType: string; - /** - * Optional value to be used in creating the metric. - */ - value?: number; - /** - * Optional object of key-value pairs that can be used to filter your metrics. - */ - properties?: SplitIO.Properties; -} -export declare type ISplitFactoryBuilder = (settings: SplitIO.IBrowserSettings | SplitIO.INodeSettings) => SplitIO.ISDK; diff --git a/types/utils.d.ts b/types/utils.d.ts deleted file mode 100644 index f37d930..0000000 --- a/types/utils.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IGetTreatmentsParams } from './types'; -/** - * Validates if a value is an object. - */ -export declare function isObject(obj: unknown): boolean; -/** - * Verify type of key and return either its matchingKey or itself - */ -export declare function matching(key: SplitIO.SplitKey): string; -/** - * ClientWithContext interface. - */ -export interface IClientStatus { - isReady: boolean; - isReadyFromCache: boolean; - isOperational: boolean; - hasTimedout: boolean; - isDestroyed: boolean; -} -export declare function getStatus(client: SplitIO.IClient): IClientStatus; -/** - * Validates and sanitizes the parameters passed to the "getTreatments" action creator. - * The returned object is a copy of the passed one, with the "splitNames" and "flagSets" properties converted to an array of strings. - */ -export declare function validateGetTreatmentsParams(params: any): IGetTreatmentsParams | false; From 5a00516db7501f2de954297026849346197535b4 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 27 Mar 2024 19:58:14 -0300 Subject: [PATCH 12/14] Update chagelog entry date --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index a4b6980..9c8c840 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -1.11.0 (March 27, 2023) +1.11.0 (April 3, 2024) - Added `sideEffects: false` property in the package.json file to allow tree shaking. - Updated Redux-Thunk peer dependency range to include redux-thunk@3.x.x. - Updated the build process and added the `tslib` package as an explicit dependency to import TypeScript helpers, thereby avoiding duplicated helper code in the output files. From 36576fe66f34462c5ac55413a16f6d50ef2efc74 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 27 Mar 2024 20:00:12 -0300 Subject: [PATCH 13/14] rc --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76d7aff..b5c5ae8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.11.0", + "version": "1.10.1-rc.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-redux", - "version": "1.11.0", + "version": "1.10.1-rc.4", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.2", diff --git a/package.json b/package.json index 87d07c6..ded7df4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.11.0", + "version": "1.10.1-rc.4", "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js", From be15db2a6a47b5427ace373c297ed5413e833f10 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 27 Mar 2024 20:05:11 -0300 Subject: [PATCH 14/14] stable version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b5c5ae8..76d7aff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.4", + "version": "1.11.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.4", + "version": "1.11.0", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio": "10.25.2", diff --git a/package.json b/package.json index ded7df4..87d07c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-redux", - "version": "1.10.1-rc.4", + "version": "1.11.0", "description": "A library to easily use Split JS SDK with Redux and React Redux", "main": "lib/index.js", "module": "es/index.js",