Summary:
This PR fixes https://github.com/facebook/flipper/issues/798 by adding customizable hotkeys to reload and/or open developer menu in React Native apps.

#### TODO:
- [x] Add correct icon for removing content of the hotkey input (currently using `undo`) - cc passy 😄
## Changelog
Add customizable hotkeys to reload and/or open developer menu in React Native apps.
Pull Request resolved: https://github.com/facebook/flipper/pull/822
Test Plan:
- Run React Native on version `0.62.0-rc.2` (you can use this app: https://github.com/lucasbento/RNWithFlipper);
- Open the Preferences window (`⌘,`);
- Customise the React Native hotkeys to whatever you want;
- Test them out with Flipper's window active and inactive.
> **Note**: this has been tested only in macOS.
Reviewed By: jknoxville
Differential Revision: D20061833
Pulled By: passy
fbshipit-source-id: 601d29e07d7de2683d2c70c7c87f0d841aa3559e
Summary: It's handy to copy images URI to paste it in other tools
Reviewed By: mweststrate
Differential Revision: D20221861
fbshipit-source-id: 09074b434d5c1277bb83daa7846b885717c5ee8d
Summary:
The platform check is a side-effect and shouldn't be in the UI component
itself.
Reviewed By: mweststrate
Differential Revision: D20159799
fbshipit-source-id: c5fa99e0b915a140f10056283671cf5b7368e9c9
Summary:
This diff fixes the broken export which is being made [here](https://fb.workplace.com/groups/graphqlandroid/permalink/3319822971399628/). In the import there is no client and plugin states. The fact that the validation succeeded on submit button click suggests that the app got disconnected between the click on submit button and the initiation of export, thus exporting the store with no plugin data and client.
I have added a validation after exporting the store and before the trace is uploaded.
Also in the support request details page, we assumed that client can't be null, relaxed this assumption as the flipper should still open even the above broken export instead of crashing.
Reviewed By: mweststrate
Differential Revision: D20136295
fbshipit-source-id: f589d01f8ff0ec0b23d53ad5099e11ebbd0930cd
Summary: When running tests locally, some are quite flaky, and there is a lot of error logging noise. This diff doesn't remove all of it, but does reduce it significantly.
Reviewed By: nikoant
Differential Revision: D20034619
fbshipit-source-id: 183f74475b644f803b2f92b1b1301f4d0f6e193a
Summary: The constructor is getting quite a few args now, so to avoid string, string mistakes I'm making sure you pass objects with named params.
Reviewed By: passy, mweststrate
Differential Revision: D20034012
fbshipit-source-id: 4e0d23eeaa9100c6c19d3e36fee62649659ad261
Summary:
Adds a visual indicator of layout nodes when using an archived device.
The "device" window isn't movable for some reason. I've tried the movable and draggable attributes but with no luck. It would obviously be good to fix that but I think its probably shippable as is, and I don't have any more ideas about how to do it.
Reviewed By: passy
Differential Revision: D19885719
fbshipit-source-id: 186ba38c85afee18ce111e30187bdccd9b919025
Summary:
Fix https://github.com/facebook/flipper/issues/808
Kills any orphaned Instruments processes belonging to the user.
In some cases, we've seen interactions between Instruments and the iOS
simulator that cause hung instruments and DTServiceHub processes. If
enough instances pile up, the host machine eventually becomes
unresponsive. Until the underlying issue is resolved, manually kill any
orphaned instances (where the parent process has died and PPID is 1)
before launching another instruments run.
Taking the same approach as done by flutter here.
Reviewed By: passy
Differential Revision: D20030005
Pulled By: jknoxville
fbshipit-source-id: aa80be78c80f7797e88bf29b15f90d4aad0c66e4
Summary: When determing whether to queue a message, the logic checked if the plugin is enabled on the currently selected app, rather than checking if it is enabled for the receiving app. This diff fixes that.
Reviewed By: passy
Differential Revision: D20000055
fbshipit-source-id: 665f0a650dcee8f7f46aa56f399a4f7d0d0aa1e0
Summary:
Device management was inconsistent so far, this diff addresses the following issues
* pending a subtle timing issue, a physical android device might also show up as emulator, so effectively the device would be shown twice, but with the same content
* Metro devices now behave more like the android devices: offline devices are replaced if it comes online again
* Generalized this logic; the reducer now forces serials to be unique
* Fixed issue where a Metro device that disconnected due to a connection failure would be archived twice
* Use the metro connection url as serial, to have a slightly more future proof serial
Reviewed By: jknoxville
Differential Revision: D19996385
fbshipit-source-id: 0f6e3ddc6444542553d25cc3b592591652d688f2
Summary: Fixed a bunch of key errors in the network plugin, when a plugin is selected
Reviewed By: passy
Differential Revision: D19980275
fbshipit-source-id: 0ae61ed3b655c03d11c848d3502f455a409dcdcf
Summary:
This issue fixes a bunch of performance issues:
* The introduction of a context menu around every _row_ in D18808544 breaks the internal contract between lists and rows that react-window has, causing empty element to appear during scrolling, and some optimizations not working. Fixed by wrapping the context menu at the right level
* Every time a new row is created for the listview, it gets fresh event handlers and column configurations. THis has been fixed by precomputing the column configuration and avoiding the need to close over the row data in the event handlers
* Added some stricter immutable typings to make sure we don't break the immutable contract somewhere
* Fix the introduction of on the fly styling generation, which isn't needed
Reviewed By: passy
Differential Revision: D19853595
fbshipit-source-id: dc82b6586889f4e8c7a437cfdc27a50dc33ba2a2
Summary:
If the browser makes a network request, and it fails, this is _always_ logged to the console, despite any error handling being in place. (see https://stackoverflow.com/questions/43012334/silence-neterr-connection-refused)
This diffs doesn't use the browser network stack, but the node network stack instead, which doesn't suffer from the same fate.
Reviewed By: passy
Differential Revision: D19995684
fbshipit-source-id: 4ffc12b820620c5310c140c1a3af63e5d2053a50
Summary:
Hovering a tooltip container would cause the full application to re-render. (Even if there isn't an actual tooltip!).
Fixed it by killing legacy context code, and using proper fragments rather than returning arrays.
Reviewed By: priteshrnandgaonkar
Differential Revision: D19969775
fbshipit-source-id: 59f6470d03b6c476305681fde7bbe3f0dca063aa
Summary:
This diff exposes the Hermes debugger as a device plugin, for similar reasons as we did with React Devtools.
Also replaced an ugly hack with another just as ugly hack (rendering outside the React tree to preserve the state of the chrome devtools when switching to another plugin and coming back), that behaves at least correctly when resizing etc instead of doing absolute styling
Reviewed By: passy
Differential Revision: D19905082
fbshipit-source-id: 1e80c55fc9c5b1f8a9292f0ba1ef66b0b007b7fc
Summary:
This diff turns the DevTools plugin from a normal plugin in a device plugin. The reason for that can be seen at the end of the test plan in the first stack of this diff: Regardless on which client you open the devtools, you are always looking at the react tree of the app that happens to listen at the appropriate port, unrelated to the actively selected app. This diff moves the plugin from being a client plugin to a device plugin, a Metro device plugin to be precisely, as of the latter there is only one and they should typically correspond (which is why we can trigger reload as done in the previous diff)
Currently we have a Flipper plugin inside the iOS / Android apps with one purpose: to select different ports to listen to on different devices. But this functionality was never implemented, nor seems there to be much demand for. So these plugin don't offer any actual value. The widely used standalone version of the react devtools (https://www.npmjs.com/package/react-devtools) doesn't offer port customization either, so this limitation seems to be acceptable.
To make sure that this change is backward compatible, we make sure to show the metro device if we find metro, regardless whether it is new enough to support log forwarding and reload commands (previously we only showed the device if it has the /events endpoint).
The only case I can think of we are killing with this approach is where people are debugging a RN app, but with having metro running. I doubt that is an actual case, but probably rickhanlonii knows more about that.
Furthermore this diff makes sure that the devTools can connect to physical android devices. Also, making it to the end of this explanation means that you have done most of the reviewing for this diff. The actual code diff is shorter.
Reviewed By: passy
Differential Revision: D19878605
fbshipit-source-id: 3f33e59d4f6e4cce39102420f38afee10018999f
Summary:
To connect to the React Devtools, the app has to be reload (or the dev menu opened).
This diff does force a reload if the React Devtools don't connect timely
Reviewed By: passy
Differential Revision: D19878172
fbshipit-source-id: 0b3e22f70c9d24dae1fdbf0cc351d23367654ae1
Summary: In many cases the React DevTools fail to show up for RN. usually that is because the app didn't enter devMode yet. This diff adds the necessary logic to query the state of the DevTools and communicate back the current connection status
Reviewed By: passy
Differential Revision: D19878127
fbshipit-source-id: f5c3f5a92b23c87c87d778a468122210325eed17
Summary: This diff selects both required and default plugins in the plugin selection menu
Reviewed By: mweststrate
Differential Revision: D19905737
fbshipit-source-id: 86fb308f8f189350cc035d14174b34fac14a2cd1
Summary: Gets flipper to open up a websocket server for web browser connections.
Reviewed By: passy, priteshrnandgaonkar
Differential Revision: D19501123
fbshipit-source-id: e506f35d7ddce622128932494e8bb10802d3747b
Summary: A first simple version of pre-bundled plugin installation. Currently both pre-bundled and source-only plugins are supported. Pre-bundled plugins should have folder "dist" inside and package.json's "main" field should point to the entry point script there.
Reviewed By: passy
Differential Revision: D19834020
fbshipit-source-id: 7e0b495fb9666acbb22fc32ca2382339cd9dc72f
Summary: No functional changes in this diff. This is just plugin manager refactoring before implementing new functionality for installing pre-bundled packages.
Reviewed By: passy
Differential Revision: D19832078
fbshipit-source-id: 56b7ff1c68b6beb4abb2941da607651268e5f71a
Summary: Tiny detail, but this shows a progress bar in the reload button, just like the console.logs of metro do normally
Reviewed By: jknoxville
Differential Revision: D19813243
fbshipit-source-id: 70b360d55776fab08c81664c6cabf998402bbba6
Summary: This diff logs the Metro messages as well so that the logs also show it Metro dies or something
Reviewed By: jknoxville
Differential Revision: D19791112
fbshipit-source-id: 477ccdd291df90e49b016d4aeae121d4d81a3835
Summary:
This diff removes the 'device plugins' section, and shows plugin at top level in certain scenarios:
- there are no other clients
- there is only one device plugin
- the device has been imported
This removes visual clutter
Reviewed By: nikoant
Differential Revision: D19789511
fbshipit-source-id: 6a5fce120ac811428662828ee43f7ab7f3331362
Summary:
The Metro control buttons are now in the titlebar. This has a few benefits:
- the buttons are accessible if you are inspecting other metro plugins
- the buttons are even usuable if you selected an app on the actual device. This should help with reducing the cognitive dissonance of having apps both as 'android' app and metro device
- killed the Metro plugin again :)
Reviewed By: nikoant
Differential Revision: D19789455
fbshipit-source-id: 476fd0af1d3fc7b51a33f1af6d3fc3578aeeefae
Summary: Fixed bug where location bar remained active but empty on apps / devices that don't have nav
Reviewed By: nikoant
Differential Revision: D19788337
fbshipit-source-id: c5f7299945783672164ed03d487a023ddaadc082
Summary: Show metro logs using the standard logs plugin
Reviewed By: passy
Differential Revision: D19697439
fbshipit-source-id: 032a9a6aa2d987945d2058e0ea494d74e5aa310e
Summary: Introduced Metro device and the possibility to directly connect to running Metro instances
Reviewed By: jknoxville
Differential Revision: D19445623
fbshipit-source-id: 31978d966a56007c48f795076d6651e23de0e38d
Summary:
In order to link to this plugin multiple times, we want to be able to clear the existing search term on entry.
This change adds a check to the `componentDidMount` section of `Searchable` to see if we want to update the existing search term from the saved state, or use the one inherited from props.
We call it from the Network tab depending on if an explicit default search term has been set, so normal navigation to and from the plugin still preserves the default behavior -- only when we enter from a `selectPlugin` call does this overwrite the existing term.
Reviewed By: mweststrate
Differential Revision: D19794860
fbshipit-source-id: 4a2b1221acc0732ffc321a16a5eee8348da019f5
Summary: This diff always allows user to select the group irrespective of the validation error. We will show the validation error at the bottom before letting them submit.
Reviewed By: passy
Differential Revision: D19816805
fbshipit-source-id: ff576a2101a5ed548c56a2f08da8d27457ebf332
Summary: In order to select IDs in a different manner, I am introducing functionality to the Network plugin to allow it to accept more than just IDs that it has assigned, and add the ability to select this plugin with a default search term. I hope to use this to allow for selecting rows by request name.
Reviewed By: mweststrate
Differential Revision: D19702494
fbshipit-source-id: 58ea397fa30eb7d80e9640a4c92905de22bb27d4
Summary: Adding a utility for capturing screenshots to the configured location without having to worry about where to store it or use buffers etc.
Reviewed By: mweststrate
Differential Revision: D19765926
fbshipit-source-id: d6b51c4ffafab7450e97a60468926d84a25a8c0f
Summary:
Plugin to plugin deeplinking was broken because the state reducer was ignoring the parameter.
This fixes it.
Reviewed By: jonathoma
Differential Revision: D19791230
fbshipit-source-id: 158b3a6278f5e634093c4284018458883e9aa5ca
Summary: We have already rolled out `support_requests_v2` to 100% of FB employees. Thus removing the unneeded checks for the GK.
Reviewed By: jknoxville
Differential Revision: D19770930
fbshipit-source-id: 06fcf7b6b7c1305ab1b5b3c8df344e2877251e65
Summary: This diff removes the older support form as we no longer use it.
Reviewed By: jknoxville
Differential Revision: D19769541
fbshipit-source-id: ca2088e721f2895f2c8a1205889b0670477cc2d2
Summary: This is experimental feature to prove that vsix format can be used to publish plugins. Turns out there are almost no differences of vsix in comparison with npm packages.
Reviewed By: jknoxville
Differential Revision: D19770476
fbshipit-source-id: b3c62e7f2a4e8000113b9f1651e8657eb3e0d6fa
Summary:
This diff fixes the broken video recording feature for iOS.
There were two bugs, the `stopScreenCapture` was misspelled and one with the codec, ReactPlayer was not able to render with the default codec of hevc
Reviewed By: jknoxville
Differential Revision: D19746904
fbshipit-source-id: f951b016be5f5aec5d4e6bcea4c9c246a62b37a3
Summary: To test plugin installation I need to restart Flipper often, however restart in dev mode is not "true" restart - instead it just reloads the window and doesn't load freshly installed plugins. To make my life easier I have implemented more realistic way for restart in dev mode.
Reviewed By: jknoxville
Differential Revision: D19770263
fbshipit-source-id: 8755663746dc265e0826ed79b9782e073132537f