Commit Graph

168 Commits

Author SHA1 Message Date
generatedunixname89002005306973
ca271dd7c3 Flipper Release: v0.62.0
Summary: Releasing version 0.62.0

Reviewed By: nikoant

Differential Revision: D24248944

fbshipit-source-id: 05742031294f6a77c78c0bdccbdffe7d82427f05
2020-10-12 06:03:03 -07:00
Paco Estevez Garcia
8c5c38d9fc Log setData events from layout inspector
Summary: Add logging events for runtime changes, if a logger is set

Reviewed By: passy

Differential Revision: D24195046

fbshipit-source-id: b2d87dd1430c212a679c766e526d83d9958d7e52
2020-10-09 03:57:17 -07:00
Michel Weststrate
3ba8bbf03c Bump dependencies (attempt 2)
Summary: In D24138822 I basically bumped all desktop deps. That was a bit too much as it affected our build infra and broke it. The problem wasn't easy to bisect so choose a smaller set of deps instead to update; everything transpile & lint related + a few well tested runtime deps.

Reviewed By: cekkaewnumchai

Differential Revision: D24161841

fbshipit-source-id: 67162efeccd05a344b229ce976102cfafe6d1099
2020-10-08 01:49:10 -07:00
Michel Weststrate
64d6b7731d Fix scroll issue
Summary: While clicking around in Flipper, noticed that the stack trace in sections plugin wasn't scrollable, fixed that

Reviewed By: Andrey-Mishanin

Differential Revision: D24138245

fbshipit-source-id: 8e08d1d9e92af5f74a047d95d71788da8bf1bd3c
2020-10-07 02:26:11 -07:00
generatedunixname89002005306973
ad929b23d0 Flipper Release: v0.61.0
Summary: Releasing version 0.61.0

Reviewed By: mweststrate

Differential Revision: D24132584

fbshipit-source-id: 7ae6ad5144561d356effe8eda5eaf472445365e6
2020-10-06 03:43:56 -07:00
generatedunixname89002005306973
8054f6446f Flipper Release: v0.60.0
Summary: Releasing version 0.60.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D24017297

fbshipit-source-id: ff193e95edc7d236c204bddf83aba56a7f009469
2020-09-30 09:28:54 -07:00
generatedunixname89002005306973
c0e8cef466 Flipper Release: v0.59.0
Summary: Releasing version 0.59.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D23985341

fbshipit-source-id: a477f9c05f7a62db3a59758c8c5fe06651ffa6f2
2020-09-29 08:11:39 -07:00
Chaiwat Ekkaewnumchai
95ae7a8bce Fix Tree View Misbehavior
Summary: The misbehavior came from undefined height and width inside `Sidebar` component. This is fixed by put it in the container that expands through whole `Sidebar`.

Reviewed By: Andrey-Mishanin

Differential Revision: D23954008

fbshipit-source-id: 9c096a8f3141a012a2a1ab32c2d5e689e7bde396
2020-09-28 02:03:09 -07:00
Michel Weststrate
ecf4cff7cf Fix most lint warnings
Summary:
I noticed that after the typescript upgrade, I got several weird positives from ESLint (like unused parameters in a type definition, which are obviously always unused, e.g. `type onClick = (e: Event) => void`). After some investigation, it turned out these warnings are generated by eslint, but that those rules should be performaned by typescript/eslint instead. For future reference to which rules this applies:

https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/README.md#extension-rules

Updated the config, and while at it, fixed all warnings in our codebase, except for `react-hooks/exhaustive-deps` warnings, since those require semantic changes.

This reduces the amount of eslint warnings from 86 to 39.

Reviewed By: passy

Differential Revision: D23905630

fbshipit-source-id: 0557708fd9ec6b17840a3c191e7d3baf225bdf23
2020-09-28 01:42:48 -07:00
generatedunixname89002005306973
32315c2d97 Flipper Release: v0.58.0
Summary: Releasing version 0.58.0

Reviewed By: cekkaewnumchai

Differential Revision: D23872448

fbshipit-source-id: b74483db292311719a0231f9b2fed78122e9f339
2020-09-23 12:06:38 -07:00
James Harmon
0a06d6c546 Add button to copy highlighted requests to routes (mock requests) (#1447)
Summary:
Add feature to Network mocks in the Network Plugin which would allow a user to highlight network requests and copy into new routes (mocks).

For many production apps, network requests can contain many headers (easily 20 or more) and a large amount of data  returned in the response (1000's of characters).  Creating mocks for these manually is time consuming and error prone.

It would be better to make mocks automatically by allowing the user to highlight desired requests and have them automatically copied into new routes, also copying the headers and the response data.

Changelog: [network] Allow user to create new mock routes by highlighting existing network requests in the Network plugin

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

Test Plan:
Tested this change manually by running through the following scenario using the sample Android app:

1). Run a GET request from the Sample app.  Verify that the request/response is correct.  Highlight the request to be copied.

![request-screen](https://user-images.githubusercontent.com/337874/89750945-baf6b700-da93-11ea-86f6-3ec600e1727d.png)

2). Go to the Mock dialog by clicking on the "Mock" button

![mock-screen](https://user-images.githubusercontent.com/337874/89750979-e8436500-da93-11ea-9dde-8717436a03bb.png)

3).  Click on "Copy Highlighted Call" to create a mock Route from the selected request.  Verify that the "data" and "headers" tab panels are correct.

![mock-screen-2](https://user-images.githubusercontent.com/337874/89751029-132db900-da94-11ea-9419-6294a304f232.png)

![mock-screen-3](https://user-images.githubusercontent.com/337874/89751053-29d41000-da94-11ea-85db-a034a20e5c18.png)

Close the Dialog

4).  Run the request again from the sample app and verify that a mock request is returned with the correct data.

![response-mock-1](https://user-images.githubusercontent.com/337874/89751083-4cfebf80-da94-11ea-8523-192ebdc869f6.png)

![response-mock-2](https://user-images.githubusercontent.com/337874/89751092-58ea8180-da94-11ea-85fe-82b7a660789f.png)

Reviewed By: cekkaewnumchai

Differential Revision: D23027793

Pulled By: mweststrate

fbshipit-source-id: 197fd5c3d120a20b6bc5d9121ae781923d69b748
2020-09-18 07:26:31 -07:00
generatedunixname89002005306973
2fcab458bf Flipper Release: v0.57.0
Summary: Releasing version 0.57.0

Reviewed By: passy

Differential Revision: D23729543

fbshipit-source-id: 0156c0214b3665815ca648e995b78bb7cb2eba42
2020-09-16 04:27:08 -07:00
Michel Weststrate
0e6546b93a Lazily build copyText and deserialize request bodies
Summary:
This diff tries to address T74467181, where Flipper (Electron) crash hard with a segfault. Although I failed to find the root issue, I noticed that this typically happened when switching to the network plugin after a long time.

Switching the network plugin causes all rows to be rebuild, and during the process all request and response bodies are deserialized which can take very long and fully blocks Flipper making it totally unresponsive.

This diff fixes that issue, by making sure the lately added lazy evaluation of copyText is used, and that requests aren't deserialized during row generation, which is only needed for full body search purposes, by making that lazily as well.

While at it fixed D21929666 (which I never finished) as well, which is a Sandy prerequisite, since it coupled the generic search table to hardcoded networking concepts like request and response. "body" search, has now been rebranded "contents" search. That is generic and makes sense in both the network and qpl plugin. Probably will make these labelings better customisable when revisiting the grids in Sandy

N.B. I thought the issue might maybe that during the blocking process the garbage collector can't run, and the process would OOM. But that doesn't seem the case (or at least not without some other factor contribution as well), as in a quick test I can trivally allocate 30 GB of memory (making the system swap), but still the process runs stably. So even with this diff I can't satisfactory explain the crash, but at least it avoids a common circumstance in which they happen, and it significantly improves the user experience.

changelog: [Network] Fixed issue where Flipper would hang for seconds or even crash when opening the Network plugin

Reviewed By: jknoxville

Differential Revision: D23599338

fbshipit-source-id: 52164fe6997b879c91907e0afe42e08ca3f315b4
2020-09-10 05:55:54 -07:00
generatedunixname89002005306973
a47ac961f7 Flipper Release: v0.56.0
Summary: Releasing version 0.56.0

Reviewed By: jknoxville

Differential Revision: D23597790

fbshipit-source-id: e0f141eebe81e46619c71c8174fb78b1aaf2c035
2020-09-09 06:46:54 -07:00
John Knox
fdf9570cb7 Fix sandbox plugin initialisation
Summary: Fixes https://github.com/facebook/flipper/issues/1515

Reviewed By: passy

Differential Revision: D23572769

fbshipit-source-id: a541e2b4f626f520f39d21c3bf05d43ed919feb8
2020-09-08 08:33:34 -07:00
Dominik Wielgórski
5b4403b400 Splitting the 'OpenInIDE' API to 'resolvePath' and 'open' APIs
Summary: Detect if resolved path is properly computed and accordingly display a success or error notification within InAppErrorReporter.

Reviewed By: arpitratan

Differential Revision: D23425001

fbshipit-source-id: 4ca903a8b9e83dc0e11bb823537f56678dd85b76
2020-09-04 08:34:04 -07:00
Michel Weststrate
cd197aeaaf Make sure network plugin doesn't crash on invalid URLs
Summary: In the attached task an IPv6 address ended up in the URL send from IG. Since that URL couldn't be parsed, it crashed the network plugin. This change makes sure the plugin doesn't crash on invalid urls.

Reviewed By: cekkaewnumchai

Differential Revision: D23344503

fbshipit-source-id: c7ac2068e407a764d59e632bef1be7c4239c8c8a
2020-09-02 05:13:06 -07:00
Michel Weststrate
2f7a84115c Fix image rendering
Summary:
Images in the network plugin are rarely displayed in the network plugin, as it tries to use the public url to preview it. However, that won't if the endpoint is behind authentication, idempotent, etc. This diff changes the behavior to instead send the network body to flipper and use that to preview.

Changelog: [Network] Fixed image preview

Reviewed By: jknoxville, passy

Differential Revision: D23370743

fbshipit-source-id: 0070e9e38c10a5761b9f7190467e26f01a7b2471
2020-09-02 05:13:06 -07:00
root@sandcastle1585.atn1.facebook.com
66692dd722 Flipper Release: v0.55.0
Summary: Releasing version 0.55.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D23444759

fbshipit-source-id: b569ff8e8dce76028e323f906e7415689ae8b1c5
2020-09-01 03:54:11 -07:00
Dominik Wielgórski
610d06cbec Try to invoke Myles while the layout plugin is launching
Summary:
The first launch of Myles might produce a lag connected with the fact that Myles daemon needs to start (mainly, set up a Watchman subscription and depending on what state Watchman is in, it could take ~10 secs to initialise).
Therefore, trying to invoke Myles as soon as the Layout Plugin is enabled.

Reviewed By: mweststrate

Differential Revision: D23371702

fbshipit-source-id: 59ee3fb20b2df1330ff4048462f342ce2e12210a
2020-08-28 06:19:15 -07:00
Anton Nikolaev
5b2fc65101 Flipper opens two copies of React devtools for react-native
Summary: https://github.com/facebook/flipper/issues/1391

Reviewed By: mweststrate

Differential Revision: D23369774

fbshipit-source-id: 25b406d90a91dbf6c2b28ffdbdb44ed1bec8fffe
2020-08-27 03:48:27 -07:00
Michel Weststrate
8d4ff8d48e Fixed several UI issues in Databases plugin
Summary:
This diff improves showing details in the databases plugin in a few ways:

1. if there is large content, it is no longer rendered of screen
1. the section is now scrollable
1. made layout vertical rather than horizontal to have more space vor values
1. show the type of a value
1. better detection of JSON versus non-json values (primitives would be picked up as json, but in contrast binary ascii such as used in instagram wouldn't). This fixes also string to be rendered incorrectly by accidentally parsing them as numbers, such as can be seen in https://fb.workplace.com/groups/flippersupport/permalink/948112715669387/

Changelog: [Databases] Fixed several layout issues when inspecting rows, and added better JSON support and support for larger responses.

Reviewed By: cekkaewnumchai

Differential Revision: D23317689

fbshipit-source-id: 47ab5164e25da003e0d1a4ae7ccb1537b637e572
2020-08-25 08:49:24 -07:00
root@sandcastle962.atn2.facebook.com
36825675d1 Flipper Release: v0.54.0
Summary: Releasing version 0.54.0

Reviewed By: mweststrate

Differential Revision: D23314243

fbshipit-source-id: ce2561b356f082613f656fedac9c08b440845bb1
2020-08-25 08:25:04 -07:00
James Harmon
47d3dd6413 Load routes to device during init (#1491)
Summary:
This is a replacement for PR https://github.com/facebook/flipper/pull/1486 which had the wrong username

When the network plugin is loaded, the route table in the device is empty.  It needs to be populated with whatever routes have already been created and saved in local storage.  Otherwise, the user would need to modify the routes to force an update.

Issue is described here - https://github.com/facebook/flipper/issues/1476

## Changelog

Routes updated in device when plugin is initialized

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

Test Plan:
1. Create a mock for the get request in the sample Android app
2. Kill the app
3. Start the app
4. Issue the get request in the app
5. Verify that the request is mocked in the Network plugin

![image](https://user-images.githubusercontent.com/69264583/90853263-37648200-e33f-11ea-8ab1-afc09395e62e.png)

Reviewed By: passy

Differential Revision: D23292355

Pulled By: mweststrate

fbshipit-source-id: 2fe16e9067a627cae02a4b1db422952d364fd036
2020-08-24 14:56:32 -07:00
Michel Weststrate
0b528f19ce Escape table names and keys
Summary:
https://github.com/facebook/flipper/issues/1426

Changelog: [Databases] Fixed escaping of column names, see #1426

Reviewed By: jknoxville

Differential Revision: D23293248

fbshipit-source-id: 6acbb87727524ba2bdc7973cad8c124a3ee026e6
2020-08-24 08:08:25 -07:00
Esa Firman
f4c36377df make body option persisted across request selection (#1448)
Summary:
This PR make the formatter body option persisted across request selection as mentioned in [here](https://github.com/facebook/flipper/issues/432)

Close https://github.com/facebook/flipper/issues/432

## Changelog

Make request body option persisted across request selection

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

Test Plan:
1. Select the first request and change the body option from `parsed` to `formatted`

<img width="1432" alt="Screen Shot 2020-08-10 at 19 00 07" src="https://user-images.githubusercontent.com/1691440/89780560-de753c80-db3b-11ea-87d7-92831e16b961.png">

2. Move to second request, still in `formatted`

<img width="1431" alt="Screen Shot 2020-08-10 at 19 00 18" src="https://user-images.githubusercontent.com/1691440/89780573-e9c86800-db3b-11ea-900e-e6d02054e9ba.png">

Reviewed By: cekkaewnumchai

Differential Revision: D23264774

Pulled By: mweststrate

fbshipit-source-id: aed97642d030fa8e01e63d115e79ffb7a702c5e6
2020-08-24 03:34:20 -07:00
Michel Weststrate
744fe01922 Some renames
Summary:
Some non-semantic changes. Mostly an earlier rename that was accidentally done only locally rather than across the codebase

Also support `.spec` test extension, which is more idiomatic Jest, since we don't use the `.node` and `.electron` distinction anymore anyway.

Reviewed By: jknoxville

Differential Revision: D22976438

fbshipit-source-id: f3abedb36cbac1e835295177117ccbca492a67a1
2020-08-20 13:32:47 -07:00
Michel Weststrate
685cc09b3b DeviceLogs plugin to Sandy
Summary:
Converted the DeviceLogs plugin to sandy.

Kept logic and UI the same (so same batching, localstorage mechanisms etc). But used sandy api's for log subscribing, state, and separating the logical part of the component from the UI.

Note that some mechanisms work slightly different, like deeplinking and scrollToBottom handling, to reflect the fact that plugins are now long lived

Reviewed By: jknoxville

Differential Revision: D22845466

fbshipit-source-id: 7c98b2ddd9121dc730768ee1bece7e71bb5bec16
2020-08-20 13:32:47 -07:00
root@sandcastle1328.prn2.facebook.com
f1c3bf8697 Flipper Release: v0.53.0
Summary: Releasing version 0.53.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D23213490

fbshipit-source-id: 66dfa59dbae33d372bad9e284f9773e2ab88487b
2020-08-19 08:22:00 -07:00
Andrey Mishanin
f40c0b9f1e Add highlight for nodes in tree
Summary:
- Passing the `treeNodeIndexPath` from `FocusInfo` all the way to the `Tree` component.
- Using the index path to find the right node and give it a different visual appearance.

Reviewed By: kevin0571

Differential Revision: D23161057

fbshipit-source-id: 05a95444bb76c1f28a21b42bf477ed9c9929e3b1
2020-08-17 08:04:53 -07:00
Andrey Mishanin
7989b4792a Handling payload
Summary:
- Added `treeNodeIndexPath` to `FocusInfo` which represents the path to the selected node in the component tree.
- Extracting scope root ID from payload to identify the time line track that corresponds to the selected component.
- Finding the most recent 'Tree Build' event on the track so we can be sure the selected component is in the associated component tree.
- Extracting the index path to the selected node in the tree.

Reviewed By: kevin0571

Differential Revision: D23160875

fbshipit-source-id: 8607bf7b34bca1374f9fafded197b35c811f3f75
2020-08-17 08:04:53 -07:00
Andrey Mishanin
4fc63da386 Wrap focusedGenerationId in a type
Summary:
- Use `FocusInfo` type instead of a raw string (I'll add another field to it in the next diff and it made sense to keep the changes separate).
- `userSelectedGenerationId` now has the type of `string | undefined` for consistency.

Reviewed By: fabiomassimo

Differential Revision: D23160820

fbshipit-source-id: f210d93b9ed7cb25eb3c2c8e6e6aadec4dc872d7
2020-08-17 08:04:53 -07:00
John Knox
f743940d02 [network[ Fix missing response status code bug
Summary:
There's a bug in the network inspector.

Messages come in in batches for performance reasons.
These batches can include both requests and responses, but the code assumes only one or the other.

This fixes it to make it not mutually exclusive.

This bug only affects row building in the table, so when you click on the row, you can still see the response and everything.

Reviewed By: cekkaewnumchai

Differential Revision: D23102575

fbshipit-source-id: 47e8c6b0f1c9cf0d5860b6f349a7d9fe225c73ae
2020-08-13 07:59:08 -07:00
John Knox
9efcbdceaf Send large responses in chunks
Summary:
It's common for responses to be completely missing in the network inspector. This is because they are larger than can be serialized in one go on some devices, so we drop all messages larger than 1MB.

This changes the android client to send large responses in individually serialized batches. This way we avoid running out of memory and can still send arbitrarily large payloads.

Changelog: Android network inspector can now handle responses large than 1MB.

Reviewed By: passy

Differential Revision: D22999905

fbshipit-source-id: ff4eb8fa72a7e42ea90d12ffe0f20c6d1e58b7e5
2020-08-10 08:47:32 -07:00
Anton Nikolaev
4a1c2a9ece Custom eslint rule for disallowing cross-package references
Summary:
Added infra for writing and using custom eslint rules and created a rule for disallowing cross-package file imports. Such imports are anti-pattern and they also break standalone plugin bundling.

We still have a bunch of places where Flipper core references code directly from plugins. I've ignored these places for now and added task T71355623 to revisit them.

Reviewed By: passy

Differential Revision: D22998955

fbshipit-source-id: d04cff8fc115ba1300a7e6830306ec134046e927
2020-08-07 10:22:04 -07:00
James Harmon
6989fa608d Add HTTP Status Code to mock response for Route (#1441)
Summary:
Mock requests can currently only return an HTTP Status Code of 200.  This is not sufficient to take full advantage of the mocking feature.  It would be more useful to specify a status code for the response.  Then not only can the original request be tested, but failure of the call could be tested as well.

This is described in Issue https://github.com/facebook/flipper/issues/1423 [https://github.com/facebook/flipper/issues/1423]

Changelog: Allow user to change response code for a mock request

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

Test Plan:
Here is a video demonstrating the change
[Uploading response-status-code.mp4.zip…]

Here is a screenshot showing where the new HTTP status code is entered for the mock request:
![image](https://user-images.githubusercontent.com/337874/89370139-a1c1c500-d6a5-11ea-9a55-e5e99ba37af5.png)

This screenshot shows a mock response with an alternate return code:
![image](https://user-images.githubusercontent.com/337874/89370265-ecdbd800-d6a5-11ea-82e7-10afbd5dd939.png)

Reviewed By: jknoxville

Differential Revision: D22977811

Pulled By: passy

fbshipit-source-id: c1662dd02abeb4546c80a416ed87f8e0dadbf96a
2020-08-07 09:30:10 -07:00
generatedunixname89002005306973
d15ae99601 Flipper Release: v0.52.1
Summary: Releasing version 0.52.1

Reviewed By: passy

Differential Revision: D22976342

fbshipit-source-id: a4857df03cd1142615754a52f69d0f1578175f18
2020-08-06 10:14:30 -07:00
Anton Nikolaev
dcd1c08dea Expose IDEFileResolver from 'flipper' module to properly import it from 'layout' plugin (#1442)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1442

Layout plugin cannot be bundled as a standalone package because it imports a file from outside of its folder. This change exposes IDEFileResolver in a proper way so now it's possible to import it from 'flipper'.

Reviewed By: passy

Differential Revision: D22975515

fbshipit-source-id: 8af6d2ca1ceb8627a449e055c8773549dd681b7a
2020-08-06 04:54:14 -07:00
Michel Weststrate
7c6065889d support createPaste
Summary:
Added support for `createPaste` in Sandy plugins

Nice minimalistic example of how to expose a Flipper api to Sandy.

Note that some indirection could be removed by having an interface that is shared directly between `BasePluginClient` and `FlipperLib` (e.g. `PublicFlipperLib`). In contrast to `addMenuEntries` from the previous diff, `createPaste` is basically exposed verbatim to Sandy without additional wrapping, so those cases could be made simpler. Maybe will do that later.

Reviewed By: passy

Differential Revision: D22815873

fbshipit-source-id: e6d0773a35341edfe5de0898317eaadf88de79d0
2020-08-04 07:47:14 -07:00
Michel Weststrate
9c202a4a10 Introduce menu entry support
Summary:
[interesting] since it shows how Flipper APIs are exposed through sandy. However, the next diff is a much simpler example of that

This diff adds support for adding menu entries for sandy plugin (renamed keyboard actions to menus, as it always creates a menu entry, but not necessarily a keyboard shortcut)

```

  client.addMenuEntry(
    // custom entry
    {
      label: 'Reset Selection',
      topLevelMenu: 'Edit',
      handler: () => {
        selectedID.set(null);
      },
    },
    // based on built-in action (sets standard label, shortcut)
    {
      action: 'createPaste',
      handler: () => {
        console.log('creating paste');
      },
    },
  );
```

Most of this diff is introducing the concept of FlipperUtils, a set of static Flipper methods (not related to a device or client) that can be used from Sandy. This will for example be used to implement things as `createPaste` as well

Reviewed By: nikoant

Differential Revision: D22766990

fbshipit-source-id: ce90af3b700e6c3d9a779a3bab4673ba356f3933
2020-08-04 07:47:14 -07:00
Michel Weststrate
94eaaf5dca killed the concept of customizable column sets per device in device logs
Summary:
No device was using this feature, so doesn't look like there is a reason to keep it.

...if somebody was about to use this feature, let me know :). But probably, if we need this, a much more simple solution is to determine the visible columns with a simple switch on device type in the logs plugin, even though that is strictly speaking less scalable. But the current solution feels a bit over-engineered for something that is not really used.

Marked [interesting] as I might be missing some background concept which would make this relevant as well.

Reviewed By: jknoxville, nikoant

Differential Revision: D22763507

fbshipit-source-id: ecdbc779cbbfa3b0b72c80b459b12c1a25bf3fc4
2020-08-04 07:47:14 -07:00
Michel Weststrate
fbb1c78184 Separated index file into smaller files
Summary: More is more. Just moving code, no further changes.

Reviewed By: nikoant

Differential Revision: D22374891

fbshipit-source-id: 65c9af8b4b34ee8e16aeae5705528093e1c800cc
2020-08-04 07:47:13 -07:00
Michel Weststrate
006bf5357f Remove unused field from Logs plugin state
Summary: Didn't understand what that field meant. Turns out, it was never used.

Reviewed By: nikoant

Differential Revision: D22374893

fbshipit-source-id: c36d8f0c1be1b27306347d1c8c8a763c621720a5
2020-08-04 07:08:32 -07:00
Michel Weststrate
a286ef5c62 Remove unused types
Summary: Little cleanup

Reviewed By: nikoant

Differential Revision: D22374892

fbshipit-source-id: 4d561992b36bff212b926c2e52b73c6287851523
2020-08-04 07:08:32 -07:00
Michel Weststrate
b9c9e89b53 Support activate and deactivate in normal plugins
Summary:
Device plugins have an activate and deactivate hook, that reflects the plugin being selected in the UI. Added these same hooks to client plugins as well. In practice they are called at the same times as `onConnect` and `onDisconnect`, except for background plugins, which connect only once, so it is pretty useful to be still able to make the distinction.

Since there is now quite some common functionality between plugins and device plugins, will clean things a bit up in a next diff

[Interesting] as it explains the difference between the different lifecycle methods of plugins, and the impact of being a background plugin

LIfecycle summary:

1. app connects
2. for background plugins: connect them (`onConnect`)
3. user selects a plugin, triggers `onActivate`. will also trigger `onConnect` the plugin if it _isnt_ a bg plugin
4. user selects a different plugin, triggers `onDeactivate`. will also trigger `onDisconnect` if it isn't a bg plugin.
5. app is unloaded. Triggers `onDisconnect` for bg plugins. Triggers `onDestroy` for all plugins,

Reviewed By: jknoxville

Differential Revision: D22724791

fbshipit-source-id: 9fe2e666eb37fa2e0bd00fa61d78d2d4b1080137
2020-08-04 07:08:31 -07:00
Michel Weststrate
489dd1521e Make sure Sandy Devices Plugins are loaded in Flipper devices
Summary:
This diff makes sure that devices will actually instantiate applicable sandy device plugins. Similar to how client plugins are owned by Client, device plugins are directly owned by BaseDevice, which significantly simplifies life cycle management and doesn't dispatch updates to all Redux connect components whenever something irrelevant changes.

Also made sure `device.teardown()` is called. That API already existed, but wasn't used or implemented before.

Updated Flipper test utils to support testing device plugins as well (both Sandy and classic ones)

Reviewed By: passy, nikoant

Differential Revision: D22693929

fbshipit-source-id: 73b2b8666ef7a0e748ea89360db84734d37eb5be
2020-08-04 07:08:31 -07:00
generatedunixname89002005306973
f01b84be27 Flipper Release: v0.52.0
Summary: Releasing version 0.52.0

Reviewed By: passy

Differential Revision: D22921075

fbshipit-source-id: 4cab9552dcd5ff1a64d20e1e771a4f5173d54860
2020-08-04 06:15:23 -07:00
Michel Weststrate
c802215dd2 Make most text selectable
Summary:
Fix long standing issue where text by default in Flipper is not selectable. Which is super annoying when working with tables, trying to copy error messages, etc etc. Wanted to fix it with ant.design, but got so annoyed by not being able to select an error I needed, that I fixed it now :-P.

This diff makes all text selectable by default, and then bails out for specific elements, like section headers, button captions, the left toolbar (navigation) and top toolbar to preserve the desktop app look & feel.

Fixes a popular papercut issue

Changelog: All text is now selectable by default in Flipper.

Reviewed By: passy

Differential Revision: D22897793

fbshipit-source-id: 7bc50a987e012595956c07d1997959a5480790aa
2020-08-04 03:06:13 -07:00
Michel Weststrate
b7cfb509f1 Improve request formatting
Summary:
This diff adds several improvements to displaying requests / responses in the network plugin

1. If there is no formatter rendering the data, the data is rendered 'raw'
2. For binary data, `(binary data)` text is printed, rather than an empty box
3. For request that have an empty request / response, `(empty)` is printed, rather than an empty box
4. If a formatter is applied, we show which formatter was used, which makes it easier to debug / spot / report issues
5. If the graphql formatter can't parse the data because it is truncated, it won't return anything, so that it falls back to the next formatter (urlencoder) to take care of the presentation

Changelog: [Network plugin] Improved presentation of request / response bodies and fixed issues where they would sometimes not be displayed.

Reviewed By: jknoxville

Differential Revision: D22865373

fbshipit-source-id: 912d2f27269a4c9edbf62f2039d46ccf90a008af
2020-08-03 11:39:49 -07:00
John Knox
45d461a3b8 Don't escape and decode network response payloads
Summary:
This was originally done in https://github.com/facebook/flipper/pull/377 to support chinese characters, but it's not clear how it works, or what problem specifically it is trying to solve.

It's causing some problems where valid responses are failing to be "decoded", so I'm removing it.

Reviewed By: mweststrate

Differential Revision: D22866879

fbshipit-source-id: a19a57b0ddba2b9f434eb3c37e6b92da1dfbef01
2020-08-03 10:21:54 -07:00