Commit Graph

674 Commits

Author SHA1 Message Date
Michel Weststrate
6fb28df855 Make Store initialization independent of module order
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
2021-06-21 08:37:20 -07:00
Michel Weststrate
806dd63f68 Add wrapper support for import / export states
Summary: Make sure custom export handlers of classic plugins wrapped in Sandy are respected

Reviewed By: passy

Differential Revision: D29233604

fbshipit-source-id: 7bab33af3422e0b59697438577906ce8580a28ad
2021-06-21 08:37:20 -07:00
Michel Weststrate
0aadb862ee Use DataList
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
2021-06-16 07:14:54 -07:00
Anton Nikolaev
a87069fa4f Fix Edit button layout
Summary: Edit button was not visible which blocked editing of databases

Reviewed By: passy

Differential Revision: D29139000

fbshipit-source-id: d0e8d22ca1a1a39697ec70e94e3eb7422e32de48
2021-06-16 03:31:51 -07:00
Pascal Hartig
fdfcc65720 Hard-code d3-array 2.3.3 for Babel compat
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
2021-06-15 08:41:17 -07:00
Michel Weststrate
bc14b047cd Fix database names being truncated
Summary: Changelog: [Database] Fix database names not being readable in selection dropdowns

Reviewed By: jknoxville

Differential Revision: D29130379

fbshipit-source-id: 7212e6869efe5f501aa76e6836dad839319204fd
2021-06-15 06:28:48 -07:00
Pascal Hartig
2f1042a9b7 Clean up kaios-ram deps
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
2021-06-15 05:39:23 -07:00
Pascal Hartig
33d5d0082c Move tests
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
2021-06-11 08:31:50 -07:00
Pascal Hartig
7ebdfa5822 Increase dropdown width
Summary: Changelog: Increase width of database name and table name dropdowns

Reviewed By: fabiomassimo

Differential Revision: D29062064

fbshipit-source-id: 46278ae6587d2feadea20fd1c5b4e04400034362
2021-06-11 06:34:02 -07:00
Michel Weststrate
7e4df00138 Implement context menu
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
2021-06-10 12:57:47 -07:00
Michel Weststrate
d2095d5937 Update to pure Sandy and update custom docs
Summary: Per title

Reviewed By: priteshrnandgaonkar

Differential Revision: D28991625

fbshipit-source-id: cab9cf59d1d053e2f8a47c588cb05abc44a527cc
2021-06-09 07:26:57 -07:00
Michel Weststrate
a0c872dd38 Update setup and createTable tutorial to 100% Sandy
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
2021-06-09 07:26:57 -07:00
Michel Weststrate
9d485b1d5d Convert plugin to Sandy
Reviewed By: passy

Differential Revision: D28964502

fbshipit-source-id: 76322dc7aec09497f6ba7e4dfb1af8f0318837ca
2021-06-08 09:52:48 -07:00
Michel Weststrate
496f8767dc Enable debug logs by default
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
2021-06-08 09:52:48 -07:00
Michel Weststrate
bc647972e1 Type improvements
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
2021-06-07 08:09:53 -07:00
Pascal Hartig
edbb41b49b Upgrade prettier
Summary: ohsopretty

Reviewed By: fabiomassimo

Differential Revision: D28930276

fbshipit-source-id: faaca8cc53c2fe42a8e010d5c1b1d79e89190858
2021-06-07 04:59:17 -07:00
Pascal Hartig
be2f15b71f Dep bump
Summary: Daily bump for low-risk deps.

Reviewed By: cekkaewnumchai

Differential Revision: D28707008

fbshipit-source-id: 453351387a9a7a05a1c30294f2712956da6ecc49
2021-05-26 08:35:12 -07:00
Anton Nikolaev
76701565ac Cleanup public plugins metadata
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
2021-05-21 07:15:28 -07:00
Michel Weststrate
767c6855c8 Clean up response handling
Reviewed By: priteshrnandgaonkar, fabiomassimo

Differential Revision: D28441183

fbshipit-source-id: 6e47d05145e986279860b49cfff078a905f62689
2021-05-19 06:22:43 -07:00
bizzguy
b378d8b946 fix problem with mock request data (#2340)
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):

![image](https://user-images.githubusercontent.com/337874/118744068-423e3b80-b819-11eb-9076-216459517fdb.png)

## 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:

![image](https://user-images.githubusercontent.com/337874/118744220-8af5f480-b819-11eb-9206-0fa40e7d7e46.png)

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
2021-05-19 03:15:30 -07:00
Denis Colliot
525e8b19fb Detect JSON API content type ('application/vnd.api+json') as textual content (#2337)
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
2021-05-18 13:48:17 -07:00
bizzguy
b0313316cc Network Plugin: Add xhtml and xml to 'Textual' check (#2336)
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
2021-05-18 10:23:38 -07:00
Mathias Fleig Mortensen
996e8ab87c Migrate Images plugin to ant.design
Summary: {gif:xcsasxxe}

Reviewed By: mweststrate

Differential Revision: D28463799

fbshipit-source-id: 280eaaf0ad5858b3507055a278d1f98fd5668fd0
2021-05-18 04:13:16 -07:00
Michel Weststrate
b947a65c51 Fix Network serialization
Summary:
Changelog: [Network] Fix import / export of binary data

Introduced proper serialization of binary data when creating a Flipper export.
Implements / solves https://github.com/facebook/flipper/issues/2308

Reviewed By: nikoant

Differential Revision: D28441021

fbshipit-source-id: 90b524bf2a5d85e373073b50a3ccf2bb29628ee0
2021-05-17 03:17:00 -07:00
Anton Nikolaev
366752f424 Enforce version "0.0.0" in plugin sources
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
2021-05-14 10:23:11 -07:00
Michel Weststrate
96cbc81e63 Fix connection and DOM management of React DevTools
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
2021-05-12 14:21:53 -07:00
Michel Weststrate
ab17bbd555 Allow using global devTools
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/2250
https://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
2021-05-12 14:21:53 -07:00
Michel Weststrate
4062950fbe Convert React DevTools to Sandy
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
2021-05-12 14:21:53 -07:00
Pascal Hartig
69c7876be9 Enforce react/jsx-boolean-value
Summary: yarn fix results.

Reviewed By: nikoant

Differential Revision: D28329714

fbshipit-source-id: 564aa24bcdb4bc6cdea67dfad10a077a9c817a2d
2021-05-11 10:14:05 -07:00
dependabot[bot]
674f71a426 Bump prettier from 2.2.1 to 2.3.0 in /desktop (#2300)
Summary:
Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/prettier/prettier/releases">prettier's releases</a>.</em></p>
<blockquote>
<h2>2.3.0</h2>
<p><a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">diff</a></p>
<p>{emoji:1f517} <a href="https://prettier.io/blog/2021/05/09/2.3.0.html">Release Notes</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's changelog</a>.</em></p>
<blockquote>
<h1>2.3.0</h1>
<p><a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">diff</a></p>
<p>{emoji:1f517} <a href="https://prettier.io/blog/2021/05/09/2.3.0.html">Release Notes</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="2afc3b9ae6"><code>2afc3b9</code></a> Release 2.3.0</li>
<li><a href="7cfa9aa89b"><code>7cfa9aa</code></a> Fix pre-commit hook setup command (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10710">#10710</a>)</li>
<li><a href="c8c02b4753"><code>c8c02b4</code></a> Build(deps-dev): Bump concurrently from 6.0.2 to 6.1.0 in /website (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10834">#10834</a>)</li>
<li><a href="6506e0f50e"><code>6506e0f</code></a> Build(deps-dev): Bump webpack-cli from 4.6.0 to 4.7.0 in /website (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10836">#10836</a>)</li>
<li><a href="69fae9c291"><code>69fae9c</code></a> Build(deps): Bump flow-parser from 0.150.0 to 0.150.1 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10839">#10839</a>)</li>
<li><a href="164a6e2351"><code>164a6e2</code></a> Switch CLI to async (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10804">#10804</a>)</li>
<li><a href="d3e7e2f634"><code>d3e7e2f</code></a> Build(deps): Bump codecov/codecov-action from v1.4.1 to v1.5.0 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10833">#10833</a>)</li>
<li><a href="9e09845da0"><code>9e09845</code></a> Build(deps): Bump <code>@​angular/compiler</code> from 11.2.12 to 11.2.13 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10838">#10838</a>)</li>
<li><a href="1bfab3d045"><code>1bfab3d</code></a> Build(deps-dev): Bump eslint from 7.25.0 to 7.26.0 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10840">#10840</a>)</li>
<li><a href="387fce4ed8"><code>387fce4</code></a> Minor formatting tweaks (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10807">#10807</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettier&package-manager=npm_and_yarn&previous-version=2.2.1&new-version=2.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/2300

Reviewed By: passy

Differential Revision: D28323849

Pulled By: cekkaewnumchai

fbshipit-source-id: 1842877ccc9a9587af7f0d9ff9432c2075c8ee22
2021-05-11 05:51:56 -07:00
Michel Weststrate
0c2348ebdb Introduce custom header columns
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
2021-05-06 04:27:59 -07:00
Michel Weststrate
9c5967caf9 Introduce button to copy request / response body to clipboard
Summary: Changelog: [Network] Introduce a copy button for request / response bodies

Reviewed By: passy

Differential Revision: D28222152

fbshipit-source-id: db33c8e91cbbe733502b32df75de14290e6f3d95
2021-05-06 04:27:59 -07:00
Michel Weststrate
72e34bbd0d Parse request bodies eagerly
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
2021-05-06 04:27:59 -07:00
Michel Weststrate
fc4a08eb55 Convert plugin UI to Sandy
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
2021-05-06 04:27:59 -07:00
Michel Weststrate
23402dfff6 Convert network plugin to Sandy
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
2021-05-06 04:27:59 -07:00
Anton Nikolaev
bef1885395 Fix broken layout on Databases plugin load
Summary: Somehow emotion styling of Typography.Text component from antd breaks the entire layout

Reviewed By: cekkaewnumchai

Differential Revision: D28226743

fbshipit-source-id: 7bdba33b7b02e4272cc9478c66fcc13ab74a0fc3
2021-05-05 11:00:16 -07:00
Mathias Fleig Mortensen
8a5b2c5981 Migrate Fresco plugin to Sandy
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
2021-05-05 06:04:37 -07:00
Michel Weststrate
e707fcc9f9 Convert UI to Sandy
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
2021-05-04 13:50:31 -07:00
Michel Weststrate
01ea822341 Code shuffle
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
2021-05-04 13:50:31 -07:00
Michel Weststrate
d903a862d2 Use DataTable as list base
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
2021-05-04 13:50:31 -07:00
Anton Nikolaev
3586f8ebbb UI Conversion: extracted plugin UI root component into a separate file
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
2021-04-30 09:38:15 -07:00
Anton Nikolaev
45397fd2f4 UI Conversion: use DetailsSidebar from "flipper-plugin"
Summary: Use DetailsSidebar from "flipper-plugin"

Reviewed By: mweststrate

Differential Revision: D28110484

fbshipit-source-id: 0b9e3c07fc642242f2846f024895e740078779f7
2021-04-30 09:38:15 -07:00
Anton Nikolaev
368dd4a5ab Remove Value/renderValue public API from "flipper"
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
2021-04-30 09:38:15 -07:00
Anton Nikolaev
23102b1997 UI Conversion: Use DataTable to show DB table structure
Summary: Use DataTable to show table structure

Reviewed By: mweststrate

Differential Revision: D28110485

fbshipit-source-id: 81f843a4763e1fbf5acf870621bc9049f719fd2c
2021-04-30 09:38:15 -07:00
Brian Vaughn
2520e6912f Update React DevTools to ^4.13.0
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
2021-04-29 16:58:33 -07:00
Anton Nikolaev
84b48ff7e9 UI Conversion: Cleanup margins / paddings
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
2021-04-29 12:04:04 -07:00
Anton Nikolaev
e1afe9d6b9 UI Conversion: Use TextArea from antd
Summary: Replaced Text and TextArea components by antd analogues

Reviewed By: mweststrate

Differential Revision: D28088959

fbshipit-source-id: 87f867f04f34a9b026045b34467a35437d132317
2021-04-29 12:04:04 -07:00
Anton Nikolaev
71d827288f UI Conversion: Replace buttons and dropdowns to antd analogues
Summary: Replaced favorite query dropdown to antd analogue

Reviewed By: mweststrate

Differential Revision: D28089366

fbshipit-source-id: 0d6e01bf6169f100ba7c9e612f0da8240ca3218d
2021-04-29 12:04:04 -07:00
Anton Nikolaev
1a315c510e UI Conversion: Switched ButtonGroup to Radio
Summary: Switched button group to Ant's radio buttons

Reviewed By: mweststrate

Differential Revision: D28068173

fbshipit-source-id: bcde8f32d76f76c18cf8bc8c8742bc3e01c54c7c
2021-04-29 12:04:04 -07:00
Anton Nikolaev
f743bd68a1 UI Conversion: Use Select from antd
Summary: Used Antd's Select component instead of the old one. In addition to that also enabled search in Select which can be quite handly as there might be many databases / tables.

Reviewed By: mweststrate

Differential Revision: D28068179

fbshipit-source-id: 4ff337a532e035c8b53a23858b5ba6d900e65ebd
2021-04-29 12:04:04 -07:00