Summary: Give the user something actionable when tree is not ready due to flipper connected check failing
Reviewed By: lblasa
Differential Revision: D49455254
fbshipit-source-id: 8869cacde5b65260f4615f5ba2ba34f967d7d27f
Summary: Leverages the new connection listener inside the ui debugger to send framework events out of the Litho debug api and to the UIDebugger
Reviewed By: adityasharat
Differential Revision: D48350647
fbshipit-source-id: 2af48578b70bc50da43712f244f2bd208ad40988
Summary:
This diff is fixing a NoSuchMethodError when calling FbReactApplicationBaseSonarUtil.startSonarClient.
This is causing catalyst Android app to not start.
This was caused by D47468613, which changed the signature of the method
Reviewed By: cortinico
Differential Revision: D48275730
fbshipit-source-id: 4693c299dbd3b6a9ad58a1439bddd9e4bfb8bdf5
Summary: Infra that will be used to capture litho framework events
Reviewed By: lblasa
Differential Revision: D47951601
fbshipit-source-id: 1dd756dc872d474f2872ff8cac1fd6aa3697e42b
Summary: Previously the bounds was 0, the trick is to steel the offset from the view and then use offsetchild zero so it doesnt get applied twice
Reviewed By: lblasa
Differential Revision: D47915115
fbshipit-source-id: ff771470dcf1720ca265fc9017ff0ea3b0bc1ca1
Summary: This whole nested observer approach can be simplified massively, but for now we are just threading the parent id through so its set for observer roots too
Reviewed By: lblasa
Differential Revision: D47915504
fbshipit-source-id: 924f722f38bb202b42ea9ef6da15e685f6c75e02
Summary: This allows UIDebugger to draw them differently in tree and visualiser
Reviewed By: lblasa
Differential Revision: D47915505
fbshipit-source-id: a4d2ef9d653233e3ff24bc26cfe8017f9b51dd2b
Summary: This is never identity hash code for declarative framework so this default impl is just a source of bugs, including this one.
Reviewed By: lblasa
Differential Revision: D47754625
fbshipit-source-id: 470aab084c82fa847f25116342021a79d52b7c67
Summary:
Previous approach was a bit flawed as the `isOpen()` API returns true by the time close is called.
This was OK in the case of errors, as the open flag was set to false hence preventing us to report a close after the error. It is not OK on healthy disconnect situations as these events were not getting reported.
In this case, a better solution is just to clear the event handler after a close or error because in either case we are no longer interested in dispatching any other events to the handler.
Reviewed By: antonk52
Differential Revision: D47510883
fbshipit-source-id: 883a3f87f24f71fe44a624590a310fe2563cbd8a
Summary:
The field changed from mStates to states breaking our reflection based code. Ideally I would like to just check if type == KStateContainer and access the field normally but the rest of the infrastructure expect to work on a java field.
Added tests to catch this sort of thing in the future. had to shift buck files around a bit to get it to work
Reviewed By: antonk52
Differential Revision: D46974357
fbshipit-source-id: 87a6f5883b33e4d1a7359df5987fc7ead7c19033
Summary:
Never really liked this code. Before this change, calls to connect were blocking.
Because of this, we had to make use of promises and a bit of really not that good-looking code.
So, this change makes connect non-blocking meaning that we make full use of our event handler.
These changes contain:
- CSR is not getting generated after each failed attempt.
- Connect is no longer blocking.
- Do not report events via the handler when explicitly disconnecting.
Reviewed By: jknoxville
Differential Revision: D46853228
fbshipit-source-id: 00e6a9c7c039a756175fe14982959e078d92bacb
Summary:
we need to wrap the bloks layout in a debug variet in order for flipper to work. See this diff for context D45605120
We are now using wether flipper is connected at all which is much more reliable.
Reviewed By: lblasa
Differential Revision: D46854921
fbshipit-source-id: 1b3baef2681ccce50fd452044cd3f740c256b0a9
Summary: Expose the newly created `isConnected` API to Android FlipperClient API.
Reviewed By: LukeDefeo
Differential Revision: D46841260
fbshipit-source-id: 1512e54d28779ef62423aa52727fed3a34d00333
Summary:
When looking at some of our logcats in logview, I noticed lots of StrictMode warnings related to a WebSocket not being tagged, and I figured out it was due to FlipperSocketImpl.
By making sure TrafficStats stats tag is set no matter if the SSL factory is used or not, it reduces the amount of StrictMode warnings we see.
Related diff: D38280819
Differential Revision: D46024367
fbshipit-source-id: 92a0bfcef8698a61ef9b27949a5bc0859e03448f
Summary: Replacing global static varaibles with local static. No cost at startup time, and also fixes any potential static initialization order fiasco.
Differential Revision: D45900844
fbshipit-source-id: 4ff05cbefe2f0c00199f40b9127e28c355d1819e
Summary:
Previously we would only generate debug wrapper for render core layout result when uidebugger was currently connected.
This meant if you navigate to a bloks screen *before* having the ui debugger open at render time it would read ui debugger as disconnected since the ui debugger is not a background plugin. The result is the user would see the native nodes instead of the bound tree, it was extra confusing since the layout result was cached so going forward and back doesnt solve it.
The ideal solution would be to have a global flipper is connected on the client but this isnt available yet, lorenzo said he would work on it later.
As a work around we use the fact that the uidebugger has ever been connected in this session.
It can still be confusing since the initial load of a bloks screen migt not generate the debug nodes until you navigate to the plugin once. I will add a note to the docs so say that you need to have open the uidebugger once before nodes will appear
Reviewed By: mweststrate
Differential Revision: D45605120
fbshipit-source-id: 970943b9f8f98221b7fc5e20bb1caf18c2266474
Summary: Cosmetic change to make the events more inline with what they are
Reviewed By: lblasa
Differential Revision: D42999134
fbshipit-source-id: e026e38da7e50e8f5520271246f9627eb22e8965
Summary:
This adds the base infra for the UIDebugger bloks integration as well as an implementation for the Layout result wrapper for bloks. When theUIDebugger is connected we wrap the original layout result with a debug varient that delegates all methods to the original layout result but also provides access to the bloks model.
This allows the UIDebugger to inspect the Layout result and bloks model together
Reviewed By: pasqualeanatriello
Differential Revision: D43444444
fbshipit-source-id: ac531a0c7491c05db1d6f7671e3ab09c73c213b9
Summary:
These are attributes that are:
1. Not common across frameworks
2. Not in every node
3. Will not be visualised via inspectable attribute mechansism
Currently we will use them for bloks but they should be useful for other features down the road
Reviewed By: lblasa
Differential Revision: D45048025
fbshipit-source-id: c258d0a384a2b09abb642778e68da178899fa9eb
Summary: This will allow a lot more flexibility and will be essential for making bloks work
Reviewed By: lblasa
Differential Revision: D44871256
fbshipit-source-id: 59d9fdccea7b18406eac532080e80a69a251267b
Summary: Since subtree update is effectively a frame dump its a lot easier to send the parent ID. This will save having figure it out on the client which is somewhat expensive and is needed for bloks
Reviewed By: lblasa
Differential Revision: D45048023
fbshipit-source-id: 90c4888df063de0aa69c9b93c86d9891e30becbe
Summary: Allow callers to pass id, deviceName, processName, and packageName when initializing Flipper. Since these are used to create the connection id, callers can use these to configure Flipper to work for secondary processes.
Reviewed By: calebgomer
Differential Revision: D44719389
fbshipit-source-id: 3df6d47855c113f454f37031df32c4891626aa66
Summary:
This diff is reverting D44566060
D44566060: Add Flipper support for secondary processes in Messenger VR by rra has been identified to be causing the following test or build failures:
Tests affected:
- [//fbandroid/javatests/com/facebook/messenger:no_sonar_in_production - main](https://www.internalfb.com/intern/test/281474996792449/)
Here's the Multisect link:
https://www.internalfb.com/multisect/1809753
Here are the tasks that are relevant to this breakage:
We're generating a revert to back out the changes in this diff, please note the backout may land if someone accepts it.
If you believe this diff has been generated in error you may Commandeer and Abandon it.
Reviewed By: passy
Differential Revision: D44682510
fbshipit-source-id: c0ae489bc5ae22c5339edd2c8988126b0adedd7f
Summary: Allow callers to pass id, deviceName, processName, and packageName when initializing Flipper. Since these are used to create the connection id, callers can use these to configure Flipper to work for secondary processes.
Reviewed By: passy
Differential Revision: D44566060
fbshipit-source-id: 605264c230956f4c9643c95c610ec40d736547ac
Summary:
On foldable devices, there's an issue whereas the topmost root view is of type `OverlayHandlerView`.
This doesn't seem to be related in any way to the running app's UI. Or at least is not something of interest when debugging the running app's UI (for example, ig4a).
This change effectively ignores the `OverlayHandlerView` instance as active child and instead returns the next to last root view.
Reviewed By: LukeDefeo
Differential Revision: D44579223
fbshipit-source-id: cea52289c5ba1e6a96817232ac54725b8d2f48d9
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/4631
In React Native for VR we use `FlipperUtils.shouldEnableFlipper()` to determine whether Flipper should be enabled for the given app build.
The problem is that some of our apps are legitimately running as services (e.g. `com.oculus.explore:explore`), so the check added inside Flipper in D5126205 which only enables Flipper for "main application's process".
This diff adds an ability to relax this requirement (as we do want to do it for the RN VR applications)
Reviewed By: passy
Differential Revision: D44511667
fbshipit-source-id: 673912b204391799a9e8821b737681d1f44bd6a8
Summary:
Added infra for collecting events from UI frameworks.
1. Framework event metadata captures all the static metadata around the event. This allows to us to not send the same metadata in every event as well as populate the monitoring drop down immediately. This is sent in init since this information is static
2. Framework event itself is quite bare at the moment. It will have thread and more attributes in the future
The UIdebugger litho support ulitity has been simplified now there are 3 extension points.
Context renamed to UIDContext since it is referenced in app initialisers where the android context is also imported and it create a naming collision
Reviewed By: lblasa
Differential Revision: D42606933
fbshipit-source-id: a419f3fd424c533d586813004c40b68feafd9a2e
Summary:
The goal is to restore the *TimeMachine* functionality in Flipper while the new UI Debugger is working in a revamped version. This version was previously removed in D42573698 (b31f8c8755).
This time machine functionality will only be available for *LithoView* that are backed by a *ComponentTree*.
Below you can find a high-level overview of the current schema:
{F884011465}
Reviewed By: LukeDefeo, adityasharat
Differential Revision: D43574130
fbshipit-source-id: fe9d661e5fcce9655e70be4785652e7048dade54
Summary: Having a timeout of 10 seconds can create a connection loop if Desktop is slow and doesn't provide a client certificate within the timeframe.
Reviewed By: antonk52
Differential Revision: D43405793
fbshipit-source-id: b1eebb4d2d66f02000f15a9889992ed0cc79bde2
Summary: The additional panel was confusing. We can add a search filter box later if needed
Reviewed By: lblasa
Differential Revision: D42801264
fbshipit-source-id: 4b2ecb44c5bc4751564a5cac3716f5af4a951f58
Summary:
Even with batching, updates can get split in half due to fact that each litho view has its own independant throttle. Eventually they will drift and and a traversal will get scheduled past the current frame for some of the views. It results in artifacts in the visualiser and will make time travelling wonky
The
Reviewed By: lblasa
Differential Revision: D42606932
fbshipit-source-id: c4cdf729302a380928b4d8720a59d5f7f6ff645a
Summary:
This is needed in preperation for the next diff where we will introduce an observer per litho view. Without batching we end up with really poor performance for a few reasons:
1. There are some operations on the desktop plugin that are o(nodes) so even sending small batches
2. Flipper isnt really a high performance message bus, it seems to prefer fewer larger messages
3. Queuing time on the client builds up as you spend more time waiting on the socket
In a future diff will address:
The name of subtree update event. It should probably be called something like FrameUpdate since they are always full frames
The performance monitoring, will more to timing methods and summing the result rather than the current appraoch of time markers
Reviewed By: lblasa
Differential Revision: D42453229
fbshipit-source-id: eda9830b4420e82874717cc69b241e1689f20029
Summary: We have gotton concurrent modification crashes from this
Reviewed By: lblasa
Differential Revision: D42343224
fbshipit-source-id: 9cf4046da63d40cbe6632c3ae24d95abd21081ba
Summary:
This plugin is rarely used and would need to be re-worked to work in a world where ComponentTree is not the only way of rendering a Litho hierarchy.
Deleting for now for simplicity
Reviewed By: adityasharat, passy
Differential Revision: D42573698
fbshipit-source-id: 0d9cd713b668e6fc79cd5cddcdcb9f24ed98f927
Summary:
This is temporary solution to get to parity with the old plugin. In future would like to make this more flexible on the desktop side
Additionally getData was renamed to getAttributes for consistency
Reviewed By: lblasa
Differential Revision: D41845248
fbshipit-source-id: 50e94a7712f5d42938229134e212cef5d379475d
Summary: This is obsolete and maintaining it as the protocol changes no longer makes sense
Reviewed By: lblasa
Differential Revision: D41845247
fbshipit-source-id: c4ead597ca66223ccfa091ac79a6a80784a3c8e4
Summary: we had special handling previously for nested scrollview and we previously used the indirect approach of asking for the local visible rect. New approach is to get the scroll x from the parent and apply it, will work for all scrolling view and it is a lot clearer what the intention is.
Reviewed By: lblasa
Differential Revision: D41772106
fbshipit-source-id: 04b5e68ecabd70548e788ed18423a360ce6c3fa7
Summary: On messenger they use fragments heavily and for navigation. The hide some views via the fragment but we were using that so we saw a lot of overlapping boxes. Ive added a check for if the fragment isVisible as well as exported some more fragment state
Reviewed By: lblasa
Differential Revision: D41800223
fbshipit-source-id: fde33c7542f5fa98d8b98e0722d4292f2d1b67d0
Summary:
The previous approach was to append any 'extra/floating' root view to the end of the childrens for the application descriptor. But the active child was always the last view so if there was a 'floating' decor view with no activity it would always be the active child, even if you opened a real activity from it. This was possible to do in FB4a and you could get into a situation where you couldn't see the top most activity.
New approach is to only iterate the root views from the resolver since it contains everything and map to activity if possible.
Reviewed By: lblasa
Differential Revision: D41731951
fbshipit-source-id: 9ef3fcfdaa41e9b07606ca6781cf22482b54e072