Skip to content

Commit 934e838

Browse files
feat: add fallback treatments config and improve client ready state handling
1 parent 52ef722 commit 934e838

File tree

7 files changed

+28
-14
lines changed

7 files changed

+28
-14
lines changed

CHANGES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
1.5.0 (October 31, 2025)
2+
- Added new configuration for Fallback Treatments, which allows setting a treatment value and optional config to be returned in place of "control", either globally or by flag. Read more in our docs.
3+
- Added `client.getStatus()` method to retrieve the client readiness status properties (`isReady`, `isReadyFromCache`, etc).
4+
- 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.
5+
- Updated the SDK_READY_FROM_CACHE event to be emitted alongside the SDK_READY event if it hasn’t already been emitted.
6+
- Updated @splitsoftware/splitio-commons package to version 2.8.0.
7+
18
1.4.1 (October 8, 2025)
29
- 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.
310

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-react-native",
3-
"version": "1.4.1",
3+
"version": "1.5.0",
44
"description": "Split SDK for React Native",
55
"main": "lib/commonjs/index.js",
66
"module": "lib/module/index.js",
@@ -61,7 +61,7 @@
6161
},
6262
"homepage": "https://github.com/splitio/react-native-client#readme",
6363
"dependencies": {
64-
"@splitsoftware/splitio-commons": "2.7.1"
64+
"@splitsoftware/splitio-commons": "2.8.0"
6565
},
6666
"devDependencies": {
6767
"@react-native-community/eslint-config": "^3.2.0",

src/settings/defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type SplitIO from '@splitsoftware/splitio-commons/types/splitio';
22
import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants';
33

4-
const packageVersion = '1.4.1';
4+
const packageVersion = '1.5.0';
55

66
export const defaults = {
77
startup: {

ts-tests/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ let fullReactNativeSettings: SplitIO.IReactNativeSettings = {
109109
},
110110
userConsent: 'GRANTED',
111111
mode: 'standalone',
112+
fallbackTreatments: {
113+
global: { treatment: 'global-treatment', config: '{"global": true}' },
114+
byFlag: {
115+
my_flag: { treatment: 'flag-treatment', config: '{"flag": true}' },
116+
my_other_flag: 'other-flag-treatment',
117+
},
118+
},
112119
};
113120

114121
reactNativeSettings.userConsent = 'DECLINED';

types/full/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ declare module JsSdk {
3232
* }
3333
* ```
3434
*
35-
* @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-native-sdk/#configuring-cache}
35+
* @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-native-sdk/#configure-cache-behavior}
3636
*/
3737
export function InLocalStorage(options?: SplitIO.InLocalStorageOptions): SplitIO.StorageSyncFactory;
3838

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ declare module JsSdk {
3232
* }
3333
* ```
3434
*
35-
* @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-native-sdk/#configuring-cache}
35+
* @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-native-sdk/#configure-cache-behavior}
3636
*/
3737
export function InLocalStorage(options?: SplitIO.InLocalStorageOptions): SplitIO.StorageSyncFactory;
3838

0 commit comments

Comments
 (0)