Skip to content

Upgrade to commons 3.0.2 and UFC API (FF-2098)#46

Merged
leoromanovsky merged 2 commits into
mainfrom
lr/ff-2098/ufc
May 16, 2024
Merged

Upgrade to commons 3.0.2 and UFC API (FF-2098)#46
leoromanovsky merged 2 commits into
mainfrom
lr/ff-2098/ufc

Conversation

@leoromanovsky

@leoromanovsky leoromanovsky commented May 15, 2024

Copy link
Copy Markdown
Member

motivation

upgrade react-native to the new UFC format and take advantage of upcoming feature releases.

description

  • bump commons to 3.0.2 - this includes the UFC API format changes + drops axios. However it does not include changes to the configuration store. We will wait until those are accepted into js-browser repo to make those changes here.
  • init function matches js-client except not polling configuration - is this needed?
  • removes redundant tests - anything tested in js-commons doesn't need to be repeated here
  • removes api test server - mocks all remote requests.

testing

running local ios and android simulators

Screenshot 2024-05-15 at 7 51 10 PM

@leoromanovsky leoromanovsky force-pushed the lr/ff-2098/ufc branch 2 times, most recently from c1f2b83 to 89e2e91 Compare May 15, 2024 23:15
@leoromanovsky leoromanovsky marked this pull request as ready for review May 15, 2024 23:47

@aarsilv aarsilv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff!

uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
node-version: '18.x' # Specify the Node.js version directly here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread package.json
{
"name": "@eppo/react-native-sdk",
"version": "1.1.0",
"version": "3.0.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📈

Comment thread package.json
},
"dependencies": {
"@eppo/js-client-sdk-common": "2.2.0",
"@eppo/js-client-sdk-common": "3.0.2",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

});

it('returns null when experiment config is absent', () => {
it('returns default value when experiment config is absent', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread src/async-storage.spec.ts
import { EppoAsyncStorage } from './async-storage';
import AsyncStorage from '@react-native-async-storage/async-storage';

describe('EppoAsyncStorage', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Comment thread src/async-storage.spec.ts Outdated
import AsyncStorage from '@react-native-async-storage/async-storage';

describe('EppoAsyncStorage', () => {
const storageKey = '@eppo/sdk-cache-ufc';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Android, we encountered users encountering issues changing up API keys on devices. I wonder if we should also make react native storage isolated per API key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should this just be STORAGE_KEY?

Comment thread src/async-storage.ts

export class EppoAsyncStorage implements IConfigurationStore {
private cache: { [key: string]: any } = {};
private _isInitialized = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other repo--how come we are using underscore prefix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with the public method.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 ah that makes sense! Carry on

@leoromanovsky leoromanovsky merged commit 2194d45 into main May 16, 2024
@leoromanovsky leoromanovsky deleted the lr/ff-2098/ufc branch May 16, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants