Summary:
we used to send plugins list with connect command, now we can respond to getPlugins request with new api.
we still support old clients
Reviewed By: jknoxville
Differential Revision: D23625139
fbshipit-source-id: 37a24d0c83cd879d93287dd3a3d4d5d2f9477b34
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
Summary: When using TableRow, you can define both backgroudColor & zebraBackgroudColor to get a cusomized zebra look to your table.
Reviewed By: jknoxville
Differential Revision: D23623221
fbshipit-source-id: df68fa015c0cd99b5f44baedb56e952c20b2dd68
Summary:
With the new design from vpileggi, this diff separated a new app UI to the current one.
This diffs show the toggle switch to enable Sandy UI for devs who are in `flipper_sandy` GK. When toggled, it will bring Sandy UI up.
Reviewed By: mweststrate
Differential Revision: D23599398
fbshipit-source-id: d85c707e0fe7726a418b3551cedb36e455fb7d14
Summary:
This allow websocket client to receive and reply messages from desktop client.
## Changelog
Implement requestResponse for websocket connection, allowing websocket client to receive and reply messages from desktop client
Pull Request resolved: https://github.com/facebook/flipper/pull/1510
Test Plan:
Tested with custom websocket client, allow communicating getPlugins, init, deinit, etc.
But I think it's better to have dedicated unit tests for this (currently there's none?), let me know what you think.
Reviewed By: passy
Differential Revision: D23499396
Pulled By: jknoxville
fbshipit-source-id: fb445c0634afd46a525fc52da33b487da4e591fe
See D23051239
Since the crash reporter endpoint does not exist anymore, and no data was reported there, removing the corresponding code from Flipper as well.
This also fixes the last remaining startup warning as well :)
Reviewed By: priteshrnandgaonkar
Differential Revision: D23472612
fbshipit-source-id: 7ce9f6a0261cdfe197a7da9b28a86407299effec
Summary: This diff adds analytics for events like uploading certs, zipping certs.Also logs the payload data received in trusted and untrusted request handlers. It will be helpful to debug the issues through this events.
Reviewed By: jknoxville
Differential Revision: D23374024
fbshipit-source-id: 6fa709bbf05e1b99ed1882be953abbd968eefc6e
Summary: This diff adds a new PoC widget for the Layout Editor to select a string from a picker. It takes a Set of values and uses them as representation. One of them is considered selected.
Reviewed By: muraziz
Differential Revision: D23374681
fbshipit-source-id: 324a3dd74a6b16edb77b862345d5288dd714fea1
Summary:
This fixes two issues. One issue where the recent change of cdn to lookaside hostname broke our build download process. More about this can be found [here](https://fb.workplace.com/groups/flipperfyi/permalink/772986153467682/).
It also fixes a bug which occurred on a retry when an error happened. Recently I made changes where, if the build is downloaded then retrying shouldn't redownload it. But we used to remove the downloaded builds after install phase, so this diff just removes the build when the download is successfull.
Reviewed By: nikoant
Differential Revision: D23372251
fbshipit-source-id: b57e69f65a20fc123191962d60165a62859d4ef7
Summary: This diff fires a notification with a remediation suggestion when the client takes a long time to connect back, for both WW and FS_ACCESS case
Reviewed By: mweststrate
Differential Revision: D23321067
fbshipit-source-id: 17ab93974e9571a0ba78af05c624eeb0522637c6
Summary:
Flipper self inspection is being used by internal devs for a month now and peeple seems happy with it :) Let's make it available to open source devs!
changelog: Flipper Self inspection - Flipper Messages plugin added to dev builds to show messages sent/received from clients
Reviewed By: jknoxville
Differential Revision: D23345560
fbshipit-source-id: 95bac52b966a78fbfa8e4d4c4e15d9d45ca960f7
Summary: With this change, I verified that our enterprise wilde app is able to connect to Flipper.
Reviewed By: jknoxville
Differential Revision: D23318335
fbshipit-source-id: cc952297ead1e8afcb1d9f5062e593e51e8ce893
Summary:
Bringing the pkd CPU usage fix to open source releases.
Now when idb is installed, Flipper will always use it to check for devices, and only fallback to instruments if not.
Fixes https://github.com/facebook/flipper/issues/1028
Reviewed By: passy
Differential Revision: D23293675
fbshipit-source-id: 6ff3e89167f5f6d4130f197b2a675202334d0e7d
Summary:
`scrollTo` used there caused the window to scroll to the most left when a user was inspecting an element which horizontal scroll wasn't in the most left position.
This diff removes the horizontal constrain and only scroll vertically.
Reviewed By: mweststrate
Differential Revision: D23284227
fbshipit-source-id: 7c19cac7496927c631572e222cb1d635dd1f8ea4
Summary:
Note: this is to be stacked upon https://github.com/facebook/flipper/pull/1479
Note: this PR will probably not succeed against FB internal flipper, as I'm pretty sure there are more call sites that need to be updated. So consider this WIP
Currently connection errors are managed in the connection reducers, and are displayed through their own means, the error bar. Showing console.errors is also hooked up to this mechanism in FB internal flipper, but not at all in the OSS version, which means that some connection errors are never shown to the user.
Besides that there is a notification system that is used by for example the crash reporter and plugin updater.
Having effectively (at least) two notifications mechanisms is confusing and error prone. This PR unifies both approaches, and rather than having the connection reducer manage it's own errors, it leverages the more generic notifications reducer. Since, in the previous PR, console errors and warnings have become user facing (even in OSS and production builds, which wasn't the case before), there is no need anymore for a separate error bar.
I left the notifications mechanism itself as-is, but as discussed in the Sandy project the notification screen will probably be overhauled, and the system wide notifications will become in-app notifications.
## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/1483
Test Plan: Only updated the unit tests at this point. Manual tests still need to be done.
Reviewed By: passy
Differential Revision: D23220896
Pulled By: mweststrate
fbshipit-source-id: 8ea37cf69ce9605dc232ca90afe9e2f70da26652
Summary:
While converting Bloks-Script plugin, Timur found a bug where the message queue wasn't processed.
Although queue processing was unit tested, the integration into the rendering lifecycle wasn't explicitly tested and missed a TODO that already signalled this should have been implemented.
Added a unit test to verify the bug and fix. Also tested in a running Flipper instance with the converted plugin (next diff)
Reviewed By: jknoxville
Differential Revision: D23263909
fbshipit-source-id: 63783c980247bdf6c93d00a46881d7d0eb291d09
Summary: If myles is taking too long users might experience issues with multiple tabs open for 'open in diffusion' functionality. This diff addresses this problem by displaying 'open in ide' menu only if the path is already resolved.
Reviewed By: mweststrate
Differential Revision: D23242199
fbshipit-source-id: ffa698110d4c5e0c0e0686fbc56a7eea6b5782e6
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
Summary: Little ux tweak, there are some rare scenarios where you can end up in an empty plugin screen, made a small message.
Reviewed By: jknoxville
Differential Revision: D22846396
fbshipit-source-id: 0ad19f1c252112d78a5587e6633fee2d9542d5e1
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
Summary:
Handling issues typically start with: did you look at the Electron logs? Since Flipper is such an extensible tool, running in varying environments I think the console should be support as first class concept. Many errors are currently not shown to the user. This PR is a first attempt to fix that.
The implementation is based on https://github.com/samdenty/console-feed, which is used by quite some web based IDE like tools (like codesandbox), and offers a lot of goodies out of the box, like collapsing errors, objects, etc.
Edit: also added a counter keeping track of the amount of errors
N.B. no need to immediately review this diff, I'll import it to phabricator as soon as I can :)
## Changelog
changelog: Introduce 'Debug Logs' section to help users to troubleshoot issues or to provide more accurate reports.
Pull Request resolved: https://github.com/facebook/flipper/pull/1479
Test Plan: 
Reviewed By: jknoxville
Differential Revision: D23198103
Pulled By: passy
fbshipit-source-id: a2505f9fa59e10676a44ffa33312efe83c7be55d
Summary:
As per the title
Bug:
{F288338655}
Reviewed By: mweststrate
Differential Revision: D23168390
fbshipit-source-id: e57ac1f22c0a3932fe9948d16cf9fc9cc74ab636
Summary: Bringing this to the latest version everywhere.
Reviewed By: priteshrnandgaonkar
Differential Revision: D23051537
fbshipit-source-id: 5cad59ab6fcc57fc72df8ace985a7b5f39de2bda
Summary:
Detect the framework used for a given component and accordingly, display a proper IDE list.
[FB Only]
changelog: It is now possible to directly open CKComponents from the Layout inspect
Reviewed By: adityasharat
Differential Revision: D23158628
fbshipit-source-id: 305f10752c72eac001334f09bab29264e3e328a6
Summary:
Added corresponding method for CKComponents which handles two main cases:
- CKSomeComponent_Spec should have corresponding CKSomeComponentSpec.mm
- CKSomeComponent should have corresponding CKSomeComponent.mm
Reviewed By: cuva
Differential Revision: D23158626
fbshipit-source-id: 9d5645a70d838847696aced6bbc947a8c4383f0c
Summary: Useful for next diffs: enables to detect whether we have LithoComponent or CKComponent
Reviewed By: adityasharat
Differential Revision: D23128972
fbshipit-source-id: b9aef358c1426df4f05213c42e43402e8cae984f
Summary:
Few cases to consider:
- SomeComponent.* might correspond to SomeComponentSpec.java
- SomeComponent.* might correspond to SomeComponentSpec.kt
- SomeComponent.* might not have a corresponding Spec file
- SomeComponent.kt (if it's a KComponent) corresponds to SomeComponent.kt
Reviewed By: adityasharat
Differential Revision: D23100032
fbshipit-source-id: f0604f3d1061f0e15fa2f455bdddd4d07ac12305
Summary:
This diff adds upload and download logic for certs. It makes changes on both Flipper Client and Desktop side. With this we enable cert exchange through WWW.
Next Diffs:
1) Add Flipper state in cert provider for more debug data
2) Tests
Reviewed By: jknoxville
Differential Revision: D23092706
fbshipit-source-id: e576253606b64b62848b70203db7e09a3bd77fd9
Summary:
Added papercuts link to the thanks message after user submits a rating within the star rating popup.
Also increased the timeout after submitting ratings from 1500 to 5000, due to the longer thanks message. Also added a dismiss option.
Reviewed By: jknoxville
Differential Revision: D23115320
fbshipit-source-id: 78de3481e5a085949ddbfbdd51ff499b8b567959
Summary:
Running `instruments -s devices` causes the `pkd` process in catalina to spike to ~100% for a few seconds.
Flipper runs this command every 3 seconds to poll for devices.
This switches it to use `idb list-targets` instead which is much more performant.
Currently switched off in the open-source version while we make sure it's working well. If you set the GK value 'flipper_use_idb_to_list_devices' to true, then you'll get the new behaviour.
Reviewed By: passy
Differential Revision: D23102067
fbshipit-source-id: 9e17155d938a4fe326e082511f747444e4b533a2
Summary: Added new events for 'open in IDE' functionality within the Layout Plugin
Reviewed By: passy
Differential Revision: D23075105
fbshipit-source-id: 1d18977da728bb4c53cd13e8669253dea65d7c4d
Summary:
This diff adds a toggle setting in wilde which will enable certificate exchange through www.
Right now it just sends the information about which medium to be used for cert exchange to Flipper JS and its client side. But its implementation is not done yet.
### Flow for Wilde
Whenever user changes the setting(or when user logs out) we set the state of exchange medium and accordingly set/reset authtoken. Note at no given point we remove already existing certificates.
### Context for OSS
With this diff we introduce another way to do certificate exchange. Before this diff, we did certificate exchange by accessing the file system of app. But it turns out it's not possible to do that in applications signed by enterprise certs. Thus with this diff one can write their FlipperKitCertificateProvider and fetch the certificate from WWW.
Reviewed By: jknoxville
Differential Revision: D22896320
fbshipit-source-id: 55aef7028a62e71ba9c02f9f79acaab41d09c0c6
Summary: This is tanking our success rates, but is an expected behaviour.
Reviewed By: jknoxville
Differential Revision: D23001697
fbshipit-source-id: 48bcdb99543d590d544cce8322950568a0ef5c6f
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
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
Summary:
Dropdown menu to select IDE in which the Litho Component will be opened.
Some Litho Components do not have corresponding Spec files. Hence, I am first trying to access files with Spec suffix and retrying if fails without the suffix. The number of such files is limited.
[FB Only]
changelog: It is now possible to directly open source files from the Layout inspector
Reviewed By: adityasharat
Differential Revision: D22922126
fbshipit-source-id: e1109c995427755a28ba78a65f5ff98392fb7060
Summary: Populate class name for Litho Components.
Reviewed By: adityasharat
Differential Revision: D22922106
fbshipit-source-id: e18b748e0e0bd6f511558124a28b4b58d217ded7
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
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
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
Summary:
The device type enum was mixing two different concepts (emulator vs physical) and (archived vs not), and we already have a separate `isArchived` field. So cleaned this up to not leak it into sandy.
If anybody can think of any unforeseen consequences of this, lemme know :)
Reviewed By: jknoxville
Differential Revision: D22763506
fbshipit-source-id: bd2f7dbd1d2d2e6942ba7c6ddd8dc91ee34d591d