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
Summary:
This diff introduces the AppInspect pane.
I didn't get very fare, and it is markup only, but while at it made a bunch of other improvement in the component lib, so figured to prematurely submit to don't make the diffs too big.
Improvements
- Separated sidebar and Layout.X, as it was to much responsibility for one component, and made customization hard. Also caused state loss when switching between resizable and not.
- Setup a basic top level selection. Maybe will move it into redux in the future, but for now it suffices.
- Introduced Layout.Horizontal and `Layout.Vertical` as alternative to Ant design's space. The reason is that the latter can't stretching children, which we use quite frequently. (that is because they use wrappers to create spacing, but since we run on Electron, we can use CSS `gap` instead, which handles that much more elegantly).
- Fixed issue where gutter handle could disappear when dragging to far.
Reviewed By: cekkaewnumchai
Differential Revision: D23867265
fbshipit-source-id: e872b7f48b868e255f2c34d45e811b8ed93d0b00
Summary: May be useful for stability signals, or general bug correlation down the line.
Reviewed By: nikoant
Differential Revision: D23904843
fbshipit-source-id: ca31722b58d4657a9600fe5ce16ea3b5efd2c870
Summary:
This adds support for flipper logs in Sandy, including some theme adjustments.
Did remove storage and showing of debug messages, as I noticed it tends to crash Flipper after a while since there are so many. Also added a fixed limit of only remembering last 1000
Also converted Toolbar and button with dropdown items to Sandy.
Reviewed By: cekkaewnumchai
Differential Revision: D23824528
fbshipit-source-id: b89d1182d4f14682251dbb482d93c2c009ddc7a4
Summary:
allow-large-files
Updated to typescript 4. Note that this is no new major, the way TS numbers is that 4.0 is simply the number after 3.9 (so they refuse to use 3.10).
Primarily reason is that it allows us to use `/** deprecated */`. although there are definitely more interesting improvements
Reviewed By: passy, nikoant
Differential Revision: D23869445
fbshipit-source-id: 54e251b398b8698d9b18898ce66c3203b32aa356
Summary:
Per title
~~Note: `useStore.tsx` is copied from D23783500 (e7fdd8332d). This should be merged correctly in case the diff is landed before.~~
Reviewed By: mweststrate
Differential Revision: D23784302
fbshipit-source-id: adb5678c1b2614e3af4278889529c3fa79335bef
Summary:
Typography on Sandy! The designed typography is [here in Figma](https://www.figma.com/file/4e6BMdm2SuZ1L7FSuOPQVC/Flipper?node-id=238%3A172)
Current deflects
- cannot find component for 'body - small' and 'meta'
- don't know how to set 'link secondary hover' as designed
Reviewed By: mweststrate
Differential Revision: D23869256
fbshipit-source-id: efb1475749cebad529b502458d1b15bd445bb346
Summary:
We're seeing some CSR mismatches when they aren't expected. Adding logging to print out what is being found, to see if it's any OS-specific encoding issues or something like that, or completely different CSRs, etc.
URL encoded in case there are differences in non printable characters.
Reviewed By: nikoant
Differential Revision: D23867267
fbshipit-source-id: f406a396c808687b6b84561eb1def61b565aee34
Summary: The Flipper `Button` component now uses Ant.design under the hood if available. This is detected using context
Reviewed By: cekkaewnumchai
Differential Revision: D23813166
fbshipit-source-id: 489a34d55c0b69d7b5bcd30f4275b89d0bb22c0d
Summary: Converted Buttons to hooks, to make it easier to use context in the future. No further changes.
Reviewed By: cekkaewnumchai
Differential Revision: D23812921
fbshipit-source-id: 3739ad49e734dbe4d903a23d58da7cc267f6e109
Summary:
This enables opening the settings panel from Sandy. Created a small code switch in layouting to make sure it looks ok in both sandy and native dialog. Inside the settings no new components are used yet, which will be done in next diffs.
Also removed the close button from temporarily titlebar as settings are now accessible from Sandy chrome
Reviewed By: cekkaewnumchai
Differential Revision: D23812321
fbshipit-source-id: f8888373632786bb75f6dad635d300729b5086dc
Summary: This copies several utilities from the old title bar to the new one. We will have to revisit this in the future as it will eventually disappear. But in the mean time it makes sure version info and performance graphs are shown
Reviewed By: cekkaewnumchai
Differential Revision: D23824366
fbshipit-source-id: 0e495cd6d70db6a38da6df52b47ffee4bcb6f69f
Summary: I accidently broke search by query in a previous diff, so fixing it here
Reviewed By: passy
Differential Revision: D23842187
fbshipit-source-id: 9fcc7a46048ff99e1bf26c8a70ef0240b38018cb
Summary:
Implemented a first button: make main menu collapsible.
Also introduced some additional utilities and hooked up startup performance logging
Reviewed By: cekkaewnumchai
Differential Revision: D23783500
fbshipit-source-id: 2456fd781a52d497facbaccfabe885e4f8c408c5
Summary: This diff introduces the. main sections and restyled resizable panes according to the Figma design
Reviewed By: cekkaewnumchai
Differential Revision: D23758349
fbshipit-source-id: 7f09574f6b5fb54551141c13667c664e1769f09a
Summary:
Probably more than just KitKat, but we got a specific report in
https://fburl.com/f88cvz4c for 4.4. ABI lists are not included
in the probs and unfortunately TS doesn't resolve this to a
`string | undefined` as it should.
{F336605489}
Reviewed By: jknoxville
Differential Revision: D23815568
fbshipit-source-id: b6af928f85549d0c973feb0d83a324252ce0f654
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1532
Upgrade to Electron 10, in an attempt to fix random hard Electron crashes. Didn't fix it, but given the changelog of Electron with all the bug fixes, seems to be a good idea nonetheless :)
Changelog: Flipper now uses Electron 10
Reviewed By: nikoant
Differential Revision: D23565000
fbshipit-source-id: 3f07b8cf8c438147bde5314698d20046ac9f94cf
Summary:
As requested in https://fburl.com/dpuz2cew
This diff adds a new popup menu option to copy the info of all the expanded elements in a view/component tree.
It does it by moving the copy function to the layer where all elements are available.
The diff also replaces `Copy` to a call to the same function.
Reviewed By: muraziz
Differential Revision: D23757826
fbshipit-source-id: 3f70c85267f928f7153db75ed8f4eaa3fac669e7
Summary:
This diff fixes two problems when further theming Flipper:
1. All shades of gray where defined in terms of black/white + transparency. Converted all colors to non transparent to make sure they stack well.
2. The color theme defined in less aren't available as javascript colors. It is possible to achieve that through setting up a babel parser that parses the less files and exposes them to JS. But since we have modern stack, figured that exposing all theme variables as CSS variables as well is a much simpler setup.
Reviewed By: passy
Differential Revision: D23756558
fbshipit-source-id: e92be1f66b11c2c9c400fc1622cb8a493cc4c2a5
Summary:
This setups the first bits of the Sandy Layout, and has a styled siderail according to the design, that does absolutely nothing.
{gif:0sa60r8c}
Reviewed By: cekkaewnumchai
Differential Revision: D23655313
fbshipit-source-id: e30278aeae0913e231ad105a9afb55c74c6a3370
Summary: Adds support for switching dark mode on the fly. Also added the option to apply certain settings without restarting Flipper, as that isn't needed in all cases.
Reviewed By: cekkaewnumchai
Differential Revision: D23625854
fbshipit-source-id: 82175ba10524daf1b48a65feec8c610460df9418
Summary:
Now full restart is not required for applying plugin changes (install/uninstall/update). So this diff changes the behavior to use reload instead of restart in Plugin Manager and Auto Update Manager. It is much faster than full restart.
Changelog: faster reload after plugin install/uninstall/update.
Reviewed By: jknoxville
Differential Revision: D23706701
fbshipit-source-id: b2dcaf7768a5d47b3c967c17e090fa74884b3850
Summary:
- Removed compilation on startup which is not required anymore after switching to plugin spec v2.
- Removed from Node process ("static" package) all the dependencies which are not required anymore: e.g. metro, babel etc.
- Plugin loading code from node process moved to browser process and made asyncronous.
Some expected benefits after these changes:
1) Reduced size of Flipper bundle (~4.5MB reduction for lzma package in my tests) as well as startup time. It's hard to say the exact startup time difference as it is very machine-dependent, and on my machine it was already fast ~1500ms (vs 5500ms for p95) and decreased by just 100ms. But I think we should definitely see some improvements on "launch time" analytics graph for p95/p99.
2) Plugin loading is async now and happens when UI is already shown, so perceptive startup time should be also better now.
3) All plugin loading code is now consolidated in "app/dispatcher/plugins.tsx" instead of being splitted between Node and Browser processes as before. So it will be easier to debug plugin loading.
4) Now it is possible to apply updates of plugins by simple refresh of browser window instead of full Electron process restart as before.
5) 60% less code in Node process. This is good because it is harder to debug changes in Node process than in Browser process, especially taking in account differences between dev/release builds. Because of this Node process often ended up broken after changes. Hopefully now it will be more stable.
Changelog: changed the way of plugin loading, and removed obsolete dependencies, which should reduce bundle size and startup time.
Reviewed By: passy
Differential Revision: D23682756
fbshipit-source-id: 8445c877234b41c73853cebe585e2fdb1638b2c9
Summary:
Do not list plugins packaged with format v1 in Plugin Manager.
Changelog: removed support for plugins packaged using legacy format (v1), so they won't appear in Plugin Manager anymore.
Reviewed By: passy
Differential Revision: D23681402
fbshipit-source-id: 1c9496ba6b739069d67228a0f4250f2f01aabd4d
Summary:
Sorry for so long diff, but actually there are no functional changes, just refactoring to make further changes of Plugin Manager easier to understand.
I've de-coupled the code related to plugin management from UI code and moved it from PluginInstaller UI component (which will be replaced soon by new UI) to "flipper-plugin-lib". So pretty much everything related to plugin discovery and installation now consolidated in this package.
Additionally, this refactoring enables re-using of plugin management code in "flipper-pkg", e.g. to create CLI command for plugin installation from NPM, e.g.: `flipper-pkg install flipper-plugin-reactotron`.
Reviewed By: passy
Differential Revision: D23679346
fbshipit-source-id: 82e7b9de9afa08c508c1b228c2038b4ba423571c
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