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

Use react-native-cli with the Android debugging fix #840

Merged
merged 1 commit into from
Apr 8, 2019

Conversation

hypest
Copy link
Contributor

@hypest hypest commented Apr 8, 2019

The recent upgrade to React Native 0.59 had a regression that made us lose the ability to properly debug the JS source code under Android.

This PR introduces a workaround by using the fixes version of the react-native-cli package, before it becomes available directly via a future React Native release.

Relevant tickets: facebook/react-native#23955, facebook/metro#380

To test:

  1. Add a debugger; statement somewhere in the JS code. Good examples can be the block-holder.js module and the render() function in gutenberg/.../components/rich-text/index.native.js.
  2. Run the demo app on Android
  3. Enable the Remote JS debugging mode via the debug menu, and notice Chrome opening up to debug
  4. Notice the debugger stopping at the debugger statements and properly showing the source file

@hypest hypest requested a review from mkevins April 8, 2019 11:54
@hypest hypest added this to the v1.3 milestone Apr 8, 2019
@mkevins
Copy link
Contributor

mkevins commented Apr 8, 2019

I tested this on Android emulator w/ Chromium 73.0. It works 🎉!

I was able to set debug lines directly in the Chromium debugger, as well as in code with the debugger statement. Also, the variable scopes and closures are correct.

Copy link
Contributor

@mkevins mkevins left a comment

Choose a reason for hiding this comment

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

This is a great workaround until the fix is merged upstream.

Thanks @hypest !

@hypest hypest merged commit ea314d3 into develop Apr 8, 2019
@hypest hypest deleted the fix/android-source-debugging branch April 8, 2019 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants