Commit Graph

50 Commits

Author SHA1 Message Date
John Knox
7e4682b694 Fix the remaining broken links on fbflipper.com
Summary:
Used https://www.brokenlinkcheck.com/broken-links.php#status for now to find broken links and fixed them all.

Would be better to use some automated tool to check this at diff time, but that's not setup yet.

Reviewed By: passy

Differential Revision: D21301702

fbshipit-source-id: f13c8769b15d9f99563fc65dc0544320d07a2bfb
2020-04-29 07:33:43 -07:00
John Knox
6554f23853 Fix numbered list syntax
Summary:
Numbered list syntax changed during the docusaurus migration from v1 to v2.

It looks wrong at https://fbflipper.com/docs/extending/js-setup/

This fixes it.

I searched for "1)" and replaced all numbered lists it found.

Reviewed By: mweststrate

Differential Revision: D21283693

fbshipit-source-id: adeb6e04693f50e0a0cfe4b2de5f4663075c34ce
2020-04-28 17:33:25 -07:00
Anton Nikolaev
1cf3c30b7c "migrate" command for flipper-pkg tool
Summary: "migrate" command for easy migration of existing Flipper plugins to the specification version 2.

Reviewed By: passy

Differential Revision: D21253913

fbshipit-source-id: 9edb170fbaa10e9c3f670d5d68e69f4f6106c151
2020-04-28 05:01:06 -07:00
Anton Nikolaev
d08dfee018 "init" command for flipper-pkg tool
Summary: Added command "init" to "flipper-pkg" which helps to quickly initialise Flipper desktop plugin.

Reviewed By: passy

Differential Revision: D21253819

fbshipit-source-id: 85a2fbde07ecb63737d180d2a7e5cc2846b4f533
2020-04-27 17:34:12 -07:00
Anton Nikolaev
21c574ac80 "lint" command for flipper-pkg tool
Summary:
Implemented json schema for flipper plugin package.json and used it for validation in "flipper-pkg lint" command.

Nice thing about json schema is that it not only allows to validate json, but also can be referenced using "$schema" property in json so IDEs like VSCode can find it and use for code completion, validation and to show properties documentation. I'm going to deploy the schema as a part of documentation website so it can be referenced as https://fbflipper.com/schemas/plugin-package/v2.json.

Also the "$schema" field can be used instead of "specVersion" to determine the specification according to which the plugin is defined. E.g., if specification version 3 would be created, it will be described in schema https://fbflipper.com/schemas/plugin-package/v3.json, etc.

Reviewed By: passy

Differential Revision: D21228294

fbshipit-source-id: f21351e584ef936a7d6b314436448489691f83a6
2020-04-27 17:34:11 -07:00
Michel Weststrate
b9c3d99f44 Stop connecting disabled background plugins
Summary:
Background for this diff: https://fb.quip.com/KqEfAlKYlgme

Some plugins don't respect that stuff (livefeed and graphql), but for others it seems to work fine.

This is just a PoC, there are some present bugs concerning the combination of selecting and bg plugins

Questions to investigate:

- [x] make sure that LiveFeed and GraphQL disconnect properly. There might be more plugins that need that
- [x] verifiy that we don't loose one of the original goals of background plugins, e.g. QPL collecting and sending data from device start. Does this still work as intended after this change?
- [x] how can we observe / measure improvements? Are dev builds more responsive after this? Is the layout inspector smoother for example because no QPL plugins are interweaved?
- [x] how is forward and backward compatibility?
   - If Flipper is updated, but device not: No change I think, as getBackgroundPlugins() will return an empty set, and background plugins are initiated as usual, so old behavior
  - If device is updated, but Flipper not, background plugins won't be started until they are selected. This is a degradation, but hopefully explainable.
- [x] Verify QPL buffer is not unbounded
- [x] Share architecutre changes with team

For Graphql updates: D20943455

Added runtime stats to monitor network traffic (sadly had to redo that since scuba couldn't handle the data format used at first, so probably will hold of landing this diff a week to make sure we can see some effects)

Follow up work:

[x] wait until we released the stat tracking before we release this, to be able to measure the effect?
[x] make sure graphql fix lands
[ ] use side effects abstraction
[ ] fix other background plugins (android only) or fix it in a generic way:

{F234394286}

Changelog: Background plugins will no longer receive a Flipper connection if they are disabled. This should significantly reduce the overall load of Flipper both on the device and desktop when unused plugins are disabled used, which could otherwise generate 10MB/s of network traffic certain scenarios. All plugins *should* be able to handle to this gracefully, but since this is quite a fundamental change, reach out to the Flipper team when in doubt!

Reviewed By: jknoxville

Differential Revision: D20942453

fbshipit-source-id: b699199cb95c1b3e4c36e026b6dfaee7d1652e1f
2020-04-27 09:46:13 -07:00
John Knox
5f1a0548f5 Migrate website to Docusaurus 2
Summary:
Docusaurus 2 is quite a lot more powerful than docu 1 it turns out.
This should convert the website fully.

* [done] Go through migration guide https://v2.docusaurus.io/docs/migrating-from-v1-to-v2
* [done] Convert landing page html
* [done] Convert all images to img tags
* [done] Convert all .md files to .mdx
* [done] Make sure ui-doc generation and including still works
* [done] Scan every page visually for sanity check
* [done] Make sure footer still works
* [done] Make sure search still works
* [done] Change all links/ to links/index
* [done] Change all links.md to links
* [done] Add some custom css to make the navbar look like the old one and darken the footer.

Reviewed By: passy

Differential Revision: D21158717

fbshipit-source-id: 5f45b711b1b6fd5ece4c5c15c55635c7ebbfb568
2020-04-27 04:05:01 -07:00
Anton Nikolaev
e165c2cd95 Desktop plugin development workflow
Summary: Updated docs describing workflow for creating Flipper desktop plugins

Reviewed By: passy

Differential Revision: D21129688

fbshipit-source-id: 68921e5d3784e3ab6b3e8397199b10101348a86a
2020-04-23 05:58:39 -07:00
Pascal Hartig
756987e4bf Fix typo in architecture
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D21158664

fbshipit-source-id: 953d968da18768db91507b4148e53ff8a042c53d
2020-04-21 11:38:33 -07:00
John Knox
5ad8106e3f Fix image links with baseUrl
Summary:
When using baseUrl in site config, it adds a prefix to all link paths.

But for assets, it doesn't work if you refer to them as `docs/assets/...`, you have to use just `assets/...`. Source: https://github.com/facebook/Docusaurus/issues/861

Reviewed By: passy

Differential Revision: D20796933

fbshipit-source-id: 2346e42b8b548f576a1e143f56ee5236eab55073
2020-04-02 03:14:08 -07:00
John Knox
0275d35233 Add lifecycle diagrams for regular and background plugins
Summary:
I think this'll clarify how to use the lifecycle methods.

Diagram edit link: https://excalidraw.com/#json=5696112581148672,nDwD6t1BNXVreQ8YE8917g

Reviewed By: mweststrate

Differential Revision: D20645302

fbshipit-source-id: 0814dbe8421cfe8e85c297bd5bfb4a8f1a83c353
2020-03-25 12:50:29 -07:00
Anton Nikolaev
0e920e8558 Few fixes in docs after folders re-arrangements
Summary: Few fixes in docs after folders re-arrangements

Reviewed By: mweststrate

Differential Revision: D20465905

fbshipit-source-id: f65a154731a9956cd0cb6ab66a42eaeecaaf8af0
2020-03-16 03:29:04 -07:00
Adam Ernst
d9a2167019 Refactor SKSubDescriptor
Reviewed By: d16r

Differential Revision: D20458337

fbshipit-source-id: e8ea848c6e2f7521c5a6c6eb4110bba0bfe25593
2020-03-15 19:42:39 -07:00
Anton Nikolaev
10d990c32c Move plugins to "sonar/desktop/plugins"
Summary:
Plugins moved from "sonar/desktop/src/plugins" to "sonar/desktop/plugins".

Fixed all the paths after moving.

New "desktop" folder structure:
- `src` - Flipper desktop app JS code executing in Electron Renderer (Chrome) process.
- `static` - Flipper desktop app JS code executing in Electron Main (Node.js) process.
- `plugins` - Flipper desktop JS plugins.
- `pkg` - Flipper packaging lib and CLI tool.
- `doctor` - Flipper diagnostics lib and CLI tool.
- `scripts` - Build scripts for Flipper desktop app.
- `headless` - Headless version of Flipper desktop app.
- `headless-tests` - Integration tests running agains Flipper headless version.

Reviewed By: mweststrate

Differential Revision: D20344186

fbshipit-source-id: d020da970b2ea1e001f9061a8782bfeb54e31ba0
2020-03-14 14:35:18 -07:00
Anton Nikolaev
85c13bb1f3 Move desktop-related code to "desktop" subfolder (#872)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/872
Move all the JS code related to desktop app to "desktop" subfolder.

The structure of "desktop" folder:
- `src` - JS code of Flipper desktop app executing in Electron Renderer (Chrome) process. This folder also contains all the Flipper plugins in subfolder "src/plugins".
- `static` - JS code of Flipper desktop app bootstrapping executing in Electron Main (Node.js) process
- `pkg` - Flipper packaging lib and CLI tool
- `doctor` - Flipper diagnostics lib and CLI tool
- `scripts` - Build scripts for Flipper desktop app
- `headless` - Headless version of Flipper app
- `headless-tests` - Integration tests running agains Flipper headless version

Reviewed By: passy

Differential Revision: D20249304

fbshipit-source-id: 9a51c63b51b92b758a02fc8ebf7d3d116770efe9
2020-03-14 14:35:17 -07:00
Anton Nikolaev
3706ea05b3 Another small clarification for VSCode debugging instructions
Summary: A small clarification after the question 7964772f82 (comments)

Reviewed By: jknoxville

Differential Revision: D19619402

fbshipit-source-id: c392c492fe5e9cd46d46c93f617288ac0a4d02a5
2020-01-29 04:09:05 -08:00
Anton Nikolaev
7964772f82 Added information about pre-requisite for debugging in VSCode
Summary: Added information that "Debugger for Chrome" extension is required to be able to debug in VSCode.

Reviewed By: passy

Differential Revision: D19599117

fbshipit-source-id: 7323fb59daae24fe6b914e9ddb450326b135ad2b
2020-01-28 06:14:20 -08:00
Anton Nikolaev
0ed95f2a99 Fix a typo in Debugging docs
Summary: Remote debugging port for Flipper is 9222

Reviewed By: passy

Differential Revision: D19598819

fbshipit-source-id: a749615027fbd0ab998e09f96803055305e4f9d1
2020-01-28 04:53:07 -08:00
Anton Nikolaev
1b3ef5f68f Update Flipper Debugging docs
Summary: Updated "Debugging" page in Flipper docs: added instructions about debugging from Visual Studio Code and Google Chrome.

Reviewed By: mweststrate

Differential Revision: D19578864

fbshipit-source-id: c88c8278feb7c90fe77bde1d883c73079f2147f9
2020-01-27 07:45:16 -08:00
Michel Weststrate
426d17b08d Update docs for JS only plugins
Summary: Added docs on how to write React-Native JavaScript based plugins

Reviewed By: passy

Differential Revision: D19344803

fbshipit-source-id: ad1ea66f1031760729fdaea8a7e6c1ef5dcd5439
2020-01-23 07:11:31 -08:00
Michel Weststrate
9acf23596e Show a message if a background plugin is not starred
Summary:
Since background plugins don't receive data anymore when not starred, we should hint the user about this.

For this diff, I reused the existing statusbar. Although this solution is quite ugly, I think it is better than introducing yet another notification / warning mechanism. Probably we should revisit the layout of this status bar in the future.

Reviewed By: jknoxville

Differential Revision: D19251588

fbshipit-source-id: 1dfd07be383d4ba318f344ebff4b08ed36194c58
2020-01-02 07:14:15 -08:00
Michel Weststrate
0494a84d98 Make sure that plugins don't store events unbounded
Summary:
To avoid plugins to collect data forever and store it (if they are never opened), introduced a hard-coded default limit on how many events will be preserved.

A semantic change is that plugins have to be potentially resistant against missing events. So far, during testing, this didn't seem to cause any problems.

Reviewed By: jonathoma

Differential Revision: D19175912

fbshipit-source-id: 828be941e76b7356c9f5be7e5a49de9a7a31b0d2
2020-01-02 07:14:13 -08:00
Michel Weststrate
cf9f4e0c5b Document how to test JavaScript plugins
Summary: It's not much, but at least more than nothing :)

Reviewed By: nikoant

Differential Revision: D18930725

fbshipit-source-id: b1e5fa203b0020de7b5f16d040808cbb247b8dd4
2019-12-13 07:11:43 -08:00
Michel Weststrate
8da2c8868b Expose Immer's produce from Flipper
Summary: Diff preparing for optimizing GraphQL (and other) plugins, and simplifying writing reducers by others

Reviewed By: nikoant

Differential Revision: D18930858

fbshipit-source-id: 91d176d77543978d65ea50635d4ed380690b1fa2
2019-12-13 07:11:43 -08:00
Anton Nikolaev
c0f902f81a Upgrade to emotion v10
Summary: React 16 is not compatible with react-emotion 9 (it prints warnings, see also https://github.com/emotion-js/emotion/issues/644). So we should upgrade to 10.

Reviewed By: mweststrate

Differential Revision: D18905889

fbshipit-source-id: c00d2dbbadb1c08544632cb9bfcd63f2b1818a25
2019-12-11 09:43:24 -08:00
Daniel Büchele
a72eac27a7 add flipper-plugin keyword to package.json
Summary: For plugins to be discoverable through NPM, they need to have `flipper-plugin` as a keyword. This adds this keyword to all existing plugins (although they are currently not distributed via NPM) and the webside/docs.

Reviewed By: passy

Differential Revision: D17395079

fbshipit-source-id: e42dd31ca39c3754cf729052ee783687748bafe8
2019-09-17 06:21:29 -07:00
Daniel Büchele
378638a451 website updates for TS
Summary: update website to use TS instead of JS

Reviewed By: passy

Differential Revision: D16986666

fbshipit-source-id: 969de3ffcdf4aa594d9811947e5b440e594838e7
2019-08-24 03:28:28 -07:00
Pascal Hartig
d1b17d3ecd Update jssetup for TypeScript
Reviewed By: jknoxville

Differential Revision: D16918664

fbshipit-source-id: 934ad08d60d882b013a3f1d9201d330a6c117bb1
2019-08-21 04:55:33 -07:00
Pascal Hartig
2aabfd98e4 Update search-and-filter.md (#449)
Summary:
Fix some minor typos.
Pull Request resolved: https://github.com/facebook/flipper/pull/449

Reviewed By: danielbuechele

Differential Revision: D15371603

Pulled By: passy

fbshipit-source-id: a64a64039a9275d9b8fce82cb06cec0627bb9af8
2019-05-16 04:22:16 -07:00
Pascal Hartig
3747b15d7b Update styling-components.md (#447)
Summary:
Link to color definitions.
Pull Request resolved: https://github.com/facebook/flipper/pull/447

Reviewed By: danielbuechele

Differential Revision: D15353434

Pulled By: passy

fbshipit-source-id: e1a15ae4979956f2b0529ee86e0a523a93d77006
2019-05-16 02:42:37 -07:00
Daniel Büchele
3df970a7d3 docs: add debugging info
Summary: Adds troubleshooting infos for issues like https://github.com/facebook/flipper/issues/444

Reviewed By: passy

Differential Revision: D15335814

fbshipit-source-id: 96969d61a6842c86123b77817059340fec38a665
2019-05-15 02:53:49 -07:00
John Knox
37101cd1a7 Tidy up error handling page
Summary: Some wording corrections, and added FlipperResponder section.

Reviewed By: passy

Differential Revision: D15200397

fbshipit-source-id: 2d52b1d7cb55b4cb8b0e15f00242201edf520f16
2019-05-03 10:29:43 -07:00
Pascal Hartig
531b5e850c JS custom UI tutorial
Summary:
- Adding tutorial for custom JS UI
- optimizing screenshots
- fixing overlapping screenshots on landing page

Reviewed By: jknoxville

Differential Revision: D15198105

fbshipit-source-id: db53403b84a2c422650a4f80e959dad6e984d274
2019-05-03 10:21:22 -07:00
John Knox
23b35e8006 Add debugging page
Summary: Information about debugging.

Reviewed By: passy

Differential Revision: D15198711

fbshipit-source-id: 587bca43d99908b666c58bb5279fadb61219e9a1
2019-05-03 09:47:59 -07:00
John Knox
0149296fc1 Reorder extending sidebar
Summary:
JS pages first, then client pages.
Would be nice if we had some sort of separator, but I think you can only have two levels.

Reviewed By: danielbuechele

Differential Revision: D15198312

fbshipit-source-id: 6c9f8d8775f513a55c256366448faed13b671767
2019-05-03 07:10:58 -07:00
John Knox
2588338c41 Tidy up and rename "Mobile Setup" page
Summary:
* Renamed to "Client Plugin API" to align with the "JavaScript Plugin API" page.
* Added some more info and reworded some parts.

Reviewed By: danielbuechele

Differential Revision: D15198192

fbshipit-source-id: 2c86b6a852e9ed52b0885eb5b7db8436028489d5
2019-05-03 07:10:58 -07:00
John Knox
d5573644ac Delete communicating and move the missing info into js-plugin-api
Summary: Documents init in the API reference and deletes the now redundant communicating page.

Reviewed By: danielbuechele

Differential Revision: D15198128

fbshipit-source-id: a9b88632b74edd7d9656ed888192db1fbe7f3642
2019-05-03 07:10:57 -07:00
John Knox
f72e4b5122 Tidy up "Sending data to Plugins" page
Summary:
* Made the code snippets uniform across languages.
* Renamed to "Providing data to plugins" because sending hints at sending across the desktop-client connection which is misleading.

Reviewed By: danielbuechele

Differential Revision: D15198081

fbshipit-source-id: e2c318cdc6055c191f47e846b518c26dd21e4a68
2019-05-03 07:10:57 -07:00
John Knox
57af6fa2bf Add JS Plugin API reference page
Summary: This documents all pretty much the entire API.

Reviewed By: passy

Differential Revision: D15187834

fbshipit-source-id: 073c6a0dc40e3373967e9e5c5b7d44ab9c0aa07f
2019-05-03 04:30:09 -07:00
John Knox
49be7fd35f Redefine Js-Setup as JS Plugin Definition
Summary:
The purpose of this page wasn't that clear to me, though the content is pretty focused. I've changed it from JS setup to JS Plugin Definition, and reworded it a bit.
I think it makes sense if this specifies everything to do with plugins on the file system, and the next page talks about what you do in javascript.

Reviewed By: passy

Differential Revision: D15184829

fbshipit-source-id: 6335ebc8d4297ffcbf1ab9860b4f055fe5bbcf87
2019-05-03 04:30:09 -07:00
John Knox
a276af9c1f Show communcating with devices page
Summary:
This page got lost in the reorganisation. Adding it back.
There's still work to be done on the content and organisation of these docs.

Reviewed By: passy

Differential Revision: D15184349

fbshipit-source-id: 76256ba53189579bec363903dc4068a421cafc98
2019-05-02 12:38:31 -07:00
Pritesh Nandgaonkar
d022cd0e42 Add iOS docs draft for Layout Inspector
Summary:
Updated syntax and code references, but someone else please
check the details here.

Reviewed By: jknoxville

Differential Revision: D15181483

fbshipit-source-id: 93ed636c2d72f33151759e822d77e80e3abd6f03
2019-05-02 12:38:31 -07:00
Pascal Hartig
df46c0c63e Add extending Layout Inspector docs
Summary:
Please give feedback on the sidebar placement.

This is only the Android part. I'll put up a second diff copying the iOS thing over
but hope someone can commandeer that and check for accuracy.

Reviewed By: priteshrnandgaonkar

Differential Revision: D15181454

fbshipit-source-id: d32081feefbfb0ffc38890e835a7d5f6b78667ab
2019-05-02 08:44:44 -07:00
John Knox
1d7b526add Don't recommend untemplated use of FlipperClient::getPlugin
Summary: We have a templated function not requiring a downcast, so there's no need to use the non-templated one.

Reviewed By: passy

Differential Revision: D15167856

fbshipit-source-id: 2f125ac9ca62d7ac4c633127104d1cd2954a13fb
2019-05-02 04:10:46 -07:00
Daniel Büchele
b0d2983bd4 docs: add code tabs
Summary: adding code tabs for Android, iOS and C++ to improve readability of pages.

Reviewed By: jknoxville

Differential Revision: D15167691

fbshipit-source-id: e7f602a3a1cbe39ef5da0a15bb0bbfc8f79e8ccc
2019-05-01 11:21:54 -07:00
John Knox
be7aefc044 Add missing full stop (#429)
Summary:
Trivial change. I missed this earlier.
Pull Request resolved: https://github.com/facebook/flipper/pull/429

Reviewed By: passy

Differential Revision: D15166391

Pulled By: jknoxville

fbshipit-source-id: 3d52eb1da6d21afa9217cc17cfe887a686cde280
2019-05-01 10:27:27 -07:00
John Knox
da44a02cad Add Implementing Layout Inspection docs
Summary: Describes the interface that clients should conform to to implement the layout plugin.

Reviewed By: danielbuechele

Differential Revision: D15166234

fbshipit-source-id: b86303f18f33762f09cfc503ece856cfcc887493
2019-05-01 09:15:51 -07:00
John Knox
821408056f Add Searching and Filtering page
Summary: I can't take credit for this, I found it in the internal wiki. Have just modernised it and made it public.

Reviewed By: danielbuechele

Differential Revision: D15165547

fbshipit-source-id: d59344aa6ad47be6ab32b88abcdfc14a7d20c775
2019-05-01 08:31:38 -07:00
John Knox
56b85dd6e3 Write up FlipperClient API.
Summary:
Specifies the API for implementing your own Flipper Client.
I believe this provides everything you need to know to build a flipper-compliant client.
The only snag is that the current certificate exchange procedure would require a change to allow for new OS's, device types etc. It would be much better if we had a TLS-opt out so you don't need to go through all that rigmarole.

Reviewed By: passy

Differential Revision: D15150550

fbshipit-source-id: 2878dcc174807c3f86c0562660e8a3e43e5777b1
2019-05-01 04:10:37 -07:00
John Knox
b3ec8b052b Add Setup and Extending top level navs
Summary: Distinguish between integrating flipper, and developing plugins.

Reviewed By: passy

Differential Revision: D15148448

fbshipit-source-id: 7c772fa1cea7d5ed789a984039afc37bc0b8a927
2019-04-30 11:06:45 -07:00