Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Expo example app and align runtime with react-native 0.76.5 #4

Merged
merged 13 commits into from
Jan 10, 2025

Conversation

jeanregisser
Copy link

@jeanregisser jeanregisser commented Jan 7, 2025

Description

This PR introduces an example app using Expo, generated with the following command:

npx create-expo-app@latest --template blank-typescript apps/example

While setting up this app, compatibility issues arose between Expo's use of [email protected] and our runtime's use of [email protected]. These were resolved by:

  1. Moving the runtime's native dependencies to peerDependencies:

    • This follows best practices for libraries that have native deps, enabling auto-linking in the final app.
    • Reference: react-native-community/cli#870 (still unresolved but relevant).
  2. Adding root resolutions:

    • Ensures only one version of react-native and related dependencies is used.

Additionally, changes were made to the runtime tests due to differences in how the <Modal /> component renders in tests with the new react-native version. Specifically, <Modal /> now renders as null when not visible.

Note: the example app doesn't yet consume the runtime, see #6 for that.

Part of RET-1279

*.pem

# local env files
.env*.local

Choose a reason for hiding this comment

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

I wonder if it could be .env* to ignore any env file, not only the local ones.

is there any scenario when someone wants to commit .env?

Copy link
Author

@jeanregisser jeanregisser Jan 10, 2025

Choose a reason for hiding this comment

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

I don't know yet, but we've committed.env.mainnet, etc. at the root.
I guess I'll ignore all env files for now as we're going to modify secrets handling and I'd prefer to avoid unintentionally leaking them.

Comment on lines 3 to 4
"name": "Example",
"slug": "example",

Choose a reason for hiding this comment

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

shall we add "MobileStack" somewhere here? to emphasize what this example is for

Copy link
Author

Choose a reason for hiding this comment

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

yes why not, we can just use MobileStack.

<Provider store={store}>
<FiatConnectReviewScreen {...mockProps} />
</Provider>
)

expect((await findByTestId('expiredQuoteDialog')).props.visible).toEqual(false)
expect(queryByTestId('expiredQuoteDialog')).toBeFalsy()
Copy link

@bakoushin bakoushin Jan 10, 2025

Choose a reason for hiding this comment

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

I'm a bit confused by the await we had previously.
like it waits for something which causes the expired quote dialog to render (or not to).
if this assumption is true, without waiting it may be always falsy.
perhaps we can move this case below the timer advance to be sure we waited?

Copy link
Author

Choose a reason for hiding this comment

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

I can try, but the difference is those dialogs are now not rendered at all until visible.

Copy link
Author

Choose a reason for hiding this comment

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

ok moving it after the timer advance still works.

Copy link

@bakoushin bakoushin left a comment

Choose a reason for hiding this comment

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

🚀

@jeanregisser jeanregisser enabled auto-merge (squash) January 10, 2025 16:10
@jeanregisser jeanregisser merged commit 559037f into main Jan 10, 2025
8 checks passed
@jeanregisser jeanregisser deleted the jeanregisser/example-app branch January 10, 2025 16:13
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