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
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
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
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
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:
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: 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
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:
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
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
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 />
[](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
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
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
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
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
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
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
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
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
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
Summary: Moved Toolbar to flipper-plugin. No further changes.
Reviewed By: nikoant
Differential Revision: D28027334
fbshipit-source-id: 35de13d87734ae3a8af037166945b1a669106274
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
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
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
Summary: Allow subscribing to Atom state changes
Reviewed By: mweststrate
Differential Revision: D28027692
fbshipit-source-id: 24fd7ea16b013c364bbb1d25b30c48bc698db014
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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