Commit Graph

249 Commits

Author SHA1 Message Date
Anton Nikolaev
b45b5f854a Move layout plugin sidebar extensions to the plugin package
Summary: Moved layout plugin sidebar extensions to the plugin package.

Reviewed By: passy

Differential Revision: D27036489

fbshipit-source-id: 5b3406e5c50ba61709d925a3c0cb07a6fd7552db
2021-04-09 05:22:00 -07:00
Anton Nikolaev
e5261967cb Link shared libs to allow re-using them in both in public and fb-internal plugins
Summary:
Link plugin shared libraries to the "plugins/node_modules" dir so they can be used as peer dependencies by both public and fb-internal plugins.

```
plugins
- node_modules
-- fb_shared_lib (symlink pointing to "plugins/fb/fb_shared_lib")
-- public_shared_lib (symlink pointing to "plugins/public/public_shared_lib")
- fb
-- fb_shared_lib
-- fb_plugin (can now use both fb_shared_lib and public_shared_lib as peer dependencies)
- public
-- public_shared_lib
-- public_plugin (can now use both public_shared_lib and fb_shared_lib (optionally if it's an fb-internal repo) as peer dependencies)
```

Reviewed By: passy

Differential Revision: D27034936

fbshipit-source-id: 68ee5312060ff57649ae061dd7dd14f8beb6d4a1
2021-04-09 05:22:00 -07:00
Anton Nikolaev
b3274a8450 Plugin folders re-structuring
Summary:
Here I'm changing plugin repository structure to allow re-using of shared packages between both public and fb-internal plugins, and to ensure that public plugins has their own yarn.lock as this will be required to implement reproducible jobs checking plugin compatibility with released flipper versions.

Please note that there are a lot of moved files in this diff, make sure to click "Expand all" to see all that actually changed (there are not much of them actually).

New proposed structure for plugin packages:
```
- root
- node_modules - modules included into Flipper: flipper, flipper-plugin, react, antd, emotion
-- plugins
 --- node_modules - modules used by both public and fb-internal plugins (shared libs will be linked here, see D27034936)
 --- public
---- node_modules - modules used by public plugins
---- pluginA
----- node_modules - modules used by plugin A exclusively
---- pluginB
----- node_modules - modules used by plugin B exclusively
 --- fb
---- node_modules - modules used by fb-internal plugins
---- pluginC
----- node_modules - modules used by plugin C exclusively
---- pluginD
----- node_modules - modules used by plugin D exclusively
```
I've moved all public plugins under dir "plugins/public" and excluded them from root yarn workspaces. Instead, they will have their own yarn workspaces config and yarn.lock and they will use flipper modules as peer dependencies.

Reviewed By: mweststrate

Differential Revision: D27034108

fbshipit-source-id: c2310e3c5bfe7526033f51b46c0ae40199fd7586
2021-04-09 05:22:00 -07:00
Michel Weststrate
07c4470ab9 Stricter types for DataDescription
Summary: Made datatypes used by DataInspector more strictly typed (in the hope to be able to drop some, but all are still in use, although the distinction between different elements isn't always clear).

Reviewed By: passy

Differential Revision: D27266825

fbshipit-source-id: 6a1c74b0ae3daff6299ca598b18a205d17c42e22
2021-04-07 07:55:12 -07:00
Michel Weststrate
b597da01e7 Introduce row truncation
Summary:
Changelog: Logs plugin will now automatically truncate long lines

...for a more pleasant experience where long messages don't distort things to much. (Made the buttons purple in a next diff for better contrast)

Reviewed By: passy

Differential Revision: D27395517

fbshipit-source-id: 733cd6329b979453ef3b428693be8c47c37adf4d
2021-03-31 03:44:34 -07:00
Mathis Gardon
f25d189aa5 Support custom metro ports (#2050)
Summary:
Based on issue https://github.com/facebook/flipper/issues/1509 I needed a custom port for the metro server to pass to flipper.

## Changelog

introduce `METRO_SERVER_PORT` env variable to be able to customize default 8081 port on startup.

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

Test Plan:
Tested with a locally built linux desktop app, this seems to work OK pour hermes debugging & RN logging.

React DevTools don't seem to find the running app, maybe there's a mapping to handle there too ?

Reviewed By: jknoxville

Differential Revision: D27339006

Pulled By: passy

fbshipit-source-id: b1700c4fe73f14bf4617e23583b2954012e0a5aa
2021-03-31 03:30:14 -07:00
Michel Weststrate
d5fbe9a5b9 Support physical device logging
Summary:
Changelog: Logs plugin now supports physical iOS devices

As reported in https://github.com/facebook/flipper/issues/262 and linked papercut.

This diff adds support for iOS device logs through idb. Since idb doesn't respect `--json` flag at the moment, we perform the parsing in Flipper itself.

Reviewed By: passy

Differential Revision: D27346262

fbshipit-source-id: 3b314716f48bb9a7fe709370303396a51893359c
2021-03-29 07:00:47 -07:00
Pascal Hartig
e4a814502a Mass bump deps
Summary:
Bumping everything that's just a patch version behind or safe-looking minor change.

Just hoping to get ahead of dependabot's next run.

Reviewed By: fabiomassimo

Differential Revision: D27367567

fbshipit-source-id: 1bf8bad02e5a9f07f5982466254f9906581230cf
2021-03-27 04:25:57 -07:00
Pascal Hartig
8c85da5bc8 Bump deps
Summary: Just trying to get ahead of dependabot and bump some easy dependencies all at once.

Reviewed By: fabiomassimo

Differential Revision: D27326687

fbshipit-source-id: 0c724c8e3a688aa9777945fcd46061284fd77969
2021-03-25 12:28:29 -07:00
Michel Weststrate
f095a00c78 Fix Flipper crashing when decoding partial encoded requests
Summary:
Changelog: Fixed an issue where Flipper would crash when decoding large partial requests.

The current processing of partial requests assumes that the proviced base64 string is always an utf-8 string, which is incorrect as it might contain binary data as well. This causes `atob` build in to throw errors when trying to decode binary base64 strings with the following exception:

{F538782963}

However, what is worse, if those strings were larger than ~2 mb, it would completely crash Electron rather than on the JS level, with reports like:

```

Crashed Thread:        0  CrRendererMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [85268]

Thread 0 Crashed:: CrRendererMain  Dispatch queue: com.apple.main-thread
0   com.github.Electron.framework 	0x000000011155b16f v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 22324575
1   com.github.Electron.framework 	0x000000011155e811 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 22338561
2   com.github.Electron.framework 	0x00000001117e2e62 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 24978002
3   com.github.Electron.framework 	0x000000010fa32660 v8::internal::ClassScope::ResolvePrivateNamesPartially() + 14944
4   com.github.Electron.framework 	0x000000010fa322b5 v8::internal::ClassScope::ResolvePrivateNamesPartially() + 14005
5   com.github.Electron.framework 	0x000000010fa31933 v8::internal::ClassScope::ResolvePrivateNamesPartially() + 11571
6   com.github.Electron.framework 	0x000000011007ef58 v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 451400
```

Reproduced this JS issue by lowering the `MAX_BODY_SIZE_IN_BYTES` in `NetworkFlipperPlugin.java` to 10KB, which causes all requests to be processed as partials.

Reproducing the the Electron crash is a lot harder, as it requires a surface that makes large, binary requests (more than a few mb), that is still intercepted by the Network layer. The best example I could find is sending large pictures or videos through a messenger for android chat. In that case it is still hard to produce due to caching though.

Fun fact, you can crash your own flipper and get the above crash by running this command:
`btoa(require("fs").readFileSync("/Users/mweststrate/Desktop/Screen Recording 2021-03-24 at 16.08.27 crop.mov", "binary"))`, where the provided file must be a few mb's large (this one is 10).

A result of fixing this issue, is that images that were send as partials can now be correctly previewed in the Network plugin again.

Reviewed By: jknoxville

Differential Revision: D27302961

fbshipit-source-id: 1ac86840f7268062bb59c789f3904537df3c51fa
2021-03-25 05:03:07 -07:00
Michel Weststrate
8f90deda55 Minor UI improvements
Summary:
Addresses feedback from: https://github.com/facebook/flipper/issues/2076

- fix filtering non-string columns
- fix overflow in filter dropdown
- hide app column on all devices
- show pid column on android, to simplify filtering per app

Reviewed By: passy

Differential Revision: D27188458

fbshipit-source-id: b6180fb5a8d0a47e50dd5dc3533da3ff1b0a1a2e
2021-03-19 08:59:12 -07:00
Pascal Hartig
414dd4d5ff Demote errors in crash reporter
Summary:
Not fatal errors and actually very, very high-firing. Something about
the serialisation here is wrong so I can't tell the exactly number right now.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27117067

fbshipit-source-id: d9ce8c736ca2228acedeadeb2e7ee6744d766265
2021-03-18 05:45:28 -07:00
Anton Nikolaev
f468f0e07d Produce tsc typings for "flipper" package
Summary: This diffs refactors tsc projects structure and structure of our custom typings to allow producing typescript typings for "flipper" package. In next diffs I'm going to use the produced typings to check compatibility of plugins with certain versions of Flipper, e.g. to check whether plugin is compatible with current "stable" and "insiders" version.

Reviewed By: passy

Differential Revision: D26997158

fbshipit-source-id: a0416c7139bf08ec9d175730da4c4c2a8768eeb7
2021-03-17 14:03:38 -07:00
Michel Weststrate
9d3c48fd84 Logs2 -> Logs
Summary:
Use Logs2 plugin now as the default logs plugin (by overwriting it).

See the rest of this stack

Changelog: The device logs plugin has been fully rewritten. It is faster and more reponsive, formats urls and json, and supports line wrapping and text selection. Beyond that it is now possible to sort and filter on all columns and pause and resume the log stream.

Reviewed By: nikoant

Differential Revision: D27048528

fbshipit-source-id: e18386fec6846ac3568f33a3578f4742213ecaca
2021-03-16 15:03:49 -07:00
Michel Weststrate
87c5fab607 Convert crash reporter plugin to Sandy (non UI only)
Summary:
This diff converts the CrashReporter plugin to Sandy. The main driver is that it allows us to fix the connection management of logs in a next diff.

There are few changes to highlight:
* A bunch of the old unit tests are removed, as they primarily verified that persistedState abstraction works, a concept that doesn't exist anymore with Sandy (as a result all the logic in error handling and crash reporter plugin has become a lot more trivial as well)
* Added additional unit tests to verify that the integration with notifications from Sandy, and the integration of crashes in combination with CrashReporter plugin works (this wasn't the case before)
* Plugin errors were always suppressed in production builds of Flipper. However, that makes error reporting pretty pointless in the first place, so enabled it by default, but made it a setting in case this results in too many errors suddenly.
* The integration with clicking OS crash notification -> bringing the user to a sensible place _doesn't_ work, but it didn't work before this diff either, so will address that later
* This doesn't upgrade the Crash reporter UI to sandy yet, will do that later in a separate diff

Changelog: Crash reporter will now report errors triggered from the device / client plugins by default. This can be disabled in settings.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27044507

fbshipit-source-id: 8233798f5cce668d61460c948c24bdf92ed7c834
2021-03-16 15:03:48 -07:00
Anton Nikolaev
b2776f1c36 Fix for tests after call to "build-plugins"
Summary: After calling "bundle-all-plugins" locally, "yarn test" is failing with obscure message, because some tests are trying to import built bundles instead of "index.tsx". This diff fixes that.

Reviewed By: passy

Differential Revision: D26986246

fbshipit-source-id: cffe988dc642e2c5d2b2028581cd162350186e0c
2021-03-11 17:07:12 -08:00
bizzguy
f61b5a1a86 Network plugin - support mocks in imported devices (#2040)
Summary:
It is not currently possible to create mock routes from imported network logs.  This PR will provide that functionality.

See this issue for more details: https://github.com/facebook/flipper/issues/1988

## Changelog

Network plugin - create mocks from imported network logs

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

Test Plan:
Use sample app to create network activity
Export network activity
Import network activity
Create mocks from imported network activity
Verify that mocks work using sample app

Reviewed By: mweststrate

Differential Revision: D26947187

Pulled By: passy

fbshipit-source-id: 5e4e0197c49bb7a8227a70e574613381815e6d30
2021-03-11 03:08:08 -08:00
Pritesh Nandgaonkar
50f31f9fe0 Update the device plugins supported devices arguments
Summary:
Device plugins won't work for DummyDevice type as the device id is a fake one for this.

This diff updates the "supportedDevices" for the plugins.

Reviewed By: mweststrate

Differential Revision: D26944601

fbshipit-source-id: a29acc288f8f0c564f52db02914e7b0491b211d2
2021-03-10 06:34:36 -08:00
bizzguy
d07b74eed0 Network Plugin - Disable routes (#1969)
Summary:
Mock routes may contain quite a bit of data for header values and response bodies.  Currently, to turn off a mock a user must delete the mock and then go through the process of creating it when needed again.  This change will allow a user to temporarily disable a mock without deleting it.

A checkbox on the Routes list is used to enable/disable mocks.  As shown in this screenshot:

![image](https://user-images.githubusercontent.com/337874/109360670-3a3fb280-784d-11eb-83fd-724f0bb067d3.png)

## Changelog

Network Plugin - disable/enable mock routes

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

Test Plan:
Create mocks using sample app
Verify that mocks are working as expected
Disable the mocks
Verify that the client has been updated with mocks (minus the disabled ones) user Flipper Messages plugin
Use the sample app to send the disabled requests again and verify that they are not mocked

Reviewed By: mweststrate

Differential Revision: D26888815

Pulled By: passy

fbshipit-source-id: cb8a05a27dd69ba4d2b60085a077efe795a99a7c
2021-03-08 11:52:36 -08:00
Anton Nikolaev
095667b742 Fix "failed to find appMatchPatterns" error
Summary: Fixed an error which happens on second and subsequent device connection to Flipper

Reviewed By: passy

Differential Revision: D26829255

fbshipit-source-id: 17eb603647626a2168e330ec67f4a89783219356
2021-03-05 03:50:24 -08:00
Michel Weststrate
afa2c6322a make lint error on missing keys
Summary: When exploratory testing Flipper, I generally see quite some React key warnings. So it seems that plugin devs often miss them. This diff will configure linting more aggressively to address that (it's not fool proof, but will find the most common cases).

Reviewed By: nikoant

Differential Revision: D26722707

fbshipit-source-id: e0d2b56de2422e1147f52c8e9150d00c7ee64bd2
2021-03-02 01:17:13 -08:00
Harold Martin
4d8be35d1a Add plugin for LeakCanary 2 (#1959)
Summary:
Add plugin for LeakCanary 2 as requested various times: https://github.com/facebook/flipper/issues/1379 https://github.com/facebook/flipper/issues/832  https://github.com/square/leakcanary/issues/1777

## Changelog

* Adds a leakcanary2 plugin for Android
* Adds support for leakcanary2 to existing desktop plugin

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

Test Plan:
* Docs updated to show new implementation
* Should old leakcanary plugin in sample be replaced?

Reviewed By: mweststrate

Differential Revision: D26691637

Pulled By: passy

fbshipit-source-id: 5e236fa6cc124f0720a6b21b5ee7c117ccf96fbf
2021-03-01 09:11:37 -08:00
bizzguy
4da2b52803 Network Plugin - Add remaining HTTP method types to mock routes (#1962)
Summary:
Currently, mock routes can only be created for GET and POST HTTP method types.  Mocks should support all the valid HTTP method types.

See specification for a list of valid types:

    https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

This was requested in issue: https://github.com/facebook/flipper/issues/1960

Here is a screen shot showing the new values added to the select list:

![image](https://user-images.githubusercontent.com/337874/108955120-418b7400-7633-11eb-9248-63d9639e0c4f.png)

## Changelog

Network Plugin - support all valid HTTP method types in mock routes

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

Test Plan:
Define mock routes using additional method types
Using "Flipper Messages" plugin, verify that new types have been sent to device

Reviewed By: passy

Differential Revision: D26635050

Pulled By: mweststrate

fbshipit-source-id: 6d85ac346bd18687516a3566d1048982ec7cae46
2021-02-26 07:23:12 -08:00
bizzguy
29d16feed5 Network Plugin - fix highlighting issues in routes list (#1917)
Summary:
Fix problems with row highlighting on mocks route list.  When selecting a row, the highlight would sometimes be on the wrong row.  Also, when adding routes, the routes would sometimes get added in the middle of the list instead of at the end.

These problems were caused by incorrectly referencing route rows in code.  Sometimes index was used and other times the key was used.  Fixed by consistently using key.

This fixes the problem described in issue https://github.com/facebook/flipper/issues/1733

## Changelog

Network Plugin - fix problems with row highlighting on mocks route list

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

Test Plan:
Start with no mocks | No rows should be shown | TRUE
Add a single mock | First (and only row should be highlighted) | TRUE
Delete mock | No rows should be shown | TRUE
Add single mockAdd another mock | 2nd row should be highlighted | TRUE
Add another mock | 3rd row should be highlighted | TRUE
Add 2 more mocks and assign number to each row (5 total) | Last row should be highlighted | TRUE
Select 1st row | 1st row should be highlighted | TRUE
Delete 1st row | 1st row should be highlighed | TRUE
Select last row | last row should be highlighted | TRUE
Delete last row | last row should be deleted and new last row should be highlighted | TRUE
Highlight a middle row (row 3) | middle row should be highlighted | TRUE
Delete middle row | middle row should be deleted and last row should be in its place and should be highlighted | TRUE

Reviewed By: passy

Differential Revision: D26604455

Pulled By: mweststrate

fbshipit-source-id: f29690244e32b364983089541718f4bc75154dd1
2021-02-26 07:19:00 -08:00
dependabot[bot]
473e0b5745 Bump dateformat from 3.0.3 to 4.5.1 in /desktop (#1957)
Summary:
Bumps [dateformat](https://github.com/felixge/node-dateformat) from 3.0.3 to 4.5.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/felixge/node-dateformat/releases">dateformat's releases</a>.</em></p>
<blockquote>
<h2>4.5.1</h2>
<ul>
<li>Fixed an issue with the <code>WW</code> mask not working</li>
</ul>
<h2>4.5.0</h2>
<ul>
<li>Added <code>WW</code> mask for week with padding (<a href="https://github-redirect.dependabot.com/felixge/node-dateformat/pull/156">details</a>)</li>
</ul>
<h2>4.4.2</h2>
<ul>
<li>Fixed an issue with <code>DDD</code> and <code>DDDD</code> masks sometimes not working (<a href="https://github-redirect.dependabot.com/felixge/node-dateformat/pull/158">details</a>)</li>
</ul>
<h2>4.4.1</h2>
<ul>
<li>Update <code>DDD</code> mask to use <code>Ysd</code>, <code>Tdy</code> and <code>Tmw</code> (<a href="https://github-redirect.dependabot.com/felixge/node-dateformat/pull/155">details</a>)</li>
</ul>
<h2>4.4.0</h2>
<ul>
<li>Added <code>DDD</code> and <code>DDDD</code> Mask for <code>Today</code>, <code>Tomorrow</code> and <code>Yesterday</code> (<a href="https://github-redirect.dependabot.com/felixge/node-dateformat/pull/71">details</a>)</li>
</ul>
<h2>4.3.1</h2>
<ul>
<li>Added <code>p</code> Mask for Timezone Offset e.g. <code>+02:00</code> (<a href="https://github-redirect.dependabot.com/felixge/node-dateformat/pull/149">details</a>)</li>
</ul>
<h2>4.2.2</h2>
<ul>
<li>Fix Rounding Issue with L Mask (<a href="https://github-redirect.dependabot.com/felixge/node-dateformat/pull/147">details</a>)</li>
</ul>
<h2>4.2.1</h2>
<ul>
<li>Reduce size of package (<a href="https://github-redirect.dependabot.com/felixge/node-dateformat/pull/142">details</a>)</li>
</ul>
<h2>4.2.0</h2>
<ul>
<li>Fixed Invalid '1970-01-01' Formatting (<a href="https://github-redirect.dependabot.com/felixge/node-dateformat/pull/143">details</a>)</li>
</ul>
<h2>4.1.0</h2>
<ul>
<li>Added Padding Short Date Mask</li>
</ul>
<h2>4.0.2</h2>
<ul>
<li>Fixed an issue with old years not having padding. e.g. 0009 was formatting as 9.</li>
</ul>
<h2>Performance Improvements</h2>
<p>This release brings significant performance improvements to dateformat.<br />
Some common operations are now 6 times faster than before!!!</p>
<p>There are no breaking changes in this release.</p>
<p><img src="https://user-images.githubusercontent.com/53957795/100558584-e0921f80-3313-11eb-984a-ac2995bc01ee.png" alt="image" /></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/felixge/node-dateformat/commits/v4.5.1">compare view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a href="https://www.npmjs.com/~chase-manning">chase-manning</a>, a new releaser for dateformat since your current version.</p>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=dateformat&package-manager=npm_and_yarn&previous-version=3.0.3&new-version=4.5.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

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

Reviewed By: mweststrate

Differential Revision: D26605958

Pulled By: passy

fbshipit-source-id: a794b90b7b183177264ed8d42c47ebff8b98e330
2021-02-24 11:31:05 -08:00
Anton Nikolaev
ded38d7869 Fix expanding of selected item
Summary: Changelog: Layout plugin: fixed automatic expanding of layout tree when a deep element selected in the target mode.

Reviewed By: passy

Differential Revision: D26577751

fbshipit-source-id: 9f4a074d114892d6903a58e1ed44cf580cf1d432
2021-02-22 04:10:00 -08:00
Michel Weststrate
d37f1c282a Fixed issue with reseting logs
Summary:
Noticed that subsequent `adb logcat` invocations are stateful, and we didn't clear it's state when clearing the logs in memory.

This is a bandaid to get back to the previous behavior. I am wondering whether it wouldn't be just much more intuitive to always clear the logs (`adb logcat -c`) before we start the streaming log listener, so that users are never shown old logs from before flipper was connected?

Also fixed a leak in cleaning up the log listeners that was revealed by the possibility to disable the log plugin

Reviewed By: nikoant

Differential Revision: D26450262

fbshipit-source-id: 5b426e2d0e1fafdbc512d48d22b7bd4f30b61309
2021-02-17 08:19:28 -08:00
dependabot[bot]
ac263e6bee Bump js-base64 from 3.5.2 to 3.6.0 in /desktop (#1935)
Summary:
Bumps [js-base64](https://github.com/dankogai/js-base64) from 3.5.2 to 3.6.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="ad8897c84b"><code>ad8897c</code></a> version 3.6.0</li>
<li><a href="78016271df"><code>7801627</code></a> add isValid()</li>
<li>See full diff in <a href="https://github.com/dankogai/js-base64/compare/3.5.2...3.6.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=js-base64&package-manager=npm_and_yarn&previous-version=3.5.2&new-version=3.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

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

Reviewed By: mweststrate

Differential Revision: D26463175

Pulled By: passy

fbshipit-source-id: 06b223e8d89c75f5bda1e67b4e41403f7663ec7e
2021-02-17 05:14:13 -08:00
Anton Nikolaev
b6372ad006 Fix appMatchPatterns error
Summary: Fixed error thrown by navigation plugin in Flipper release builds (T84083443)

Reviewed By: passy

Differential Revision: D26402201

fbshipit-source-id: 7433457e3074c26ad17ac5158522d287232e2ede
2021-02-12 09:22:21 -08:00
bizzguy
1b76c3d8e7 Changes to local storage for mocks and body format (#1871)
Summary:
Network calls are normally unique to an application as are the associated mocks.  Currently, the mocks for different applications are combined together and saved to the local store.  It would be better if mocks were saved (and retrieved by application).

This PR adds "appId" to the local store name to save mocks separately for each app.  This is not really the ideal technique since different apps could have the same name.  Android apps use packageId rather than app name (which is what appid is) to uniquely identify an app.  However, package id does not seem to be available to the Flipper client so appid is used instead.

This requirement is described in this issue: https://github.com/facebook/flipper/issues/1487

Also, individual developers often have a preference for how they like to view response data (parsed or formatted).  This PR saved the selected format so that the developer does not have to keep selecting it.  Since this preference is not specific to an app, it is not necessary to save the preference for each app.

## Changelog

Network plugin - save mocks by app
Network plugin - save response body format preference to local storage

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

Test Plan:
Install two apps (with different names)
Create mocks in each app
Restart Flipper
View the mocks for each app and verify that they are unique to the app

Reviewed By: mweststrate

Differential Revision: D26341333

Pulled By: passy

fbshipit-source-id: cc0286a9dc4e37e008672bfad7c6180f0d5675e4
2021-02-10 05:11:17 -08:00
Michel Weststrate
bf7599e574 Bumped some deps to fix parsing of template literal types
Summary:
I want to use TypesScipt type literals in a next diff (e.g.

```
type Percentage = `${number}%`
```

But to be able to use that typescript, prettier and eslint needed bumps :)

Reviewed By: nikoant

Differential Revision: D26321133

fbshipit-source-id: a4891246ef8c654f324c6daf303c5c4b2f54496e
2021-02-10 02:52:22 -08:00
Michel Weststrate
60cfcb54a1 Wrap plugin calls into isConnected guards
Summary:
Previously, plugins could relatively safely use `client.call` at any moment in time to fetch some information from / to the client. Except for some raise conditions there was generally speaking a connection available.

With this stack it becomes possible to interact with plugins even after an app (unexpectedly) disconnected, which makes Flipper a lot more versatile, especially when it comes to inspect crashes post mortem. (For more explanation see the second diff in this stack)

However, this means that it is no longer safe to assume there is always a connection available. For that reason `client.isConnected` has been introduced to safeguard against that.

This diff introduces guards on all user interactions that are not super explicitly triggered by the user to avoid a lot of errors being generated. This is mostly in `init()` blocks and implicit user events like selecting or hovering rows.

Explicit user interactions like pressing buttons are not guarded by this diff, as ideally failure to communicate with the client should be communicated back to the user more explicitly rather than failing silently. The next diff will introduce a fallback mechanism where a popup is shown in case those calls aren't guarded.

Fixed a few key warnings while at it.

Reviewed By: nikoant

Differential Revision: D26275604

fbshipit-source-id: 5630066cdd9541e448a6dd1f8a21861b5d751ced
2021-02-09 04:16:26 -08:00
Michel Weststrate
1bb1cae167 Don't send messages to disconnected clients. Make exportPersistedState compatible with disconnected devices.
Summary:
This diff addresses two problems:

1. Since clients plugins can be active beyond having a connection, we have to make it possible for plugin authors to check if they are connected before they make a call.
2. if there is a custom `exportPersistedState`, plugins should be able to skip making calls if the device has disconnected.

Introducing this change makes it possible to interact with a reasonable level with disconnected clients, and makes it possible to create Flipper traces for disconnected clients.

Note that both items were already problems before supporting offline clients; as there can be a noticeable delay between disconnecting and Flipper detecting that (i've seen up to 30 secs). What happend previously in those cases is that the export would simply hang, as would other user interactions, as loosing the connection in the middle of a process would cause the promise chains to be neither rejected or resolved, which is pretty iffy.

Before this diff, trying to export a disconnected device would hang forever like:

{F369600601}

Reviewed By: nikoant

Differential Revision: D26250895

fbshipit-source-id: 177624a116883c3cba14390cd0fe164e243bb97c
2021-02-09 04:16:26 -08:00
Michel Weststrate
ff7997b3fa Make sure disconnected devices / apps can be imported and exported
Summary:
It should be possible to exported disconnected devices, so that flipper traces / support form reports can be created from them. This diff introduces this functionality. Support for plugins with custom export logic is introduced in a later diff.

Issues fixed in this diff:
- don't try to take a screenshot for a disconnected device (this would hang forever)
- device plugins were always exported, regardless whether the user did select them or not
- sandy plugins were never part of exported disconnected clients
- increased the amount of data exported for device logs to ~10 MB. This makes more sense now as the logs will no longer be included in all cases
- fixed issue where are plugins would appear to be enabled after the client disconnected (this bug is the result of some unfortunate naming of `isArchived` vs `isConnected` semantics. Will clean up those names in a later diff.

Changelog: It is now possible to create a Flipper trace for disconnected devices and apps

Reviewed By: nikoant

Differential Revision: D26250894

fbshipit-source-id: 4dd0ec0cb152b1a8f649c31913e80efc25bcc5dd
2021-02-09 04:16:25 -08:00
Michel Weststrate
7361ecc080 Disable CPU plugin on archived devices
Summary:
Changelog: CPU plugin will no longer show up for archived devices

CPU plugin did show up on imported devices, but would always result in exceptions as no `adb` connection is available for them.

Reviewed By: jknoxville

Differential Revision: D26249575

fbshipit-source-id: c4fa7b3fec895f9c4ab9e31dce2f61fb23e9195b
2021-02-09 04:16:24 -08:00
Michel Weststrate
40abef860f Fix key warning
Summary: Crash reporter generated React errors because the different lines in a stack trace are not per definition unique

Reviewed By: jknoxville

Differential Revision: D26201941

fbshipit-source-id: 084e0157b1fa3b8216d35f62f0dc17b0d6414b8e
2021-02-03 06:59:59 -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
7cc55daf34 Stop storing device logs on the device object and in the plugin
Summary:
Logs were stored hardcoded on the Device object first, this diff makes it normal plugin state.

This makes sure that we can use the same abstractions as in all plugins that store large data sets, and that we can leverage the upcoming DataSource abstraction.

Reviewed By: nikoant

Differential Revision: D26127243

fbshipit-source-id: 7c386a615fa7989f35ba0df5b7c1d218d37b57a2
2021-02-01 11:43:30 -08:00
bizzguy
5320015776 Fix mock export file format (#1872)
Summary:
Provide a more robust technique for exporting the mocks to a file.

The current technique for exporting mocks to a file seems to fail under some scenarios.  The correct format is an array of objects:

```
[
  {
    "requestUrl": "https://api.github.com/repos/facebook/yoga",
    "requestMethod": "GET",
```
However, the following format is sometimes exported instead:

```
{
  "10": {
    "requestUrl": "https://demo9512366.mockable.io/SonarPost",
```

Using `Object.values` provides a more robust technique that has been successful during subsequent testing.

## Changelog

Network Plugin - new technique for exporting mocks

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

Test Plan:
Create mocks in the network plugin
Export mocks
Manually examine file for correct format
Import mocks and verify that the file has been imported correctly

Reviewed By: nikoant

Differential Revision: D26172954

Pulled By: mweststrate

fbshipit-source-id: bdfa3ba7dfe656f30ef17df001fc83dd8ea18ece
2021-02-01 10:23:45 -08:00
dependabot[bot]
a9ad3d2f1b Bump @testing-library/react from 11.1.0 to 11.2.3 in /desktop (#1868)
Summary:
Bumps [testing-library/react](https://github.com/testing-library/react-testing-library) from 11.1.0 to 11.2.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/testing-library/react-testing-library/releases"><code>testing-library/react's releases</code></a>.</em></p>
<blockquote>
<h2>v11.2.3</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.2.2...v11.2.3">11.2.3</a> (2021-01-07)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Return type of unmount is <code>void</code> (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/857">https://github.com/facebook/flipper/issues/857</a>) (<a href="1389f09474">1389f09</a>)</li>
</ul>
<h2>v11.2.2</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.2.1...v11.2.2">11.2.2</a> (2020-11-20)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>dependencies:</strong> bump dom testing library (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/836">https://github.com/facebook/flipper/issues/836</a>) (<a href="7fcb0f2e93">7fcb0f2</a>)</li>
</ul>
<h2>v11.2.1</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.2.0...v11.2.1">11.2.1</a> (2020-11-19)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> Allow all HTML and SVG elements in render. (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/833">https://github.com/facebook/flipper/issues/833</a>) (<a href="1dc33b23be">1dc33b2</a>)</li>
</ul>
<h2>v11.2.0</h2>
<h1><a href="https://github.com/testing-library/react-testing-library/compare/v11.1.2...v11.2.0">11.2.0</a> (2020-11-18)</h1>
<h3>Features</h3>
<ul>
<li>bump dom testing library (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/831">https://github.com/facebook/flipper/issues/831</a>) (<a href="456424ff33">456424f</a>)</li>
</ul>
<h2>v11.1.2</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.1.1...v11.1.2">11.1.2</a> (2020-11-11)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>import pretty-format from testing-library/dom (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/821">https://github.com/facebook/flipper/issues/821</a>) (<a href="2712dc2da4">2712dc2</a>)</li>
</ul>
<h2>v11.1.1</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.1.0...v11.1.1">11.1.1</a> (2020-11-03)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>upgrade dependencies, typescript, testing-library/dom etc (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/816">https://github.com/facebook/flipper/issues/816</a>) (<a href="e07e6416f2">e07e641</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="deafd51bc2"><code>deafd51</code></a> docs: add sanchit121 as a contributor (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/858">https://github.com/facebook/flipper/issues/858</a>)</li>
<li><a href="1389f09474"><code>1389f09</code></a> fix: Return type of unmount is <code>void</code> (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/857">https://github.com/facebook/flipper/issues/857</a>)</li>
<li><a href="64a8b9c2f3"><code>64a8b9c</code></a> chore: update all deps (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/842">https://github.com/facebook/flipper/issues/842</a>)</li>
<li><a href="03bea9fd76"><code>03bea9f</code></a> chore: Add 'Cancel Previous Runs' step (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/840">https://github.com/facebook/flipper/issues/840</a>)</li>
<li><a href="7fcb0f2e93"><code>7fcb0f2</code></a> fix(dependencies): bump dom testing library (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/836">https://github.com/facebook/flipper/issues/836</a>)</li>
<li><a href="276673ff00"><code>276673f</code></a> chore(types): add test for rendering SVG elements (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/834">https://github.com/facebook/flipper/issues/834</a>)</li>
<li><a href="1dc33b23be"><code>1dc33b2</code></a> fix(types): Allow all HTML and SVG elements in render. (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/833">https://github.com/facebook/flipper/issues/833</a>)</li>
<li><a href="456424ff33"><code>456424f</code></a> feat: bump dom testing library (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/831">https://github.com/facebook/flipper/issues/831</a>)</li>
<li><a href="236ea4962d"><code>236ea49</code></a> chore: remove one temporary fix with a better permenant one</li>
<li><a href="96b9aebe96"><code>96b9aeb</code></a> chore: Update validate.yml (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/827">https://github.com/facebook/flipper/issues/827</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/testing-library/react-testing-library/compare/v11.1.0...v11.2.3">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@testing-library/react&package-manager=npm_and_yarn&previous-version=11.1.0&new-version=11.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

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

Reviewed By: mweststrate

Differential Revision: D26149524

Pulled By: passy

fbshipit-source-id: 6cc8159ffdf8e13b7851042e7c25ff058f5c88cb
2021-02-01 09:02:11 -08:00
bizzguy
6a9d06a4ce Misc UI fixes (#1873)
Summary:
Continue with cleanup of Network plugin mock screens.  This mostly consists of replacing FlexColumn, FlexRow and FlexBox with equivalent Sandy components.

Here is the new screen:

- replace text buttons with Button
- add NUX info to "Copy Highlighted Calls" button
- add message when no calls have been highlighted
- in routes list remove padding on line items

![image](https://user-images.githubusercontent.com/337874/106415468-d58f6480-6414-11eb-93a8-498fd81b54d9.png)

Here is the prior screen:

![image](https://user-images.githubusercontent.com/337874/106415499-e8099e00-6414-11eb-8e0e-48875a945621.png)

## Changelog

Network Plugin - Additional cleanup of UI on mock screen

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

Test Plan:
Create and modify mocks
Verify that the functionality has not been affected by UI changes

Reviewed By: passy

Differential Revision: D26172915

Pulled By: mweststrate

fbshipit-source-id: f0af143d8509b53585076737832657fb095e75a6
2021-02-01 03:58:34 -08:00
bizzguy
8c3abf7450 Network Plugin - Minor UI fixes (#1864)
Summary:
Made UI fixes to Network Plugin (mostly to Route screens) to continue migration to the new design framework.  This consisted mostly of replacing FlexColumn and FlexRow with Layout.Container and Layout.Horizontal.

Also, contains some cosmetic changes to "Mock Network Response" page.

Here is the screenshot with UI changes:

![image](https://user-images.githubusercontent.com/337874/105937062-6d0e4500-601a-11eb-97ce-d9c4ae0c184f.png)

This was the old screen for comparison:

![image](https://user-images.githubusercontent.com/337874/105937028-5667ee00-601a-11eb-84a9-a2bd4bb78846.png)

## Changelog

Network Plugin - UI changes to continue migration to Sandy design framework

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

Test Plan: Manual testing to ensure that all data still displayed with new UI changes (especially the Data and Headers info in the "Route Info" section)

Reviewed By: passy

Differential Revision: D26125656

Pulled By: mweststrate

fbshipit-source-id: a25104274ed25788e5c0738ac0a9609f2cead751
2021-01-29 09:02:54 -08:00
Anton Nikolaev
d7cfcb5d8e Extend device plugin metadata to include supported devices
Summary: Plugin metadata format extended to include type of each plugin (client / device) and list of supported devices (android/ios/..., emulator/physical, etc). This will allow to detect plugins supported by device even if they are not installed and only available on Marketplace.

Reviewed By: mweststrate

Differential Revision: D26073531

fbshipit-source-id: e331f1be1af1046cd4220a286a1d52378c26cc53
2021-01-27 17:31:41 -08:00
bizzguy
6df117ba04 Network Plugin - New functions to import, export and clear Routes (#1855)
Summary:
In the network plugin, add features to import and export routes as described in issue https://github.com/facebook/flipper/issues/1651

Primary use case is that external testers (such as QA teams) would be able to create test data, convert it to mocks and save the mocks to make bug fixes easier for devs.

Here is a screenshot showing location of buttons to perform import/export (and clearing) of mock routes:

![image](https://user-images.githubusercontent.com/337874/105658269-cb58ed80-5e8b-11eb-8118-f13efc96bf6d.png)

Here is another screenshot showing export dialog:

![image](https://user-images.githubusercontent.com/337874/105657733-afa11780-5e8a-11eb-9725-120617e1dd71.png)

Changelog: [Network] Mock routes can now be imported and exported. Thanks bizzguy!

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

Test Plan:
Performed manual testing

- create new mocks
- export mocks
- clear mocks
- import mocks
- verify that mocks still work by making GET/POST requests in sample app

Performed various permutations of above manual tests, including restarting Flipper at various points to ensure that test plan still worked.  Also performed visual inspection of exported files to verify correctness.

Would be very interested in learning how to create automated tests for this functionality.

Reviewed By: passy

Differential Revision: D26072928

Pulled By: mweststrate

fbshipit-source-id: 51bd5e19e78d830b94add850d5dc9b9e45fa6fad
2021-01-26 05:34:36 -08:00
dependabot[bot]
0b4d5fedc1 Bump recharts from 1.7.1 to 2.0.3 in /desktop (#1846)
Summary:
Bumps [recharts](https://github.com/recharts/recharts) from 1.7.1 to 2.0.3.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/recharts/recharts/blob/master/CHANGELOG.md">recharts's changelog</a>.</em></p>
<blockquote>
<h2>2.0.3 (Jan 13, 2021)</h2>
<h3>refactor</h3>
<ul>
<li>use <code>getDerivedStateFromProps</code> to replace <code>UNSAFE_componentWillReceiveProps</code>, support react@17, <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2385">#2385</a></li>
</ul>
<h2>2.0.2 (Jan 12, 2021)</h2>
<h3>fix</h3>
<ul>
<li>fix lint error</li>
</ul>
<h2>2.0.1 (Jan 12, 2021)</h2>
<h3>fix</h3>
<ul>
<li>Fix typo, createLabeldScales -&gt; createLabeledScales</li>
<li>Prefer Number.isFinite if available</li>
<li>fix types error</li>
<li>fix(package.json): disable side effects explicitly</li>
</ul>
<h3>feat</h3>
<ul>
<li>Add aria-hidden to measurementSpan</li>
</ul>
<h2>2.0.0 (Dec 29, 2020)</h2>
<h3>fix</h3>
<ul>
<li>fix minAngle for 0 in PieChart, fix #<a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2237">#2237</a></li>
<li>fix type error of <!-- raw HTML omitted -->, fix <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2335">#2335</a></li>
<li>fix type error of cursor in <!-- raw HTML omitted -->, fix <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2178">#2178</a></li>
<li>fix Props of XAxis, fix <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2128">#2128</a></li>
<li>export Props of components, fix <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2319">#2319</a>, <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2156">#2156</a>, <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2203">#2203</a></li>
<li>Fix typo, getRectangePath -&gt; getRectanglePath in Rectangle</li>
<li>allow Duplicated Category for bar charts not using correct entries for custom tool tips</li>
<li>fixing typescript array coalesce</li>
<li>fix types error of sankey, fix <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2280">#2280</a></li>
<li>Fixed SVG path for pie charts when corner radius is set to a value other than zero (<a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2331">#2331</a>)</li>
</ul>
<h3>feat</h3>
<ul>
<li>add props <code>reversed</code> to <code>&lt;Funnel /&gt;</code></li>
<li>add <code>breakAll</code> props to <code>&lt;Text /&gt;</code> to allow break all for chinese</li>
<li>fix width of labelList in Funnel; fix <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2056">#2056</a>, <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/1866">#1866</a></li>
<li>support range RadarChart and add props <code>connectNulls</code> to <!-- raw HTML omitted -->, fix <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/1890">#1890</a></li>
<li>add ability to pass in custom legend icon.</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="a7f39d196c"><code>a7f39d1</code></a> Version 2.0.3</li>
<li><a href="702163b27a"><code>702163b</code></a> fix: update test case</li>
<li><a href="2b635f43ef"><code>2b635f4</code></a> fix: fix type error of &lt;Text /&gt;</li>
<li><a href="29b793b33e"><code>29b793b</code></a> refactor: use <code>getDerivedStateFromProps</code> to replace `UNSAFE_componentWillRece...</li>
<li><a href="69da3a2e24"><code>69da3a2</code></a> Version 2.0.2</li>
<li><a href="aeea67edf1"><code>aeea67e</code></a> fix: fix lint error</li>
<li><a href="e9e71b0849"><code>e9e71b0</code></a> Version 2.0.1</li>
<li><a href="f4d0153225"><code>f4d0153</code></a> refactor: rewirte demo by ts, fix type error, fix <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2372">#2372</a></li>
<li><a href="c35db1ef71"><code>c35db1e</code></a> refactor: use .tsx to write demo files</li>
<li><a href="98294c97b4"><code>98294c9</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/recharts/recharts/issues/2362">#2362</a> from juajang/chore</li>
<li>Additional commits viewable in <a href="https://github.com/recharts/recharts/compare/v1.7.1...v2.0.3">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=recharts&package-manager=npm_and_yarn&previous-version=1.7.1&new-version=2.0.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

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

Reviewed By: mweststrate

Differential Revision: D25945597

Pulled By: priteshrnandgaonkar

fbshipit-source-id: d4061cfd9f5a4638443ade74fa67b4340da10cce
2021-01-21 04:37:51 -08:00
bizzguy
1559c1ef2c Network Plugin - Update UI for routes (#1831)
Summary:
The current UI for managing mock network request definitions (routes) has some issues
- too small for the amount of information it displays
- no formatting for JSON response bodies
- uses the older design system (not ant)
- no separation between commands for creating routes and the list of routes

The following screen images show these problems.

![image](https://user-images.githubusercontent.com/337874/104691438-deb9cb00-56cb-11eb-92df-9e2d122f65c2.png)

![image](https://user-images.githubusercontent.com/337874/104691471-eda07d80-56cb-11eb-8f82-444d591ff966.png)

## Changelog

Enhance UI for Mocks dialog in Network Plugin

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

Test Plan:
Ran multiple manual tests using the Android sample app.  Here is a screen image (at 1280 x 720) for the enhanced UI.

![image](https://user-images.githubusercontent.com/337874/104691649-37896380-56cc-11eb-849f-4e470bb7fbc4.png)

Reviewed By: mweststrate

Differential Revision: D25922798

Pulled By: priteshrnandgaonkar

fbshipit-source-id: d27ba30a7eb51105a8d381097ecaafd82624cad5
2021-01-20 15:45:38 -08:00
bizzguy
f806ee41d7 Network plugin - fix issue with responses with empty body (#1776)
Summary:
The Network Plugin does not properly handle network requests that return an empty body (because of the body actually being empty or because the network call returns something like a 404 status).

Also, the creation of mocks using the "Copy Highlighted" command when the original response returns an empty body is not handled properly.

## Fix

The Android plugin now returns a response when the body length is 0.

The client plugin creates a body containing an empty string instead of null when the body is empty.

## Changelog

Fix problem in Network Plugin when original call or mock has an empty body in the response.

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

Test Plan:
The following screen output for the Network Plugin shows that the call is now being handled correctly.  The fields for "status", "size" and "duration" are now populated.

Also, the mock calls are properly defined and shown in yellow.

![image](https://user-images.githubusercontent.com/337874/102738969-5edd5280-4311-11eb-9b46-33a57a50e334.png)

Reviewed By: mweststrate

Differential Revision: D25804212

Pulled By: passy

fbshipit-source-id: b31cc87619c604b4df76e05bca5c86554a1cabff
2021-01-07 04:15:18 -08:00
dependabot[bot]
dbf194b952 Bump react-devtools-core from 4.9.0 to 4.10.1 in /desktop (#1795)
Summary:
Bumps [react-devtools-core](https://github.com/facebook/react/tree/HEAD/packages/react-devtools-core) from 4.9.0 to 4.10.1.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/facebook/react/commits/HEAD/packages/react-devtools-core">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=react-devtools-core&package-manager=npm_and_yarn&previous-version=4.9.0&new-version=4.10.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

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

Reviewed By: mweststrate

Differential Revision: D25802076

Pulled By: passy

fbshipit-source-id: 142dabcc0a7e688309cc4fc5ced8abde6914879e
2021-01-06 05:02:31 -08:00
dependabot[bot]
be6fd42e11 Bump pako from 1.0.11 to 2.0.2 in /desktop (#1786)
Summary:
Bumps [pako](https://github.com/nodeca/pako) from 1.0.11 to 2.0.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/nodeca/pako/blob/master/CHANGELOG.md">pako's changelog</a>.</em></p>
<blockquote>
<h2>[2.0.2] - 2020-11-19</h2>
<h3>Fixed</h3>
<ul>
<li>Fix esm build named exports.</li>
</ul>
<h2>[2.0.1] - 2020-11-17</h2>
<h3>Changed</h3>
<ul>
<li>Changed esm build <code>.js</code> =&gt; <code>.mjs</code> to fix node.js <code>import</code>.</li>
<li>Added <code>module</code> entry in package.json for some bundlers.</li>
</ul>
<h2>[2.0.0] - 2020-11-17</h2>
<h3>Changed</h3>
<ul>
<li>Removed binary strings and <code>Array</code> support.</li>
<li>Removed fallbacks for TypedArray methods (<code>.set()</code>, <code>.subarray()</code>).</li>
<li>Rewritten top-level wrappers.</li>
<li>Removed support of <code>Inflate</code> &amp; <code>Deflate</code> instance create without <code>new</code>.</li>
<li><code>Inflate.push()</code> no longer needs second param (end is auto-detected).</li>
<li>Increased default inflate chunk size to 64K.</li>
<li>Moved exported constants to <code>.constants</code>.</li>
<li>Switched to es6. Legacy es5 builds available in <code>/dist</code>.</li>
<li>Added esm build.</li>
<li>Structure of <code>/dist</code> folder changed.</li>
<li>Upgraded build tools to modern ones.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="45cce9f4d6"><code>45cce9f</code></a> 2.0.2 released</li>
<li><a href="b3861d9a66"><code>b3861d9</code></a> dist rebuild</li>
<li><a href="d0382badcc"><code>d0382ba</code></a> Fix esm build named exports</li>
<li><a href="8d5f9c70f8"><code>8d5f9c7</code></a> 2.0.1 released</li>
<li><a href="70ee7697ac"><code>70ee769</code></a> dist rebuild</li>
<li><a href="bd90fca738"><code>bd90fca</code></a> Add <code>module</code> entry for some bundlers</li>
<li><a href="84d6931fe8"><code>84d6931</code></a> Rename module build .js =&gt; .mjs to fix node import (<a href="https://github-redirect.dependabot.com/nodeca/pako/issues/200">https://github.com/facebook/flipper/issues/200</a>)</li>
<li><a href="52df0c510f"><code>52df0c5</code></a> 2.0.0 released</li>
<li><a href="a8faeffc94"><code>a8faeff</code></a> dist rebuild</li>
<li><a href="b4d9a94488"><code>b4d9a94</code></a> Added esm build, <a href="https://github-redirect.dependabot.com/nodeca/pako/issues/97">https://github.com/facebook/flipper/issues/97</a></li>
<li>Additional commits viewable in <a href="https://github.com/nodeca/pako/compare/1.0.11...2.0.2">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pako&package-manager=npm_and_yarn&previous-version=1.0.11&new-version=2.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

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

Reviewed By: passy

Differential Revision: D25664507

Pulled By: cekkaewnumchai

fbshipit-source-id: bd33a7a11ef38b54675cde31d1243742476263d9
2020-12-22 04:03:03 -08:00
Michel Weststrate
41a1af33cb Kill metrics reducer
Reviewed By: nikoant

Differential Revision: D24332440

fbshipit-source-id: 0a48b25f98d93b181b622e8477a74c7ef0094816
2020-12-15 01:44:27 -08:00