@launchdarkly/react-native-client-sdk 0.2.1 → 10.0.1
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 +30 -0
- package/README.md +19 -15
- package/dist/package.json +3 -7
- package/package.json +3 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
### Dependencies
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## [10.0.0](https://github.com/launchdarkly/js-core/compare/react-native-client-sdk-v0.2.1...react-native-client-sdk-v10.0.0) (2024-02-08)
|
|
8
|
+
|
|
9
|
+
### Introducing `@launchdarkly/react-native-client-sdk` as a replacement for `launchdarkly-react-native-client-sdk`.
|
|
10
|
+
|
|
11
|
+
* The SDK has been re-written in Typescript.
|
|
12
|
+
* Supports Expo.
|
|
13
|
+
* The SDK has been moved to a new [repository](https://github.com/launchdarkly/js-core/tree/main/packages/sdk/react-native) in github.
|
|
14
|
+
* The SDK has a new [package name](https://www.npmjs.com/package/@launchdarkly/react-native-client-sdk).
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* React Native SDK major release. ([#369](https://github.com/launchdarkly/js-core/issues/369)) ([1d5ca40](https://github.com/launchdarkly/js-core/commit/1d5ca40888c4db4bb938884ca55732750fb10614))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* Fix Detox e2e tests broken after 0.73 update. ([#366](https://github.com/launchdarkly/js-core/issues/366)) ([6349b98](https://github.com/launchdarkly/js-core/commit/6349b98e70554d8240f0e8d6b1090e4c37bde6eb))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* dependencies
|
|
31
|
+
* @launchdarkly/js-client-sdk-common bumped from 0.2.1 to 1.0.0
|
|
32
|
+
|
|
3
33
|
## [0.2.1](https://github.com/launchdarkly/js-core/compare/react-native-client-sdk-v0.2.0...react-native-client-sdk-v0.2.1) (2024-02-07)
|
|
4
34
|
|
|
5
35
|
|
package/README.md
CHANGED
|
@@ -6,17 +6,15 @@
|
|
|
6
6
|
[![NPM][sdk-react-native-dm-badge]][sdk-react-native-npm-link]
|
|
7
7
|
[![NPM][sdk-react-native-dt-badge]][sdk-react-native-npm-link]
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
The LaunchDarkly React Native SDK is designed primarily for use in mobile environments. It follows the client-side
|
|
10
|
+
LaunchDarkly model for multi-user contexts.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
This SDK is a complete rewrite of the React Native SDK and replaces [launchdarkly-react-native-client-sdk](https://github.com/launchdarkly/react-native-client-sdk). The
|
|
13
|
+
APIs are based on the JS SDK rather than the iOS and Android SDKs. It is not a wrapper of the iOS and Android SDKs.
|
|
14
|
+
It is implemented purely in JS and supports Expo. Please consider updating your application to use this package instead.
|
|
15
15
|
|
|
16
16
|
For more information, see the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/client-side/react-native).
|
|
17
17
|
|
|
18
|
-
This library is an alpha version and should not be considered ready for production use while this message is visible.
|
|
19
|
-
|
|
20
18
|
## Install
|
|
21
19
|
|
|
22
20
|
```shell
|
|
@@ -35,21 +33,27 @@ and re-run pod install for [auto-linking to work](https://github.com/react-nativ
|
|
|
35
33
|
|
|
36
34
|
## Quickstart
|
|
37
35
|
|
|
38
|
-
1. Wrap your application with `LDProvider`
|
|
39
|
-
|
|
36
|
+
1. Wrap your application with `LDProvider` and set the `client` prop to an instance of `ReactNativeLDClient`. Call
|
|
37
|
+
`identify` at a later time to get flags. In the example below, `identify` is called on App mount:
|
|
40
38
|
|
|
41
|
-
```
|
|
39
|
+
```tsx
|
|
42
40
|
// App.tsx
|
|
43
41
|
import { LDProvider, ReactNativeLDClient } from '@launchdarkly/react-native-client-sdk';
|
|
44
42
|
|
|
45
43
|
const featureClient = new ReactNativeLDClient('mobile-key', AutoEnvAttributes.Enabled);
|
|
46
44
|
const userContext = { kind: 'user', key: 'test-user-1' };
|
|
47
45
|
|
|
48
|
-
const App = () =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
const App = () => {
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
featureClient.identify(userContext).catch((e) => console.error(e));
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<LDProvider client={featureClient}>
|
|
53
|
+
<YourComponent />
|
|
54
|
+
</LDProvider>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
53
57
|
|
|
54
58
|
export default App;
|
|
55
59
|
```
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@launchdarkly/react-native-client-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "10.0.1",
|
|
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": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
29
|
"clean": "rimraf dist",
|
|
30
|
-
"build": "npx tsc
|
|
30
|
+
"build": "npx tsc",
|
|
31
31
|
"tsw": "yarn tsc --watch",
|
|
32
32
|
"start": "rimraf dist && yarn tsw",
|
|
33
33
|
"lint": "eslint . --ext .ts,.tsx",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"test": "jest",
|
|
36
36
|
"coverage": "yarn test --coverage",
|
|
37
37
|
"check": "yarn prettier && yarn lint && yarn build && yarn test",
|
|
38
|
-
"link-dev": "./link-dev.sh",
|
|
39
38
|
"android": "yarn && yarn ./example && yarn build && (cd example/ && yarn android-release)",
|
|
40
39
|
"ios": "yarn && yarn ./example && yarn build && (cd example/ && yarn ios-go)"
|
|
41
40
|
},
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"react-native": "*"
|
|
45
44
|
},
|
|
46
45
|
"dependencies": {
|
|
47
|
-
"@launchdarkly/js-client-sdk-common": "0.
|
|
46
|
+
"@launchdarkly/js-client-sdk-common": "1.0.0",
|
|
48
47
|
"@react-native-async-storage/async-storage": "^1.21.0",
|
|
49
48
|
"base64-js": "^1.5.1",
|
|
50
49
|
"event-target-shim": "^6.0.2"
|
|
@@ -76,8 +75,5 @@
|
|
|
76
75
|
"ts-node": "^10.9.2",
|
|
77
76
|
"typedoc": "0.25.0",
|
|
78
77
|
"typescript": "5.1.6"
|
|
79
|
-
},
|
|
80
|
-
"installConfig": {
|
|
81
|
-
"hoistingLimits": "workspaces"
|
|
82
78
|
}
|
|
83
79
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@launchdarkly/react-native-client-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "10.0.1",
|
|
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": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"scripts": {
|
|
29
29
|
"clean": "rimraf dist",
|
|
30
|
-
"build": "npx tsc
|
|
30
|
+
"build": "npx tsc",
|
|
31
31
|
"tsw": "yarn tsc --watch",
|
|
32
32
|
"start": "rimraf dist && yarn tsw",
|
|
33
33
|
"lint": "eslint . --ext .ts,.tsx",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"test": "jest",
|
|
36
36
|
"coverage": "yarn test --coverage",
|
|
37
37
|
"check": "yarn prettier && yarn lint && yarn build && yarn test",
|
|
38
|
-
"link-dev": "./link-dev.sh",
|
|
39
38
|
"android": "yarn && yarn ./example && yarn build && (cd example/ && yarn android-release)",
|
|
40
39
|
"ios": "yarn && yarn ./example && yarn build && (cd example/ && yarn ios-go)"
|
|
41
40
|
},
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"react-native": "*"
|
|
45
44
|
},
|
|
46
45
|
"dependencies": {
|
|
47
|
-
"@launchdarkly/js-client-sdk-common": "0.
|
|
46
|
+
"@launchdarkly/js-client-sdk-common": "1.0.0",
|
|
48
47
|
"@react-native-async-storage/async-storage": "^1.21.0",
|
|
49
48
|
"base64-js": "^1.5.1",
|
|
50
49
|
"event-target-shim": "^6.0.2"
|
|
@@ -76,8 +75,5 @@
|
|
|
76
75
|
"ts-node": "^10.9.2",
|
|
77
76
|
"typedoc": "0.25.0",
|
|
78
77
|
"typescript": "5.1.6"
|
|
79
|
-
},
|
|
80
|
-
"installConfig": {
|
|
81
|
-
"hoistingLimits": "workspaces"
|
|
82
78
|
}
|
|
83
79
|
}
|