@launchdarkly/react-native-client-sdk 10.12.4 → 10.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/src/hooks/variation/LDEvaluationDetail.d.ts +26 -0
- package/dist/src/hooks/variation/LDEvaluationDetail.d.ts.map +1 -0
- package/dist/src/hooks/variation/LDEvaluationDetail.js +2 -0
- package/dist/src/hooks/variation/LDEvaluationDetail.js.map +1 -0
- package/dist/src/hooks/variation/useTypedVariation.d.ts +1 -1
- package/dist/src/hooks/variation/useTypedVariation.d.ts.map +1 -1
- package/dist/src/hooks/variation/useTypedVariation.js +21 -10
- package/dist/src/hooks/variation/useTypedVariation.js.map +1 -1
- package/dist/src/hooks/variation/useVariation.d.ts +4 -4
- package/dist/src/hooks/variation/useVariation.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/platform/PlatformInfo.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [10.12.6](https://github.com/launchdarkly/js-core/compare/react-native-client-sdk-v10.12.5...react-native-client-sdk-v10.12.6) (2026-01-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* evaluation detail type should be optional ([#1064](https://github.com/launchdarkly/js-core/issues/1064)) ([e81c333](https://github.com/launchdarkly/js-core/commit/e81c333034f2e8206dfaf70d6fdb6001747b777f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @launchdarkly/js-client-sdk-common bumped from 1.17.1 to 1.17.2
|
|
16
|
+
|
|
17
|
+
## [10.12.5](https://github.com/launchdarkly/js-core/compare/react-native-client-sdk-v10.12.4...react-native-client-sdk-v10.12.5) (2026-01-08)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Dependencies
|
|
21
|
+
|
|
22
|
+
* The following workspace dependencies were updated
|
|
23
|
+
* dependencies
|
|
24
|
+
* @launchdarkly/js-client-sdk-common bumped from 1.17.0 to 1.17.1
|
|
25
|
+
|
|
3
26
|
## [10.12.4](https://github.com/launchdarkly/js-core/compare/react-native-client-sdk-v10.12.3...react-native-client-sdk-v10.12.4) (2026-01-06)
|
|
4
27
|
|
|
5
28
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LDEvaluationDetail as CommonDetail, LDEvaluationDetailTyped as CommonDetailTyped, LDEvaluationReason } from '@launchdarkly/js-client-sdk-common';
|
|
2
|
+
/**
|
|
3
|
+
* An object that combines the result of a feature flag evaluation with information about
|
|
4
|
+
* how it was calculated.
|
|
5
|
+
*
|
|
6
|
+
* This is the result of calling `LDClient.variationDetail`.
|
|
7
|
+
*/
|
|
8
|
+
export type LDEvaluationDetail = Omit<CommonDetail, 'reason'> & {
|
|
9
|
+
/**
|
|
10
|
+
* An optional object describing the main factor that influenced the flag evaluation value.
|
|
11
|
+
*/
|
|
12
|
+
reason: LDEvaluationReason | null;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* An object that combines the result of a feature flag evaluation with information about
|
|
16
|
+
* how it was calculated.
|
|
17
|
+
*
|
|
18
|
+
* This is the result of calling detailed variation methods.
|
|
19
|
+
*/
|
|
20
|
+
export type LDEvaluationDetailTyped<TFlag> = Omit<CommonDetailTyped<TFlag>, 'reason'> & {
|
|
21
|
+
/**
|
|
22
|
+
* An optional object describing the main factor that influenced the flag evaluation value.
|
|
23
|
+
*/
|
|
24
|
+
reason: LDEvaluationReason | null;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=LDEvaluationDetail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LDEvaluationDetail.d.ts","sourceRoot":"","sources":["../../../../src/hooks/variation/LDEvaluationDetail.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,IAAI,YAAY,EAClC,uBAAuB,IAAI,iBAAiB,EAC5C,kBAAkB,EACnB,MAAM,oCAAoC,CAAC;AAQ5C;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG;IAC9D;;OAEG;IACH,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACnC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,CAAC,KAAK,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,GAAG;IACtF;;OAEG;IACH,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LDEvaluationDetail.js","sourceRoot":"","sources":["../../../../src/hooks/variation/LDEvaluationDetail.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTypedVariation.d.ts","sourceRoot":"","sources":["../../../../src/hooks/variation/useTypedVariation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTypedVariation.d.ts","sourceRoot":"","sources":["../../../../src/hooks/variation/useTypedVariation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,2BACvB,MAAM,uBAkBZ,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,uBAAuB,2BAC7B,MAAM,gDAgDZ,CAAC"}
|
|
@@ -44,19 +44,30 @@ export const useTypedVariation = (key, defaultValue) => {
|
|
|
44
44
|
* The result (as an {@link LDEvaluationDetailTyped<T>}).
|
|
45
45
|
*/
|
|
46
46
|
export const useTypedVariationDetail = (key, defaultValue) => {
|
|
47
|
+
var _a, _b, _c, _d, _e;
|
|
47
48
|
const ldClient = useLDClient();
|
|
48
49
|
switch (typeof defaultValue) {
|
|
49
|
-
case 'boolean':
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
case '
|
|
54
|
-
|
|
50
|
+
case 'boolean': {
|
|
51
|
+
const detail = ldClient.boolVariationDetail(key, defaultValue);
|
|
52
|
+
return Object.assign(Object.assign({}, detail), { reason: (_a = detail.reason) !== null && _a !== void 0 ? _a : null });
|
|
53
|
+
}
|
|
54
|
+
case 'number': {
|
|
55
|
+
const detail = ldClient.numberVariationDetail(key, defaultValue);
|
|
56
|
+
return Object.assign(Object.assign({}, detail), { reason: (_b = detail.reason) !== null && _b !== void 0 ? _b : null });
|
|
57
|
+
}
|
|
58
|
+
case 'string': {
|
|
59
|
+
const detail = ldClient.stringVariationDetail(key, defaultValue);
|
|
60
|
+
return Object.assign(Object.assign({}, detail), { reason: (_c = detail.reason) !== null && _c !== void 0 ? _c : null });
|
|
61
|
+
}
|
|
55
62
|
case 'undefined':
|
|
56
|
-
case 'object':
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
case 'object': {
|
|
64
|
+
const detail = ldClient.jsonVariationDetail(key, defaultValue);
|
|
65
|
+
return Object.assign(Object.assign({}, detail), { reason: (_d = detail.reason) !== null && _d !== void 0 ? _d : null });
|
|
66
|
+
}
|
|
67
|
+
default: {
|
|
68
|
+
const detail = ldClient.variationDetail(key, defaultValue);
|
|
69
|
+
return Object.assign(Object.assign({}, detail), { reason: (_e = detail.reason) !== null && _e !== void 0 ? _e : null });
|
|
70
|
+
}
|
|
60
71
|
}
|
|
61
72
|
};
|
|
62
73
|
//# sourceMappingURL=useTypedVariation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTypedVariation.js","sourceRoot":"","sources":["../../../../src/hooks/variation/useTypedVariation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTypedVariation.js","sourceRoot":"","sources":["../../../../src/hooks/variation/useTypedVariation.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAGzC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,GAAW,EACX,YAAe,EACZ,EAAE;IACL,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,QAAQ,OAAO,YAAY,EAAE;QAC3B,KAAK,SAAS;YACZ,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,YAAuB,CAAM,CAAC;QACnE,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC,eAAe,CAAC,GAAG,EAAE,YAAsB,CAAM,CAAC;QACpE,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC,eAAe,CAAC,GAAG,EAAE,YAAsB,CAAM,CAAC;QACpE,KAAK,WAAW,CAAC;QACjB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,YAAY,CAAM,CAAC;QACxD;YACE,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;KAChD;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,GAAW,EACX,YAAe,EACa,EAAE;;IAC9B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,QAAQ,OAAO,YAAY,EAAE;QAC3B,KAAK,SAAS,CAAC,CAAC;YACd,MAAM,MAAM,GAAG,QAAQ,CAAC,mBAAmB,CAAC,GAAG,EAAE,YAAuB,CAAC,CAAC;YAE1E,OAAO,gCACF,MAAM,KACT,MAAM,EAAE,MAAA,MAAM,CAAC,MAAM,mCAAI,IAAI,GACA,CAAC;SACjC;QACD,KAAK,QAAQ,CAAC,CAAC;YACb,MAAM,MAAM,GAAG,QAAQ,CAAC,qBAAqB,CAAC,GAAG,EAAE,YAAsB,CAAC,CAAC;YAE3E,OAAO,gCACF,MAAM,KACT,MAAM,EAAE,MAAA,MAAM,CAAC,MAAM,mCAAI,IAAI,GACA,CAAC;SACjC;QACD,KAAK,QAAQ,CAAC,CAAC;YACb,MAAM,MAAM,GAAG,QAAQ,CAAC,qBAAqB,CAAC,GAAG,EAAE,YAAsB,CAAC,CAAC;YAE3E,OAAO,gCACF,MAAM,KACT,MAAM,EAAE,MAAA,MAAM,CAAC,MAAM,mCAAI,IAAI,GACA,CAAC;SACjC;QACD,KAAK,WAAW,CAAC;QACjB,KAAK,QAAQ,CAAC,CAAC;YACb,MAAM,MAAM,GAAG,QAAQ,CAAC,mBAAmB,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAE/D,OAAO,gCACF,MAAM,KACT,MAAM,EAAE,MAAA,MAAM,CAAC,MAAM,mCAAI,IAAI,GACA,CAAC;SACjC;QACD,OAAO,CAAC,CAAC;YACP,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;YAE3D,OAAO,gCACF,MAAM,KACT,MAAM,EAAE,MAAA,MAAM,CAAC,MAAM,mCAAI,IAAI,GACA,CAAC;SACjC;KACF;AACH,CAAC,CAAC"}
|
|
@@ -29,7 +29,7 @@ export declare const useBoolVariation: (key: string, defaultValue: boolean) => b
|
|
|
29
29
|
* @returns
|
|
30
30
|
* The result (as an {@link LDEvaluationDetailTyped<boolean>}).
|
|
31
31
|
*/
|
|
32
|
-
export declare const useBoolVariationDetail: (key: string, defaultValue: boolean) => import("
|
|
32
|
+
export declare const useBoolVariationDetail: (key: string, defaultValue: boolean) => import("./LDEvaluationDetail").LDEvaluationDetailTyped<boolean>;
|
|
33
33
|
/**
|
|
34
34
|
* Determines the numeric variation of a feature flag.
|
|
35
35
|
*
|
|
@@ -61,7 +61,7 @@ export declare const useNumberVariation: (key: string, defaultValue: number) =>
|
|
|
61
61
|
* @returns
|
|
62
62
|
* The result (as an {@link LDEvaluationDetailTyped<number>}).
|
|
63
63
|
*/
|
|
64
|
-
export declare const useNumberVariationDetail: (key: string, defaultValue: number) => import("
|
|
64
|
+
export declare const useNumberVariationDetail: (key: string, defaultValue: number) => import("./LDEvaluationDetail").LDEvaluationDetailTyped<number>;
|
|
65
65
|
/**
|
|
66
66
|
* Determines the string variation of a feature flag.
|
|
67
67
|
*
|
|
@@ -93,7 +93,7 @@ export declare const useStringVariation: (key: string, defaultValue: string) =>
|
|
|
93
93
|
* @returns
|
|
94
94
|
* The result (as an {@link LDEvaluationDetailTyped<string>}).
|
|
95
95
|
*/
|
|
96
|
-
export declare const useStringVariationDetail: (key: string, defaultValue: string) => import("
|
|
96
|
+
export declare const useStringVariationDetail: (key: string, defaultValue: string) => import("./LDEvaluationDetail").LDEvaluationDetailTyped<string>;
|
|
97
97
|
/**
|
|
98
98
|
* Determines the json variation of a feature flag.
|
|
99
99
|
*
|
|
@@ -127,5 +127,5 @@ export declare const useJsonVariation: (key: string, defaultValue: unknown) => u
|
|
|
127
127
|
* If you provided a callback, then nothing. Otherwise, a Promise which will be resolved with
|
|
128
128
|
* the result (as an{@link LDEvaluationDetailTyped<unknown>}).
|
|
129
129
|
*/
|
|
130
|
-
export declare const useJsonVariationDetail: (key: string, defaultValue: unknown) => import("
|
|
130
|
+
export declare const useJsonVariationDetail: (key: string, defaultValue: unknown) => import("./LDEvaluationDetail").LDEvaluationDetailTyped<unknown>;
|
|
131
131
|
//# sourceMappingURL=useVariation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVariation.d.ts","sourceRoot":"","sources":["../../../../src/hooks/variation/useVariation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,QAAS,MAAM,gBAAgB,OAAO,YACpB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,QAAS,MAAM,gBAAgB,OAAO,
|
|
1
|
+
{"version":3,"file":"useVariation.d.ts","sourceRoot":"","sources":["../../../../src/hooks/variation/useVariation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,QAAS,MAAM,gBAAgB,OAAO,YACpB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,QAAS,MAAM,gBAAgB,OAAO,oEACpB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,QAAS,MAAM,gBAAgB,MAAM,WACtB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB,QAAS,MAAM,gBAAgB,MAAM,mEACtB,CAAC;AAErD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,QAAS,MAAM,gBAAgB,MAAM,WACtB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB,QAAS,MAAM,gBAAgB,MAAM,mEACtB,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,QAAS,MAAM,gBAAgB,OAAO,YACpB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,sBAAsB,QAAS,MAAM,gBAAgB,OAAO,oEACpB,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export * from '@launchdarkly/js-client-sdk-common';
|
|
|
11
11
|
export * from './hooks';
|
|
12
12
|
export * from './provider';
|
|
13
13
|
export * from './LDPlugin';
|
|
14
|
+
export type { LDEvaluationDetailTyped, LDEvaluationDetail, } from './hooks/variation/LDEvaluationDetail';
|
|
14
15
|
export { ReactNativeLDClient, RNOptions as LDOptions, RNStorage };
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEnD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAI3B,YAAY,EACV,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,SAAS,IAAI,SAAS,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAGxD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAGxD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAS3B,OAAO,EAAE,mBAAmB,EAAqC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ldApplication, ldDevice } from './autoEnv';
|
|
2
2
|
const sdkName = '@launchdarkly/react-native-client-sdk';
|
|
3
|
-
const sdkVersion = '10.12.
|
|
3
|
+
const sdkVersion = '10.12.6'; // x-release-please-version
|
|
4
4
|
export default class PlatformInfo {
|
|
5
5
|
constructor(_logger, _config) {
|
|
6
6
|
this._logger = _logger;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@launchdarkly/react-native-client-sdk",
|
|
3
|
-
"version": "10.12.
|
|
3
|
+
"version": "10.12.6",
|
|
4
4
|
"description": "React Native LaunchDarkly SDK",
|
|
5
5
|
"homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/sdk/react-native",
|
|
6
6
|
"repository": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react-native": "*"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@launchdarkly/js-client-sdk-common": "1.17.
|
|
44
|
+
"@launchdarkly/js-client-sdk-common": "1.17.2",
|
|
45
45
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
46
46
|
"base64-js": "^1.5.1"
|
|
47
47
|
},
|