Commit Graph

69 Commits

Author SHA1 Message Date
Adam Ernst
d9a2167019 Refactor SKSubDescriptor
Reviewed By: d16r

Differential Revision: D20458337

fbshipit-source-id: e8ea848c6e2f7521c5a6c6eb4110bba0bfe25593
2020-03-15 19:42:39 -07:00
Adam Ernst
19876273a3 Refactor SKComponentLayoutDescriptor
Reviewed By: Andrey-Mishanin

Differential Revision: D20458227

fbshipit-source-id: 1723043d6b217323a1c70a455042b28eaf5218a0
2020-03-15 19:42:38 -07:00
Adam Ernst
1725fd6bf1 Simplify CKComponentHostingViewProtocol
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
2020-03-15 19:42:38 -07:00
Shahar Freundlich
72a74c9a1d Change compiler flag
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
2020-03-12 00:49:50 -07:00
Andrey Mishanin
f544d95953 Displaying component identifiers
Summary: Adding the new "Identity" section to CK components' description.

Reviewed By: cuva

Differential Revision: D19948738

fbshipit-source-id: cbd9bc9c77b6f6503e10cfc75581ef4b94dd0247
2020-03-11 09:41:06 -07:00
Andrey Mishanin
127cb604be Use unique id for both root and hosting views
Summary: Same as D19600721, but supports hosting views too.

Reviewed By: cuva

Differential Revision: D19949935

fbshipit-source-id: 4490b03aff9f6d00003cf59468081cc3a4fef598
2020-03-11 09:31:09 -07:00
Eloy Durán
c6c667df69 Make iOS 9 compatible again. (#874)
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
2020-03-09 07:42:34 -07:00
Hugo Cuvillier
987822074b Back out "Use component.className instead of NSStringFromClass"
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
2020-03-06 07:59:11 -08:00
Hugo Cuvillier
5a4ac4c32d Use component.className instead of NSStringFromClass
Summary: Use `component.className` in sonar for the layout inspector.

Reviewed By: kfirapps

Differential Revision: D20184486

fbshipit-source-id: 3e7564b2561016ee59f3b1fc9d21313e068bacb3
2020-03-06 04:06:02 -08:00
generatedunixname89002005287564
5c44d53739 Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D20278397

fbshipit-source-id: 2188283cd01d0d9d9d5b3995bd8d3f1fd687ad55
2020-03-05 08:30:40 -08:00
Pritesh Nandgaonkar
f03f119f0e Fix the broken target selector
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
2020-03-04 06:46:59 -08:00
Andrey Mishanin
adce24d343 Displaying identifier for root views
Summary: Adding the new "Identity" section to CK root views' description.

Reviewed By: cuva

Differential Revision: D19948784

fbshipit-source-id: f5e7fe51afd387a476f6500db32b8b5149594007
2020-02-21 04:25:16 -08:00
Pritesh Nandgaonkar
972277b031 Fix warnings of FlipperKit in iOS
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
2020-02-18 12:47:21 -08:00
Pritesh Nandgaonkar
e8b20d5b15 Run CLANGFORMAT on plugins
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
2020-02-17 10:49:18 -08:00
Pritesh Nandgaonkar
cfb8b367c5 Fix for the broken Layout plugin
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
2020-01-29 07:50:27 -08:00
Andrey Mishanin
67a1c27af2 Prepending root scope ID
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
2020-01-28 08:27:38 -08:00
Hugo Cuvillier
7047354f94 Removal of unused protocol CKRenderWithChildrenComponentProtocol
Summary: Ditto

Reviewed By: kfirapps

Differential Revision: D19496643

fbshipit-source-id: ab6777acb68122f2395919a5afbb30a1ccfafe06
2020-01-21 08:26:19 -08:00
Oleksii Dykan
8a136542a3 Remove margin from CKFlexboxComponent style property
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
2020-01-08 12:10:00 -08:00
Kevin Lin
5ca8b6dc30 Make rootNode a weak reference in SKComponentLayoutWrapper
Summary: In some cases this can cause a retain cycle.

Reviewed By: priteshrnandgaonkar

Differential Revision: D18297780

fbshipit-source-id: c60abdcaad9fd94c457647509aec0519042801e4
2019-11-05 09:58:04 -08:00
Andres Suarez
0675dd924d Tidy up Flipper license headers [1/2]
Reviewed By: passy

Differential Revision: D17863711

fbshipit-source-id: 259dc77826fb803ff1b88c88529d7f679d3b74d8
2019-10-11 13:46:45 -07:00
Kfir Schindelhaim
52976f1ee3 Introduce CKMountable protocol
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
2019-10-02 08:20:00 -07:00
Andres Suarez
c4c5d453c2 Fix license headers
Reviewed By: scottrice

Differential Revision: D17673481

fbshipit-source-id: 1794e0a6e92e6894b5634b24c6e7910847616261
2019-09-30 15:10:17 -07:00
Roman Gorbunov
eff95991c6 Moving SKHighlightOverlay
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
2019-09-05 07:31:23 -07:00
Oleksii Dykan
dbf0e3db43 Add size prop to layout inspector
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
2019-08-07 10:24:19 -07:00
Roman Gorbunov
00e8f43e37 Improvement of live editing
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
2019-07-31 03:13:38 -07:00
Cory Wilhite
aa470a9aef Compile out objc_msgSend_stret on 64 bit machines
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
2019-07-25 16:42:36 -07:00
Roman Gorbunov
a903c7ddc6 CKCenterLayoutComponent live editing
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
2019-07-25 04:03:04 -07:00
Roman Gorbunov
a6b374aba7 CKRatioLayoutComponent live editing
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
2019-07-25 04:03:03 -07:00
Roman Gorbunov
b697d147d1 CKFlexboxComponent live editing
Summary:
CKFlexboxComponent's insets 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: D16379743

fbshipit-source-id: 69bc9b7cb6b2103ff34b5c4489b240ac7562a85d
2019-07-25 04:03:03 -07:00
Roman Gorbunov
f42badeb88 CKInsetComponent live editing
Summary:
CKInsetComponent's insets are now live editable
P.S. Now it takes some time to see the view changed and the new value of insets on flipper side

Reviewed By: kevin0571

Differential Revision: D16338109

fbshipit-source-id: 9c6648e72d55a09df9d715637e82901d1b5dcec8
2019-07-25 04:03:03 -07:00
Roman Gorbunov
f2bc5d3fb2 Generic solution for live editing
Summary: Preparation for making components live editable

Reviewed By: kevin0571

Differential Revision: D16379961

fbshipit-source-id: d0ea3d753eb588fe7b55f2345124427b4a5a58b5
2019-07-25 04:03:03 -07:00
Roman Gorbunov
89911acd84 Made a DataStorage for live editing in flipper
Summary: Theadsafe Data Storage for new insets in CKInsetComponent

Reviewed By: kevin0571

Differential Revision: D16338091

fbshipit-source-id: 3b77652a4d08cfebce115a606af3fc3440a1aca0
2019-07-25 04:03:02 -07:00
Roman Gorbunov
cf1347d2e3 Fixed bug with flipper live editing
Summary:
Fixed bug with live editing
Previously if the meaining of the value was changed in flipper you receive back same value as it was
Now you see correct changed value

Reviewed By: priteshrnandgaonkar

Differential Revision: D16162141

fbshipit-source-id: 1a68ea64603171e952382c5093470d2cc12f7bbe
2019-07-10 12:13:15 -07:00
Roman Gorbunov
8b2a886c19 Fixed a bug with accessibility button
Summary:
Fixed a bug with accessibility button
Now it's pressable

Reviewed By: kevin0571

Differential Revision: D16165294

fbshipit-source-id: 9c6ea464f2faa149aa78c0534c51a0f58bd249ad
2019-07-10 11:40:03 -07:00
Roman Gorbunov
7551b6da04 Added search in text of some components
Summary: Added a possibility to search for the text not only in name and id of components but also in text for all components, that conforms to a protocol <SKTextSearchable>

Reviewed By: priteshrnandgaonkar

Differential Revision: D16108297

fbshipit-source-id: 31da4ac6762c487ef644d62c9576d9eff43e8cd4
2019-07-08 03:43:55 -07:00
John Knox
b0f44d9a9b Add accessibilityIdentifier to iOS layout attributes
Summary: Apparently useful for debugging e2e tests which reference accessibility Identifiers

Reviewed By: passy

Differential Revision: D15874161

fbshipit-source-id: b6a71a8474b52546bd825c0d13c1487688c7a30e
2019-06-18 09:40:19 -07:00
Rain ⁣
aa649ff48f standardize C-like MIT copyright headers throughout fbsource
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3

In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.

Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.

Reviewed By: zertosh

Differential Revision: D15640366

fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
2019-06-06 19:40:28 -07:00
Oleksii Dykan
cb79b3b9ba Fix layout plugin for CKFlexboxComponent and CKInsetComponent
Summary: Importing the extensions fixes the fact that responds to selector was returned false for `sonar_additionalDataOverride` selector

Reviewed By: priteshrnandgaonkar

Differential Revision: D15535414

fbshipit-source-id: ab465a1aab36cccd2129c5b0c29a7872dfd65015
2019-05-29 04:59:13 -07:00
Pritesh Nandgaonkar
7576e1c61d Fix watch tab bug
Summary:
This solves the watch tab crash discussed here D15266478, which got reverted.

Bug: [Here](diffusion/FBS/browse/master/xplat/sonar/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.mm;57c596a566bec49e343af51b93df65ed1377a2b9$338), when the node is `CKComponentRootView` the `[descriptor childForNode: node atIndex: i]` returns `SKComponentLayoutWrapper`. In the next iteration of the loop, node is `SKComponentLayoutWrapper`, the  `[descriptor childForNode: node atIndex: i]` returns `CKComponentRootView`, and hence the infinite recursion

I also tested T44431259, it is not regressed.

Reviewed By: passy

Differential Revision: D15451821

fbshipit-source-id: 25f10112f5f52bb1fa964316a4c7e91a3b29156d
2019-05-23 03:50:11 -07:00
Pritesh Nandgaonkar
0a514c3618 Back out "[Flipper] Use the tree node idenitifer as the component identifier"
Summary:
Original commit changeset: 4d83c1bee3fd

BUG:

{F159187385}

Reviewed By: passy

Differential Revision: D15415247

fbshipit-source-id: 6209a2c9c2b5da6b9405bf01e3cb7622b3431475
2019-05-20 09:46:50 -07:00
Jonathan Ballerano
bcc05296ef Back out "Fix the crash in the watch tab"
Summary: This resolves a crash related to the contents of certain CKComponents, which was apparently introduced by D15266478

Differential Revision: D15406260

fbshipit-source-id: efd1ad1a1bcb41451c56b74c240ad2dca069deb0
2019-05-17 22:42:35 -07:00
Pritesh Nandgaonkar
821232a9c6 Fix the crash in the watch tab
Summary:
BUG:

{F158264042}

Context: The code entered an infinite loop till it crashed. In the implementation of `- (SKSearchResultNode *)searchForQuery:(NSString *)query fromNode:(id)node withElementsAlreadyAdded:(NSMutableSet<NSString *> *)alreadyAdded`, we recurse through the child. In the case when the view was `CKRootComponent` it created a `SKComponentLayoutWrapper` in the call to `[descriptor childForNode: node atIndex: i];`. This wrapper's descriptor used to return the very same view from which it was created when it's children were asked. So this led to an infinite loop.

Reviewed By: kfirapps

Differential Revision: D15266478

fbshipit-source-id: 8035209746b7cb4b8773e2fcbdd4c0a148191304
2019-05-10 09:53:18 -07:00
Pascal Hartig
bbee7a3357 Update iOS license headers (and more)
Summary: Add the affiliates bit that the linter is checking for.

Reviewed By: jknoxville

Differential Revision: D15164826

fbshipit-source-id: 500ffe89ec0c2fd3acfbc374408d16a337cecfa4
2019-05-02 03:28:07 -07:00
Kfir Schindelhaim
b78dbb75b2 Use the tree node idenitifer as the component identifier
Summary: Now that we always build the component tree (CKTreeNode) in debug, we can just use the tree node identifier as the component identifier instead of creating a very long string.

Reviewed By: fabiomassimo

Differential Revision: D15046568

fbshipit-source-id: 4d83c1bee3fd7ac85ee4bd6e9f4f47812509e0c3
2019-04-26 10:15:02 -07:00
Kfir Schindelhaim
1c35b705eb Use the cached layout wrapper if it exists
Summary:
- We cache the layout wrapper, but never used it actually.
- This should make the Layout plugin faster.

Reviewed By: fabiomassimo

Differential Revision: D15046463

fbshipit-source-id: b61f28d9a981e782b76abe78037d37665f7d8ba3
2019-04-26 10:15:02 -07:00
Kfir Schindelhaim
c764322c1a Layout plugin integration for reused nodes information
Summary:
- Expose the reused component counter into the layout plugin

https://pxl.cl/wVJf

Reviewed By: priteshrnandgaonkar

Differential Revision: D14952906

fbshipit-source-id: 784a02dbf44d80d95fdd3a804f58ecd0f51a3e1f
2019-04-26 10:15:02 -07:00
Kevin Lin
7f20c34e34 Remove unneeded TODO
Summary: Remove unneeded TODO.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14882889

fbshipit-source-id: cbcb26bb90a315b5c36f4573bfcb416b8a0b4c46
2019-04-11 03:50:49 -07:00
Pritesh Nandgaonkar
8a19a859f2 Update Componentkit, Yoga, YogaKit
Summary: Fixed the broken master for flipper iOS  oss

Reviewed By: jknoxville

Differential Revision: D14686908

fbshipit-source-id: abdcacf279449f83c98d1635c65ff8759ee17926
2019-04-01 06:59:59 -07:00
Andrey Mishanin
a0e0b434ee Removed UIView (CKComponentAttachController)
Summary: Remove ObjC categories so we can strip dead code

Reviewed By: kfirapps

Differential Revision: D14665041

fbshipit-source-id: 243dee61a5b7cfd854191bfb5fa3a570b4ac1a4b
2019-03-28 09:23:41 -07:00
Kevin Lin
deef14d3a2 Rename CKComponentDataSourceAttachController to CKComponentAttachController
Summary:
`CKComponentDataSourceAttachContrlller` doesn't have to be tied with datasource. It's totally legit to use it in hosting view as well.
Renaming it to `CKComponentAttachController` and move it to `Core` folder.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14526150

fbshipit-source-id: f48a8d27a3bfa5170e22a397fe1b32e806bc3c55
2019-03-20 06:09:22 -07:00