Commit Graph

196 Commits

Author SHA1 Message Date
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
dependabot[bot]
ec356309c0 Bump @emotion/react from 11.1.5 to 11.4.0 in /desktop (#2302)
Summary:
Bumps [emotion/react](https://github.com/emotion-js/emotion) from 11.1.5 to 11.4.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/emotion-js/emotion/releases"><code>@​emotion/react</code>'s releases</a>.</em></p>
<blockquote>
<h2><code>@​emotion/react</code><a href="https://github.com/11"><code>@​11</code></a>.4.0</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a href="https://github-redirect.dependabot.com/emotion-js/emotion/pull/2334">#2334</a> <a href="7d9e74f8f0"><code>7d9e74f8</code></a> Thanks <a href="https://github.com/Andarist"><code>@​Andarist</code></a>! - The Global component no longer replaces style elements from server-rendering on first mount and instead reuses the server-side rendered style element</p>
</li>
<li>
<p>Updated dependencies [<a href="38f9d44f91"><code>38f9d44f</code></a>]:</p>
<ul>
<li><code>@​emotion/cache</code><a href="https://github.com/11"><code>@​11</code></a>.4.0</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="3a8eaac14c"><code>3a8eaac</code></a> Version Packages (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2365">#2365</a>)</li>
<li><a href="7d9e74f8f0"><code>7d9e74f</code></a> feat(server): add extractCriticalToChunks (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2334">#2334</a>)</li>
<li><a href="38f9d44f91"><code>38f9d44</code></a> Fix moving of client-side inserted style tags from Emotion 10 when intending ...</li>
<li><a href="780bc17cc7"><code>780bc17</code></a> Upgrade Changesets</li>
<li><a href="2463507409"><code>2463507</code></a> Added Frontity to the in the wild list (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2362">#2362</a>)</li>
<li><a href="6c4a9e50f1"><code>6c4a9e5</code></a> Fix slack invite link</li>
<li><a href="f3c51e8aca"><code>f3c51e8</code></a> 📝 Updated readme of <code>@​emotion/cache</code> for key attribute. (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2346">#2346</a>)</li>
<li><a href="d759ae1298"><code>d759ae1</code></a> Switch to GitHub actions (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2347">#2347</a>)</li>
<li><a href="4d7efcb33c"><code>4d7efcb</code></a> Run Windows on CI (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2341">#2341</a>)</li>
<li><a href="f36b946b4b"><code>f36b946</code></a> Version Packages (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2339">#2339</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/emotion-js/emotion/compare/emotion/react@11.1.5...@emotion/react@11.4.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@emotion/react&package-manager=npm_and_yarn&previous-version=11.1.5&new-version=11.4.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/2302

Reviewed By: mweststrate

Differential Revision: D28323892

Pulled By: cekkaewnumchai

fbshipit-source-id: 94464b2230470c1aa945121eae85fbc6715d4b6a
2021-05-11 05:51:56 -07:00
Michel Weststrate
0b3b2cf8e5 Set up demo project
Summary: allow-large-files

Reviewed By: priteshrnandgaonkar

Differential Revision: D28056697

fbshipit-source-id: e58e1415282540622b1a07918e7db7277536d8a4
2021-05-10 07:03:40 -07:00
Michel Weststrate
44521315c4 Set up separate package build
Summary:
Added a microbundle based build setup to the data-source folder to be able to package just that folder.

For simplicity / iteration speed, this is only used to publish externally. Our own code still references the source files directly.

More strict separation can be done later if there is external adoption.

Reviewed By: nikoant

Differential Revision: D28056699

fbshipit-source-id: a011b615cfffeff8ecb879bd7281a71085cea965
2021-05-10 07:03:40 -07:00
Michel Weststrate
84e2646909 Reorganise for easier extraction
Summary:
To make the DataSource abstraction reusable for other teams and an upcoming talk, this diff moves all DataSource storage & virtualization logic in one folder.

Will set up a build process and demo project in later diffs.

Reviewed By: nikoant

Differential Revision: D28056700

fbshipit-source-id: 7cfe5b40bbbe387da711f765a604a45029d451c7
2021-05-10 07:03:39 -07:00
Michel Weststrate
f5b5e9be9f Convert rsys plugin to Sandy
Summary:
The `flipper` dependency is being deprecated for plugins, so upgraded the plugin to new APIs. This should be pretty safe, however, I'm not sure how to test it :)

Also removed react-diff-viewer dependency, as that seemed unused.

Reviewed By: passy

Differential Revision: D28091469

fbshipit-source-id: b9be007e3fc7b0689b1e1f711849ed82a6e01716
2021-05-06 06:44:22 -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
84d65b1a77 DataTable tweaks
Summary: Found a small issue in the column width calculation where initial invisible columns still got space assigned.

Reviewed By: passy

Differential Revision: D28221659

fbshipit-source-id: ef052533bc37bc833bab72979803ce36bcf50e61
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
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
be3cdedf52 Some UI / docs fine-tuning
Summary: Added wash color option to Toolbar, made codeblocks transparent rather than gray & bordered, which looks cleaner

Reviewed By: passy

Differential Revision: D28119720

fbshipit-source-id: 9d1f4db5b39a91d9d117046bd5482726ac2f555d
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
Michel Weststrate
5bf9541e05 Standardize CodeBlock component
Summary:
Code blocks are quite common in Flipper, and a bit verbose in Ant, so let's standardize!

Changelog: Standardize CodeBlock component

Reviewed By: passy

Differential Revision: D28117560

fbshipit-source-id: 5a5538a49b59ef40c814d22055fac56e7598cbbb
2021-05-04 13:50:31 -07:00
Michel Weststrate
dd7a9f5195 introduce onReady life-cycle
Summary: Flipper Sandy plugins didn't have an event to hook into that is run _after_ any state snapshot is loaded, which was needed by the graphQL plugin, as they do some post processing when a data snapshot is restored.

Reviewed By: passy

Differential Revision: D28189573

fbshipit-source-id: 4ef992f3fafc32787eab3bc235059f2c41396c80
2021-05-04 12:52:26 -07:00
dependabot[bot]
574e902a34 Bump jest-mock-console from 1.0.1 to 1.1.0 in /desktop (#2265)
Summary:
Bumps [jest-mock-console](https://github.com/bpedersen/jest-mock-console) from 1.0.1 to 1.1.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/bpedersen/jest-mock-console/commits">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=jest-mock-console&package-manager=npm_and_yarn&previous-version=1.0.1&new-version=1.1.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/2265

Reviewed By: mweststrate

Differential Revision: D28181903

Pulled By: passy

fbshipit-source-id: 40b305d3a90a01adfb7e21b3cbd5a8e75ce5de04
2021-05-04 11:49:56 -07:00
Pascal Hartig
bf571065f9 Allow copying from whole row
Summary:
Increase the mouse target for copying values from the the tree in a data inspector to the full row, not just the text.

Not sure if bringing reversing the order here has any unintended side-effects, but in testing it seems to work fine.

Reviewed By: mweststrate

Differential Revision: D28185064

fbshipit-source-id: b9b86a7e181bfd0083f2a3bcb24c571b5ec4647e
2021-05-04 10:35:36 -07:00
Michel Weststrate
699343a9ca Fix bug causing archived devices trying to connect
Reviewed By: nikoant

Differential Revision: D28064540

fbshipit-source-id: 43f05c4348a33e9633751bb9f69cd8d17ddd13c4
2021-04-29 12:12:57 -07:00
Anthony Dubis
8a3ba8615d Extend Atom's update interface
Summary:
This help handle updates to objects containing JSONObject type (generates typescript errors around infinite recursion:

> Type instantiation is excessively deep and possibly infinite.ts(2589)

Reviewed By: mweststrate

Differential Revision: D28098502

fbshipit-source-id: a8e7f785b03bce7c8e1c0b355e2eca2e087b1881
2021-04-29 12:06:21 -07:00
Michel Weststrate
1a8943e903 Fix autoscroll issue
Summary:
Noticed a regression in sticky scrolling not being sticky. I suspect this is caused by pixel inaccuracy + rounding, but our offset from bottom calculation consistently now reports `1` when being at the end of the scrollable region.

Too bad it is really hard to protect against these kind of regressions automated.

Reviewed By: passy

Differential Revision: D28095803

fbshipit-source-id: 1dbd57d84fb308023c2300c543aca344bf27ec28
2021-04-29 11:45:14 -07:00
Pascal Hartig
c3f3b35a31 Mass-bump deps
Summary:
Trying to get ahead of dependabot by bumping a bunch of things at once
that are minor or patch level bumps.

Reviewed By: muraziz

Differential Revision: D28094201

fbshipit-source-id: b6b53ae2d582686201124b82fed4f436a60b3172
2021-04-29 11:33:57 -07:00
Michel Weststrate
e3cb16d870 Fixed layout issue with undefined column widths
Summary: This fixes an earlier reported issue with Messages plugin, if no column widths are set values can jump around per row

Reviewed By: passy

Differential Revision: D28090807

fbshipit-source-id: be124b94f507584cf177710816035cd280a5ef01
2021-04-29 07:31:54 -07:00
Michel Weststrate
e26a8c5ad0 Provide standardised MasterDetail
Summary:
Noticed in reviews during the convertathon there is still quite some boilerplate in things that happen on the boundary of UI and plugin state, such as setting up menu entries and providing common functionality like clear, master/detail layout, etc.

This diff introduces the `MasterDetail` component, which takes a higher level approach by merely needing to provide the state atoms and desired features, and taking care of the wiring.

Applied it to createTablePlugin, to prove that going from `createTablePlugin` to `MasterDetail` will be a much smaller step now.

Verified on the funnel logger plugin

Reviewed By: passy

Differential Revision: D28090362

fbshipit-source-id: 146f8c315fea903901ad4e3e46711642f16cf0e6
2021-04-29 07:31:54 -07:00
Michel Weststrate
05bf55419f Introduce createTablePlugin
Summary: This diff exposes the createTablePlugin from flipper-plugin, so that createTablePlugin based plugins can be converted to Sandy as well

Reviewed By: jknoxville

Differential Revision: D28031227

fbshipit-source-id: 8e9c82da08a83fddab740b46be9917b6a1023117
2021-04-28 12:28:37 -07:00
Michel Weststrate
bbcb16d8fb Make DataTable / DataInspector unit tests predictable
Summary: Having time / async / non-blocking behavior in components in unit tests is really annoying, as it makes unit tests async without an easy way to determine 'done'. This diff makes sure that DataTable & DataInspector don't break down their work in smaller tasks, but do everything block if they are running in a unit test.

Reviewed By: nikoant

Differential Revision: D28054487

fbshipit-source-id: 72c3b519e092ad69ed71eb1731e1fed80022f91f
2021-04-28 06:33:04 -07:00
Michel Weststrate
39be769bab DataInspector renames
Summary:
Two minor renames:
* `DataInspector` => `DataInspectorNode`
* `ManagedDataInspector` => `DataInspector`

This aligns the internal and public name of the component, and better captures the meaning of the original `DataInspector` class.

The diff looks quite hefty, but that seems to be a phabricator issue caused by the filename swap; barely a thing changed :)

Reviewed By: jknoxville

Differential Revision: D28028554

fbshipit-source-id: d3d61fcb50abffaeae4bd1d26966604cece37b03
2021-04-28 06:33:04 -07:00
Michel Weststrate
8e02b2ec10 Expose Toolbar from Sandy
Summary: Moved Toolbar to flipper-plugin. No further changes.

Reviewed By: nikoant

Differential Revision: D28027334

fbshipit-source-id: 35de13d87734ae3a8af037166945b1a669106274
2021-04-28 05:48:20 -07:00
Michel Weststrate
d6c74c4e2f Support natural sizing
Summary:
Introduced the `scrollable={false}` option to DataTable, that gives the table its natural size, while still having all the other gimmicks of DataTable, like search, filter, etc etc.

To implement this, a non-virtualizing rendering is needed, which is handled by the `StaticDataSourceRenderer`

Also introduced the option to hide the searchbar.

Reviewed By: nikoant

Differential Revision: D28036469

fbshipit-source-id: 633c4f7f3fabfa99efa2839059aaa59b0a407ada
2021-04-28 05:48:20 -07:00
Michel Weststrate
00e4d2440d Support providing records directly to DataTable
Summary: This diff allows using a DataTable without setting up a full datasource, which is simpler in case the dataset is small and/or fixed. For an continuously growing dataset a DataSource should still be set up.

Reviewed By: jknoxville

Differential Revision: D28037897

fbshipit-source-id: 2e56b1970e19f967c3752a78737b8f7a3f934b87
2021-04-27 14:53:40 -07:00
Michel Weststrate
d26ea5fa46 Allow onExport handler to return nothing
Summary:
In many cases, the onExport handler doesn't try to customise the format, but merely fetch some additional information before creating an export.

By allowing the `onExport` handler to also return nothing, and instead merely update existing state, this case will be easier to express now;

Reviewed By: nikoant

Differential Revision: D28026558

fbshipit-source-id: 2b90b3e1ced6a6a5b42938b6f6b74b0eb9ceafc0
2021-04-27 14:53:40 -07:00
Anton Nikolaev
140cf38ffd Expose subscribe / unsubscribe functions from Atom
Summary: Allow subscribing to Atom state changes

Reviewed By: mweststrate

Differential Revision: D28027692

fbshipit-source-id: 24fd7ea16b013c364bbb1d25b30c48bc698db014
2021-04-27 09:31:11 -07:00
Michel Weststrate
37a7b16774 Introduce Tabs
Summary:
Ant'd tabs didn't allow for vertical fill out. Introduced our own tiny wrapper that has `grow` by default.

Also made sure the users last selection is remembered.

Reviewed By: cekkaewnumchai

Differential Revision: D28026345

fbshipit-source-id: 7703bc241cd1427336b7c917bdb5be9f56bba9b9
2021-04-27 08:13:16 -07:00
Michel Weststrate
34e5e3a11a Fine tuning and docs for Panel
Summary: Better documentation for Panel. Fixes styling issue for uncollapsible panels

Reviewed By: passy

Differential Revision: D28025557

fbshipit-source-id: db0f9fd44f501fa36be3fc31ebbe7917d7c0a88c
2021-04-27 08:13:16 -07:00
dependabot[bot]
1842674d00 Bump react-virtual from 2.6.1 to 2.7.1 in /desktop (#2235)
Summary:
Bumps [react-virtual](https://github.com/tannerlinsley/react-virtual) from 2.6.1 to 2.7.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/tannerlinsley/react-virtual/releases">react-virtual's releases</a>.</em></p>
<blockquote>
<h2>v2.7.1</h2>
<h2><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.7.0...v2.7.1">2.7.1</a> (2021-04-16)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>replace Object.assign with property assignment (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/117">https://github.com/facebook/flipper/issues/117</a>) (<a href="6b241fddef">6b241fd</a>)</li>
</ul>
<h2>v2.7.0</h2>
<h1><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.6.2...v2.7.0">2.7.0</a> (2021-04-15)</h1>
<h3>Features</h3>
<ul>
<li>use binary search to calculate range (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/114">https://github.com/facebook/flipper/issues/114</a>) (<a href="55356390d9">5535639</a>)</li>
</ul>
<h2>v2.6.2</h2>
<h2><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.6.1...v2.6.2">2.6.2</a> (2021-04-13)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>measureRef type in VirtualItem, add missing onScrollElement, scrollOffsetFn (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/110">https://github.com/facebook/flipper/issues/110</a>) (<a href="08920a8f36">08920a8</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="80dba579dc"><code>80dba57</code></a> chore: remove ts-toolbelt (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/118">https://github.com/facebook/flipper/issues/118</a>)</li>
<li><a href="6b241fddef"><code>6b241fd</code></a> fix: replace Object.assign with property assignment (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/117">https://github.com/facebook/flipper/issues/117</a>)</li>
<li><a href="55356390d9"><code>5535639</code></a> feat: use binary search to calculate range (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/114">https://github.com/facebook/flipper/issues/114</a>)</li>
<li><a href="4e08b8018c"><code>4e08b80</code></a> fix:scrollOffsetFn not included in effect dependency list (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/111">https://github.com/facebook/flipper/issues/111</a>)</li>
<li><a href="08920a8f36"><code>08920a8</code></a> fix: measureRef type in VirtualItem, add missing onScrollElement, scrollOffse...</li>
<li>See full diff in <a href="https://github.com/tannerlinsley/react-virtual/compare/v2.6.1...v2.7.1">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=react-virtual&package-manager=npm_and_yarn&previous-version=2.6.1&new-version=2.7.1)](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/2235

Reviewed By: passy

Differential Revision: D27999982

Pulled By: priteshrnandgaonkar

fbshipit-source-id: abff7d19fa682f5f3d00bbc5009d2446a4fa26b7
2021-04-27 03:51:35 -07:00
Michel Weststrate
844abca78c Expose logger from client
Summary: The `logger` was currently only available in a React context, and not directly exposed from the `client` API as well. This diff fixes it. The infrastructure including test stubs were present already, so the change is minimal.

Reviewed By: nikoant

Differential Revision: D28010120

fbshipit-source-id: cdd09ed236f5d92d07005d4e5a699360596281e4
2021-04-27 01:43:42 -07:00
Michel Weststrate
c89d18fd68 Introduce DataList
Summary: Introduce the DataList component. Not feature complete yet, but core functionality is present so that people can use it during the convertathon. It is used to implement the route list in the network mock dialog

Reviewed By: priteshrnandgaonkar

Differential Revision: D27046716

fbshipit-source-id: a247ce7032b350b31bf55962ca4268e30f43471a
2021-04-27 01:43:42 -07:00
Michel Weststrate
c005753018 Expose Panel and useLocalStorageState
Summary: Expose a Panel api from Sandy, which is quite similar to the old one, except that it uses Antd, and it will remember the users closed / open preference through sessions, a much requested feature.

Reviewed By: nikoant

Differential Revision: D27966607

fbshipit-source-id: 9b18df377215c1e6c5844d0bf972058c8c574cbb
2021-04-23 09:29:59 -07:00
Michel Weststrate
faf8588097 Minor improvements
Summary:
Some styling fixes and minor improvements in DataTable, used by network plugin:

- be able to customise the context menu
- be able to customise how entire rows are copied and presented on the clipboard to be able to deviate from the standard JSON
- deeplink handling was made async, this gives the plugin the opportunity to first handle initial setup and rendering before trying to jump somewhere which is a typical use case for deeplinking

Reviewed By: passy

Differential Revision: D27947186

fbshipit-source-id: a56f081d60520c4bc2ad3c547a8ca5b9357e71a1
2021-04-23 09:29:59 -07:00
Michel Weststrate
18491dac11 Fixed issue where split container with null elems woudn't use remaining size
Summary:
This fixes an issue where `Layout.Top/Right/Left/Bottom` would not render its secondary child in the remaining size, if the primary child is empty (`null`). This is caused by React not rendering anything for null children, and as a result the CSS rules for the primary child would then match the second child.

In the example below making the component tree invisible if there are no bundles in the NT/Bloks plugin. Fixed by rendering a zero sized element instead.

Reviewed By: jknoxville

Differential Revision: D27793382

fbshipit-source-id: 1e76b51986c30a6a0d98e9356fcad4dd8d5d5f91
2021-04-15 07:48:33 -07:00
Michel Weststrate
0fe879c838 Improve multiple element selector UI
Summary:
Layer selection is pretty easy to miss, as reported in for example: https://fb.workplace.com/groups/flippersupport/permalink/1098169193997071/

Moved the layer selection to the top of the view and gave it some highlighting + dynamic height. The section is no longer collapsible.

Changelog: [Layout] Make the layer selection more prominent

Reviewed By: priteshrnandgaonkar

Differential Revision: D27708650

fbshipit-source-id: c86a55c3a20794aee86e64b6766b2ca4dd6b563f
2021-04-15 07:48:33 -07:00
Michel Weststrate
5db2ef1275 Perf fixes
Summary:
This diff fixes some more perf bottlenecks in the layout inspector (see the diffs earlier in the stack for the total picture). Mostly:

1. Pass down stable refs from the root for callbacks and configuration
2. Remove the deep-equality check in the sidebar section rendering, which has a pretty significant constant overhead, especially if the selection didn't change
3. If the selection changes, the correct semantics is to reset the sidebar rather than trying to reconcile the elements. (A consequence of this is that Panel collapse state isn't preserved atm after changing selection, will address that in a later diff)

This reduces average render time for sidebar from ~20 to ~2 ms.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27677353

fbshipit-source-id: ba183b7e3d778c0b3c8e7ca0d51535ce99a097ca
2021-04-15 07:48:33 -07:00
Michel Weststrate
7d9495027b Fix layout inspector re-rendering all elements on all changes
Summary:
Changelog: [Layout] Addressed several performance issues in the layout plugin

This diff and a few of the next stuff fix some performance issues in the Layout plugin. This diff fixes an issue where computing the context menu will cause all rows to render at all times, make the responiveness of the plugin quite slugish.

The fix in this case is to build up the context menu lazily, and pass a stable ref to the function through the tree, rather than a new menu every time the root component renders.

The changes in this diff and the next ones in total reduces the time (in prod builds) to draw a frame from ~200ms to ~5ms.

Reviewed By: cekkaewnumchai

Differential Revision: D27685983

fbshipit-source-id: a48b2ce2cdd1db31bb13122924617cbc3b6c198a
2021-04-15 07:48:33 -07:00
Michel Weststrate
69de9bc92d Initial move to flipper-plugin
Summary:
This diff moves the core of ElementsInspector to flipper-plugin and decouples it from legacy design system and Electron, without any significant improvements or API changes yet, which will follow later.

Colors and docs will be added later in this stack.

Reviewed By: passy

Differential Revision: D27660300

fbshipit-source-id: 96abfa3b3174fa852cf04ae119c23c3d629fee74
2021-04-15 07:48:33 -07:00
Michel Weststrate
53c557f923 Move DataInspector to flipper-plugin
Summary:
This diff moves the rest of the DataInspector jungle to flipper-plugin. No actual improvements are made yet, but the code is decoupled from Electron and the legacy theming. For example by using Antd based context menus.

Note that `ManagedDataInspector` is now rebranded `DataInspector`, as that is the only variation that should (and is) used publicly.

For the interactionTracker removal, see next diff.

SearchableDataInspector will be addressed in a next diff

Reviewed By: passy

Differential Revision: D27603125

fbshipit-source-id: 188bd000260e4e4704202ce02c7fc98319f0bc22
2021-04-07 07:55:13 -07:00
Michel Weststrate
9030a98c6e Move DataDescription utility to flipper-plugin
Summary:
Another utility component used by DataInspector.

Colors have been hardcoded for now, to decouple from the classic Flipper color palette. Will organize this better later in this stack, and when addressing / adding support for dark mode.

Buttons, checkboxes, selects have been replaced by Antd's counterpart.

Unlike ManagedDataTable, the DataInspector is primarily moved rather than copied & adapted, as the underlying abstraction / API won't change significantly. So the changes here will immediately affect all plugins in Flipper using this component.

Reviewed By: passy

Differential Revision: D27603126

fbshipit-source-id: bacd48c9af2b591033e7f2352627f11acb4df589
2021-04-07 07:55:13 -07:00
Michel Weststrate
b6674bf96b Move highlighter to flipper-plugin
Summary: This stack moves the DataInspector component to flipper-plugin. The first diffs will move some utility abstractions to turn this into smaller steps

Reviewed By: passy

Differential Revision: D27591890

fbshipit-source-id: d0285ca31b6c9b334000dd15c722b9bda7638d73
2021-04-07 07:55:12 -07:00
Michel Weststrate
cd27e4c010 Folder rename datatable -> data-table
Summary: just a rename, as we will have `data-inspector` folder as well in next diffs.

Reviewed By: passy

Differential Revision: D27591891

fbshipit-source-id: b1fe92cbf4be1633e623e59b694efc3f687c3413
2021-04-07 07:55:12 -07:00
Michel Weststrate
1060ea6e9e Fix message truncating failing in production builds
Summary: Message truncated worked in devs build, but failed in production build, as it JSON formatted React elements in prod build (incorreclty), while it didn't do so in Dev builds, as in dev that generates an exception (undesired) meaning the serialisation gets skipped (desired).

Reviewed By: passy, nikoant, priteshrnandgaonkar

Differential Revision: D27467280

fbshipit-source-id: 1f8e0ca4750464c778c33b69a8cf13d05f019143
2021-03-31 09:24:32 -07:00
Michel Weststrate
220ebbc601 Make autoScrolling explicit
Summary:
Changelog: Added an explicit autoscroll indicator in logs and fixed snapping

We got several reports that auto scrolling was to aggressive, so revisited the implementation and the new one is a lot more reliable. Also added an explicit indicator / button to toggle tailing.

Exposed ant's active color as well in our theme, as it gives better contrast on the buttons than Flipper purple.

Reviewed By: passy

Differential Revision: D27397506

fbshipit-source-id: 5e82939de4b2f8b89380bd55009e3fa2a7c10ec9
2021-03-31 03:44:34 -07:00
Michel Weststrate
8cd38a6b49 Fix redraw after resizing elements
Summary:
Fixed a longer standing issue where after a horizontal resize the rows wouldn't redraw until new data arrives (or the user scrolls), resulting in rendering artefacts.

Also introduced a hook to force a reflow of contents if the contents of a hook changes. It's a bit leaky abstraction, but does keep the virtualization performant if dynamic heights are used.

Reviewed By: passy

Differential Revision: D27395516

fbshipit-source-id: 1691af3ec64f1a476969a318553d83e22239997c
2021-03-31 03:44:34 -07:00