From fdda27f1b9bc31466c17ae3c6996e27f0edb3bc3 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 7 May 2024 10:01:59 -0300 Subject: [PATCH 1/4] Remove EventEmitter max listeners warning --- CHANGES.txt | 3 +++ src/utils.ts | 4 ++++ tsconfig.json | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 941d295..3e87d22 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +1.11.2 (May XX, 2024) + - Updated internal use of the SDK client to remove EventEmitter memory leak warnings. These warnings are emitted when using multiple hooks and components from the SDK simultaneously, but they do not indicate an actual memory leak and are irrelevant for SDK usage (Related to https://github.com/splitio/react-client/issues/191). + 1.11.1 (March 26, 2024) - Bugfixing - Added tslib as an explicit dependency to avoid issues with some package managers that don't resolve it automatically as a transitive dependency from @splitsoftware/splitio-commons (Related to issue https://github.com/splitio/javascript-client/issues/795). diff --git a/src/utils.ts b/src/utils.ts index 760077a..cbd2894 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -53,6 +53,10 @@ export function getSplitClient(factory: SplitIO.IBrowserSDK, key?: SplitIO.Split // Handle client lastUpdate if (client.lastUpdate === undefined) { + // Remove EventEmitter warning emitted when using multiple SDK hooks or components. + // Unlike JS SDK, users don't need to use the client directly and so the warning is not relevant. + client.setMaxListeners(0); + const updateLastUpdate = () => { const lastUpdate = Date.now(); client.lastUpdate = lastUpdate > client.lastUpdate ? lastUpdate : client.lastUpdate + 1; diff --git a/tsconfig.json b/tsconfig.json index 53b35e1..a409207 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,9 @@ "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ }, - "include": ["src"], + "include": [ + "src" + ], "exclude": [ "./src/__tests__", "umd.ts", From 57310e5fa30b57e94970c71c8813c27dfe68ad1c Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 8 May 2024 11:38:53 -0300 Subject: [PATCH 2/4] Upgrade JS SDK dependency --- CHANGES.txt | 6 ++++++ package-lock.json | 34 +++++++++++++++++----------------- package.json | 4 ++-- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 941d295..9719bf6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,9 @@ +1.12.0 (May 8, 2024) + - Updated @splitsoftware/splitio package to version 10.26.0 that includes minor updates: + - Added support for targeting rules based on semantic versions (https://semver.org/). + - Added special impression label "targeting rule type unsupported by sdk" when the matcher type is not supported by the SDK, which returns 'control' treatment. + - Updated Split API client to include the flags spec version query parameter for the `splitChanges` and `auth` endpoints. + 1.11.1 (March 26, 2024) - Bugfixing - Added tslib as an explicit dependency to avoid issues with some package managers that don't resolve it automatically as a transitive dependency from @splitsoftware/splitio-commons (Related to issue https://github.com/splitio/javascript-client/issues/795). diff --git a/package-lock.json b/package-lock.json index c39002d..37eb5c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splitsoftware/splitio-react", - "version": "1.11.1", + "version": "1.12.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-react", - "version": "1.11.1", + "version": "1.12.0", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio": "10.25.2", + "@splitsoftware/splitio": "10.26.0", "memoize-one": "^5.1.1", "shallowequal": "^1.1.0", "tslib": "^2.3.1" @@ -1548,11 +1548,11 @@ } }, "node_modules/@splitsoftware/splitio": { - "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==", + "version": "10.26.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-10.26.0.tgz", + "integrity": "sha512-sACjAcov/Zn1gYaN6m0qQb9G/LDk43c8rEzFaabhlnWOsH0W22ImVHGx8iU3I/DyC1S2wrsjXTSnW1GQlbb7+Q==", "dependencies": { - "@splitsoftware/splitio-commons": "1.13.1", + "@splitsoftware/splitio-commons": "1.14.0", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "bloom-filters": "^3.0.0", @@ -1571,9 +1571,9 @@ } }, "node_modules/@splitsoftware/splitio-commons": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.13.1.tgz", - "integrity": "sha512-xGu94sLx+tJb6PeM26vH8/LEElsaVbh2BjoLvL5twR4gKsVezie5ZtHhejWT1+iCVCtJuhjZxKwOm4HGYoVIHQ==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.14.0.tgz", + "integrity": "sha512-ANP0NRPAMehi4bUQsb19kP5W5NVuCYUKRsDC5Nl78xHIu6cskAej1rXkjsocLnWerz2rO0H9kMjRKZj9lVsvKA==", "dependencies": { "tslib": "^2.3.1" }, @@ -12091,11 +12091,11 @@ } }, "@splitsoftware/splitio": { - "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==", + "version": "10.26.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio/-/splitio-10.26.0.tgz", + "integrity": "sha512-sACjAcov/Zn1gYaN6m0qQb9G/LDk43c8rEzFaabhlnWOsH0W22ImVHGx8iU3I/DyC1S2wrsjXTSnW1GQlbb7+Q==", "requires": { - "@splitsoftware/splitio-commons": "1.13.1", + "@splitsoftware/splitio-commons": "1.14.0", "@types/google.analytics": "0.0.40", "@types/ioredis": "^4.28.0", "bloom-filters": "^3.0.0", @@ -12108,9 +12108,9 @@ } }, "@splitsoftware/splitio-commons": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.13.1.tgz", - "integrity": "sha512-xGu94sLx+tJb6PeM26vH8/LEElsaVbh2BjoLvL5twR4gKsVezie5ZtHhejWT1+iCVCtJuhjZxKwOm4HGYoVIHQ==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.14.0.tgz", + "integrity": "sha512-ANP0NRPAMehi4bUQsb19kP5W5NVuCYUKRsDC5Nl78xHIu6cskAej1rXkjsocLnWerz2rO0H9kMjRKZj9lVsvKA==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index a8dcb9c..3254c17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-react", - "version": "1.11.1", + "version": "1.12.0", "description": "A React library to easily integrate and use Split JS SDK", "main": "lib/index.js", "module": "es/index.js", @@ -63,7 +63,7 @@ }, "homepage": "https://github.com/splitio/react-client#readme", "dependencies": { - "@splitsoftware/splitio": "10.25.2", + "@splitsoftware/splitio": "10.26.0", "memoize-one": "^5.1.1", "shallowequal": "^1.1.0", "tslib": "^2.3.1" From aaf6b042f7de985b749336ed09d4e5955a35cad0 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 10 May 2024 11:35:59 -0300 Subject: [PATCH 3/4] Update changelog entry date --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9719bf6..3f9a8a9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -1.12.0 (May 8, 2024) +1.12.0 (May 10, 2024) - Updated @splitsoftware/splitio package to version 10.26.0 that includes minor updates: - Added support for targeting rules based on semantic versions (https://semver.org/). - Added special impression label "targeting rule type unsupported by sdk" when the matcher type is not supported by the SDK, which returns 'control' treatment. From 08711d9ddc8ac6beb04ef1052448dbd31abec82b Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 10 May 2024 11:52:08 -0300 Subject: [PATCH 4/4] Update changelog entry --- CHANGES.txt | 2 +- src/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 1ebc95f..a2ae970 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,7 +3,7 @@ - Added support for targeting rules based on semantic versions (https://semver.org/). - Added special impression label "targeting rule type unsupported by sdk" when the matcher type is not supported by the SDK, which returns 'control' treatment. - Updated Split API client to include the flags spec version query parameter for the `splitChanges` and `auth` endpoints. - - Updated internal use of the SDK client to remove EventEmitter memory leak warnings. These warnings are emitted when using multiple hooks and components from the SDK simultaneously, but they do not indicate an actual memory leak and are irrelevant for SDK usage (Related to https://github.com/splitio/react-client/issues/191). + - Updated internal use of the SDK client to remove EventEmitter memory leak warnings. These warnings were emitted when using multiple hooks and components from the SDK simultaneously, but they do not indicate an actual memory leak and are irrelevant for SDK usage (Related to https://github.com/splitio/react-client/issues/191). 1.11.1 (March 26, 2024) - Bugfixing - Added tslib as an explicit dependency to avoid issues with some package managers that don't resolve it automatically as a transitive dependency from @splitsoftware/splitio-commons (Related to issue https://github.com/splitio/javascript-client/issues/795). diff --git a/src/utils.ts b/src/utils.ts index cbd2894..856e825 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -54,7 +54,7 @@ export function getSplitClient(factory: SplitIO.IBrowserSDK, key?: SplitIO.Split // Handle client lastUpdate if (client.lastUpdate === undefined) { // Remove EventEmitter warning emitted when using multiple SDK hooks or components. - // Unlike JS SDK, users don't need to use the client directly and so the warning is not relevant. + // Unlike JS SDK, users can avoid using the client directly, making the warning irrelevant. client.setMaxListeners(0); const updateLastUpdate = () => {