Summary: Add macOS only descriptors. Currently does not support Yoga/YogaKit or accessibility features; will add those in a later diff.
Reviewed By: priteshrnandgaonkar
Differential Revision: D27332601
fbshipit-source-id: 35c93cf715f004dbf8dbf8753534f1d4f9801b4c
Summary: Add macOS dependencies and alternative classes to the libraries that FlipperKitLayoutPlugin needs to function.
Reviewed By: priteshrnandgaonkar
Differential Revision: D27328277
fbshipit-source-id: f22d1e9f6a5415cee0bae8eaada653be5f5467b3
Summary:
This diff moves the iOS descriptors and other layout helpers into its own buck target. Earlier everything was part of the FlipperKitLayoutPlugin target. When kcui, tried to add macos descriptors, we realised that FlipperKitLayoutPlugin doesn't have macos platform in it and thus he had to put #if TARGET_OS_SIMULATOR check in iOS descriptors and at some other places.
In order to make the integration easier I decided to split the Layout Plugin in following way.
```
FlipperKitLayoutPlugin
-> FlipperKitLayoutIOSDescriptors (platform set as IOS)
-> FlipperKitLayoutHelpers (used in iOS Descriptors and usefule for Macos too)
-> FlipperKitLayoutMacOSDescriptors(coming soon by kcui)(platform set as MacOS)
```
Reviewed By: kcui
Differential Revision: D27127587
fbshipit-source-id: f108ef81914297e93c886fe53dabf0a4bf11ebc1
Summary:
This diff keeps the opensource integration of CK for Flipper at the same place. It moves the code which is referred internally to a different folder under Facebook directory.
The reason we are doing this is because, CK won't be publishing any more opensource releases to Cocoapods. Thus we would like to keep the code for opensource compatible to the latest one. Internally we would refer to the CK code from Facebook directory.
Reviewed By: fabiomassimo
Differential Revision: D26047510
fbshipit-source-id: 302890bcd36d3e4c4888577d821433f58fcab5c7
Summary:
After updating the internal properties of CKInsetComponent we didn't update some KVO magic being used in Flipper which caused some crashes:
https://fb.workplace.com/groups/componentkit/permalink/4986354281413147/
Reviewed By: fabiomassimo
Differential Revision: D25946704
fbshipit-source-id: 5995cda20d12b18f7520507cb6ede897fddf2670
Summary:
This PR fixes the crash mentioned [here](https://github.com/facebook/flipper/issues/1674#issuecomment-754402609) in the https://github.com/facebook/flipper/issues/1674 . The issue was that logging `NSLog(@"%@", [self valueForKey:@"_methodDescription"]);` in the swizzled network delegate class used to cause a crash. The cause of this was the nil `methodDescription.types` sent to `class_addMethod`.
In the following change we do not add a method to the class which doesn't implement the selector, we will anyway listen for those events from the base NSURLSession class. Removing the `class_addMethod`, fixes both the issue mentioned
[here](https://github.com/facebook/flipper/issues/1674#issuecomment-754402609) in https://github.com/facebook/flipper/issues/1674.
This PR also fixes an issue where no network calls where logged in Flipper when the iOS version was 14, the reason was that the URLSessionResume task was not properly swizzled for 14.
## Changelog
- Do not add a runtime method to the delegate which doesn't implement a responder
- Fix swizzling logic of the URLSession task resume method for ios 14
Pull Request resolved: https://github.com/facebook/flipper/pull/1810
Test Plan:
- I ran the sample app and checked that the network calls are logged.
- I copy pasted the changes in RN project and verified that the issues mentioned in https://github.com/facebook/flipper/issues/1674 doesn't happen and also verified that the network calls being hit from JS and Native code gets logged in Flipper. Verified with IsolatedSwizzles.zip mentioned over [here](https://github.com/facebook/flipper/issues/1674#issuecomment-754726174). Also verified by copy pasting the code in the fresh RN project.
Reviewed By: fabiomassimo
Differential Revision: D25801510
Pulled By: mweststrate
fbshipit-source-id: 53ef574696d2abbdbfc2b6d94769327cdfa8aa2b
Summary: This adds macOS compatibility to Flipper client along with some of the standard plugins.
Reviewed By: jknoxville
Differential Revision: D24644439
fbshipit-source-id: dc15636a6ac1bf684fa1c89735f51f0e97667b62
Summary:
This should fix build failures with prod config. The symbols should only be in internal builds and not the prod ones.
```
stderr: Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_SKNamed", referenced from:
...
"_OBJC_CLASS_$_SKComponentLayoutDescriptor", referenced from:
...
```
Reviewed By: rzito
Differential Revision: D24250749
fbshipit-source-id: 68c3d066a76baf4b1646f27dac0fd081bcaff41b
Summary:
This diff renames the plugin identifier of the NT State plugin to `flipper-plugin-bloks-state`.
WWW side changes are here D23991116
Distillery: D24136550
[NOTE]: LAND IT IN WEEKEND TO AVOID CLIENT AND SERVER IN AN UNSYNC STATE
Differential Revision: D23932149
fbshipit-source-id: 1d9d28f83581be48c218150fe2a5cff26e5d846e
Summary: This tripped me up for a bit. Add some docs.
Reviewed By: Andrey-Mishanin
Differential Revision: D24160934
fbshipit-source-id: a36ac6b205a9edeeb0698f44476456583146907c
Summary:
We have some "internal-only" stuff we want to put in the attribute of a layout node.
This allows us to do so a way that keeps it out of open-source and avoid the clunky subclassing.
Reviewed By: adamjernst
Differential Revision: D24162047
fbshipit-source-id: 518ab9fbf0b4274076f5b0ae1b249e197563fa7f
Summary:
Changelog: [iOS][Network] Network plugin now supports iOS 14
Network plugin stopped working for iOS 14 as reported in https://github.com/facebook/flipper/issues/1534.
The fix is based on the origin Flex network observer, as seen in https://github.com/FLEXTool/FLEX/pull/451
- NetworkPlugin supports iOS 14+
Pull Request resolved: https://github.com/facebook/flipper/pull/1543
Test Plan: Verified manually that before this fix the network plugin broken on iOS 14, and after it, it initializes correctly.
Reviewed By: passy
Differential Revision: D24136401
Pulled By: mweststrate
fbshipit-source-id: 87e0e0fa4bc927d082387d937390b1e728125753
Summary: Send data to NT/Bloks plugin instead of Bloks plugin. There are changes on the distillery side as well D23873230, which needs to land together with this diff.
Differential Revision: D23903952
fbshipit-source-id: 2b748e73116f10d69ec1cf810075882bb8fa09a6
Summary:
Related diff [Litho]: D23243009
This diff adds support for a protocol for layout messages where the type is recursively encoded as:
```
{
kind: "type",
data: ???
}
```
We check if the message adheres to the new encoding, otherwise we fall back to the old behavior. If it's the new encoding, the message is traversed recursively flattening the types to EditorValue using the type hints provided.
Reviewed By: Andrey-Mishanin
Differential Revision: D23319619
fbshipit-source-id: 79e8886f8f5a0aea4ec32938f1d5cd2fd645a297
Summary: This field is going to be removed in a subsequent version of the struct. Showing it is not that important, so let's just remove it.
Reviewed By: kevin0571
Differential Revision: D22335170
fbshipit-source-id: 0916927ee30757678f847cd0f826caa1d4a6c7cc
Summary:
`CKComponentAccessibilityContext::operator==` can be extremely expensive; it may invoke the `accessibilityLazyTextBlock` for its `CKComponentAccessibilityTextAttribute` members, and that can do a lot of string construction.
I could refactor this to make it cheaper, e.g. by migrating to a function-pointer-and-context-object approach. But the easiest thing to do is to simply remove it; I don't think it's meaningfully used.
Reviewed By: kevin0571
Differential Revision: D22322108
fbshipit-source-id: 82a0548d6dd28ec4adf2f3ba85705eabf665d100
Summary: Discovered in https://fburl.com/h6eczhr2; the highlight didn't get removed correctly. This was from [this method](https://fburl.com/diffusion/twur28gt), which must be called on main thread to be executed completely.
Reviewed By: jknoxville
Differential Revision: D21629318
fbshipit-source-id: cfc52ac755a1ddfe92e675aac1a81066ce338bd7
Summary:
This reverts D21285438 and patches some holes in the layout invalidation routines.
(I tried to use `didAddSubview:` and `willRemoveSubview:` but those are annoying for other reasons; for example, `willRemoveSubview:` can be called from within `dealloc` which is surprising. Also they still don't catch the case where subviews are being reordered.)
Reviewed By: Andrey-Mishanin
Differential Revision: D21512129
fbshipit-source-id: 1d9e8dac9333eddfae2309d446ef4de9e83220d6
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