Commit Graph

3287 Commits

Author SHA1 Message Date
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
Anton Nikolaev
9b99d58acc Removed unused dependencies
Summary: Removed dependencies from package.json which are not referenced anywhere in code.

Reviewed By: passy

Differential Revision: D21187840

fbshipit-source-id: e5a69be01ad3e592f2782b7921bc95bff833e267
2020-04-23 05:33:20 -07:00
Anton Nikolaev
ec07272c78 Linter checks for extraneous dependencies
Summary: Added eslint rule "no-extraneous-imports" which disallow using modules which are not listed as dependencies in the corresponding package.json. Fixed a bunch of reported errors after the rule applied.

Reviewed By: passy

Differential Revision: D21186848

fbshipit-source-id: 0af9ac4b3fffdfd0ab7c23ae4ff12a3f5989d5e9
2020-04-23 05:33:20 -07:00
Pritesh Nandgaonkar
17ccdeaf6f Change the export logic for the Inspector
Summary:
This enables the feature which showed the theme information in the layout plugin. It was disabled due to the OOM which occurred while exporting flipper trace. The OOM happened when we tried to serialise the whole layout hierarchy and the amount of info added per node by the theme info was quite heavy. Thus removing it solved the OOM problem at that point, but its not the correct solution.

The problem is that each node has too much information and sending it at one stretch is very heavy and causes OOM. So instead of sending it at one stretch, I have broken it into multiple calls at each level of the tree. This no longer causes OOM and we will be able to show theme information too.

Also for iOS we don't have AXNodes call or AXRoot feature implemented, so anyway I had to put a check to not make those calls, so instead I have kept the feature of fetching all nodes on the iOS instead, as there has been no problem on the iOS side with regards to the OOM. But I am indifferent, the same logic will work for iOS too, it might increase the time to export.

issue discussed [here](https://fb.workplace.com/groups/flippersupport/permalink/854729375007722/)

Reviewed By: jknoxville

Differential Revision: D21136057

fbshipit-source-id: becd237a6d53c50af082597f2e8ed790c25cb966
2020-04-23 04:31:17 -07:00
Pritesh Nandgaonkar
9d0d900b05 Pass supportsMethod as an argument to the exportPersistedState
Summary:
This diff adds supportsMethod as a closure which can be used to verify a method is implemented on the client side.

It will be used in the next diff

Reviewed By: jknoxville

Differential Revision: D21176415

fbshipit-source-id: fe16d966c58d36558034ce4ade8f58f8031aab18
2020-04-23 04:31:17 -07:00
generatedunixname89002005306973
3a95875f67 Flipper Snapshot Bump: v0.39.1-SNAPSHOT
Summary: Releasing snapshot version 0.39.1-SNAPSHOT

Reviewed By: mweststrate

Differential Revision: D21199719

fbshipit-source-id: 8413813d2bbda124e216c937c7dde6183fae47dc
2020-04-23 03:57:12 -07:00
generatedunixname89002005306973
99c5a427c7 Flipper Release: v0.39.0
Summary: Releasing version 0.39.0

Reviewed By: mweststrate

Differential Revision: D21199718

fbshipit-source-id: 1082098a2b4fcfaa7b7efb201e8321331fd4bdc4
2020-04-23 03:57:12 -07:00
Michel Weststrate
f07d898a35 Use fragments instead of arrays when returning elements
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
2020-04-23 03:47:32 -07:00
Michel Weststrate
67412bfb43 Fix scrolling of query items and JSON details view
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
2020-04-23 03:47:31 -07:00
Michel Weststrate
4665bcf218 Introduced Layout component
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
2020-04-23 03:47:31 -07:00
Andrey Mishanin
8936ec540c More robust regex for stack frames
Summary:
- Library name can contain whitespace and dots.
- Not using fixed number of whitespace characters.

Reviewed By: fabiomassimo

Differential Revision: D21185820

fbshipit-source-id: 429656dc03b6450ef61383ed91b5aee132802ca8
2020-04-23 03:09:59 -07:00
Pascal Hartig
f5ed06cbd7 Remove unused pattern.gif
Summary: Can't find a reference to this.

Reviewed By: jknoxville

Differential Revision: D21177180

fbshipit-source-id: 52da3987d99d2648d67aa65a20b796be94d9b856
2020-04-23 02:05:56 -07:00
Pascal Hartig
65f935efab Fix CFBundleVersion
Summary:
This defaults to the `version` and is used to update the inline plists
of the Frameworks that are bundled with the MacOS app bundle. Setting
them to a fixed value means that they remain unchanged across rebuilds
(bringing them in line with Linux and Windows equivalents). This
is required to ship them as separate bundles for the launcher.

Why 50? The reason this was introduced was to allow people to override
this to values >= 50 as this is somehow a Mac App Store requirement:
https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643

Reviewed By: priteshrnandgaonkar

Differential Revision: D21179072

fbshipit-source-id: a6f10b7508526b4305b229bd160d6e570ddce822
2020-04-23 01:49:36 -07:00
Anton Nikolaev
1509180929 Fixed warning about using kebab-style for emotion styling
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
2020-04-22 14:03:08 -07:00
Chaiwat Ekkaewnumchai
f3edfb36db Fix Stream Closed IOException
Summary:
Original Issue: https://github.com/facebook/flipper/issues/993

The exception occurs when OkHttp and we try to read request body twice, while it can be only read once.

Hence, we will read request body after it is processed by OkHttp.

Tradeoff for this is requests on Flipper will not appear immediately after fired, but they will appear together with their responses.

There are ways we can get rid of the tradeoff. For example, as demonstrated in D21167308, OkHttp ^3.14.0 contains method `isOneShot`, which can be used to check if we can read request body more than once. Another example is to change server side to accept nullable variable so that we can send request body and others separately.

Reviewed By: passy

Differential Revision: D21175341

fbshipit-source-id: 053789a2c2f28cd8149ea1bb36fd0cfe1c668df7
2020-04-22 09:28:11 -07:00
Anton Nikolaev
1a692ccf08 Fix build for Reactotron plugin
Summary: Fixed build for Reactotron plugin. It was broken because one of dependencies has statement "import * as React from 'react'" which transformed wrongly.

Reviewed By: passy

Differential Revision: D21178313

fbshipit-source-id: d700981a570dc8ded2080910e872b44976b850e8
2020-04-22 09:28:11 -07:00
Anton Nikolaev
2890306ad5 Disable asar packing as it doesn't play well with Metro
Summary: Disabled asar packing until Metro removed from Flipper bundle

Reviewed By: passy

Differential Revision: D21178188

fbshipit-source-id: e8508fd65fec3e31a7bed8d391149a57c5416863
2020-04-22 09:28:11 -07:00
Michel Weststrate
a6ac9a0b6c Update fs-extra
Summary:
Major update without breaking changes, but from changelog doesn't sound like it will affect us. Does require node 10. But afaik that is what we require already anyways.

Closes #907

Reviewed By: passy

Differential Revision: D21137620

fbshipit-source-id: dd7a64ba334f95733997acbb52eee7d8f3322ec4
2020-04-22 07:38:45 -07:00
Andrey Mishanin
e4ea3ecec6 Tree generation search
Summary:
Added the ability to search tree generations for a particular component. As soon as you start typing in the search bar, only relevant timeline tracks would be displayed.

Currently, I'm looking for the search string in `component_class_name` of the payload and among all nodes in the tree.

Reviewed By: fabiomassimo

Differential Revision: D21175734

fbshipit-source-id: 642c628350192697980becd20352d303200a031e
2020-04-22 05:16:33 -07:00
Pascal Hartig
7e768f3e1f Remove unused static resources
Summary: It seems that these are not referenced anywhere in the repository.

Reviewed By: mweststrate

Differential Revision: D21176051

fbshipit-source-id: 502d4a2020d230f8c57bee31e15fbcf996484676
2020-04-22 05:07:07 -07:00
Anton Nikolaev
2595e40c59 Fixed plugin compilation in release build
Summary: Fixed plugin compilation in release build. One dependency was missing from the final package.

Reviewed By: jknoxville, passy

Differential Revision: D21174687

fbshipit-source-id: 311e04b3ab782093bdbb8f1b81191380320e94d0
2020-04-22 04:22:28 -07:00
Michel Weststrate
c611ae12f0 Flipper Snapshot Bump: v0.38.1-SNAPSHOT
Summary: Releasing snapshot version 0.38.1-SNAPSHOT

Reviewed By: nikoant

Differential Revision: D21155372

fbshipit-source-id: 97360d17c973162db2ece2078c0d4c24df5a414e
2020-04-21 13:10:57 -07:00
Michel Weststrate
18b88a7e03 Flipper Release: v0.38.0
Summary: Releasing version 0.38.0

Reviewed By: cekkaewnumchai

Differential Revision: D21155371

fbshipit-source-id: 554393fc357135cd8538c9b77eee023f8a3e1525
2020-04-21 13:10:56 -07:00
Adam Ernst
d66484822b Allow subdescriptors to return nil to signal no data
Summary: Currently subdescriptors are *always* rendered. Allow them to return `nil` to signal that they don't need to be rendered.

Reviewed By: cuva

Differential Revision: D21157249

fbshipit-source-id: 68a83424efc50723e1ec71c069feef8e10037671
2020-04-21 11:53:11 -07:00
Adam Ernst
d0803ecd56 Show mounted ComponentKit views in Flipper
Summary:
Before this diff, Flipper showed *leaf* views created by ComponentKit, but not any intermediate views. Now we show both.

A new node type `SKComponentMountedView` is used for this purpose. Its descriptor `SKComponentMountedViewDescriptor` mostly delegates to its view's descriptor, but redirects back into ComponentKit for children.

Reviewed By: Andrey-Mishanin

Differential Revision: D21130997

fbshipit-source-id: b3c12ea7cc1200962b3ba7c269c48d68b1809948
2020-04-21 11:53:10 -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
Anton Nikolaev
9e3b57bea7 Remove "incremental" option from base tsconfig
Summary: "incremental" option in base config conflicts with "tsc --noemit" which leads to crashes like in D21155831. Removing it from base config, anyway it is explicitly set for all the packages where required (babel-transformer, pkg-lib, pkg)

Reviewed By: timur-valiev

Differential Revision: D21157205

fbshipit-source-id: bb37101521d865bbe737e99637a9bc83a308494e
2020-04-21 10:19:53 -07:00
Timur Valiev
764ba546f7 Move ToolbarIcon to main ui components folder
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
2020-04-21 09:23:46 -07:00
Anton Nikolaev
75fb681eb8 Fixed version bumping for devDependencies
Summary: Fixed bumping versions for local packages added as devDependencies

Reviewed By: passy

Differential Revision: D21154758

fbshipit-source-id: 234fdf073b9bc166eb9deb78a879bc1380d0d1bc
2020-04-21 07:05:07 -07:00
John Knox
4b54eb3ec6 Fix broken asset link
Summary:
Assets should never be referenced by /doc/assets, as it breaks docusaurus' baseUrl conversion.

I'd write a lint rule for this but I don't know if it affects docusaurus v2, might be better to just migrate to that.

Reviewed By: passy

Differential Revision: D21153686

fbshipit-source-id: d839015e989a64f897617855ece77439da388cb7
2020-04-21 06:53:48 -07:00
Michel Weststrate
60ddad7e08 Fix deeplink parsing issue and device plugin highlighting
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
2020-04-21 06:33:25 -07:00
Pritesh Nandgaonkar
c0a9150dd8 Github action to validate Flipper and FlipperKit pod (#1026)
Summary:
This PR adds Github Action to validate the podspec file. Validation is crucial, if it podspecs don't validate then we won't be able publish pods to the trunk.
## Changelog

Add Github Action to validate FlipperKit and Flipper pod
Pull Request resolved: https://github.com/facebook/flipper/pull/1026

Test Plan: Github Action passes.

Reviewed By: mweststrate

Differential Revision: D21130523

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 0116120b9bbb073516798d4d7f08b347ed9755a3
2020-04-21 04:52:33 -07:00
Pascal Hartig
9c18a98f89 Enable build minification
Summary: This shaves another ~6MB of the zipped build. Less than I would have thought, but I haven't looked at the alternative options so far at all.

Reviewed By: nikoant

Differential Revision: D21131772

fbshipit-source-id: 641515d6f36fdeeffa5be81d64c2c1043a9e4e34
2020-04-21 02:10:49 -07:00
Anton Nikolaev
2cf9eeb224 Fix the tests failing on Windows (#1036)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1036

Fixed the tests failing on Windows

Reviewed By: passy

Differential Revision: D21144338

fbshipit-source-id: 3b76a5d42a764a2eec89e26ee0ca94bd739e46bd
2020-04-21 01:42:51 -07:00
Michel Weststrate
ec1bfaf651 disable greenkeeper for the electron stack. Fixes #1017
Summary: Updating Electron is an expensive call (in terms of time investment), and potentially very impactful in a way that is hard to test automated. So should be done consciously rather than for every random patch that appears.

Reviewed By: jknoxville

Differential Revision: D21134157

fbshipit-source-id: 9d208cffa84728aead620d0ec6a6cd1f01f01e2d
2020-04-20 12:45:06 -07:00
Michel Weststrate
04085c490b Bump @typescript-eslint-plugin, fixes #986
Summary: Make greenkeeper happy

Reviewed By: jknoxville

Differential Revision: D21130872

fbshipit-source-id: fd58379400ed7580e82ae5ee5567e1708677ee8d
2020-04-20 12:45:05 -07:00
Anton Nikolaev
1491e111c9 Bundle command
Summary:
Command which transpiles and bundles plugin code.

It is supposed to be used in "prepack" script for all open-sourced plugin packages to bundle them before publishing like this:
```
{
  "devDependencies": {
    "flipper-pkg": "latest"
  },
  "scripts": {
    "prepack": "flipper-pkg bundle"
  }
}
```

Also made directory parameter of other command "pack" optional so it also can be called from plugin directory simply by `flipper-pkg pack`.

Changelog: "flipper-pkg bundle" command for bundling plugins before publishing.

Reviewed By: mweststrate

Differential Revision: D21129691

fbshipit-source-id: 8f97bc950c28cf9ad8b0117c0e1d811ed1b988eb
2020-04-20 11:14:37 -07:00
Anton Nikolaev
105345facd Rename command "bundle" to "pack"
Summary: Renamed command "bundle" to "pack" because the latter name better describe what the command does. Also I'm going to add another command which will only bundle the plugin code and it will be called "bundle" (see the next diff in this stack)

Reviewed By: mweststrate

Differential Revision: D21129690

fbshipit-source-id: 2dde30501c3776d6796c27c68d49948d1f84f822
2020-04-20 11:14:36 -07:00
Anton Nikolaev
3ff2d3bf99 Add "id" field to Flipper plugin manifest
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
2020-04-20 11:14:36 -07:00
Michel Weststrate
bbbf535ea7 Update @types/react-virtualized, fixes #1023
Summary: Make greenkeeper happy. Yay.

Reviewed By: passy

Differential Revision: D21130827

fbshipit-source-id: 8cf39803cd7b587c3ad9abb0bae9f8dc8ea747d0
2020-04-20 10:39:02 -07:00
Michel Weststrate
c37179533c Upgrade ts-jest, fixes #1024
Summary: Make greenkeeper happy. Yay.

Reviewed By: passy

Differential Revision: D21130815

fbshipit-source-id: 936185bfbedf4156427d11a4eb0436420d640100
2020-04-20 10:39:02 -07:00
Michel Weststrate
fb4935d18a Upgrade @types-node, fixes #1027
Summary: Make greenkeeper happy. Yay.

Reviewed By: passy

Differential Revision: D21130793

fbshipit-source-id: 4d0deddf30b8d807707ebac609e408087c26d10d
2020-04-20 10:39:01 -07:00
Michel Weststrate
01772740e7 Update jest2, fixes #1029
Summary: Make greenkeeper happy. Yay.

Reviewed By: passy

Differential Revision: D21130632

fbshipit-source-id: 82e986f810bc40d363fbece90c129cc7732dfae3
2020-04-20 09:49:40 -07:00
John Knox
a5dbfbb82d Fix UI-doc generation
Summary: I noticed the UI components page was empty, the components have been moved and the generator was still looking in the old place.

Reviewed By: passy

Differential Revision: D21131943

fbshipit-source-id: 3310d4f7c88ea0f1e77a13c81eb411f9b1475125
2020-04-20 09:41:42 -07:00
Alexander Kawrykow
c0c96dcd3e Fix typing of graphQLQuery
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
2020-04-20 09:31:08 -07:00
Pritesh Nandgaonkar
9cbd7cbbdd Add github action for testing Sample app (#1025)
Summary:
This PR adds Github actions to verify that the Sample Objective-C, Swift and Tutorial app build successfully.

## Changelog

Add Github Actions for building Sample Objective-C, Swift and Tutorial app.
Pull Request resolved: https://github.com/facebook/flipper/pull/1025

Test Plan: Github Action passes successfully.

Reviewed By: jknoxville

Differential Revision: D21098106

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 6edd5a3cba74b5ea843abba366c4ad9dc550cf4e
2020-04-20 08:42:22 -07:00
Pascal Hartig
70de1dbad8 @allow-large-files [flipper] Flow v0.123.0
Summary: Fix https://github.com/facebook/flipper/pull/1020

Reviewed By: nikoant

Differential Revision: D21091422

fbshipit-source-id: a702d88b0e5f97ad258bfa82b797351ef35462aa
2020-04-20 08:35:55 -07:00
Anton Nikolaev
8a7470556e Re-use pkg-lib for runtime plugin compilation
Summary: Re-use the same function for plugin building both at publishing time by "flipper-pkg" and in runtime by Flipper itself.

Reviewed By: jknoxville

Differential Revision: D21129685

fbshipit-source-id: b7bff6737310352d28a14223128f127ac4d2eebf
2020-04-20 06:59:38 -07:00
Anton Nikolaev
ca2d04a5da Versioning for plugin format
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
2020-04-20 06:03:16 -07:00
Anton Nikolaev
eb34b2f6e3 Disable flow for pkg-lib and lib output folders (#1030)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1030

Currently flow linter is failing on GitHub. This diff disables flow for pkg-lib and lib output folders where it is failing currently.

Reviewed By: passy

Differential Revision: D21129580

fbshipit-source-id: 71f28c8bd0d4b7293bdc8f1be943b5fd77b6b444
2020-04-20 05:19:39 -07:00