Commit Graph

115 Commits

Author SHA1 Message Date
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
John Knox
808d173c89 Fix docs: Typography.Heading => Typography.Title
Summary:
Noticed this while migrating

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: passy

Differential Revision: D28057969

fbshipit-source-id: a8b7c1159c13e666abc3bab54fafae302e18e8dd
2021-04-28 06:52:37 -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
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
fe10e9dcc2 Additional migration notes
Summary: Extended migration notes a bit based on feedback of the process so far

Reviewed By: passy

Differential Revision: D28025556

fbshipit-source-id: a3743a76c8a91b16cc3e669494de07baaa8199e6
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
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
John Knox
13ce7741a6 Fix broken links
Summary: Noticed some broken links while converting plugins

Reviewed By: priteshrnandgaonkar

Differential Revision: D27997670

fbshipit-source-id: fd2715db010a042f749e0908b44a3fb3c6aa6f18
2021-04-26 08:29:12 -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
0e08b63ce3 Fix several links
Summary: Per discussion in parent diff, fixed the links to be idiomatic so that they work in both internal and public builds

Reviewed By: jknoxville

Differential Revision: D27963896

fbshipit-source-id: 35504b04e8975acc419be668804c5d7ad7aa2a16
2021-04-23 04:14:43 -07:00
Michel Weststrate
3af41bfdd1 Add migration guide to convert from classic to Sandy plugins
Summary: Added migration guide from classic to Sandy plugins

Reviewed By: passy

Differential Revision: D27908674

fbshipit-source-id: d4b5a0b45e314226825375d762902041f90c04c8
2021-04-23 01:55:54 -07:00
Michel Weststrate
e29222fba7 Update and patch loading React DevTools
Summary:
When trying to run some React component performance profiles, the updates registered made absolutely no sense (components rerendering without any parent or other cause causing them to render etc). That turned out to be caused by having an outdated version of the React devTools in Flipper.

Sadly the newer version of the React DevTools didn't work with our current Electron version anymore. Some horrible hacking is needed to work around that.

To help with updating the tools in the future (they are by default cached forever on the local machine), I've introduced the `FLIPPER_UPDATE_DEV_TOOLS` variable.

The plugin loading work around is inspired by https://github.com/electron/electron/issues/23662#issuecomment-787420799

Reviewed By: passy

Differential Revision: D27685981

fbshipit-source-id: c35e49aff9b2457b63122eeee0d5c042ddd3b08b
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
Anton Nikolaev
5b0f7e8757 Docs on how to include fb-only parts into open-sourced plugins
Summary: Added docs on how to include fb-only parts into open-sourced plugins

Reviewed By: mweststrate

Differential Revision: D27678276

fbshipit-source-id: e0c3de8ed57a7d25f291e8e6ac15ed32812a0cbc
2021-04-09 08:57:15 -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
Pritesh Nandgaonkar
6479c7e642 Add documentation for www certificate exchange
Summary: Adds documentation regarding www certificate exchange.

Reviewed By: jknoxville

Differential Revision: D27592932

fbshipit-source-id: 2284f77c6bf4fdd638588e2272598cb4ef370526
2021-04-06 09:09:05 -07:00
Bartosz Kaszubowski
40e6cdebb1 improve docs code blocks highlighting (#2049)
Summary:
This PR adds missing Objective-C entry to the Docusaurus config, fixes Objective-C code blocks label and adds or replaces several code block labels to improve the currently highlighted blocks.

Prism in Docusaurus by default also includes syntax highlight for `jsx` and `tsx`, which improves the nodes and props highlight, so I have used those syntaxes in few places too.

I have also fixed one typo that I have spotted and my IDE made a cleanup of whitespaces in edited files.

## Changelog

* [website] improve docs code blocks highlighting

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

Test Plan:
The changes have been tested running Flipper website on `localhost`.

## Preview

<img width="650" alt="Screenshot 2021-03-12 150934" src="https://user-images.githubusercontent.com/719641/110951135-fff20d00-8344-11eb-96db-1bdc82c8d5ea.png">

<img width="649" alt="Screenshot 2021-03-12 151022" src="https://user-images.githubusercontent.com/719641/110951268-2ca62480-8345-11eb-9d3b-1a48f1267776.png">

Reviewed By: priteshrnandgaonkar

Differential Revision: D27336599

Pulled By: passy

fbshipit-source-id: c2dfb3d8cad4675da0f5e1270cada1e56a0175c0
2021-03-29 02:46:11 -07:00
Michel Weststrate
ba8232f30d Move DetailSidebar to flipper-plugin
Summary: This moves `<DetailSidebar>` component to `flipper-plugin` and documents it. No semantic changes.

Reviewed By: passy

Differential Revision: D27234575

fbshipit-source-id: 74640602d718f84ad999f5dac0420089796ed7fb
2021-03-23 12:56:17 -07:00
Michel Weststrate
7093a932f8 expose client.writeTextToClipboard
Summary: per title

Reviewed By: priteshrnandgaonkar

Differential Revision: D27044508

fbshipit-source-id: 8af99f66ec8203b76ccb3d880e1a184193a389c7
2021-03-16 15:03:48 -07:00
Michel Weststrate
4e2383cdb0 Introduce showNotification API
Summary: Introduced `showNotifcation` to the Sandy API.

Reviewed By: jknoxville

Differential Revision: D27012001

fbshipit-source-id: d3f237910a478400b0f925f0362af485c96072bb
2021-03-16 15:03:47 -07:00
Michel Weststrate
be25df6490 Documented createDataSource, DataSource & DataSourceView
Summary: Per title

Reviewed By: nikoant

Differential Revision: D26978363

fbshipit-source-id: b3cfeda0fb0f6556e1ba9041325ae080cba69a7b
2021-03-16 15:03:47 -07:00
Michel Weststrate
d73f6578a7 Support linkify-ing urls
Summary:
Changelog: The new logs plugin will linkify urls and pretty print json-like messages

This implements one of our top papercuts (see linked task), and the WP request over here: https://fb.workplace.com/groups/flipperfyi/permalink/902949260471370/. Partially addresses

https://github.com/facebook/flipper/issues/1162
https://github.com/facebook/flipper/issues/1010
https://github.com/facebook/flipper/issues/2029

Reviewed By: nikoant

Differential Revision: D26947007

fbshipit-source-id: be0fdb476765905ae6b63bd8799c9c6093014de3
2021-03-16 15:03:47 -07:00
Michel Weststrate
11eb19da4c Introduce column filters
Summary:
Beyond a search across all columns, it is now possible to specific columns for specific values:

* for a row to be visible, all active column filters need to be matched (e.g. both a filter on time and app has to be satisfied)
* if multiple values within a column are filtered for, these are -or-ed.
* if no value at all within a column is checked, even when they are defined, the column won't take part in filtering
* if there is a general search and column filters, a row has to satisfy both

Filters can be preconfigured, pre-configured filters cannot be removed.

Reseting will reset the filters back to their original

Move `useMemoize` to flipper-plugin

Merged the `ui/utils` and `utils` folder inside `flipper-plugin`

Reviewed By: nikoant

Differential Revision: D26450260

fbshipit-source-id: 11693d5d140cea03cad91c1e0f3438d7b129cf29
2021-03-16 15:03:44 -07:00
Michel Weststrate
86ad413669 Initial logs with datasource / datatable setup
Summary:
First rudementary setup of DataTable component that follows a data source. Initially used react-virtuose library, but it performed really badly by doing expensive layout shifts and having troublesome scroll handling. Switched to react-virtual library, which is a bit more level, but much more efficient, and the source code is actually understandable :)

Features:
- hook up to window events of datasource
- high and low prio rendering, based on where the change is happening (should be optimized further)
- sticky scrolling support
- initial column configuration (custom rendering, styling, columns etc will follow in next diffs)

Reviewed By: nikoant

Differential Revision: D26175665

fbshipit-source-id: 224be13b1b32d35e7e01c1dc4198811e2af31102
2021-03-16 15:03:43 -07:00
Michel Weststrate
0dc1abdac4 Initial DataSource setup
Summary:
For context see https://fb.workplace.com/notes/470523670998369

This diff introduces the DataSource abstraction, that can store records. If a key is set a key -> record mapping is stored, to make it easy to update existing records using `upsert`, without knowing their exact index.

Internal storage will be slightly altered in upcoming diffs, so don't pay to much attention to that part.

Reviewed By: nikoant

Differential Revision: D25953337

fbshipit-source-id: 1c3b53a2fcf61abaf061946be4af21d2aecc6c6d
2021-03-16 15:03:42 -07:00
Pascal Hartig
d7e584627a Update testing-rn instructions
Summary: `install` is now ambiguous because of some new plugins we've added.

Reviewed By: mweststrate

Differential Revision: D26633940

fbshipit-source-id: 62369ba76cced905350e62b7782619811b7284a0
2021-02-24 07:29:30 -08:00
John Knox
08b594db5c Upgrade static docs plugin
Summary:
Upgrade the static docs plugin.

You no longer need to import OssOnly and FbInternalOnly in markdown files, so removed those imports too.

Reviewed By: passy

Differential Revision: D26580059

fbshipit-source-id: 2763de2f5fbef41ec2ac7f7bdd147418badb78b6
2021-02-22 09:17:44 -08:00
Anton Nikolaev
1c898bd2da Device plugin management (5/n): Docs
Summary: Updated docs to mention the new way of specifying device plugins compatibility metadata.

Reviewed By: mweststrate

Differential Revision: D26424203

fbshipit-source-id: 313e15ee54a8877c95850a37a13c5684b3c165f0
2021-02-16 10:50:19 -08:00
Pascal Hartig
061ca274fd Add docs for new Android release
Summary:
Tried to give as much context here not just for how it works but also
how to set it up. For other projects and if we need to redo something.

Reviewed By: mweststrate

Differential Revision: D26400452

fbshipit-source-id: 9b41fd1a36c45554c7a7b562b73b4b9753f7ecfe
2021-02-12 04:36:10 -08:00
Michel Weststrate
bb529411b5 Expose current connection status to Sandy plugins
Summary:
Introduced `isConnected` flag on device and plugin client to reflect whether a connection is still available for the plugins, or that they have been disconnected.

Potentially we could expose the (readonly) `connected` state atom for this as well, or an `onDisconnect` event for device pugins, to create a responsive UI, but there might be no need for that, in which case this suffices.

Reviewed By: nikoant

Differential Revision: D26249346

fbshipit-source-id: b8486713fdf2fcd520488ce54f771bd038fd13f8
2021-02-09 04:16:24 -08:00
Michel Weststrate
594fa4d2bc serialize Sandy plugins with serialization utils to support Date/Set/Map
Summary:
Unlike non-sandy plugins, non-sandy plugins weren't serialized using our serialization utility yet. This diff addresses that, meaning that users don't have to bother about how to serialize maps, sets and dates.

Unlike the old fashioned plugins, the `makeObjectSerialize` utility is used, rather than `serialize`. This normalizes the objects, but doesn't serialize them, which is done at the end of the export data process anyway for the whole tree. This avoids creating a double JSON serialization which is fully of ugly escape characters.

This makes the onImport / onExport definition of the logs plugin nicer.

Also improved the docs.

Reviewed By: nikoant

Differential Revision: D26146421

fbshipit-source-id: 6abfb6ee2e3312e2a13a11832ff103dc62fd844c
2021-02-01 11:43:31 -08:00
Michel Weststrate
f2ade40239 Support custom data processing during import
Summary: Per title, this allows for pre-processing data after it is deserialized and before it is stored in the plugin

Reviewed By: nikoant

Differential Revision: D26126423

fbshipit-source-id: bc08a6ab205d2a0d551515563cd85a197595ddb2
2021-02-01 11:43:30 -08:00
Michel Weststrate
34c915a739 Add support for async / custom plugin export
Summary:
Sandy plugins can now set up an `onExport` handler to enable customizing the export format of a plugin: `client.onExport(callback: (idler, onStatusMessage) => Promise<state>)`

Import will be done in next diff

Reviewed By: nikoant

Differential Revision: D26124440

fbshipit-source-id: c787c79d929aa8fb484f15a9340d7c87545793cb
2021-02-01 11:43:29 -08:00
Michel Weststrate
d3430e067f Documented analysing plugins
Reviewed By: passy

Differential Revision: D26019044

fbshipit-source-id: f60e9bcbcc4fce0f741b6778d4bbc1e9efbb353a
2021-01-22 09:14:34 -08:00
Michel Weststrate
9cdb36ec0e Add --public-build option to start an OSS like build of Flipper
Summary: This diff adds the `--public-build` option which allows run a devServer emulating the OSS version of flipper. Technical details are explained in the comments.

Reviewed By: passy, nikoant

Differential Revision: D25944966

fbshipit-source-id: 540855808179582752b8aa646f0b8afd4b78396f
2021-01-18 06:48:03 -08:00
John Knox
c460cb767f Fix deleted page redirects
Summary:
The redirects we added inline in the deleted pages don't work when there's a baseUrl.

This is because it's the standard react-router Redirect component, which knows nothing about docusaurus sites.

We could get around that by adding `useBaseUrl()` calls around all of them, but that's not great.
So changing to using declarative redirects instead, where they are all put in config. This automatically takes care of base urls, and reduces copy-pasted code.

Reviewed By: passy

Differential Revision: D25780599

fbshipit-source-id: c67d3643ab28f0fcd440904baf54c67687781686
2021-01-05 09:24:48 -08:00
Michel Weststrate
69dae5c8e5 Restructured dev workflow docs
Summary: This diff unifies setup and workflow information that was scattered a bit around into one cohesive 'Development workflow' subsection in the 'creating plugins' section of Flipper.

Reviewed By: nikoant

Differential Revision: D25612288

fbshipit-source-id: 5fa7f2d000fb7ab3e1b5c5a4fc8cc1f209252f41
2020-12-17 07:40:58 -08:00
Michel Weststrate
19ea20511c Unify documentation on how to get a plugin instance
Summary: There were 3 pages describing how to obtain a plugin instance, public, ios and android. iOS didn't differ from the public one, and android only in the fact that internally DI is available. So combined the pages with just an optional section for DI inside FB on Android.

Reviewed By: jknoxville

Differential Revision: D25588057

fbshipit-source-id: 3a54ae699130a4c5ba018220708f844a35a8d6a9
2020-12-17 05:07:11 -08:00
Michel Weststrate
51995776d4 Combine client testing documentation
Summary: There was one public page for testing client plugins, and two internal ones. Combined it into a one pager, that has tabs per target, with separate content for internal versus external (didn't combine those as the testing frameworks recommended differ)

Reviewed By: nikoant

Differential Revision: D25588058

fbshipit-source-id: afa151ec0c3a5de26142938d3d389627716f1ff7
2020-12-17 05:07:11 -08:00
Michel Weststrate
a9ad932955 Combine the two pages describing sending data
Summary: send data was documented twice, in the general client API, and in the internal docs where it was specifically combined with obtaining a plugin instance. However, that is a proper public API as well, so combined those two.

Reviewed By: nikoant

Differential Revision: D25588059

fbshipit-source-id: 7135a74b64a87d0c8c3f8f20f7f260469f52d41c
2020-12-17 05:07:11 -08:00
Michel Weststrate
58cbea0017 Fix all docusaurus tabs
Summary: Seems that all tabs were broken after migration to Docusaurus 2.

Reviewed By: jknoxville

Differential Revision: D25586214

fbshipit-source-id: 31a8da4e13fbac01911a03f1f4bab0d2837c9c9a
2020-12-16 07:26:15 -08:00
Michel Weststrate
32a75ecb58 Restructure extending docs
Summary:
This diff restructures the 'extending' section of the docs, and rebrands it to 'creating plugins'. It then restructures this section into 4 top-level items

* Tutorial
* Desktop plugin APIs
* Client plugin APIs
* Workflow

Pages are put under the relevant sections, including pages which were before under internal. Some pages that didn't relate directly to plugin development have been moved to other top level sections (e.g. testing RN).

I didn't do de-duplication between pages yet, that will be done in the next diff.

Overview of changes:

* Extending -> Creating Plugins
* Moved Extending > Other platforms to Setup > Other platforms (as this is about clients, not plugins)
* Moved Internal FB plugin development stuff into Creating Plugins
* Separated Creating Plugins into ‘Tutorial’, Desktop API Reference, Cient API Reference, Workflow
* Remove TypeScript strict page, we are already strict
* Moved QPL linters to api docs and named id QPL lints
* Grouped the different pages on extending Layout plugin (needs deduping still)
* Warning about avoiding custom styling in general
* Moved internal index page to the top of the navigation of FB Internal, rather than at the bottom

Reviewed By: passy

Differential Revision: D25585172

fbshipit-source-id: ba2aa891395097d6aa101809084b915f115ee69d
2020-12-16 05:55:23 -08:00
Michel Weststrate
63e46738c1 Move GK documentation / explanation to the refguide
Summary: ^

Reviewed By: nikoant

Differential Revision: D25559029

fbshipit-source-id: cf47c3f3b9d567ba24b7a6a254a945c763350195
2020-12-15 12:34:14 -08:00
Michel Weststrate
d08aa5d33e Removed void intro page to the tutorial
Summary: The 'extending flipper' introduction page didn't contain anything meaty, so collapsed it into the tutorial introduction, cleaning up the top level navigation.

Reviewed By: passy

Differential Revision: D25531718

fbshipit-source-id: ca0f98186e889e13cb97be8818db3588738e5039
2020-12-15 08:22:31 -08:00
Pascal Hartig
e188469acd Add public release docs
Summary: Per title.

Reviewed By: nikoant

Differential Revision: D25535920

fbshipit-source-id: 63fc1b7f5ea122478a3e82e3345d057bc7be37cd
2020-12-14 11:27:01 -08:00
Michel Weststrate
52862f6083 Introduce isPluginAvailable and selectPlugin
Summary:
Introduced API to replace the deprecated `selectPlugin` in Sandy.

The API can be used to navigate from `device plugin -> device plugin`, or` client plugin -> device / client plugin`

Introduced `isPluginAvailable` as well, so that the user interaction an be fine tuned in case the plugin is not disabled.

Reviewed By: jknoxville

Differential Revision: D25422370

fbshipit-source-id: c6c603f1c68e6291280b3d0883e474448754ded1
2020-12-09 14:36:18 -08:00
Michel Weststrate
8dc321c1ee Verify that all APIs are documented in unit test
Summary: When exposing new top-level APIs from `flipper-plugin`, they should be documented. Added a unit test to enforce this and added documentation for all missing APIs.

Reviewed By: passy

Differential Revision: D25421401

fbshipit-source-id: f5cafc1881de846c8a5dd86e5d094ebd27a66f2a
2020-12-09 05:33:08 -08:00