From 52268a8bfc72f0ecfa4477c6e41c2dd47c8866e6 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 8 Oct 2025 12:25:13 -0300 Subject: [PATCH 1/3] Use log level when logger is set --- CHANGES.txt | 3 +++ package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/settings/defaults.ts | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 506ff0d..13f55b3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +1.4.1 (October 8, 2025) + - Bugfix - Updated @splitsoftware/splitio-commons package to version 2.7.1, which fixes the `debug` option to support log levels when the `logger` option is used. + 1.4.0 (October 7, 2025) - Added an EventSource polyfill to fall back when native EventSource modules and the global EventSource object are unavailable, providing out-of-the-box streaming support on more platforms and Expo projects. - Added support for custom loggers: added `logger` configuration option and `factory.Logger.setLogger` method to allow the SDK to use a custom logger. diff --git a/package-lock.json b/package-lock.json index ffc2dd3..cca5ad5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splitsoftware/splitio-react-native", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-react-native", - "version": "1.4.0", + "version": "1.4.1", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio-commons": "2.7.0" + "@splitsoftware/splitio-commons": "2.7.1" }, "devDependencies": { "@react-native-community/eslint-config": "^3.2.0", @@ -4887,9 +4887,9 @@ } }, "node_modules/@splitsoftware/splitio-commons": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.7.0.tgz", - "integrity": "sha512-w2aemu5HNVQXX/tbmSuFjpWa/AjS+EBiH6ltHMqfg2MZMWayTFJbfjjQcudAVLR+vLjDw2DuCTp/xj3kKlcf5g==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.7.1.tgz", + "integrity": "sha512-7a4VVMczh0YKVRi35EhD0FOAEwzqfJRcCiKqLLhZCxAvrZBpE2khpGn8pOP+y6TefdPVtblW8GIku4O4r0KRdQ==", "license": "Apache-2.0", "dependencies": { "@types/ioredis": "^4.28.0", @@ -21659,9 +21659,9 @@ } }, "@splitsoftware/splitio-commons": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.7.0.tgz", - "integrity": "sha512-w2aemu5HNVQXX/tbmSuFjpWa/AjS+EBiH6ltHMqfg2MZMWayTFJbfjjQcudAVLR+vLjDw2DuCTp/xj3kKlcf5g==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.7.1.tgz", + "integrity": "sha512-7a4VVMczh0YKVRi35EhD0FOAEwzqfJRcCiKqLLhZCxAvrZBpE2khpGn8pOP+y6TefdPVtblW8GIku4O4r0KRdQ==", "requires": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" diff --git a/package.json b/package.json index c03e6b4..cba0b84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-react-native", - "version": "1.4.0", + "version": "1.4.1", "description": "Split SDK for React Native", "main": "lib/commonjs/index.js", "module": "lib/module/index.js", @@ -61,7 +61,7 @@ }, "homepage": "https://github.com/splitio/react-native-client#readme", "dependencies": { - "@splitsoftware/splitio-commons": "2.7.0" + "@splitsoftware/splitio-commons": "2.7.1" }, "devDependencies": { "@react-native-community/eslint-config": "^3.2.0", diff --git a/src/settings/defaults.ts b/src/settings/defaults.ts index b2ed60a..a2f820d 100644 --- a/src/settings/defaults.ts +++ b/src/settings/defaults.ts @@ -1,7 +1,7 @@ import type SplitIO from '@splitsoftware/splitio-commons/types/splitio'; import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants'; -const packageVersion = '1.4.0'; +const packageVersion = '1.4.1'; export const defaults = { startup: { From 89c99677b81db56375f5c45b560529fefd285a8f Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 8 Oct 2025 12:27:37 -0300 Subject: [PATCH 2/3] Test update to reduce its flakiness --- src/platform/__tests__/RNSignalListener.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/__tests__/RNSignalListener.spec.ts b/src/platform/__tests__/RNSignalListener.spec.ts index bdd1406..95aa3a7 100644 --- a/src/platform/__tests__/RNSignalListener.spec.ts +++ b/src/platform/__tests__/RNSignalListener.spec.ts @@ -46,7 +46,7 @@ describe('RNSignalListener', () => { // Wait for features refresh rate to validate that syncAll is called when resuming foreground expect(syncManagerMockWithPushManager.pollingManager!.syncAll).toBeCalledTimes(0); - await new Promise((resolve) => setTimeout(resolve, settingsMock.scheduler.featuresRefreshRate)); + await new Promise((resolve) => setTimeout(resolve, settingsMock.scheduler.featuresRefreshRate + 20)); // Going to foreground should be handled AppStateMock._emitChangeEvent('inactive'); From 934e838764aaec621520c9551b71ee3016444c48 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Thu, 30 Oct 2025 18:29:39 -0300 Subject: [PATCH 3/3] feat: add fallback treatments config and improve client ready state handling --- CHANGES.txt | 7 +++++++ package-lock.json | 18 +++++++++--------- package.json | 4 ++-- src/settings/defaults.ts | 2 +- ts-tests/index.ts | 7 +++++++ types/full/index.d.ts | 2 +- types/index.d.ts | 2 +- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 13f55b3..c1e06db 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,10 @@ +1.5.0 (October 31, 2025) + - 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. + - Added `client.getStatus()` method to retrieve the client readiness status properties (`isReady`, `isReadyFromCache`, etc). + - Added `client.whenReady()` and `client.whenReadyFromCache()` methods to replace the deprecated `client.ready()` method, which has an issue causing the returned promise to hang when using async/await syntax if it was rejected. + - Updated the SDK_READY_FROM_CACHE event to be emitted alongside the SDK_READY event if it hasn’t already been emitted. + - Updated @splitsoftware/splitio-commons package to version 2.8.0. + 1.4.1 (October 8, 2025) - Bugfix - Updated @splitsoftware/splitio-commons package to version 2.7.1, which fixes the `debug` option to support log levels when the `logger` option is used. diff --git a/package-lock.json b/package-lock.json index cca5ad5..1625949 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splitsoftware/splitio-react-native", - "version": "1.4.1", + "version": "1.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-react-native", - "version": "1.4.1", + "version": "1.5.0", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio-commons": "2.7.1" + "@splitsoftware/splitio-commons": "2.8.0" }, "devDependencies": { "@react-native-community/eslint-config": "^3.2.0", @@ -4887,9 +4887,9 @@ } }, "node_modules/@splitsoftware/splitio-commons": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.7.1.tgz", - "integrity": "sha512-7a4VVMczh0YKVRi35EhD0FOAEwzqfJRcCiKqLLhZCxAvrZBpE2khpGn8pOP+y6TefdPVtblW8GIku4O4r0KRdQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.8.0.tgz", + "integrity": "sha512-QgHUreMOEDwf4GZzVPu4AzkZJvuaeSoHsiJc4tT3CxSIYl2bKMz1SSDlI1tW/oVbIFeWjkrIp2lCYEyUBgcvyA==", "license": "Apache-2.0", "dependencies": { "@types/ioredis": "^4.28.0", @@ -21659,9 +21659,9 @@ } }, "@splitsoftware/splitio-commons": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.7.1.tgz", - "integrity": "sha512-7a4VVMczh0YKVRi35EhD0FOAEwzqfJRcCiKqLLhZCxAvrZBpE2khpGn8pOP+y6TefdPVtblW8GIku4O4r0KRdQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-2.8.0.tgz", + "integrity": "sha512-QgHUreMOEDwf4GZzVPu4AzkZJvuaeSoHsiJc4tT3CxSIYl2bKMz1SSDlI1tW/oVbIFeWjkrIp2lCYEyUBgcvyA==", "requires": { "@types/ioredis": "^4.28.0", "tslib": "^2.3.1" diff --git a/package.json b/package.json index cba0b84..0abd107 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-react-native", - "version": "1.4.1", + "version": "1.5.0", "description": "Split SDK for React Native", "main": "lib/commonjs/index.js", "module": "lib/module/index.js", @@ -61,7 +61,7 @@ }, "homepage": "https://github.com/splitio/react-native-client#readme", "dependencies": { - "@splitsoftware/splitio-commons": "2.7.1" + "@splitsoftware/splitio-commons": "2.8.0" }, "devDependencies": { "@react-native-community/eslint-config": "^3.2.0", diff --git a/src/settings/defaults.ts b/src/settings/defaults.ts index a2f820d..4b1dbf6 100644 --- a/src/settings/defaults.ts +++ b/src/settings/defaults.ts @@ -1,7 +1,7 @@ import type SplitIO from '@splitsoftware/splitio-commons/types/splitio'; import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants'; -const packageVersion = '1.4.1'; +const packageVersion = '1.5.0'; export const defaults = { startup: { diff --git a/ts-tests/index.ts b/ts-tests/index.ts index 07c5b79..399a8d3 100644 --- a/ts-tests/index.ts +++ b/ts-tests/index.ts @@ -109,6 +109,13 @@ let fullReactNativeSettings: SplitIO.IReactNativeSettings = { }, userConsent: 'GRANTED', mode: 'standalone', + fallbackTreatments: { + global: { treatment: 'global-treatment', config: '{"global": true}' }, + byFlag: { + my_flag: { treatment: 'flag-treatment', config: '{"flag": true}' }, + my_other_flag: 'other-flag-treatment', + }, + }, }; reactNativeSettings.userConsent = 'DECLINED'; diff --git a/types/full/index.d.ts b/types/full/index.d.ts index 5c6de26..bd44b0f 100644 --- a/types/full/index.d.ts +++ b/types/full/index.d.ts @@ -32,7 +32,7 @@ declare module JsSdk { * } * ``` * - * @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-native-sdk/#configuring-cache} + * @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-native-sdk/#configure-cache-behavior} */ export function InLocalStorage(options?: SplitIO.InLocalStorageOptions): SplitIO.StorageSyncFactory; diff --git a/types/index.d.ts b/types/index.d.ts index b9bfaf1..459e7f2 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -32,7 +32,7 @@ declare module JsSdk { * } * ``` * - * @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-native-sdk/#configuring-cache} + * @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-native-sdk/#configure-cache-behavior} */ export function InLocalStorage(options?: SplitIO.InLocalStorageOptions): SplitIO.StorageSyncFactory;