Summary: per title, for reasons see next diff :)
Reviewed By: passy
Differential Revision: D29327501
fbshipit-source-id: 548d943e90769af478232d3031d916fb399a067a
Summary:
Changelog: [Network] The network plugin will now detect utf-8 strings if no content header is present
Fixes https://github.com/facebook/flipper/issues/2406
Reviewed By: nikoant
Differential Revision: D29388968
fbshipit-source-id: 7017828a5f3f28dcf220eeda1d30888f1fc5f07a
Summary:
After loading a layout plugin snapshot, I noticed the plugin feels really sluggish. I noticed that getDimensions, which recursively walks the full tree, is triggered on every rendering, although the state it introduces is only required when opening a screenshot visualizer. So Moved the function invocation to there.
Also did some first steps on supporting iOS; the visualizer will no show a preview of iOS as well. I'll leave implementing the highlights to a volunteer :)
Reviewed By: passy
Differential Revision: D29262697
fbshipit-source-id: b13b19b013eeeb98abb66fb648a193c69688a7e3
Summary: Changed some imports, and again the Flipper initialisation broke. Refactored the store initialization to create nowhere module local constants, which prevents generally against module loading issues, making it possible to load all code first, and then intialise things through the `init()` method, which should make Flipper initialisation a lot more robust to changes
Reviewed By: passy
Differential Revision: D29233603
fbshipit-source-id: 322cb87cba23228b1d7a88634b7b3995e27cc277
Summary:
With new abstraction, `DataList` matches what the plugin trying to render.
Should fix:
https://fb.workplace.com/groups/flippersupport/permalink/1145431339270856/
Changelog: [MobileConfig] Fix issues with scrolling not working and several other improvements
Reviewed By: cekkaewnumchai
Differential Revision: D28314408
fbshipit-source-id: 4d8fbe3d8e868f737750203cd568d94bae8b4108
Summary: Edit button was not visible which blocked editing of databases
Reviewed By: passy
Differential Revision: D29139000
fbshipit-source-id: d0e8d22ca1a1a39697ec70e94e3eb7422e32de48
Summary:
Got this in my dep bump: https://www.internalfb.com/intern/sandcastle/job/13510799320314417/
Babel is having some trouble with a certain syntax in newer d3-array elements: https://github.com/babel/babel/issues/11038
Until that's fixed the recommended work-around is hard-coding the old version which is apparently compatible.
Reviewed By: priteshrnandgaonkar
Differential Revision: D29107071
fbshipit-source-id: 5a4ba8e698969bc033a76da78ce9116d1cfbbeb4
Summary:
- recharts includes types now as part of the main distro
- the react resolution doesn't make a difference to the `yarn.lock` anymore
Reviewed By: mweststrate
Differential Revision: D29105837
fbshipit-source-id: 5699b7b9c4f00da00781245fed8b2a94d603bb63
Summary: We somehow had both `__test__` and `__tests__`. Moving over to the more common place.
Reviewed By: mweststrate
Differential Revision: D29062420
fbshipit-source-id: 1589fcda18609dcc61b1ca4ef80cbf48c9e8d170
Summary: Changelog: Increase width of database name and table name dropdowns
Reviewed By: fabiomassimo
Differential Revision: D29062064
fbshipit-source-id: 46278ae6587d2feadea20fd1c5b4e04400034362
Summary:
Re-introduced context menu to DataTable, due to popular demand.
Originally it wasn't there to better align with ant design principles, but in an app like Flipper it makes just too much sense to have it
See e.g. https://fb.workplace.com/groups/flippersupport/permalink/1138285579985432/
changelog: Restored context menu in data tables
Reviewed By: passy
Differential Revision: D28996137
fbshipit-source-id: 16ef4c90997c9313efa62da7576fd453a7853761
Summary:
The current desktop plugin tutorial was outdated as it has several steps that are now automated, and still referred to old APIs. This has been updated now.
Additionally left the intermediate code of the tutorial in the plugin, but splitting `index.tsx` into `index_table.tsx` and `index_custom.tsx` (which will be updated in the next diff)
Clarified the tutorial page labels a little bit to show that 3 pages are covering the Desktop plugin development process.
Changelog: Updated the Desktop plugin tutorial
Reviewed By: jknoxville
Differential Revision: D28990029
fbshipit-source-id: a06a7a774ceca3daf10f8e8fbd4e03191dbfd1cc
Summary: Changelog: [Logs] show debug level logs by default. Now only verbose level is hidden by default
Reviewed By: fabiomassimo
Differential Revision: D28963445
fbshipit-source-id: e960654b02cf3b4248e0c8d4a9745208f160bc8d
Summary: some type simplifications, that makes it easier to reuse data sources and helps type inference
Reviewed By: passy
Differential Revision: D28413380
fbshipit-source-id: 261a8b981bf18a00edc3075926bd668322e1c37d
Summary: Now we support splitting metadata to public and fb-internal (see the previous diff in the stack), and this diff actually cleans up all public plugin metadata from fb-specific things.
Reviewed By: passy
Differential Revision: D28568413
fbshipit-source-id: eae699eabaae489c4bcfbfcc407c3bef42bfd338
Summary:
Network Plugin - When creating a mock request from a selected request, the request data is not in the proper format. It is decoded instead of just being copied from the call (which has already been decoded properly). This PR fixes that problem.
Below is a screenshot showing the problem (which occurs for all text response data):

## Changelog
Network Plugin - Fix problem with decoding request data for mocks copied from selection
Pull Request resolved: https://github.com/facebook/flipper/pull/2340
Test Plan:
Using the sample Android app, issue a network request
In Flipper, create a mock for the network request by selecting it and using the "Copy Selected Calls" function in the mock
Verify that the request data is readable:

Note:
Testing was done using the sample app which uses responses with JSON data. I was not able to provide testing for other types of calls, specifically calls that would return binary data.
Reviewed By: passy
Differential Revision: D28533224
Pulled By: mweststrate
fbshipit-source-id: ce11d23ade60843c110286f7a5bbeba91febbcf0
Summary:
Network requests and responses using JSON API content type of pattern `application/vnd.api+json` (see https://jsonapi.org/#mime-types) are currently treated as binary data. They should be treated as textual content.
## Changelog
Add regular expression to detect JSON content types.
Pull Request resolved: https://github.com/facebook/flipper/pull/2337
Test Plan: Using an API that return `Content-Type` of pattern `application/vnd.api+json`, verify that the response data in sidebar appears as text rather than `(binary data)`.
Reviewed By: passy
Differential Revision: D28513547
Pulled By: mweststrate
fbshipit-source-id: 3335b7eeb63c2429c2245113c8c83bd7e08a9420
Summary:
Network requests that return a "Content-Type" of 'application/xhtml+xml' are currently being treated as binary data when they should be treated as text.
## Changelog
Network Plugin - treat "Content-Type" of 'application/xhtml+xml' as text
Pull Request resolved: https://github.com/facebook/flipper/pull/2336
Test Plan: Using an API that return "Content-Type" of 'application/xhtml+xml' , verified that the response data in sidebar appears as text rather than '(binary data)'
Reviewed By: nikoant
Differential Revision: D28478695
Pulled By: mweststrate
fbshipit-source-id: ed60c8301dbd0cf65924a80d9e6a5800a59c6bb8
Summary: I've noticed that two plugins had wrong versions set and because of that they always published with the same version and not auto-updated. This diff fixes that and also adds safeguard which shows error on "yarn install" if some plugin packages has version set to something different from "0.0.0".
Reviewed By: passy
Differential Revision: D28443509
fbshipit-source-id: d982dbe05fa876717799d9464f900f2173b32f70
Summary:
This diff fixes several existing issues in the React DevTools:
Every time the user opened the plugin we re-instantiated the devtools, which has a few problems: 1) it looses all state (e.g. selection), and 2) this causes the tools to start a websocket listener on a new port, that was never cleaned up, or ever used, since React Native always connects to port 8097 anyway.
To preserve the state the idea of the original implementation was to move the devTools out of the current view, without disposing it. This actually didn't work in practice due to a faulty implementation, causing a full reinialization of the tools every time. Addressed this by reusing the mechanism that is used by the Hermes debugger tools as well.
By properly managing the port (e.g. closing it), there is no need to start (in vain) the devTools on a random port.
Port reversal for physical devices needs to happen only once, in principle upon connecting the device, so moved it to the device logic, which also avoids the need to hack into the global Flipper store.
Avoiding recreating the devTools makes plugin switching near instant, instead of needing to wait for a few seconds until the devTools connect.
When multiple apps are connected the behavior is now consistent: the application that refreshed last will be the one visible in the devTools. (That is still pretty suboptimal, but at least predicable and not a use case that is requested / supported in the DevTools themselves atm)
There is still ugly DOM business going on, did put that in a stand alone component for now.
Didn't extract the shared logic with Hermes plugin yet, but did verify both are still working correctly.
Changelog: [React DevTools] Several improvements that should improve the overal experience, the plugin should load much quicker and behave more predictably.
Reviewed By: bvaughn
Differential Revision: D28382587
fbshipit-source-id: 0f2787b24fa2afdf5014dbf1d79240606405199a
Summary:
Currently Flipper embeds the React devTools, and as a result the version of the React devTools is strictly coupled to the Flipper version. This is troublesome when connecting to (slightly) older React Native versions, that use a different version of the tools. That results in errors like this one:
{F615263497}
This diff introduces a feature to use globally installed devTools instead of the embedded ones, giving users the flexibility to pick their own version.
{F615263580}
This addresses
https://fb.workplace.com/groups/flippersupport/permalink/1125669971246993/https://github.com/facebook/flipper/issues/2250https://github.com/facebook/flipper/issues/2224
Changelog: [React DevTools] It is now possible to switch between the embedded and globally installed version of the React DevTools. This will enable the React DevTools to connect to older RN versions. Fixes#2250, #2224
Reviewed By: passy
Differential Revision: D28382586
fbshipit-source-id: a5386a5043933acda5aab2db74078bf7ceb105ca
Summary:
Converted ReactDevTools to Sandy, no real semantic changes. Will add those in next diffs.
Made some minor flow optimizations.
The port forwarding setup interacted directly with the Flipper store, so made an escape hatch for that. Will clean that up again in next diffs.
Reviewed By: passy
Differential Revision: D28380055
fbshipit-source-id: 053979fd10bf3b62089a4f1e27b0e02b4b05e2e1
Summary:
Changelog: [Network] It is now possible to add custom columns for specific request / response headers
This implements #3 papercut. See also https://fb.workplace.com/groups/flippersupport/permalink/1080685582412099/
Didn't include a way to remove custom columns yet. But they can be hidden just like normal columns. Custom columns aren't remembered across Flipper sessions or apps. We can add that later if desired.
Reviewed By: passy
Differential Revision: D28223515
fbshipit-source-id: 3ed008883430be4ae51a645c6a4ac780467ba442
Summary:
Currently the network plugin was always storing the transfer format of our request/ response bodies: a base64 string. However, those are not searchable, and every formatter (and multiple can be invoked in a single view) was responsible for its own decompressing.
This diff changes parsing requests / responses into an accurate format: a decompressed, de-base64-ed utf8 string, or a Uint8array for binary data.
We will use this in the next diffs to do some more efficient searching
Reviewed By: passy
Differential Revision: D28200190
fbshipit-source-id: 33a71aeb7b340b58305e97fff4fa5ce472169b25
Summary:
Changelog: Updated Network plugin to Sandy UI, including several UI improvements
Converted UI to Sandy, and some minor code cleanups
Moved all mock related logic to its own dir
Fixes https://github.com/facebook/flipper/issues/2267
Reviewed By: passy
Differential Revision: D27966606
fbshipit-source-id: a64e20276d7f0966ce7a95b22557762a32c184cd
Summary:
converted the network plugin to use DataSource / DataTable. Restructured the storage to contain a single flat normalised object that will be much more efficient for rendering / filtering (as columns currently don't support nested keys yet, and lazy columns are a lot less flexible)
lint errors and further `flipper` package usages will be cleaned up in the next diff to make sure this diff doesn't become too large.
The rest of the plugin is converted in the next diff
Reviewed By: nikoant
Differential Revision: D27938581
fbshipit-source-id: 2e0e2ba75ef13d88304c6566d4519b121daa215b
Summary:
Removed the "notifications for leaks" test since we're no longer storing notifications but showing them immediately.
Will do UI updates separately.
Reviewed By: mweststrate
Differential Revision: D28025507
fbshipit-source-id: 58db2504c29bba441b2c2d86cd3e2b8b5c010757
Summary:
With proper notification, components and code clean up in place, time for the reward and giving the plugin a fresh look.
Changelog: CrashReporter plugin got a fresh look and several navigation issues were addressed.
Reviewed By: passy
Differential Revision: D28102398
fbshipit-source-id: 5721634e45c5b1fc5fba3fb0c0b8970635b80b46
Summary:
Moved a lot of utility logic in separate files for Android and iOS, to make cleanup in next diffs easier by having a bit smaller files.
Purely a code shuffle, no functional changes
Reviewed By: passy
Differential Revision: D28102399
fbshipit-source-id: 2fd8f6669bdd2804fa8a7e1791c610ae7883eda6
Summary:
Changelog: Standardized DataList component
This diff standardizes the DataList component, by reusing the DataList. This is done to be able to take full advantage of all its features like virtualisation, keyboard support, datasource support, etc.
Also cleaned up DataTable properties a bit, by prefixing all flags with `enableXXX` and setting clear defaults
Reviewed By: passy
Differential Revision: D28119721
fbshipit-source-id: b7b241ea18d788bfa035389cc8c6ae7ea95ecadb
Summary: Extracted plugin UI root coomponent to a separate file to avoid falling back to full reloads even when "--fast-refresh" flag provided
Reviewed By: mweststrate
Differential Revision: D28119498
fbshipit-source-id: 18ef891512cbe5ddc34cacf7010dfd82f86c4fcc
Summary:
Moving Value/renderValue API to "database" plugin as these APIs used exclusively by this plugin.
Alternative to that could be moving this API to "flipper-plugin" instead, but I think it doesn't make sense to expose public API which is only used in one plugin.
Reviewed By: mweststrate
Differential Revision: D28110483
fbshipit-source-id: 1576444681c1e0531fe45f0c15f442d65a28f803
Summary: Use DataTable to show table structure
Reviewed By: mweststrate
Differential Revision: D28110485
fbshipit-source-id: 81f843a4763e1fbf5acf870621bc9049f719fd2c
Summary:
React DevTools has gotten pretty outdated in React Native. Let's fix that!
Last time I tried this it caused a lot of churn for tools like Flipper, so I approached this in two steps ([detailed in this post](https://fb.workplace.com/groups/rnsyncsquad/permalink/808063140086959/)).
First was a short term plan (as implemented in [PR 21344](https://github.com/facebook/react/pull/21344)) to:
1. Branch and make a patch release of DevTools 4.10 that adds a protocol check to the frontend (to detect any newer backends).
2. Upgrade Flipper (and recommend upgrade for the OSS React Native Debugger as well) to this new frontend.
3. Wait for the updated frontend to roll out.
The short term plan is now done, at least for the internal build of Flipper, and both GitHub PRs to update Flipper and React Native Debugger have been merged.
So this diff moves forward with the longer term plan (implemented in [PR 21331](https://github.com/facebook/react/pull/21331)):
1. Add an explicit version to the protocol used by the DevTools "backend" and "frontend" components to talk to each other.
2. Check this protocol during initialization to ensure it matches.
3. Show upgrade/downgrade instructions if there's a mismatch (or if the check times out without a response– indicating an older backend).
4. Release this as 4.13.
---
Changelog:
[General][Changed] - Upgrade `react-devtools-core` from ~4.6.0 to ^4.13.0
Reviewed By: yungsters
Differential Revision: D28103394
fbshipit-source-id: 21114294144bde9aede63cb3ba98a240082299bd
Summary:
Cleaned up margins and paddings by removing hardcoded values and use constant sizes from "themes" instead.
Changelog: Database plugin UI aligned with the new Flipper UI
Reviewed By: mweststrate
Differential Revision: D28094217
fbshipit-source-id: 6514b2f1ea7073ca658a86e49c2be029f054ddf0