Commit Graph

1288 Commits

Author SHA1 Message Date
John Knox
0445a05e5b Add isMethodSupported to client
Summary: Allows plugins to check if extension commands or new features are enabled in the current app, by calling `this.client.supportsMethod('xxx')`.

Reviewed By: passy

Differential Revision: D14225961

fbshipit-source-id: c9f7f5b3091209f0ce9705d9d3a0ec173edf3e25
2019-02-27 10:10:02 -08:00
John Knox
6dc2215753 Reuse adb client in certificate provider
Summary: Avoid making duplicate clients, and this one uses a more reliable creation method.

Reviewed By: passy

Differential Revision: D14241448

fbshipit-source-id: 95846a373335818758c8c4a282ed4db26b62d986
2019-02-27 05:42:24 -08:00
John Knox
99bb43fe32 Move adb client creation into it's own file
Summary: Allows the created client to be reused.

Reviewed By: passy

Differential Revision: D14241449

fbshipit-source-id: 6bbb64eeb708dce9c24e4581e8480d19af998e47
2019-02-27 05:42:24 -08:00
Pascal Hartig
edbe2555fc Clear adb logcat when clearing Flipper logs
Summary: When using "Clear logs" in Flipper, also flush the native Android buffer.

Reviewed By: jknoxville

Differential Revision: D14225722

fbshipit-source-id: f41ff9013b95fc3271d3ae44910da18023708d2d
2019-02-26 16:33:19 -08:00
Pascal Hartig
ea03aa36b7 Add child-process-es6-promise
Summary: Using this in the next diff. If you don't feel like this is a good fit, probably better to comment there.

Reviewed By: jknoxville

Differential Revision: D14225747

fbshipit-source-id: 29cd0b4a37b988b4bd8643f1db64bb3e2610b0e4
2019-02-26 16:33:19 -08:00
Manish Singhal
b8e6298df5 Added support for cold start in image perf plugin
Summary:
This diff adds support for cold start in image perf plugin. Now developer can see which images have been requested as part of cold start.

CC: Diego Sanchez Vivian Wehner Alexander Oprisnik Gaurav Nijhara

Reviewed By: jknoxville

Differential Revision: D14227065

fbshipit-source-id: 3347b460e491b218115d8572cb8b323de909ef1b
2019-02-26 16:01:20 -08:00
John Knox
40ada838d7 Add isMethodSupported handler
Summary: Allows plugin to check if something is supported by that app, for example an extension command or a new feature, before trying to use it.

Reviewed By: passy

Differential Revision: D14225957

fbshipit-source-id: 3c5a29a06b56fe5f1da772824232547447872344
2019-02-26 10:08:21 -08:00
Pascal Hartig
dbb4fa1191 Fix typo
Summary: typo_gnome

Reviewed By: jknoxville

Differential Revision: D14224864

fbshipit-source-id: eab74df8fb7c48782a44b5284483ab67c205387e
2019-02-26 07:37:52 -08:00
Pritesh Nandgaonkar
f8bd473828 Use Folly and RSocket from cocoapods (#379)
Summary:
I have released pods for Folly and RSocket on cocoapods. Thus we won't need to host different versions of these pods on our repository. I haven't removed those pods from `Specs` folder, as the current users of `0.16.2` would still be referring the Specs folder on the master branch. I will remove the specs folder once, all our pods are on cocoapods and we no longer need to host any pods.
Pull Request resolved: https://github.com/facebook/flipper/pull/379

Reviewed By: jknoxville

Differential Revision: D14185931

Pulled By: priteshrnandgaonkar

fbshipit-source-id: ea285024123e41c2d110827e26f79a72ef22c008
2019-02-26 04:18:00 -08:00
John Knox
9c4aa9b9cb Call out SoLoader.init in getting started docs
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/383

Reviewed By: danielbuechele

Differential Revision: D14208864

Pulled By: jknoxville

fbshipit-source-id: 54a319a4b6a658ae49ed90223463ddf7a07bb9c7
2019-02-26 02:46:49 -08:00
Daniel Büchele
b8cb95ab0c toolbar
Summary: When there wasn't enough space for the text toolbar, the text was wrapped into multiple lines. Now it's truncated.

Reviewed By: jknoxville

Differential Revision: D14209813

fbshipit-source-id: 1971cd791daf345639993ed0632d718374a5f91b
2019-02-26 02:37:17 -08:00
Daniel Büchele
2e8394cb36 fix search
Summary: Layout search was throwing errors before, now it's working. The problem was, the event object used in the `setTimeout`-callback was released, before the timeout fired and therefore was null.

Reviewed By: jknoxville

Differential Revision: D14209811

fbshipit-source-id: 2465241c376d3e709155830e796aa3b991cbd7de
2019-02-26 02:37:17 -08:00
Daniel Büchele
385d74ef30 remove virtualization
Summary:
Removing the virtualization in the elements inspector. This didn't really make sense here, because usually the inspector renders 10-1000 rows, which can be easily done in the browser. Having virtualization here, caused some problems with icons flickering and scrolling being broken.

Let's make it less complex and just remove the virtualization!

Reviewed By: jknoxville

Differential Revision: D14209815

fbshipit-source-id: 115d3ed57a1ccdbc20108636ff4fc7fc68e6c9c0
2019-02-26 02:37:17 -08:00
Daniel Büchele
0d0da3df24 sidebar
Summary: Before, the a11y inspector was in a sidebar. This changes the actual view hierarchy to be in a sidebar on the left side. This doesn't make an actual difference for the user, but helps to fix the scrolling issues in D14209815

Reviewed By: jknoxville

Differential Revision: D14209812

fbshipit-source-id: 414e8fd34c889cdce2dd3776727dd4a3a59efeb5
2019-02-26 02:37:17 -08:00
Daniel Büchele
5f5a38f1fe element expanding
Summary:
Previously nodes were always marked as expanded, when they were loaded. In some cases this caused a node to be marked as expanded, but its children not being loaded.

This changes the behaviour to only mark a node as expanded, once its children are loaded.

Reviewed By: jknoxville

Differential Revision: D14209814

fbshipit-source-id: f825d6a066373be932e42b9612a1bf78877b12aa
2019-02-26 02:37:17 -08:00
John Knox
f12144be38 Fix CRASH: undefined undefined bug
Summary:
Display "crashes" as plugin errors when they don't include the expected crash attributes.

Plugins can respond to a `call()` with success or error. If error, then they can provide an arbitrary json object.
These errors go through the same code as crash reports for the crash reporter plugin, but they don't necessarily contain the expected attributes.

When they don't display them as a plugin error, and stringify the whole object.

It would be better to distinguish these properly and highlight that they aren't crashes, in the crash reporter, but that's a bigger task. This stops them being shown as "undefined undefined".

Reviewed By: xiphirx

Differential Revision: D14207907

fbshipit-source-id: 8ba357fbe681a40cd671510a187073e4cbfa2184
2019-02-25 09:33:01 -08:00
Daniel Büchele
f1d46caa2f remove console.log
Summary: as per title

Reviewed By: jknoxville

Differential Revision: D14207127

fbshipit-source-id: e6608382061f4c4a8aff3076810d7ab32be9e990
2019-02-25 03:01:30 -08:00
Pascal Hartig
2a94da7db3 Best-effort fix for crash
Summary:
The keys in WeakMaps have to be Objects (i.e. can't be primitives) as
they have to be fall under the responsibility of the GC.

Without this check, we may get "TypeError: Invalid value used as weak map key"
as we accept `any` as `data` for the inspector. I'm not entirely
confident if this check is enough, but I also don't have a way of reproducing
the error we got reported.

Reviewed By: jknoxville

Differential Revision: D14182463

fbshipit-source-id: 3397678935f08513e485bf5654377b54053ee32f
2019-02-22 11:07:55 -08:00
Pascal Hartig
156a0c17c6 Load Fresco image on button press only
Summary: Only load the image when clicking on the "button"

Reviewed By: oprisnik

Differential Revision: D14165707

fbshipit-source-id: d07fb76562f8b91fc945713d779319b976e17016
2019-02-22 02:51:33 -08:00
Pascal Hartig
cbfb280783 Set up FrescoFlipperPlugin default constructor
Summary:
Not quite sure about the default as static, but then if it's for
debugging only, does it matter?

Reviewed By: oprisnik

Differential Revision: D14165668

fbshipit-source-id: edd53420a4fc8570de87f02b3e5e65cfe649f810
2019-02-22 02:51:33 -08:00
Pascal Hartig
d371a211a8 Set up Fresco in sample app
Summary:
This looks bad. There are two things I want to follow up on in future
diffs before landing this:

- Make loading the image conditional by adding another button.
- Add a default constructor to the plugin that avoids this crazy bit of boilerplate.

Reviewed By: oprisnik

Differential Revision: D14165569

fbshipit-source-id: 25c5fbaee32e72c6469979cda694cc9f13a92166
2019-02-22 02:51:33 -08:00
Pascal Hartig
2067e5e1fc Upgrade react-dom to fix CVE-2018-6341
Summary:
Better safe than sorry even though we're not directly
working with user-supplied data, plugins or apps might.

Reviewed By: danielbuechele

Differential Revision: D14168566

fbshipit-source-id: 8108a2a592d2e2d6b8b2259e0e4bf943cf9c333e
2019-02-21 10:33:17 -08:00
Pritesh Nandgaonkar
c073aad801 Add an option to crash a sample app to test crash reporter plugin
Summary: As per the title

Reviewed By: jknoxville

Differential Revision: D14168217

fbshipit-source-id: c138a4d5c3258f094436a2b09fd18130539a866c
2019-02-21 10:19:58 -08:00
John Knox
5fff501d26 Don't log cert exchange connection failures
Summary: This info is still available in the diagnostic screen.

Reviewed By: passy

Differential Revision: D14164791

fbshipit-source-id: 1fc91da0b7437d530bddee6cbb5ea8c2d11f7b80
2019-02-21 10:12:04 -08:00
Daniel Büchele
8ff625397b persist search
Summary:
The search query can only be persisted if we have an identifier for the searchable component. For this we already have a property `tableKey` on our `ManagedTable`. However, we don't want to require every plugin to provide a key for their table.

In this diff, a tableKey is auto-generated from the table's column configuration. This should be good enough to uniquely identify a table and persist it's query.

Reviewed By: passy

Differential Revision: D14168577

fbshipit-source-id: 13e928a606c3a05096dfbfb01ae90b15aa085bf2
2019-02-21 10:02:45 -08:00
Pritesh Nandgaonkar
863088e7cf Filter Images by surfaces
Summary:
Adds a capability to filter images by surfaces.

Note: I will allow multi select in the next diff, stacked on the current one.

Reviewed By: passy

Differential Revision: D14158223

fbshipit-source-id: d96d73b94a8a442f3b60f656bc573b328c5500ad
2019-02-21 09:46:55 -08:00
Daniel Büchele
520ffec7c9 removing entry, rootDir from defaultPlugins
Summary:
When bundling default plugins, we create a JSON-file containing information about the plugin and where to require it from. This information contained two filed: `entry` and `rootDir`, which were written while bundling the plugins. Because the plugins are bundled on Sandcastle, this was a path on the Sandcastle machine.

This also happened for the OSS version, see the screenshot from a GitHub issue.
Entry and rootDir are only used during the build process and not needed afterwards, so it is save to remove them from the JSON.

https://pxl.cl/qQSx

Reviewed By: passy

Differential Revision: D14165679

fbshipit-source-id: 4e7c5ac25652758ccfc3a459f4dd197254c6f897
2019-02-21 09:39:54 -08:00
Daniel Büchele
43157f974e Update docs to use package name as ID
Summary: We swtiched from using the name of the package as the ID which is used to identify a client plugin. These changes were not reflected correctly in our docs.

Reviewed By: jknoxville

Differential Revision: D14165439

fbshipit-source-id: 1cbb9c1723911f8fa4b7df19c631e6f260c81bd8
2019-02-21 09:39:54 -08:00
Aziz Murtazaev
0279fc919f Move android module's support lib references to AndroidX
Summary: SupportLib v28 -> AndroidX v1

Reviewed By: passy

Differential Revision: D14150032

fbshipit-source-id: f9c0d15a4f281fea78500e78275eb260e484e674
2019-02-21 09:26:07 -08:00
Pritesh Nandgaonkar
01ee57c601 Move fresco plugin to use redux store
Summary: This diff moves the state to PersistedState

Reviewed By: danielbuechele

Differential Revision: D14126419

fbshipit-source-id: aaf5f035ddc7e64ad2602ae4b80c9901a20df144
2019-02-21 07:16:12 -08:00
Pritesh Nandgaonkar
6ee8d72a1e Move Fresco plugin to oss directory
Summary: Moved the fresco plugin folder to open source directory

Reviewed By: passy

Differential Revision: D14126407

fbshipit-source-id: 15b2d1698e18b951742ec37ca94642e6511094b0
2019-02-21 07:16:11 -08:00
Pascal Hartig
aac9c40183 Open-source Fresco Android plugin
Summary: Let there be MIT!

Reviewed By: oprisnik

Differential Revision: D14150942

fbshipit-source-id: b907934e319d5ac7bd114a918fe79ca363724229
2019-02-21 03:30:02 -08:00
Pascal Hartig
e69306b34d Objecthelper
Summary:
Split off objecthelper into a (future) public and an fb-only version. This also open-sources the very first bit which is pretty useless on its own, but will already compile as its neatly stand-alone.

Note that this blocks releases until we have a stable version of Fresco to depend on.

Reviewed By: oprisnik

Differential Revision: D14149645

fbshipit-source-id: 0020d7ceccf89999695414ce389106ca6325ab7e
2019-02-21 03:30:02 -08:00
Daniel Büchele
13f7444013 electron update
Summary:
Started with upgrading electron from 3.0.0 to 4.0.5. This required a bunch of subsequent updates:
* upgrading `electron-builder` to latest version, because the old version couldn't build electron 4 apps.
  * `appDir` is deprecated in builder config, `projectDir` is used instead, which we already had set, so its fine to just remove this ([see GitHub commit](a5e457163e)).
* upgrading `jest-runner/electron` because the old version couldn't run electron 4 tests.
  * upgrading our custom dependency resolution to use electron 4.0.5, because the test runner still resolves to 2.0.8 ([see GitHub issue](https://github.com/facebook-atom/jest-electron-runner/issues/31)).
* updating `sandcastle.sh` to use the new cache files from D14131344.
* removing `package-lock.json` as is was causing warnings. We use `yarn` and `yarn.lock` anyways. This file must have been committed by accident.
* updating our check to only run one version of Flipper at a time to use the new electron API `app.requestSingleInstanceLock` as the old one was removed in electron 4.
* updating the snapshot test that checks App rendering, which changed a little due to the electron upgrade.
* upgrading flow-type definitions to `electron-v4.0.5.js` generated by [electron-flowtype-definitions](https://github.com/danielbuechele/electron-flowtype-definitions).

**PS: Best new feature in Electron 4: Copy&paste working in dev tools**

Reviewed By: jknoxville

Differential Revision: D14131360

fbshipit-source-id: d7ed9643875629a1fa1860bb61b11dd0c64112ab
2019-02-21 02:46:12 -08:00
Artur Pyrogovskyi
0a59dc2918 Added onSort and a fix for columnOrder to ManagedTable
Summary:
1. Added onSort() pass-through to ManagedTable which allows to handle sort order changes.

2. columnOrder now gets updated when the corresponding prop is changed indepedently from ref.

Reviewed By: danielbuechele

Differential Revision: D14147857

fbshipit-source-id: 03300629a3316a69be6b745810516966b8060aa6
2019-02-21 02:02:09 -08:00
Pascal Hartig
fa33764cc3 Flipper Bump: v0.16.3-SNAPSHOT
Summary: This release targets the support library and target SDK v28.

Reviewed By: muraziz

Differential Revision: D14151637

fbshipit-source-id: 5f32a98580558606aef17902e82a9d8061b99f48
2019-02-20 13:54:29 -08:00
Pascal Hartig
4871186a77 Flipper Release: v0.16.2
Summary: This release targets the support library and target SDK v28.

Reviewed By: muraziz

Differential Revision: D14151636

fbshipit-source-id: 70f4412dc0ccba3c77dda74dcf9b143782b90713
2019-02-20 13:54:29 -08:00
Pascal Hartig
0d185108a7 Bump to target SDK 28
Summary:
We need this to continue to build with Fresco and
in preparation of AndroidX.

Reviewed By: muraziz

Differential Revision: D14149811

fbshipit-source-id: dd227f85ead23b8412706905f8723b3c153b28b7
2019-02-20 13:54:29 -08:00
Pascal Hartig
3dbb201c2a Flipper Bump: v0.16.2-SNAPSHOT
Summary: Reenable snapshots.

Reviewed By: jknoxville

Differential Revision: D14150282

fbshipit-source-id: 5c1d9cd5dfcf48f2efd41ba610583a68d38e8cc6
2019-02-20 09:29:07 -08:00
Pascal Hartig
f043a3d4db Flipper Release: v0.16.1
Summary:
<Placeholder for v0.16.0 release notes>

Resubmitting as the previous release job stalled.

Reviewed By: jknoxville

Differential Revision: D14150283

fbshipit-source-id: 0357d37bf8c69accf898d2c4c81b89d0c16339c3
2019-02-20 09:29:07 -08:00
Daniel Büchele
6ada04bc38 ignore flipper-public/dist folder in build
Summary:
Builds in flipper-public are failing, because duplicate imports: https://our.intern.facebook.com/intern/sandcastle/job/22517998213713260

That's most likely because the `flipper-public` is not blacklisted in metro, so let's add it!

Reviewed By: passy

Differential Revision: D14134423

fbshipit-source-id: 52f87196957c8578b8ac7f578efa74e3c13fe1bb
2019-02-20 06:58:54 -08:00
Daniel Büchele
517262bbf2 fix version number
Summary: The electron stub is used by the headless version of Flipper. For that reason, the version number was always `1`. The headless version has a the actual version written to a global variable. So let's use it here.

Reviewed By: passy

Differential Revision: D14149692

fbshipit-source-id: c4781987fd3201e67897eaf31627b0bb2970ffcb
2019-02-20 06:42:21 -08:00
Daniel Büchele
6c0a534e15 fix logs
Summary:
Logs were not collected in headless mode, because there was no subscriber listening to the logs. Now they are always stored, even if there is no subscriber. Actually this makes more sense even for the desktop UI, as subscribers could subscribe later.
The only reason this was working on the desktop app was because the log plugin automatically subscribed on launch.

This brings us to the actual question: If a message is logged in a forest and no one is around to read it, is it actually logged? 🤯

Reviewed By: passy

Differential Revision: D14149691

fbshipit-source-id: 212f1b0a69bd0cc8ae0ba3592f29ca90b7a5a475
2019-02-20 06:42:21 -08:00
Pascal Hartig
d8d01b4a6f Remove global state for perf logger
Summary: Instead of installing some global mutable thing, pass it down. This also eliminates the rather gnarly side-effect of instantiating some visitor and suddenly logging information in an entirely different place.

Reviewed By: oprisnik

Differential Revision: D14131253

fbshipit-source-id: 760c6a3f85056e334ac1149c76ca4126fbfa7da4
2019-02-20 02:52:11 -08:00
Pascal Hartig
cf0003a87e Update perflogger package name
Summary:
Buck doesn't really care so the previous diff works out fine on
its own, but Android Studio is less forgiving.

Reviewed By: oprisnik

Differential Revision: D14131182

fbshipit-source-id: 0ad26e7c5f1e0776bdf07dda2f04bdf16183a5e8
2019-02-20 02:52:11 -08:00
Pascal Hartig
7f77dd1c1a Move logging interface out of QPL plugin
Summary:
This is generic enough, even though I strongly dislike the
installing mechanism, but that can be changed later.

Reviewed By: oprisnik

Differential Revision: D14131183

fbshipit-source-id: b75c1e1563ac9371cbc7d28b239c316a0aa1a9dd
2019-02-20 02:52:11 -08:00
John Knox
81e8b7982b Add date and time reminder to diagnostic screen
Summary: I got tripped up again with a physical iOS device that had the wrong date and time. SSL certs won't be valid. Adds a reminder to the diagnostic screen for anyone running into this in future.

Reviewed By: passy

Differential Revision: D14132411

fbshipit-source-id: 623120ef5252eae3e2fe0f6f653074f586f17e0e
2019-02-19 10:33:25 -08:00
John Knox
ce7287f08b Re-enable physical iOS device support in mobile SDK
Summary: Only usable with a desktop app that supports physical iOS devices, which isn't released yet.

Reviewed By: passy

Differential Revision: D14132413

fbshipit-source-id: 376d1db06e46ae06346974f2acc95c3d2ff6825d
2019-02-19 10:33:25 -08:00
John Knox
9c87dfe230 Only create CSR once per app invocation
Summary: The CSR has no need to change, don't recreate it every time we need it. Useful for the physical iOS case especially, because it connects to the portforwarder and keeps attempting to send a CSR.

Reviewed By: passy

Differential Revision: D14131617

fbshipit-source-id: 82a69d5aff813d77fa05dd13fc2441b784766d99
2019-02-19 10:33:25 -08:00
Pascal Hartig
b594fb7c76 Fix download caching
Summary:
Not sure why, but if we stick this in the build folder,
the artifacts get downloaded every single time despite `onlyIfNewer`.

Reviewed By: jknoxville

Differential Revision: D14132383

fbshipit-source-id: 464e4a6e474877c16a06a6e83ccd1a2e355cbea2
2019-02-19 09:06:19 -08:00