Summary:
If you're going to swizzle, you have to be very careful to call the original version of the swizzled method!
The blame diff for this regression is D21285438.
In this case we would fail to call `swizzle_removeFromSuperview` if the view being removed was a child of a window. Thus the view would never be removed.
In practice, this manifested as `UITransitionView` instances being left around. These would block taps, leading to developer reports of unresponsive UI.
Reviewed By: priteshrnandgaonkar
Differential Revision: D21509692
fbshipit-source-id: e400c55232c44e9cd3f478eb2b456222c0bc6576
Summary: Similar to D21040424 and D21040426.
Reviewed By: Andrey-Mishanin
Differential Revision: D21335955
fbshipit-source-id: 5e8326915e54647c77fb241ad2ed4eaa55d0cfe2
Summary:
Similar to D21040429, we need to add data sent to Flipper desktop so that we can use to retrieve necessary data.
~~The implementation is different; storing **all** component data is needed because the plugin refers to it when asked for information. This might cause an issue because we need to store more data. However, due to the sparseness of data at a single touch, this shouldn't cause any OOM.~~
Implementation Detail:
- `FlipperKitLayoutPlugin.mm`
- When the process finishes the tree returned is trie from root node to every node that is touched
- `SKTouch.m`
- `_nodeStack` keeps track of path from root to current component
- `_treeStack` keeps track of current prefix tree (trie)
- `continueWithChildIndex` takes care of logic for `_nodeStack` and `_treeStack`
Reviewed By: Andrey-Mishanin
Differential Revision: D21335956
fbshipit-source-id: 84c0cabd7399abe50cf2deaff2b01149a1a792d5
Summary:
Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to:
* specify build settings (through the `xcconfig` property);
* and selectively include certain pods only in certain build configurations (e.g. debug).
Finally, this PR also includes a commit [to fix the current builds](https://github.com/facebook/flipper/pull/1086/files#r418526812).
## Changelog
> Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive.
Pull Request resolved: https://github.com/facebook/flipper/pull/1086
Test Plan: I have built and ran the Sample application, as well as used this version of Flipper with a new RN app built from `master`.
Reviewed By: passy
Differential Revision: D21381828
Pulled By: priteshrnandgaonkar
fbshipit-source-id: edf6dae28eb02336a49e8230654d6186360ea8d6
Summary:
Before this diff the nodes were not invalidated properly when the new view got added in the hierarchy, due to this there was following bug.
https://our.intern.facebook.com/intern/px/p/15RSP
Reviewed By: Andrey-Mishanin
Differential Revision: D21285438
fbshipit-source-id: b72aa93856688b31296ae1df4f15e128037aa1ca
Summary: Added in D14209157, but the JavaScript no longer ever calls this method.
Reviewed By: jknoxville
Differential Revision: D21290792
fbshipit-source-id: df1969d83f0dc096a24977c15c27100d2f2bdfc0
Summary: Currently subdescriptors are *always* rendered. Allow them to return `nil` to signal that they don't need to be rendered.
Reviewed By: cuva
Differential Revision: D21157249
fbshipit-source-id: 68a83424efc50723e1ec71c069feef8e10037671
Summary:
Before this diff, Flipper showed *leaf* views created by ComponentKit, but not any intermediate views. Now we show both.
A new node type `SKComponentMountedView` is used for this purpose. Its descriptor `SKComponentMountedViewDescriptor` mostly delegates to its view's descriptor, but redirects back into ComponentKit for children.
Reviewed By: Andrey-Mishanin
Differential Revision: D21130997
fbshipit-source-id: b3c12ea7cc1200962b3ba7c269c48d68b1809948
Summary:
This change makes it possible to remove preferences. I also added a `Delete` context menu option to `DataInspector` because I needed it to implement this feature. passy confirmed that it makes sense to add this because delete is a common action.
Fixes https://github.com/facebook/flipper/issues/451
Pull Request resolved: https://github.com/facebook/flipper/pull/1018
Reviewed By: jknoxville
Differential Revision: D21086308
Pulled By: passy
fbshipit-source-id: 551ff0908d5e6c93f58d6012b42e1ee3531de997
Summary: Component classes do not reflect the source of the component anymore.
Reviewed By: fabiomassimo
Differential Revision: D20595754
fbshipit-source-id: 645a63f78ee6aaaf75ac0c1e08bf67229a3f906b
Summary: It took me a few tries to understand what this was for.
Reviewed By: jknoxville
Differential Revision: D20462208
fbshipit-source-id: f6dac7836409c8d4ec1ffb90a74f632624fb68f7
Summary:
- Avoid holding lock while calling out to `send:withParams:`; it's hard to reason about whether we could trigger deadlock.
- Remove unnecessary `lastInvalidateMessage` ivar; we already ensure that we send at most one invalidate batch per 500ms by using `invalidateMessageQueued`.
- Misc code style items
Reviewed By: Andrey-Mishanin
Differential Revision: D20462193
fbshipit-source-id: 80f61e5a7ce5021e16ebc19a2ec40adfc46f9b92
Summary: All current implementations of `CKComponentHostingViewProtocol` *contain* a `CKInspectableView`, so there is no need for the hosting view itself to conform. This also simplifies the Flipper plugin.
Reviewed By: d16r
Differential Revision: D20457822
fbshipit-source-id: 472f80f5bb2ee507862487d076cfb0e3de6416fa
Summary: Change compiler flag "-Wno-unguarded-availability" to "-Wunguarded-availability" in order to make build time safety check for unsafe newly introduced api without guarding it with available conditional.
Reviewed By: priteshrnandgaonkar
Differential Revision: D20335903
fbshipit-source-id: b4b0e492a9244233f1bc3b5ba2a63c6415c92bb4
Summary: Adding the new "Identity" section to CK components' description.
Reviewed By: cuva
Differential Revision: D19948738
fbshipit-source-id: cbd9bc9c77b6f6503e10cfc75581ef4b94dd0247
Summary:
React Native v0.62.0’s template still uses iOS 9 as deployment target, bumping it to 10 this late in the release cycle is probably not a good idea, so instead I made this tiny change to make it iOS 9 compatible again.
⚠️ I made this change on top of the `v0.32.2` **tag**, as `master` was giving me a build failure and in any case it would be better to release _just_ this change as a patch release so the RN `v0.62.0-rc.3` release can go out without having to test Flipper as thoroughly again.
## Changelog
Make FlipperKit compatible with iOS 9 again.
Pull Request resolved: https://github.com/facebook/flipper/pull/874
Test Plan:
- `pod install` with a Podfile that has iOS 9 as its deployment target passes again.
- Building the Flipper Sample works.
- Building with a RN application created with the `v0.62.0-rc.3` template works.
Reviewed By: priteshrnandgaonkar
Differential Revision: D20307073
Pulled By: passy
fbshipit-source-id: 0dd02dfb810b7382c52ca81b8f1322f807fb3f29
Summary:
Original diff broke OSS flipper. Need a new OSS release of CK first
Original commit changeset: 3e7564b25610
Reviewed By: kfirapps
Differential Revision: D20304743
fbshipit-source-id: 08a56359a42bc56b576d212e7cf642197a064076
Summary: Use `component.className` in sonar for the layout inspector.
Reviewed By: kfirapps
Differential Revision: D20184486
fbshipit-source-id: 3e7564b2561016ee59f3b1fc9d21313e068bacb3
Summary:
The target selector was broken on iOS. The overlay view which has the gesture recognizer, was never added to the window, due to which the gestures were not registered and the feature broke.
This diff adds the overlay view in the window object as the subview and then discards it in its view descriptor as otherwise we will capture all our touches in this view.
This was the most popular bug in our research trip and almost everyone reported it.
Reviewed By: fabiomassimo
Differential Revision: D20225594
fbshipit-source-id: af4041859d7e662152b2575d1eb258dd0c2d990e
Summary: Adding the new "Identity" section to CK root views' description.
Reviewed By: cuva
Differential Revision: D19948784
fbshipit-source-id: f5e7fe51afd387a476f6500db32b8b5149594007
Summary:
This diff fixes the warnings raised from FlipperKit. Also this diff updates the deployement target of FlipperKit to iOS 10. Even wilde assumes the min deployment OS version to be iOS 10. In layout plugin we use [UIAccessibiltyTraiTabBar](https://developer.apple.com/documentation/uikit/uiaccessibility/uiaccessibilitytraits/1648592-tabbar), which assumes iOS 10 and above.
Partially fixes https://github.com/facebook/flipper/issues/803
Still there are some warnings which are coming from the dependencies outside of Flipper.
Reviewed By: passy
Differential Revision: D19941558
fbshipit-source-id: 31809fedb9aa297bc318b5af72e29e8444f0142f
Summary:
This diff runs CLANGFORMAT lint on plugins. I have added CLANGFORMAT as the lint engined for objc files in xplat/sonar. Right now the iOS folder is not formatted according to CLANGFORMAT.
Ran `arc lint -a --paths-cmd "find ./iOS/Plugins -type f" --verbose`
Reviewed By: passy
Differential Revision: D19942173
fbshipit-source-id: 8b975b0a344df073b02d69cd1f9ee5629af2799d
Summary:
This diff turns the DevTools plugin from a normal plugin in a device plugin. The reason for that can be seen at the end of the test plan in the first stack of this diff: Regardless on which client you open the devtools, you are always looking at the react tree of the app that happens to listen at the appropriate port, unrelated to the actively selected app. This diff moves the plugin from being a client plugin to a device plugin, a Metro device plugin to be precisely, as of the latter there is only one and they should typically correspond (which is why we can trigger reload as done in the previous diff)
Currently we have a Flipper plugin inside the iOS / Android apps with one purpose: to select different ports to listen to on different devices. But this functionality was never implemented, nor seems there to be much demand for. So these plugin don't offer any actual value. The widely used standalone version of the react devtools (https://www.npmjs.com/package/react-devtools) doesn't offer port customization either, so this limitation seems to be acceptable.
To make sure that this change is backward compatible, we make sure to show the metro device if we find metro, regardless whether it is new enough to support log forwarding and reload commands (previously we only showed the device if it has the /events endpoint).
The only case I can think of we are killing with this approach is where people are debugging a RN app, but with having metro running. I doubt that is an actual case, but probably rickhanlonii knows more about that.
Furthermore this diff makes sure that the devTools can connect to physical android devices. Also, making it to the end of this explanation means that you have done most of the reviewing for this diff. The actual code diff is shorter.
Reviewed By: passy
Differential Revision: D19878605
fbshipit-source-id: 3f33e59d4f6e4cce39102420f38afee10018999f
Summary: Client implementation for the flipper send data lispy api
Reviewed By: adamjernst
Differential Revision: D19862378
fbshipit-source-id: 7a5cc8b47772bdbc0e89d723d0099ff824a81ed5
Summary: Fixes the broken Layout plugin in wilde. Before this fix it will just show an empty screen in the layout plugin.
Reviewed By: jknoxville
Differential Revision: D19621517
fbshipit-source-id: e10078248b95b93c6b9c87ccf4508628b6ad86bb
Summary: Using just the scope identifier for the root component is not sufficient when it doesn't have a scope. Solve this by prepending the scope root identifier to the parent identifier.
Reviewed By: fabiomassimo
Differential Revision: D19600721
fbshipit-source-id: d90f9ffd7ae369c76316cebc4ef792626a4584b7
Summary: This diff removes the margin property from the CKFlexboxComponetn style, as it was never working properly.
Reviewed By: Andrey-Mishanin
Differential Revision: D19251856
fbshipit-source-id: eb8e448a68d2e0ff3cd6726c40af0267fced96ea
Summary: In some cases this can cause a retain cycle.
Reviewed By: priteshrnandgaonkar
Differential Revision: D18297780
fbshipit-source-id: c60abdcaad9fd94c457647509aec0519042801e4
Summary:
Flipper's network plugin may cause crash on a frequency of about one time per 1~2 days(I think it depends on how many network request we send).

I assume the crash is caused by part of the code of HTTPParser is not thread-safe, and invoke it asynchronously may cause double-free crash. So I manually ask for HTTPBody synchronously, make the HTTPParser parse the request and cache them in advance, before any possible asynchronous invoking.
## Changelog
Fix potential crash cause by network plugin.
Pull Request resolved: https://github.com/facebook/flipper/pull/563
Test Plan:
1. Run our App with Flipper integrated
2. Make sure FlipperNetworkPlugin is active
3. It may take days to reproduce the crash
Reviewed By: passy
Differential Revision: D17739327
Pulled By: priteshrnandgaonkar
fbshipit-source-id: e814145c346bd2da1d2f5f87b6a2f7e200f0bf2d
Summary:
- Introduce new base protocol `CKMountable`
- Contains Layout & Mount methods that have been extracted from `CKComponent`
- This will allows us to introduce a new lighter version of `CKComponent`, which doesn't rely on Scope/State/Controllers/etc
- Refactor `CKComponentLayout` to work with `CKMountable` instead of `CKComponent`, which will allows us to interop between `CKComponent` and a new type of components.
- Refactor the codebase to support this change
Reviewed By: kevin0571
Differential Revision: D17668253
fbshipit-source-id: 13db5ff4acb37b338e291ca2dd7d67cd25dbc6d2
Summary: Moving FlipperKitLayoutPlugin/FlipperKitPluginUtils/SKHighlightOverlay to shared folder, so Layout and WorkingRange plugins can depend on it
Reviewed By: kevin0571
Differential Revision: D17156396
fbshipit-source-id: 3f17371f2ab4818924d61e6cfb243f60ad1f2892
Summary:
Publishing React Dev tools plugin:
- migrate to TS
- move iOS and JS part to public folder (Android was already)
Reviewed By: passy
Differential Revision: D17164782
fbshipit-source-id: 20ccba71d807df2d33fe5348a62c6ee7f78ae8ba
Summary: Size is passed as a prop to every `CKComponent` and `CKFlexboxChild`. It is useful to see where it was set exactly
Reviewed By: kevin0571
Differential Revision: D16688496
fbshipit-source-id: 5f8dc39a967ab2d7d89d6a37a8152aa6b59db220
Summary:
Live editing is now working faster.
We had an issue that it took about 5 seconds to see the view changed and 10 seconds to see tha value in the flipper, now it's done immidiately
Reviewed By: priteshrnandgaonkar
Differential Revision: D16500961
fbshipit-source-id: 742ce628a887bab06c1b883d9710c477af2508e7
Summary: objc_msgSend_stret isn't available when building for 64 bit devices so this line breaks. objc_msgSend is the correct function to call in 64 bit, but Flipper doesn't run for devices so its fine either way.
Reviewed By: jasonhotsauce
Differential Revision: D16502377
fbshipit-source-id: cfc20880bcccd086dc34fad74a6eef2c9a17cb17
Summary:
CKCenterLayoutComponent's options are now live editable
P.S. Now it takes some time to see the view changed and the new value of everything on flipper side
Reviewed By: kevin0571
Differential Revision: D16458390
fbshipit-source-id: a5344253641633dd8c985549c2d9bc6f64da1f74
Summary:
CKRatioLayoutComponent's ratio is now live editable
P.S. Now it takes some time to see the view changed and the new value of everything on flipper side
Reviewed By: kevin0571
Differential Revision: D16458380
fbshipit-source-id: 0f06426477b6747f6ad71716dc66e69316b23208