Commit Graph

179 Commits

Author SHA1 Message Date
Chaiwat Ekkaewnumchai
88f3faffb1 Enable Plugin
Summary: Encountered while debugging. Seems that the id was incorrect. This diff changes the id back to `"Example"`

Reviewed By: nikoant

Differential Revision: D24782578

fbshipit-source-id: ad1c6d6fe4962179ad609728c8641adc2063e929
2020-11-06 05:24:13 -08:00
generatedunixname89002005306973
a3bcf6b043 Flipper Release: v0.64.0
Summary: Releasing version 0.64.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D24590607

fbshipit-source-id: 04671a31028a33cf020acd8b83c219608fe38319
2020-10-28 06:06:33 -07:00
Pascal Hartig
f36c3656b5 Upgrade to React 17
Summary:
Doing some oncall upgrades.

Changelog: Upgrade internal React version to v17

Reviewed By: mweststrate

Differential Revision: D24506315

fbshipit-source-id: 911e4f657684b4d98ec3ef91bc8a81c43130da5b
2020-10-27 05:56:34 -07:00
Michel Weststrate
5731e3a155 Scrolling improvements
Summary:
Split container had a convenient property `scrollable`, that automatically applies a Scroll container to the main content.

But I noticed it leads to bad design choices because it is so convenient. So sometimes scrolling would be unnecessarily in two directions because of this.

Or, since the scroll container wraps around the whole content, toolbars would scroll out of view. By forcing scrolling to be put explicitly in the component tree, we encourage plugin developers to think about where they actually want to have that scroll, and in which direction.

Also added options to use the Container padding properties on ScrollContainer, which is great since we can keep the scrollbars outside the padding, and apply it to the content only, to prevent an accidental mistake where people would put a scroll container in a padded container, that would put the scrollbar inside the padding.

Reviewed By: cekkaewnumchai

Differential Revision: D24502546

fbshipit-source-id: 524004a1c5f33a185f9b959251b72875dd623cb3
2020-10-23 06:46:15 -07:00
Chaiwat Ekkaewnumchai
402ea2fc14 Convert to Shared Preference Plugin to Sandy
Summary:
per title

In addition, this diff adds `startUnactivated` option to allow setting up `onSend` mock implementation.

Reviewed By: mweststrate

Differential Revision: D24477989

fbshipit-source-id: f913574ebacdd436e8511baa43744249a014e90b
2020-10-23 06:22:02 -07:00
Michel Weststrate
966d748ace Some fixes in rendering legacy plugins
Summary:
Some exploratory testing on all iOS and Android plugins, to see how they behave inside Sandy, and fixed some layout glitches (some were also present without Sandy)

General fixes:
* Introduced some niceties like searchbox resizing properly, and toolbars wrapping automatically in Sandy, rather than buttons becoming invisible
* Containers don't grow anymore by default, but take size of contents
* ScrollContainer child is now a Layout.Vertical. Layout.Vertical should be used as default container everywhere (e.g. Tabs, Panels) in the future
* Fixed layout issue if a split container had only 1 visible child
* DetailsSidebar now scrolls vertically by default
* Details sidebar would sometimes render content in-place rather than in the reserved area
* AppSelector dropdown and Plugin list will now properly ellipse (...) if there is not enough space

Plugin fixes:
* Long database / table names in Database plugin would break layout

Also fixes https://github.com/facebook/flipper/issues/1611

Reviewed By: passy

Differential Revision: D24454188

fbshipit-source-id: c60c867270900a1d4f28587d47067c6ec1072ede
2020-10-22 09:41:11 -07:00
generatedunixname89002005306973
0f23f409ab Flipper Release: v0.63.0
Summary: Releasing version 0.63.0

Reviewed By: nikoant

Differential Revision: D24423408

fbshipit-source-id: 0bc12c49d8bf77d8dbf9688adb07dc176b210548
2020-10-20 11:13:12 -07:00
Michel Weststrate
a2fac737f6 Render sidebar
Summary:
Restore sidebar functionality for Sandy plugins

Also needed to fix some circular dependency issues as fallout.

Reviewed By: cekkaewnumchai

Differential Revision: D24362215

fbshipit-source-id: 0a09ac35ba981322ae0793edc3aa79ffddf2ce73
2020-10-20 03:24:47 -07:00
Michel Weststrate
99757622a5 Tiny Regex improvements
Summary: Recreation of D22118786, which was so old rebasing died on some lacking meta data. Lands https://github.com/facebook/flipper/pull/1256

Reviewed By: passy

Differential Revision: D24331424

fbshipit-source-id: 65fc5d8bf0242d4266e269716a319d71ce2e2826
2020-10-15 09:23:35 -07:00
Michel Weststrate
6b7b1fab5c Fix content encoding issues
Summary:
Changelog: [Network] Non-binary request are not properly utf-8 decoded on both iOS and Android, both when gzipped and when not gzipped

This diff fixes a long standing / ping-pong issue regarding network decoding differences between
* iOS vs Android
* binary vs utf-8
* gzipped vs uncompressed

The changes aren't too big, but the underlying investigating is :)

The primary contribution to this diff is:

First, adding test cases for know problematic cases. This is done by grabbing the messages that are send from the flipper client to flipper using the flipper messages plugin. This is the base64 data that is stored in the `.txt` files. Beyond that, for all tests public endpoints are used, so that we can both get a hold of the raw original files, and how we expect them to be displayed in flipper.

For testing a simple RN app was build, with a button that fires a bunch requests. The first 3 are captured in unit tests, the last one is not idempotent, but a case reported in #1466, so just left it there as manual verification.

```
const fetchData = async () => {
  await fetch(
    'https://raw.githubusercontent.com/SangKa/MobX-Docs-CN/master/docs/donating.md',
    {
      headers: {
        'Accept-Encoding': 'identity', // signals that we don't want gzip
      },
    },
  );
  await fetch('https://reactnative.dev/img/tiny_logo.png?x=' + Math.random());
  await fetch(
    'https://raw.githubusercontent.com/SangKa/MobX-Docs-CN/master/docs/donating.md',
  );
  await fetch(
    'https://ex.ke.com/sdk/recommend/html/100001314?hdicCityId=110000&paramMap[source]=&id=100001314&mediumId=100000037&elementId=&resblockId=1111027381003&templateConfig=%5Bobject%20Object%5D&fbExpoId=346620976471638017&fbQueryId=&required400=true&unique=1111027381003&parentSceneId=',
  );
};
```

The second contribution of this diff is that it doesn't use weird URLencoder hacks to convert base64 to utf8, but rather a proper library. The problem with our original solution, using `atob` is that it converts to ASCII, not to utf-8, which is the source of the original bugs. See for more background on this: https://www.npmjs.com/package/js-base64#decode-vs-atob-and-encode-vs-btoa-

Solves:
https://github.com/facebook/flipper/issues/1466
https://github.com/facebook/flipper/pull/1541
https://github.com/facebook/flipper/issues/1458

Supersedes D23837750

Future work: we don't inspect the `content-type=xxx;charset` header yet, which we should do for less common encodings, to make sure that they get displayed correctly as well

Future work: in feature like copy data and curl, we always call decode body, without check if we are actually dealing with non-binary data. Probably it is better to keep binary data in base64, rather than decoding it, as that will assume the data is an utf-8 string, which might fail.

An assumption in these changes is that binary data is never gzipped, which is generally correct; gzip is not applied by webserver to things like images, as it would increase, not decrease their size, and waste a lot of computation power.

Reviewed By: cekkaewnumchai

Differential Revision: D23403095

fbshipit-source-id: 5099cc4a7503f0f63bd10585dc6590ba893f3dde
2020-10-14 06:23:27 -07:00
Anna Murawska
fdde2761ef Migrate Network plugin to Sandy (#1583)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1583

Migrate Network plugin to Sandy

Reviewed By: mweststrate

Differential Revision: D24108772

fbshipit-source-id: e889b9f6b00398cd5f98cf15660b42b1d5496cea
2020-10-14 01:48:55 -07:00
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