Commit Graph

21 Commits

Author SHA1 Message Date
Lorenzo Blasa
e80843d433 Modal visible -> open
Summary: The `visible` prop is marked as deprecated in favour of `open`

Reviewed By: passy

Differential Revision: D49226821

fbshipit-source-id: 4a4a7d03a1c8ff860c4e4cd02e19071185a8554e
2023-09-13 05:19:13 -07:00
Andrey Goncharov
ccdc6735c6 Log mock errors only for connected devices
Reviewed By: antonk52

Differential Revision: D44367935

fbshipit-source-id: e6de3bf08d9daef9e607b9d24200892f4d04ecd2
2023-03-24 06:34:38 -07:00
Michael Judd
0115ab3113 feat(network-plugin): add support for optional "gql operation name" in data table (#4625)
Summary:
Using this network tab explorer at a company that works in graphql is very difficult because everything comes from the same HTTP route. I've added support for an optional (not visible by default) "GraphQL operation name" field for people who want to use that.

## Changelog
Adds a new optional column in the desktop network plugin called "GraphQL operation name" which will display the operation name if its available.

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

Test Plan:
I didn't see much in the way of component testing for this behaviour. Looking for some guidance here. I'm happy to add some if we think that makes sense

https://user-images.githubusercontent.com/17029928/227016610-b6da1ff3-4a7e-45c6-88da-ceaa6fad53ad.mp4

Reviewed By: ivanmisuno

Differential Revision: D44331605

Pulled By: aigoncharov

fbshipit-source-id: fe7a7812541c235871ae8a71e5461ea2adbd2560
2023-03-23 05:38:15 -07:00
kongxiaojun
42ac82bc8c Fix a crash when trying to remove a mock network call (#4403)
Summary:
Crash when trying to remove a mock network call

Issue: https://github.com/facebook/flipper/issues/3799

## Changelog

Read mock routes type error.Transform it from array to object.

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

Test Plan: Test passed on my Mac.

Reviewed By: antonk52

Differential Revision: D42918910

Pulled By: passy

fbshipit-source-id: 919bb6d2a2887aed46fb4a348f3f93e7abb765e5
2023-02-13 05:05:18 -08:00
Andrey Goncharov
f463520522 Decapitate "network" plugin
Reviewed By: lawrencelomax

Differential Revision: D39466980

fbshipit-source-id: b880690a2b334fd063f2d06923743d67b79e7b08
2022-09-15 10:02:19 -07:00
Alex Hunt
e7591b2a81 Set clearLogs accelerator for log-rendering plugins
Summary:
Sets a default key binding of `ctrl+l` to clear the screen within built-in Flipper plugins which display a log view.

Motivation: A small quality of life improvement for developers used to the default "clear screen" binding. This makes our log-rendering plugins consistent with other native apps such as terminals, Chrome DevTools, and many others.

Reviewed By: mweststrate

Differential Revision: D37782638

fbshipit-source-id: 0a85b930faaa0e9468d5391f15092aad7b6057ee
2022-07-13 01:38:55 -07:00
Erkka Marjakangas
c973f4eba0 Add outgoing payload size to flipper network plugin
Summary:
Flipper network plugin does not show request payload size at all, only the response.

I was trying to use flipper to check the compression ratio and overall analytics log size, but wasn't able to it, so fixed the network plugin

Reviewed By: lblasa

Differential Revision: D34062808

fbshipit-source-id: f4d4395eece9d41380b8ac6f834a014315c5db66
2022-02-14 10:21:34 -08:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Pascal Hartig
47099cfd31 Fix Flipper lints #16
Summary: Larger list of fixes. Adding another package to the flipper export is a bit nasty but it unblocks us for now and centralises `remote` access which seems like a win for FAAS.

Reviewed By: mweststrate

Differential Revision: D30785421

fbshipit-source-id: 931297e8566b5d8a213b69ae87d0cda7648b3ed4
2021-09-08 08:44:19 -07:00
Pascal Hartig
09107460a3 Filter duplicate requests
Summary:
Right now this is throwing an error, we instead gracefully
handle this. I'm not quite sure where this is coming from but as we're
not really doing anything with the requests before they're added here,
it must be coming from the network stack.

We can't really build another stable key on the client side because we
also need to match it up with the response. Open for ideas!

Changelog: Network requests with duplicate IDs are filtered out

Reviewed By: mweststrate

Differential Revision: D30337820

fbshipit-source-id: d312833727b383fa5f4d18a506ab581cd2151d13
2021-08-16 05:32:36 -07:00
Michel Weststrate
a8062499df Use local storage for state persisting
Summary: Apply local storage setting at a few relevant places, see parent diff

Reviewed By: cekkaewnumchai

Differential Revision: D29516498

fbshipit-source-id: 4797986e3540217e42dfb867f7d627921b97618e
2021-07-05 08:39:54 -07:00
Michel Weststrate
767c6855c8 Clean up response handling
Reviewed By: priteshrnandgaonkar, fabiomassimo

Differential Revision: D28441183

fbshipit-source-id: 6e47d05145e986279860b49cfff078a905f62689
2021-05-19 06:22:43 -07:00
Michel Weststrate
b947a65c51 Fix Network serialization
Summary:
Changelog: [Network] Fix import / export of binary data

Introduced proper serialization of binary data when creating a Flipper export.
Implements / solves https://github.com/facebook/flipper/issues/2308

Reviewed By: nikoant

Differential Revision: D28441021

fbshipit-source-id: 90b524bf2a5d85e373073b50a3ccf2bb29628ee0
2021-05-17 03:17:00 -07:00
Pascal Hartig
69c7876be9 Enforce react/jsx-boolean-value
Summary: yarn fix results.

Reviewed By: nikoant

Differential Revision: D28329714

fbshipit-source-id: 564aa24bcdb4bc6cdea67dfad10a077a9c817a2d
2021-05-11 10:14:05 -07:00
Michel Weststrate
0c2348ebdb Introduce custom header columns
Summary:
Changelog: [Network] It is now possible to add custom columns for specific request / response headers

This implements #3 papercut. See also https://fb.workplace.com/groups/flippersupport/permalink/1080685582412099/

Didn't include a way to remove custom columns yet. But they can be hidden just like normal columns. Custom columns aren't remembered across Flipper sessions or apps. We can add that later if desired.

Reviewed By: passy

Differential Revision: D28223515

fbshipit-source-id: 3ed008883430be4ae51a645c6a4ac780467ba442
2021-05-06 04:27:59 -07:00
Michel Weststrate
9c5967caf9 Introduce button to copy request / response body to clipboard
Summary: Changelog: [Network] Introduce a copy button for request / response bodies

Reviewed By: passy

Differential Revision: D28222152

fbshipit-source-id: db33c8e91cbbe733502b32df75de14290e6f3d95
2021-05-06 04:27:59 -07:00
Michel Weststrate
72e34bbd0d Parse request bodies eagerly
Summary:
Currently the network plugin was always storing the transfer format of our request/ response bodies: a base64 string. However, those are not searchable, and every formatter (and multiple can be invoked in a single view) was responsible for its own decompressing.

This diff changes parsing requests / responses into an accurate format: a decompressed, de-base64-ed utf8 string, or a Uint8array for binary data.

We will use this in the next diffs to do some more efficient searching

Reviewed By: passy

Differential Revision: D28200190

fbshipit-source-id: 33a71aeb7b340b58305e97fff4fa5ce472169b25
2021-05-06 04:27:59 -07:00
Michel Weststrate
fc4a08eb55 Convert plugin UI to Sandy
Summary:
Changelog: Updated Network plugin to Sandy UI, including several UI improvements

Converted UI to Sandy, and some minor code cleanups

Moved all mock related logic to its own dir

Fixes https://github.com/facebook/flipper/issues/2267

Reviewed By: passy

Differential Revision: D27966606

fbshipit-source-id: a64e20276d7f0966ce7a95b22557762a32c184cd
2021-05-06 04:27:59 -07:00
Michel Weststrate
23402dfff6 Convert network plugin to Sandy
Summary:
converted the network plugin to use DataSource / DataTable. Restructured the storage to contain a single flat normalised object that will be much more efficient for rendering / filtering (as columns currently don't support nested keys yet, and lazy columns are a lot less flexible)

lint errors and further `flipper` package usages will be cleaned up in the next diff to make sure this diff doesn't become too large.

The rest of the plugin is converted in the next diff

Reviewed By: nikoant

Differential Revision: D27938581

fbshipit-source-id: 2e0e2ba75ef13d88304c6566d4519b121daa215b
2021-05-06 04:27:59 -07:00
Harold Martin
4d262c0da4 Add protobuf support to network inspector (#2080)
Summary:
Protobuf based APIs are becoming more common (i.e. gRPC) but are difficult to inspect. Unlike plain text data formats (JSON), Protobuf calls transmit binary data requiring the format to be known ahead of time, making ad-hoc inspection impossible. This PR allows for those format definitions (messages in protobuf terminology) to be transmitted from the client to the network inspector plugin. These definitions are then imported into ProtobufJS which enables the binary data transmitted to be inspected as easily as JSON data.

See Retrofit PR in https://github.com/facebook/flipper/pull/2084

## Changelog

* Add ProtobufJS library to network plugin
* New `ProtobufFormatter` UI in `RequestDetails`
* `ProtobufDefinitionsRepository` to cache and load protobuf defintions
* `addProtobufDefinitions` call in the Android network plugin

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

Test Plan: ![screenshot](https://user-images.githubusercontent.com/745166/111652068-001a5e80-87c4-11eb-8c94-e19b46dd074c.png)

Reviewed By: mweststrate

Differential Revision: D27507451

Pulled By: passy

fbshipit-source-id: 586d891b74f2b17d28fe7a2a99074da755851f38
2021-04-20 05:10:39 -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