Skip to content

Commit 2194d45

Browse files
Upgrade to commons 3.0.2 and UFC API (FF-2098) (#46)
* Upgrade to commons 3.0.2 and UFC API (FF-2098) * re-use storage key
1 parent 4c2d81e commit 2194d45

File tree

13 files changed

+362
-427
lines changed

13 files changed

+362
-427
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
- name: Setup Node.js
88
uses: actions/setup-node@v3
99
with:
10-
node-version-file: .nvmrc
10+
node-version: '18.x' # Specify the Node.js version directly here
1111

1212
- name: Cache dependencies
1313
id: yarn-cache

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v3
1616

17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '18'
21+
1722
- name: Setup
1823
uses: ./.github/actions/setup
1924

@@ -29,6 +34,11 @@ jobs:
2934
- name: Checkout
3035
uses: actions/checkout@v3
3136

37+
- name: Setup Node.js
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: '18'
41+
3242
- name: Setup
3343
uses: ./.github/actions/setup
3444

@@ -44,6 +54,11 @@ jobs:
4454
- name: Checkout
4555
uses: actions/checkout@v3
4656

57+
- name: Setup Node.js
58+
uses: actions/setup-node@v3
59+
with:
60+
node-version: '18'
61+
4762
- name: Setup
4863
uses: ./.github/actions/setup
4964

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v3
1111
- uses: actions/setup-node@v3
1212
with:
13-
node-version: 16
13+
node-version: '18.x'
1414
- run: yarn install
1515
- run: yarn test
1616
- uses: JS-DevTools/npm-publish@v1

example/src/EppoRandomizationProvider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export default function EppoRandomizationProvider({
1919
const [isInitialized, setIsInitialized] = useState(false);
2020
useEffect(() => {
2121
init({
22-
baseUrl: 'https://eppo.cloud/api',
2322
apiKey: '<API_KEY>',
2423
assignmentLogger: {
2524
logAssignment(assignment) {

example/src/TestComponent.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ import { getInstance } from '@eppo/react-native-sdk';
66
export default function TestComponent(): JSX.Element {
77
const assignedVariation = React.useMemo(() => {
88
const eppoClient = getInstance();
9-
return eppoClient.getAssignment('<USER_ID', 'test-feature-flag');
9+
return eppoClient.getStringAssignment(
10+
'test-feature-flag',
11+
'<USER_ID>',
12+
{},
13+
'default-value'
14+
);
1015
}, []);
1116

12-
var text = 'In control';
17+
var text = `In Variation: ${assignedVariation}`;
1318
if (assignedVariation === 'show-logo') {
1419
text = 'Assigned to logo group';
1520
}

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eppo/react-native-sdk",
3-
"version": "1.1.0",
3+
"version": "3.0.0",
44
"description": "Eppo React Native SDK",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",
@@ -41,7 +41,6 @@
4141
"android"
4242
],
4343
"repository": "https://github.com/Eppo-exp/reactive-native-sdk",
44-
"author": "Nick Pleis <[email protected]> (https://github.com/Nickp-eppo)",
4544
"license": "MIT",
4645
"bugs": {
4746
"url": "https://github.com/Eppo-exp/reactive-native-sdk/issues"
@@ -51,9 +50,8 @@
5150
"registry": "https://registry.npmjs.org/"
5251
},
5352
"dependencies": {
54-
"@eppo/js-client-sdk-common": "2.2.0",
53+
"@eppo/js-client-sdk-common": "3.0.2",
5554
"@react-native-async-storage/async-storage": "^1.18.0",
56-
"axios": "^1.6.0",
5755
"md5": "^2.3.0"
5856
},
5957
"devDependencies": {
@@ -85,7 +83,7 @@
8583
"react-native": "*"
8684
},
8785
"engines": {
88-
"node": ">= 16.0.0"
86+
"node": ">= 18.0.0"
8987
},
9088
"jest": {
9189
"preset": "react-native",

0 commit comments

Comments
 (0)