Commit Graph

9256 Commits

Author SHA1 Message Date
Andrey Goncharov
d9ecac4bc2 Track legacy manager API access
Summary:
We swap legacy MasterDetail and DataTable with the new ones that have power search.
The new ones have partially incompatible table manager API.
This diff adds a warning, a migration guide and  tracking for these cases.

Reviewed By: LukeDefeo

Differential Revision: D50969831

fbshipit-source-id: ef4153fec9720ea5d7ae1cb4df3528c5d6bca2bb
2023-11-03 08:03:50 -07:00
Andrey Goncharov
9c5df1516f Export legacy MasterDetail and DataTable
Summary: Allow plugin developers to force old search for migration purposes

Reviewed By: LukeDefeo

Differential Revision: D50969832

fbshipit-source-id: 7fe5c3e65680d628bced2cd09823f7f3c132d33a
2023-11-03 08:03:50 -07:00
generatedunixname89002005325672
36cb69e1fd Daily arc lint --take KTFMT
Reviewed By: martintrojer

Differential Revision: D50964272

fbshipit-source-id: 1bdfffd1b32f76f2a81e95c6a59e15805a3a9436
2023-11-03 07:00:14 -07:00
Anton Kastritskiy
99dbcfa079 casing convension
Summary:
[eslint-typescript/naming-convension rule docs](https://typescript-eslint.io/rules/naming-convention/)

Initially looked into it to enforce UPPER_CASE for top most constants like `const DELAY = 10` which is a standard in js ecosystem, which turned to be more difficuilt(we will still get there).

Turns out we had casing checks disabled for everything but typeLike names. What I did in this diff

- use default setting for eslint rule
    `✖ 9890 problems`
- with any propery names
    `✖ 8229 problems`
- without checking properies at all
    `✖ 3683 problems`
- without checking enum members
    `✖ 3231 problems`
- without checking object properties/methods
    `✖ 2978 problems`
- allowing PascalCase for variables
    `✖ 1657 problems
- allowing PascalCase for functions
    `✖ 975 problems
- not checking typeMethod and parameters
    `✖ 916 problems`
- allow double underscore before after variable
    `✖ 461 problems`
- allow snake_case variables
    `✖ 49 problems`

Fix remaining problems.

Future plans. Ban usage of PascalCase for variables that are not components

Reviewed By: LukeDefeo

Differential Revision: D50970193

fbshipit-source-id: d9f3abe6b02c9f7822598c8fa5382f58d067f70e
2023-11-03 06:16:18 -07:00
Luke De Feo
3bb3ce6a66 Fix media gallery activity
Summary:
Weird edge case, this activity doesnt actualy contain the content and instead its in the decor view behind it, solution is to filter it out from traversal and snapshot

https://fb.workplace.com/groups/443457641253219/permalink/643518977913750/

Reviewed By: elboman, lblasa

Differential Revision: D50936817

fbshipit-source-id: 8c1e276d4d943c42c9c2085bf70113347cbd5c74
2023-11-02 12:29:07 -07:00
Luke De Feo
62e9181075 Improve logging
Summary: Lets make the logging higher signal

Reviewed By: passy

Differential Revision: D50853449

fbshipit-source-id: 95ebfbc142c34c36fb11e459c573842580cd6e4c
2023-11-02 12:29:07 -07:00
Luke De Feo
bd6e1285da Only pixel copy if view is hardwell accell
Summary:
You can only use pixel copy if the view is drawn by the hardware, this sort of makes sense as there is no hardware buffer to copy from.

we were falling back but there was a lot of noise in the logs

Reviewed By: lblasa

Differential Revision: D50853427

fbshipit-source-id: 9365a3d566a05de9082afb8bc2915922c624fd88
2023-11-02 12:29:07 -07:00
Luke De Feo
44b8a39874 remove common package
Summary: Just cleaning up some packages

Reviewed By: lblasa

Differential Revision: D50849169

fbshipit-source-id: 2b732e41ff11361dc7462598f282abb2d4116ce7
2023-11-02 12:29:07 -07:00
Luke De Feo
5b89331ea2 Fix case where traversal was out of sync with snapshot
Summary:
Its was possible for the view tree observer to be observing one root but this can a dead root with no view in it. As a result the snapshot will be empty and the observer will never fire.

The layout traversal Applicaiton ref descriptor had logic to handle these dead roots, this logic is now extracted and shared between the descriptor in the traversal and by the decor view tracker so they are in sync

Reviewed By: lblasa

Differential Revision: D50848155

fbshipit-source-id: ce6da13df40632cbb7a302a59382b4907131d9f5
2023-11-02 12:29:07 -07:00
Luke De Feo
d26612d840 Add modern snapshot approach
Summary:
Since api level 34 there is a way to snapshot any view, prior to this you needed a window which you can only get from an activity, or a surface which required hacks. The hacks are in place for older verisons of android but ive added modern pixel copy snapshotter for future proofing in case google decide to make any of the previously used hack not work in future version of android

Since there was a bunch of common code in each snap shot impl this has been pull into a utility function

Reviewed By: lblasa

Differential Revision: D50845284

fbshipit-source-id: c7910c45ff51fcf8636adc3d7272198ac3d4aefe
2023-11-02 12:29:07 -07:00
Luke De Feo
6e64f53046 Support pixel copy on views attached directly to window manager
Summary:
As mentioned in the previous diff pixel copy only support copying a Window, Surface or SurfaceView, All of these underneath use surface.

For views attached to the window manager there is no activity / window so we need another solution

There is no official way to get a views underlying surface so we had to do some dirty hacks to get it from the window manager. See the inline comments for details.

Additionally it turns out that the pixel copy api was actually made async in Android 34, so to prepare for this the snapshot method was made a suspend function and we wrap the callback based apit with suspendCoroutine.

Reviewed By: lblasa

Differential Revision: D50845281

fbshipit-source-id: 5ba8ed6f330c1e04549812a6493ae5f4cb629d1f
2023-11-02 12:29:07 -07:00
Luke De Feo
d85adc030f Use pixel copy on activities
Summary:
Pixel copy is a more reliable and consistent way to take a snapshot rather than drawing into a canvas. It accepts either:

Surface
SurfaceView
Window

For root views that belong to an activity its easy to get the window so we do that here.

In the next diff we solve this for other root views

Reviewed By: lblasa

Differential Revision: D50845282

fbshipit-source-id: 3968828dedd1e96a854b907e0fd152ad64993d95
2023-11-02 12:29:07 -07:00
Luke De Feo
6bf93347ee Extracted snapshot out of descriptor
Summary: Snapshot never made much sense in the descriptor since we only snapshot the decor views. Additionally in the next diff i will introduce a new way to snapshot so this will make it easier

Reviewed By: lblasa

Differential Revision: D50845280

fbshipit-source-id: c2eac351b72786e7b66951d0fa09cea52a6dcc69
2023-11-02 12:29:07 -07:00
Luke De Feo
c93c494ef4 Refactor android view observation
Summary:
The previous approach was designed for a world that didnt happen and was extremely confusing and allowed for states that didnt make a lot of sense. E.g it was possible we were snapshotting multiple views.

The new model is much simpler. we still depend on the root view resolver to tell us about root decor views but now we just attach a predraw listener to the top most view and push out the updates. This is handled by the new class decor view tracker which is a replacement for all the observer business

Additionally we use a conflated chanel in the update queue, this means if the background processing is slow we wont keep adding new frames to the queue, we just keep 1 and the most recent frame

Partial layout traversal -> Layout traversal as traversal is now always from top to bottom of the whole application

Reviewed By: lblasa

Differential Revision: D50791527

fbshipit-source-id: 43640723aefa775aa7b74065f405cc08224ed8b8
2023-11-02 12:29:07 -07:00
Lorenzo Blasa
87cb9bd77a Track state changes
Summary: Track server connectivity state changes, queries will follow.

Reviewed By: antonk52

Differential Revision: D50928297

fbshipit-source-id: 9f3a3b799481556bab7339d710736448fed6004c
2023-11-02 10:42:15 -07:00
Lorenzo Blasa
afae1bd141 Track unable to become ready within timeout
Summary: This is currently done by querying the 'console-log' event. Instead, make it type safe and official.

Reviewed By: antonk52

Differential Revision: D50927954

fbshipit-source-id: ff767acdc51b942c6deb92ffbfd93288b3367062
2023-11-02 10:42:15 -07:00
Lorenzo Blasa
d5a0c206f2 Track WS server error
Summary: This is currently done by querying the 'console-log' event. Instead, make it type safe and official.

Reviewed By: antonk52

Differential Revision: D50927803

fbshipit-source-id: e0488782dd584e36b6f742f9892fc09ffaf62469
2023-11-02 10:42:15 -07:00
Lorenzo Blasa
8f1b4ffa1c Track UI launches
Summary: This is currently done by querying the 'console-log' event. Instead, make it type safe and official.

Reviewed By: antonk52

Differential Revision: D50927713

fbshipit-source-id: 780c0f158bf8bdaa6d009035a0cee62c7828f479
2023-11-02 10:42:15 -07:00
Lorenzo Blasa
fecaa8d974 Back out "Use isPWA utility function instead"
Summary:
Original commit changeset: 6bc0c942b3d9

Original Phabricator Diff: D50885337

There's an issue with the import, same reason we do:

```
require('flipper-ui-core').startFlipperDesktop(flipperServer);
```

Reviewed By: aigoncharov

Differential Revision: D50926125

fbshipit-source-id: 04e1b920bcecab9f245924907637b36dac312f1f
2023-11-02 04:28:14 -07:00
generatedunixname89002005325672
e72dcbb28d Daily arc lint --take KTFMT
Reviewed By: martintrojer

Differential Revision: D50925513

fbshipit-source-id: 1b964b758c53d6d490bd6c7f76d003c0afecfc70
2023-11-02 03:41:53 -07:00
Lorenzo Blasa
c8ee1847a2 Flipper browser singleton
Summary:
This will ensure only one instance of Flipper is running at any given point in time.

#thanks antonk52 for guidance and advise implementing a single Flipper instance solution which will improve overall Flipper user experience.

Reviewed By: antonk52

Differential Revision: D50455446

fbshipit-source-id: 2407c77d43ba28e91d525f6cdb11d7b9db1cfab7
2023-11-02 03:31:35 -07:00
Lorenzo Blasa
1a98038979 Use isPWA utility function instead
Summary: As a follow-up from the utility created on the previous diff

Reviewed By: aigoncharov

Differential Revision: D50885337

fbshipit-source-id: 6bc0c942b3d96eb020ec15395f34d5794ba2ae15
2023-11-01 11:15:17 -07:00
Lorenzo Blasa
08e742ceff Utility to determine if client is PWA
Summary: This is currently used in multiple places, let's put it under utils.

Reviewed By: aigoncharov

Differential Revision: D50883125

fbshipit-source-id: ee161a035cd01ca73a2521f813c4b397aa647037
2023-11-01 11:15:17 -07:00
generatedunixname89002005306973
368dfc90f6 Flipper Snapshot Bump: v0.235.1-SNAPSHOT
Summary: Releasing snapshot version 0.235.1-SNAPSHOT

Reviewed By: aigoncharov

Differential Revision: D50885747

fbshipit-source-id: a586315fd281e643298ea22c15758550d49ec845
2023-11-01 10:11:43 -07:00
generatedunixname89002005306973
7a6f95d120 Flipper Release: v0.235.0
Summary: Releasing version 0.235.0

Reviewed By: aigoncharov

Differential Revision: D50885746

fbshipit-source-id: 582d6c6373ffcd96572ae59f11709bb2d2741c67
2023-11-01 10:11:43 -07:00
Andrey Goncharov
b4f77da11a Fix unexpected unkown options recognition
Summary:
#thanks LukeDefeo for helping to debug power search

Before:
 https://pxl.cl/3JFqq

Reviewed By: LukeDefeo, lblasa

Differential Revision: D50884084

fbshipit-source-id: 4cf76a73704cda3627b3bb5ab170d6e76df977cf
2023-11-01 07:55:57 -07:00
Pascal Hartig
6d3ff9d5d9 Bump Fresco to 3.1.3 (#5252)
Summary:
[android] Bump Fresco to 3.1.3

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/5252).
* __->__ https://github.com/facebook/flipper/issues/5252
* https://github.com/facebook/flipper/issues/5247
* https://github.com/facebook/flipper/issues/5246
* https://github.com/facebook/flipper/issues/5245

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

Reviewed By: lblasa

Differential Revision: D50737888

Pulled By: passy

fbshipit-source-id: 18eba6b140abf24ae9b1c4440938b19432b2e620
2023-11-01 07:47:09 -07:00
Luke De Feo
9f78eb3f00 Fix NPE in text descriptor
Summary: Apparantly this can be null, we have received traversal errors with this in the stacktrace

Reviewed By: adityasharat

Differential Revision: D50839760

fbshipit-source-id: 8e43f35b2adfa91358924b1e162c53c50b0d855d
2023-11-01 06:41:55 -07:00
Luke De Feo
620b41b691 Fix npe crash in visibility check
Summary:
https://fb.workplace.com/groups/443457641253219/permalink/1716178925529425/

we had this stack trace which i belive is because we are accessing the litho view after its been unmounted, this is possible as the attributes fetching is async. To fix we move this part to be sync on the main thread

ui-debugger] Client error during traversal:  {\n  \"nodeName\": \"DeferredProcessing\",\n  \"errorType\": \"NullPointerException\",\n  \"errorMessage\": \"Attempt to invoke virtual method 'com.facebook.rendercore.extensions.ExtensionState com.facebook.litho.LithoHostListenerCoordinator.getVisibilityExtensionState()' on a null object reference\",\n  \"stack\": \"java.lang.NullPointerException: Attempt to invoke virtual method 'com.facebook.rendercore.extensions.ExtensionState com.facebook.litho.LithoHostListenerCoordinator.getVisibilityExtensionState()' on a null object reference\\n\\tat com.facebook.litho.LithoView.getVisibilityExtensionState(LithoView.java:710)\\n\\tat com.facebook.litho.DebugComponent$Companion.isVisible(DebugComponent.kt:406)\\n\\tat com.facebook.flipper.plugins.uidebugger.litho.descriptors.DebugComponentDescriptor.getMountingData(DebugComponentDescriptor.kt:182)\\n\\tat com.facebook.flipper.plugins.uidebugger.litho.descriptors.DebugComponentDescriptor.access$getMountingData(DebugComponentDescriptor.kt:32)\\n\\tat com.facebook.flipper.plugins.uidebugger.litho.descriptors.Debug

Reviewed By: adityasharat

Differential Revision: D50843793

fbshipit-source-id: 8c1df8b291371fd379cb819df33ed933f36026a6
2023-11-01 06:41:55 -07:00
Brett Lavalla
254110bf02 Make 'none' AccessibilityRole return the class for View
Summary:
This changes the default behavior for a "NONE" accessibility role to match Googles implementation in ExploreByTouchHelper (https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/com/android/internal/widget/ExploreByTouchHelper.java;drc=c7585d0e2f27f00c47802a78422228a81cf2c939;l=56?q=ExploreByTouchHelper).

This also matches ReactNative's default behavior here as well:
https://www.internalfb.com/code/fbsource/[199b5d1c47b224f2891b8cba33da90c5c8714a81]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java?lines=291

A role of "View" is a no-op behind the scenes for accessibility services, but making this a valid string rather than `null` will prevent potential crashed from systems expecting a string value to always exist from the "getClassName" method.

For context on how large of a potential problem this is, see this post:
https://fb.workplace.com/groups/sbteng/posts/1396301817590446

Reviewed By: ikenwoo

Differential Revision: D50864782

fbshipit-source-id: 8b176ed9427f62a1d039b012d10ea889df4777e3
2023-11-01 05:46:53 -07:00
generatedunixname89002005306973
0f3f4de25e Flipper Snapshot Bump: v0.234.1-SNAPSHOT
Summary: Releasing snapshot version 0.234.1-SNAPSHOT

Reviewed By: aigoncharov

Differential Revision: D50878229

fbshipit-source-id: 93f70c9b4109746edcedf2f06d4113ca4a776c10
2023-11-01 05:11:58 -07:00
generatedunixname89002005306973
7bbc386d71 Flipper Release: v0.234.0
Summary: Releasing version 0.234.0

Reviewed By: aigoncharov

Differential Revision: D50878230

fbshipit-source-id: 79a2a01b4e881ae6b97e3616057e759fd4f73c64
2023-11-01 05:11:58 -07:00
Lorenzo Blasa
6dd1fcd569 Set x64 default architecture and .pkg target for RN-only builds
Summary: These are local changes required to make an installer for the last RN-only Electron distribution of Flipper. Instead of just throwing this away, let's keep it in the history of the repository, just in case.

Reviewed By: passy

Differential Revision: D50838207

fbshipit-source-id: 4966e046161e24a616c04d5cf57fee2512f06525
2023-11-01 04:44:48 -07:00
Pascal Hartig
43530e3bbf Upgrade compose deps (#5247)
Summary:
[android][sample] Upgrade compose deps
Was dependent on SDK 34.

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

Test Plan:
 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/5247).
* __->__ https://github.com/facebook/flipper/issues/5247
* https://github.com/facebook/flipper/issues/5246
* https://github.com/facebook/flipper/issues/5245

Reviewed By: lblasa

Differential Revision: D50599220

Pulled By: passy

fbshipit-source-id: 54038274ba894264c4027e48799ce6d0ceda4e82
2023-11-01 03:38:11 -07:00
Andrey Goncharov
3706be8b2f Fix power search metrics
Summary: Move them from programmatic API that is barely used to a central place that handles state updates

Reviewed By: lblasa

Differential Revision: D50841152

fbshipit-source-id: 7938ae08629ba05736cb7acba5ca2014e2827acc
2023-10-31 09:51:13 -07:00
Pascal Hartig
8086816f82 Upgrade deps
Summary: 666 deletions seems just right.

Reviewed By: lblasa

Differential Revision: D50600098

fbshipit-source-id: 269ce9f1da18ece283492ed7ff29c4dcfc2f78b4
2023-10-31 07:10:30 -07:00
Lorenzo Blasa
57d4e86545 Additional troubleshoot guidance for idb
Summary:
Reference:
https://fb.workplace.com/groups/flippersupport/permalink/1717333982080586/

The steps added below seem to have fixed the issue.

Still need to investigate why these steps are needed.

Reviewed By: aigoncharov

Differential Revision: D50797561

fbshipit-source-id: a31c71dbedc506344438082846b41ff16b6f459a
2023-10-31 05:16:21 -07:00
Lorenzo Blasa
560a50485c Improve offline page
Summary:
The previous offline page suggested launching Flipper from terminal by running a command.

Although this works, guidance can be simplified by just instructing users to launch Flipper from within the Applications folder.

Reviewed By: aigoncharov

Differential Revision: D50833741

fbshipit-source-id: 5a41090a66ee62c30cfc35edd69de51ed9cbbab9
2023-10-31 04:45:33 -07:00
github-actions[bot]
6bec2d659e Automated: Update Podfile.lock (#5251)
Summary:
This is an automated PR to update the Podfile.lock.
- Make sure that the Podfile.lock contains latest FlipperKit and Flipper pod versions.
- Also make sure that all the dependencies are updated to the latest one.
- This is auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request)

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

Reviewed By: mweststrate

Differential Revision: D50793947

Pulled By: passy

fbshipit-source-id: be1d4967f825a125c1f8819f1c2eea4b52c9eaba
2023-10-31 04:42:26 -07:00
Pascal Hartig
87d9414bf0 Bump target SDK to 34 (#5246)
Summary:
[android] Bump target SDK to 34
Changelog: Android SDK is now built against SDK 34

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

Test Plan:
 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/flipper/pull/5246).
* https://github.com/facebook/flipper/issues/5252
* https://github.com/facebook/flipper/issues/5247
* __->__ https://github.com/facebook/flipper/issues/5246
* https://github.com/facebook/flipper/issues/5245

Reviewed By: mweststrate

Differential Revision: D50599215

Pulled By: passy

fbshipit-source-id: a9883fdbab7bdd06a63a2949e1502a7854299752
2023-10-31 04:41:05 -07:00
Lorenzo Blasa
34bbd41547 If unable to load main bundle, retry after 3 seconds
Summary: If we fail to load the main js bundle, retry after 3 seconds.

Reviewed By: aigoncharov

Differential Revision: D50732857

fbshipit-source-id: b19ea165776f8105d724e586b1bed20bf1f5178c
2023-10-27 10:19:33 -07:00
Andrey Goncharov
2c1e814264 Allow power search to be controlled externally
Reviewed By: LukeDefeo

Differential Revision: D50732883

fbshipit-source-id: a19932b5a3f319fd1dc45572fef251369283cc61
2023-10-27 05:45:28 -07:00
Lorenzo Blasa
f0023ea79d If there's an existing problem, show regardless
Summary:
Setup Doctor can be used to discover installation issues. I've seen numerous times when there's a setup issue but users didn't check / bother with using the tool.

Instead, if there's an issue, show the screen regardless.

Reviewed By: mweststrate

Differential Revision: D50642080

fbshipit-source-id: 10eb7a758a61765a5b06d398f5041897fff6280e
2023-10-27 03:12:03 -07:00
generatedunixname89002005325672
9aadcefbf9 Daily arc lint --take KTFMT
Reviewed By: martintrojer

Differential Revision: D50729003

fbshipit-source-id: b739c041af3edb9ae7f787368938b23ae8efe4d0
2023-10-27 01:34:53 -07:00
Luke De Feo
92e831cc40 Promote k state to top level
Summary:
In the new sidebar design complex types are behind a preview. before states was an array under the key states.

Now we create a top level attribute according to its index

Reviewed By: lblasa

Differential Revision: D50654698

fbshipit-source-id: 410c50c5f1ab14efc77184a5b147d9bdf70761d4
2023-10-26 11:29:30 -07:00
Luke De Feo
f3449a5641 Make panel adhere to Figma design
Summary: css to change the header styling

Reviewed By: lblasa

Differential Revision: D50595982

fbshipit-source-id: 836ea7881426e95abb449c085fca39606cd8cfdd
2023-10-26 05:24:30 -07:00
Luke De Feo
115cb1af71 Dont show empty subsections
Summary: changelog: UIDebugger - new sidebar design

Reviewed By: lblasa

Differential Revision: D50653551

fbshipit-source-id: 8a173abb033f35ba6abd2d5f417e647ca2ffe8e7
2023-10-26 05:24:30 -07:00
Luke De Feo
20a1b9d255 format numbers
Reviewed By: lblasa

Differential Revision: D50653525

fbshipit-source-id: 265a2821acef572ca6d9576be647ee1d07f3850e
2023-10-26 05:24:30 -07:00
Luke De Feo
8af6ca7f02 Shrink input size (final )
Summary:
Allows more content on screen. Final diff of stack

Changelog: UIDebugger, new sidebar design

Reviewed By: lblasa

Differential Revision: D50595987

fbshipit-source-id: 436af4191dba37f7a0f41dca23ab6349856358cd
2023-10-26 05:24:30 -07:00
Luke De Feo
aafd7e12df Add raw data panel
Reviewed By: lblasa

Differential Revision: D50595980

fbshipit-source-id: 3679d53cfbfe38ab466d96efe39928c0299fb4d5
2023-10-26 05:24:30 -07:00