Summary: Returning arrays from render kills react-reconciliation and produces missing key warnings. Turned all array rendering methods to use Fragments, where I could find them.
Reviewed By: jknoxville
Differential Revision: D21178253
fbshipit-source-id: 85ddf8adfa79732ccbe68409fdcf150399455983
Summary: This diff fixes the tripple scrollbars in the graphQL plugin, and makes sure scrollbars for the detail panel are properly shown
Reviewed By: jonathoma
Differential Revision: D21177849
fbshipit-source-id: d40173d7e9a45064b608c8d953c7aea47a4acd0f
Summary:
This diff introduces a Layout component.
Layout is now quite randomly build up by using panels, sidebars, flex columns, flexrow and view components. They all have slight different scrolling, overflow, and grow behavior. Which causes issues with areas not being srcollable, double scrollbars or simply the wrong area scrolling. Too make things worse to design, many components by default display hidden content, and show scrollbars automatically rather than deliberately.
To work towards a consist, and especially simple layout model, over time I want to build a consistent outside-in layout model, where always parents reserve space for children, and children fill the available space and device it even further.
Note that this approaches better how 'applications' typically organize their layout, which is opposite from the classic 'document', where the contents is allowed to grow and is used to push things down / aside where they want. However, such a model fits an application with toolbars, sidebars and scroll regions badly, and currently those two philosophies are mixed throughout the application.
This component is a very small first step to organizing our layout consistently. By using a new component there is less risk to break existing layouts. The `Layout` component takes up all available space, both horizontally and vertically, and gives the first child what it needs based on its own size (typically, a toolbar or (resizable) sidebar), and all the remaining space to the second child. By default the space is distributed vertically, but it can also be distributed horizontally. It can provide scrollbars as well if needed so that the main content doesn't need to provide that by itself.
Examples:
```
<Layout scrollable>
<Toolbar />
<LargePicture />
</Layout>
<Layout horizontal>
<ResizableSidebar />
<SomeContentTable />
</Layout>
```
Reviewed By: jknoxville
Differential Revision: D21178245
fbshipit-source-id: c2d2f167d1572278e51a5b66e1cbf13c42c3b898
Summary: Just fixed warning that kebab-style properties are deprecated and camel-case should be used instead
Reviewed By: mweststrate
Differential Revision: D21178489
fbshipit-source-id: 9fba323b3c6ccfce7eb2acc97aa57526305e24ac
Summary: there are two plugins which uses copy-pasted ToolbarIcon and at least one more where it will be helpful. Let's move it to components folder
Reviewed By: nikoant
Differential Revision: D21089290
fbshipit-source-id: a14dcd56633dd24016711e34308b94023fcb40ed
Summary:
This diff fixes an issue where the selected device was not correctly updated when selecting a device plugin, causing the wrong plugin, or none at all, to be highlighted.
This diff fixes an issue where deeplinks were not correctly parsed if formatted as shown in the test plan of D20920587 (it was a different format in the recording, but after looking into it, using `plugin?params` instead of `plugin/?params` is the natural thing to do, so we now support both)
Reviewed By: jknoxville
Differential Revision: D21154190
fbshipit-source-id: c31132aaf7213ee1c3c188a6a1cf2b6bcc7b5b00
Summary:
Added "id" field to Flipper plugin manifest which is used to match native and desktop plugin parts. Before that, "name" field was used both as npm package name and as plugin id.
The problem is that currently there are a lot of plugins which has invalid values in "name", e.g. not starting with "flipper-package-", or containing upper cased letters.
Simple renaming of "name" field can be very problematic, so we need a new field to avoid any breaking changes and keep historical analytics data which is also bound to plugin id.
Reviewed By: mweststrate
Differential Revision: D21129689
fbshipit-source-id: efd143c82a6a802cc0b5438fd3f509bd99aded0e
Summary: This was being interpreted as returning `void` which was causing problems when trying to access the resolved value from the request. Fixing to slightly better type of `Promise<any>`
Reviewed By: passy
Differential Revision: D21105552
fbshipit-source-id: 76deb5a83b5220bafed8c12c3f56f339a5215c14
Summary:
Added versioning for plugin format.
The first version is where "main" points to source code entry and plugins are bundled by Flipper in run-time on loading them.
The second version is where "main" points to the already existing bundle and Flipper just loads it without bundling. The plugins of version 2 must be bundled using "flipper-pkg" tool before publishing.
Changelog: Support new packaging format for plugins.
Reviewed By: mweststrate
Differential Revision: D21074173
fbshipit-source-id: 7b70250e48e5bd5d359c96149fb5b14e67783c4d
Summary:
This change makes it possible to remove preferences. I also added a `Delete` context menu option to `DataInspector` because I needed it to implement this feature. passy confirmed that it makes sense to add this because delete is a common action.
Fixes https://github.com/facebook/flipper/issues/451
Pull Request resolved: https://github.com/facebook/flipper/pull/1018
Reviewed By: jknoxville
Differential Revision: D21086308
Pulled By: passy
fbshipit-source-id: 551ff0908d5e6c93f58d6012b42e1ee3531de997
Summary: I think it is good to have error handlers where-ever possible, so that there is historical data in our monitoring when we need it, and can track from which point of the code it originates :)
Reviewed By: jknoxville
Differential Revision: D21040059
fbshipit-source-id: 1c07fbfa65379739554bc98f83761ae97870ba82
Summary: Unity is using this, and I noticed it was showing up as Web Browser which is a bit misleading.
Differential Revision: D21067698
fbshipit-source-id: 93d6a598824e61490e0eadd1b2c9fb3ebc12d01c
Summary:
I was trying to plot some graphs based on our background plugin stats, grouped per plugin, but discovered that we can't exploded or group on json object keys, so separated the data into separate `plugin-stats-plugin` events, as is done with the `time-spent` event.
Also fixed:
* grouping stats per plugin, rather than per plugin method, which was to fine-grained
* added `bytesReceived` field to the cumulative event `plugin-stats`
Reviewed By: jknoxville
Differential Revision: D21046016
fbshipit-source-id: 1043612064921cf6427d5b3bbee10b76776df39e
Summary:
D20920582 was unfortunately not enough to fix ability for Flipper to connect to packages that are running as services without an `<application>` tag in the manifest.
The issue there is that the push of `sonarCA.crt` succeeded due to erroneous changes to the target package.
This change ensures both pull and push are covered.
Reviewed By: jknoxville
Differential Revision: D21024673
fbshipit-source-id: cad86ba9ae3b02a99187d3f6bd3b500d2a4b971a
Summary:
Solves this T65385916.
Before this diff the bugreporter showed a disabled UI while waiting for the upload to finish. Its confusing for the user as, it can be seen from the above the task. Thus I added an intermediate UI with a spinner and a text "Submitting..." which makes it clear for the user that we are uploading a bug report.
Reviewed By: mweststrate
Differential Revision: D21017426
fbshipit-source-id: ce12dfbefc8726adfad9ef17abd744cc92c254ed
Summary:
This diff enables optional [Fast Refresh](https://reactnative.dev/docs/fast-refresh) for Flipper in dev mode. It can be opted-in using additional argument "--fast-refresh": `yarn start --fast-refresh`. I've copy-pasted the most part of implementation from React Native with some minor changes.
I made this optional for now as it works not ideally. In most cases which I checked it works fine, however for some files it falls back to full refresh (e.g. when `desktop/plugins/network/index.tsx` changed) and sometimes doesn't refresh content even after change detected and re-compiled (e.g. when `src/ui/components/searchable/Searchable.tsx` is changed, Network plugin which is dependent on it is not refreshed automatically).
State from redux is restored after fast refresh, but local state in class-based components is cleared. For function-based components local state is also stored, so it's an additional point to make plugins components functional :)
Also, for now there is no UI for Fast Refresh (loading indicator etc), information is just logged to console.
Changelog: Experimental support for Fast Refresh in dev mode can be enabled by `yarn start --fast-refresh`.
Reviewed By: jknoxville
Differential Revision: D20993073
fbshipit-source-id: 65632788df105a85fac0b924b7808120900b349e
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/998
After this diff all the default plugins (which are distributed with Flipper) will be included into the main app bundle instead of bundling each of them separately and then loading from file system. This is done by auto-generating plugins index in build-time and importing it from Flipper app bundle, so Metro can follow these imports and bundle all the plugins to the app bundle.
This provides several benefits:
1) reduced Flipper bundle size (~10% reduction of zipped Flipper archive), because Metro bundles each of re-used dependencies only once instead of bundling them for each plugin where such dependency used.
2) Faster Flipper startup because of reduced bundle and the fact that we don't need to load each plugin bundle from disk - just need to load the single bundle where everything is already included.
3) Metro dev server for plugins works in the same way as for Flipper app itself, e.g. simple refresh automatically recompiles bundled plugins too if there are changes. This also potentially should allow us to enable "fast refresh" for quicker iterations while developing plugins.
4) Faster build ("yarn build --mac" is 2 times faster on my machine after this change)
Potential downsides:
1) Currently all the plugins are identically loaded from disk. After this change some of plugins will be bundled, and some of them (third-party) will be loaded from disk.
2) In future when it will be possible to publish new versions of default plugins separately, installing new version of such plugin (e.g. with some urgent fix) will mean the "default" pre-built version will still be bundled (we cannot "unbundle" it :)), but we'll skip it and instead load new version from disk.
Changelog: Internals: include default plugins into the main bundle instead producing separate bundles for them.
Reviewed By: passy
Differential Revision: D20864002
fbshipit-source-id: 2968f3b786cdd1767d6223996090143d03894b92
Summary: We cannot just add internal plugins as workspaces to the root package.json in "sonar/desktop" as they are not open-sourced, so public build will break. Instead, I have created root package.json for internal plugins and added all internal plugins as workspaces there. This means all these plugins will use the single root yarn.lock and installation of their dependencies will be faster. This also means that plugins can declare dependencies to other local packages included into workspaces and they will be symlinked automatically.
Reviewed By: mweststrate
Differential Revision: D20806237
fbshipit-source-id: f8b3327166963dec7da8ac74079682aebe4527e1
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/969
Added all public plugins as workspaces to the root package.json. This means all these plugins will use the single root yarn.lock and installation of their dependencies will be faster. This also means that plugins can declare dependencies to other local packages included into workspaces and they will be symlinked automatically.
Changelog: Internals: plugins added as "yarn workspaces" into the root package.json to simplify dependency management between them
Reviewed By: mweststrate
Differential Revision: D20805231
fbshipit-source-id: e85c62d3195d1ea3c5c60def6ca12318a2b53466
Summary: Adding id field for the currently logged in user in the store's state
Reviewed By: passy
Differential Revision: D20928642
fbshipit-source-id: eff5373bd88ed8fd228193b47649f586cf20b585
Summary: As per the title it adds the CK support to the Flipper's support form.
Reviewed By: jknoxville
Differential Revision: D20943408
fbshipit-source-id: bc8f0ac6a4974fe8258e91d7ac9437931c4d4abd
Summary: Allow optionally to provide the device title to select a plugin in. Currently, there's only support for `flipper://<app>/<plugin_id>`. This allows to add a `?device=<specifier>`.
Reviewed By: mweststrate
Differential Revision: D20920587
fbshipit-source-id: e7df4b510f1adfa9c2c9d072f6aebca1edb89cc0
Summary: When an android package is not an application, the `run-as` command will fail. In this case, the package might be an operating system service package. In this case, it may be possible for the user to run adb as root. Note that Flipper does not restart adbd via `adb root` on behalf of the user; the command is simply retried without `run-as`.
Reviewed By: jknoxville
Differential Revision: D20920582
fbshipit-source-id: 8db86084c3c3a61d8322edb1e34fdfdf48d0412d
Summary:
Added a graph to show how much data is sent to plugins. The tooltip shows a sorted overview of the amount of data.
Will put up a GK so that plugin devs can get this data also more easily
Reviewed By: jknoxville
Differential Revision: D20919321
fbshipit-source-id: f2b78b21ef34551e0ed562b009589d2a5dba9ff3
Summary:
Measure how many byte we receive per plugin, and add this to the plugin stats that are collected
Will add a graph to the flipper dashboard, and probably a small visualization in a next diff as well.
Reviewed By: priteshrnandgaonkar
Differential Revision: D20917583
fbshipit-source-id: bb341531ecf8492080af82c56e73c0ec608f7b36
Summary:
* Fixed issue where the test wouldn't be reliable if it fired to quickly since the process has started
* Increased all test timings with a factor 10, to make the test less sensitive to system load
Reviewed By: passy
Differential Revision: D20914978
fbshipit-source-id: a3870e6374e61cf9ec1b11da529077876ef85bf8
Summary:
This adds another field to the exit data to record whether we had a clean exit where the app was closed as it should.
Note that doing a reload inside Flipper will be recorded as an unclean exit.
Reviewed By: passy
Differential Revision: D20915481
fbshipit-source-id: 240192d7a69bf620bfaa316e3e5cb0f45d6a34cc
Summary:
D20559197 inadvertantly broke support for old SDKs by properly handling an
exception that we previously ignored. However, this meant that Android versions
that don't support reverse-proxying will not fail to get registered although
they're otherwise supported.
Changelog: Fix connections on Android devices with older SDKs (19)
Reviewed By: jknoxville
Differential Revision: D20868923
fbshipit-source-id: 409fe20a0875dc26ecc971d33264a1145012d586
Summary: Accept websocket connections from any localhost origin, in addition to the existing chrome extensions support.
Reviewed By: jknoxville
Differential Revision: D20792131
fbshipit-source-id: d3991aa375bfb4e6f492c02dfab9bf72b1f8c412
Summary:
The url for the getting started page was changed yesterday. (no longer getting-started.html)
This fixes some links that were broken because of it.
Reviewed By: cekkaewnumchai
Differential Revision: D20855343
fbshipit-source-id: 788efb75f3581e4fe6cecd5f69f11dd64b03e7df
Summary: Adding a role and tabIndex because it's clickable.
Reviewed By: mweststrate
Differential Revision: D20814436
fbshipit-source-id: 2d5acc06363df0cce1c24df7e77b1a6eaa98ab63
Summary:
changelog: Add scroll to inspected element in layout plugin
Before this diff, when one inspected an element, one needed to scroll down to see highlighted line for that element. This diff added automatic scroll to inspected element. It will scroll so that the line is in middle of the app.
Also, fix direct state mutation and this error:
```
Public property 'onKeyDown' of exported class has or is using private name 'Element'.
```
Reviewed By: passy, mweststrate
Differential Revision: D20798587
fbshipit-source-id: 763eb63cd51abd73940e301e36e89232033722c3
Summary:
There was a problem for the next diff because ContextMenu doesn't forward reference to child elements which causes no component attached to ref.
This diff forward ref of ContextMenu to its child. Also, there is casting because of genetic functional component used by NotificationHub
Reviewed By: mweststrate
Differential Revision: D20817968
fbshipit-source-id: d0a19a447decca73db53f02ea029f56fc7127e94
Summary:
Launcher was sort of a proxy for cases where we *wanted* to have an update
mechanism but possibly couldn't use it, e.g. Windows at FB.
This makes sure we can also show this in OSS.
Reviewed By: nikoant
Differential Revision: D20770804
fbshipit-source-id: 62d2dddf9cbd22d51098dda65eea50df420a3078
Summary: This diff adds the capability to show the plugin names for which flipper failed to fetch metadata. These changes are done for both export as URL and export as File. This diff also fixes the logging for the export as a file and logs the result object in scuba.
Reviewed By: jknoxville
Differential Revision: D20724860
fbshipit-source-id: 4c9591267ca05045e0ed084804d96851c9d7636d
Summary: Publish all the public packages (excluding those with "private=true") included as workspaces to "desktop" project.
Reviewed By: jknoxville
Differential Revision: D20765097
fbshipit-source-id: 444541e9a682a90eba02cb3da85ada9bd00d93d0
Summary:
Automatically bump versions for all local npm packages included as workspaces and fix local dependencies correspondingly.
As a part of this I have also aligned versioning for all the packages by using the same version for all of them.
Reviewed By: jknoxville
Differential Revision: D20745632
fbshipit-source-id: 2d438c4b23ee72f7d7c068c5ce161063c7ceb9e5
Summary: Import ws package in a usual way instead of importing it as source code
Reviewed By: jknoxville
Differential Revision: D20724584
fbshipit-source-id: 39cad6e544b71e66560a9351f1e5a0c89be2c152
Summary:
Before we dropped all messages if the client connected before the device has been registered. Which happens typically on iOS (it can actually take very long, will investigate that as well, but not in this diff).
However, we don't need to wait for the device to process messages, we just need its serial, which we already know (given that we use that query id to find the matching device in the first place).
I think this will greatly improved perceived stability for iOS
Reviewed By: jknoxville
Differential Revision: D20734892
fbshipit-source-id: f98e8d31558ef606b9a8287e03fc41ab6c3a087d
Summary: See previous two diffs, this applies the abstraction to our code base
Reviewed By: passy
Differential Revision: D20679687
fbshipit-source-id: 05e340dca3f832971783a844a78d1ffd553ff9d2
Summary:
This diff introducing the sideEffect abstractions, that creates a fundamental solution for the problem in D20619226: If a subscription to the store errors, the entire store can't be updated anymore, bringing the entire app to a halt.
Applying this abstraction will be done in a next diff.
To essential idea of sideEffect is that it fixes a few problems:
1. I decouples and throttles the effect so that no arbitrary expensive burden is added to every store update
2. It makes sure that a crashing side effect doesn't crash the entire store update
3. It helps with tracing and monitoring perf problems
4. It puts the side effect behind a selector so that the side effect is only triggered if a relevant part of the store changes, like we do for components.
Note that if some subscription _must_ be handled synchronously, than that logic should be in a reducer, not in a subscription or side effect. Luckily we don't have any examples of that in our code base.
This abstraction might actually be intesting to be shared wider for fun and profit.
Reviewed By: passy
Differential Revision: D20625872
fbshipit-source-id: adaf8356950594d50e6a99a17a862f757c3777db