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

RFC: Decoupling Flipper from React Native core #641

Merged
merged 1 commit into from Jun 21, 2023

Conversation

huntie
Copy link
Collaborator

@huntie huntie commented Apr 27, 2023

Outlines our intent to no longer include Flipper's native integration in React Native 0.74, and to replace Flipper's JS debugging experience in React Native 0.73 with an equivalent one-click debugging flow leveraging Chrome DevTools.

View the rendered RFC

@huntie huntie changed the title WIP (reserved) WIP: Flipper and JS debugging Apr 27, 2023
@huntie huntie changed the title WIP: Flipper and JS debugging Decoupling Flipper from React Native core May 10, 2023
@huntie huntie changed the title Decoupling Flipper from React Native core RFC: Decoupling Flipper from React Native core May 10, 2023
@huntie huntie marked this pull request as ready for review May 10, 2023 12:25
@acoates-ms
Copy link
Collaborator

Looks good from a react-native-windows perspective.

@thymikee
Copy link
Member

Good from RN CLI point of view. Since we're essentially losing all the non-js debugging tools working out-of-the-box with Flipper, I'd put emphasis on how to integrate Flipper again to one's codebase. I believe this part is missing in the RFC – what would be the actions that a user needs to take to integrate Flipper after e.g. installing this new package.

@usrbowe
Copy link

usrbowe commented May 15, 2023

Does this only include Hermes, or this option can be also enabled for JSC (via some proxy server).
Although the JSC likely does not expose Network requests as compared to Hermes.

Also this got me thinking for extensibility option. Would we be able to install custom chrome extensions? Like leverage existing React DevTools or some of state management library DevTools?
Feels like now we heading direction, where we have two separate DevTools (Chrome DevTools and Flipper). So might cause a bit of friction to switch between those depending on the need.
We could technically have also lighter version of Flipper integration, which would only work for JS realm of RN, then we can initiate the connection via js-flipper.

@zoontek
Copy link
Member

zoontek commented May 16, 2023

Looks great! Do you have an idea on how will it play with RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD?

@Fl0p

This comment was marked as spam.

@ferologics

This comment was marked as spam.

@kneth
Copy link

kneth commented Jun 7, 2023

@huntie @cortinico As a library maintainer, the Realm team has a few comments:

  • We've been very pleased with the transition to running JavaScript on device when debugging and attaching via the Chrome DevTools Protocol, for apps running Hermes.
  • So much so, we've removed support for debugging apps using Realm, via the legacy Chrome debugger (which ran JS code in the browser).
  • We've invested in plugins for Flipper to browse the Realm database in a running app on device.
  • Of course we're a bit sad that we have sunk cost invested in a product which is no longer enabled by default. And we don't expect to be prioritising work on this until we see the future of Flipper materialising. We do however hope to see Flipper getting revived in some shape or form in the future.
  • What's vital to us, is that execution of JavaScript stays on device as that's a prerequisite for a performant debugging experience for an app using Realm.

@huntie
Copy link
Collaborator Author

huntie commented Jun 8, 2023

@kneth @usrbowe

JSC debugging, on-device debugging

  • JSC debugging is something we're reviewing ahead of 0.73, but is independent from this proposal (which focuses on Hermes+Flipper → Hermes+DevTools).
  • The last action around this is removing JSC remote debugging in the Dev Menu (again for 0.73).

What's vital to us, is that execution of JavaScript stays on device

  • Certainly, we're aligned with this — our hope is for all JavaScript execution and debugging to be on device, for all supported JavaScript engines.
    • This will absolutely be the case for Hermes, which is our default and recommended JavaScript engine.

On the future of Flipper and custom plugins

We do however hope to see Flipper getting revived in some shape or form in the future.

  • The Flipper team will continue maintaining Flipper as a tool, but will not explicitly support React Native use cases.
  • Flipper can coexist with our new default debugging setup, however we are seeking an interested partner to maintain this integration for the community beyond 0.73. New debugging investments from the React Native team will be centred on our Chrome DevTools workflow.

Would we be able to install custom chrome extensions? Like leverage existing React DevTools or some of state management library DevTools?

  • This will be a medium term gap that is only supported by Flipper today.
    • As stated, this RFC is not the end state for React Native debugging — we acknowledge that plugins are an important need for users (e.g. previously filled by react-native-debugger). For these use cases, opting into Flipper will remain necessary.
    • We would like a future iteration of our Chrome DevTools Protocol-based experience to support plugins for debugging JavaScript concepts (particularly for state management libraries such as Relay), but cannot commit to this happening within 2023.
    • ⬆️ Hopefully, we can share some more news in the coming months.
  • React DevTools specifically will be included as a one-click workflow for 0.73 (as a standalone window).

@kneth
Copy link

kneth commented Jun 8, 2023

@huntie Thank you for the comments, and addressing our concerns. We are happy to see that you also believe that debugging on device is here to stay (and we don't need to maintain a poor shadow implementation of Realm). Of course it will be ideal to support both JSC and Hermes, but for now it is fine to push users in the direction of Hermes.

@huntie
Copy link
Collaborator Author

huntie commented Jun 21, 2023

Update: Amended timelines

Just pushed an edit following some of this feedback and our internal discussions.

  • We're now aiming for a slower timeline. We will deprecate the Flipper integration in 0.73 (remaining on by default), and will remove it in 0.74. This allows more time for the community to be aware of these changes and adapt to the new tooling.
  • Replacing the Dev Menu actions with non-Flipper replacement flows remains targeted for 0.73.

Note: React Native release dates are not official — just my best guess.

Copy link
Member

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

LGTM

@Pranav-yadav
Copy link

We're now aiming for a slower timeline. We will deprecate the Flipper integration in 0.73 (remaining on by default), and will remove it in 0.74. This allows more time for the community to be aware of these changes and adapt to the new tooling.
Replacing the Dev Menu actions with non-Flipper replacement flows remains targeted for 0.73.

@huntie could you please also change the PR desc to add ⬆️.

Not much but the PR link previews are somewhat misleading ;)

tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 11, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 11, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 16, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 16, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 17, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 17, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 24, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 24, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 24, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 24, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 25, 2023
BREAKING CHANGE: Dropped support for Flipper.

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 27, 2023
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Oct 30, 2023
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Nov 1, 2023
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
@jbrodriguez
Copy link

is there a proposal for a network tab ? being able to look at network requests is in many cases critical for troubleshooting

@huntie
Copy link
Collaborator Author

huntie commented Nov 15, 2023

@jbrodriguez Debugging via the Network tab in Chrome DevTools is definitely in our long term plans! We are likely to begin working on this in 2024 (no promises on when this ships, though!). We will be prefacing this work with some necessary foundational improvements to how we implement CDP in React Native.

We will be sharing more of our debugging plans publicly in future. Until then, here's a couple of links:

tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Nov 28, 2023
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Nov 30, 2023
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Dec 5, 2023
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Dec 6, 2023
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Dec 6, 2023
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Jan 4, 2024
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Jan 8, 2024
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Jan 10, 2024
BREAKING CHANGE: Dropped support for Flipper

For more context, see
react-native-community/discussions-and-proposals#641.
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.

None yet