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

[Wallet] Enable Flipper on iOS along with Redux Debugger and Reactotron #6488

Merged
merged 18 commits into from
Jan 27, 2021

Conversation

jeanregisser
Copy link
Contributor

@jeanregisser jeanregisser commented Jan 14, 2021

Description

This PR enables Flipper on iOS along with Redux Debugger and Reactotron plugins.

This allows viewing / debugging the following:

  • React DevTools (Components and Profiling)
  • Network connections
  • View hierarchy
  • Redux State / Actions
  • AsyncStorage
  • App preferences
  • Hermes
  • and more ;)

It also opens the door for creating/adding our own Flipper plugins (for instance for viewing transactions 😉).

Setup instructions were added to the mobile README.

Details

When we upgraded to React Native 0.63.x and Reanimated 2, the introduction of TurboModules broke the ability to use remote debugging with the Chrome DevTools, see this discussion with more details.

As an alternative we can use Flipper to provide similar debugging functionalities.

Flipper was already working on Android, but on iOS there was a conflict between the OpenSSL lib shipped as part of react-native-fast-crypto and the one included by Flipper. To workaround this problem, we now use a "headers" only version of OpenSSL that makes Flipper happy while building.

The 2nd issue was that Flipper in React Native doesn't work with use_frameworks! enabled in the Podfile, which we need because we have Swift dependencies, which don't work without it.
I bent CocoaPods a little more so that everything Flipper related is built as static frameworks.

I've integrated both Redux Debugger and Reactotron as they provide different lenses to debug the app.
There's also a redux-saga plugin for Reactotron but it triggered some odd unhandled promise rejections, so I didn't include it.

While working on this I noticed the state in the exchange reducer is very big and made the Redux Debugger plugin quite unusable within Flipper. There's an issue open which should address this (#6284). In the meantime I've filtered out that part of the state in Redux Debugger. Reactotron can still be used to see it and is not affected.

Overall this gives us more tools to see what is happening within the app.

Tested

  • Flipper works on both iOS and Android along with their Redux Debugger and Reactotron plugins.
  • iOS release builds don't include Flipper (Flipper modules are built for release builds, but NOT linked - this makes the build take more time, but unfortunately no simple way around this with CocoaPods for now, or we'd need to manage multiple Podfile.lock files, see Flipper should not get built on iOS release builds facebook/flipper#1275).

Screenshot 2021-01-15 at 11 38 52

Screenshot 2021-01-15 at 11 39 19

Screenshot 2021-01-15 at 12 30 47

Screenshot 2021-01-15 at 11 40 26

Screenshot 2021-01-15 at 11 40 48

Screenshot 2021-01-15 at 11 47 17

Screenshot 2021-01-15 at 11 49 12

Screenshot 2021-01-15 at 11 49 32

Related issues

Backwards compatibility

Yes

@jeanregisser jeanregisser marked this pull request as ready for review January 15, 2021 11:51
@jeanregisser jeanregisser requested a review from a team January 15, 2021 11:52
Copy link
Contributor

@tarikbellamine tarikbellamine left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for tackling this!

Would you (or someone else who's familiar with Flipper) consider doing a short demo for the team sometime soon? Setting up and getting the most out of a new tool often takes a bit of time so it would be great to jump start us on this process :)

@jeanregisser
Copy link
Contributor Author

Would you (or someone else who's familiar with Flipper) consider doing a short demo for the team sometime soon? Setting up and getting the most out of a new tool often takes a bit of time so it would be great to jump start us on this process :)

Yes definitely! I'll schedule this soon!

@jeanregisser jeanregisser added the automerge Have PR merge automatically when checks pass label Jan 27, 2021
@mergify mergify bot merged commit c549ae5 into master Jan 27, 2021
@mergify mergify bot deleted the jeanregisser/enable-flipper-ios branch January 27, 2021 11:09
@Lss-Ankit
Copy link

Hi @jeanregisser Could you please let us know what need to test us here from front end side? Also please let us know if anything which we would test from backend side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants