-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for New Architecture - iOS & Android (Fabric) #931
Conversation
I have signed the CLA! |
5ca942c
to
1b7533b
Compare
LGTM! |
Thanks for testing this out @RichardLindhout! Did you run across any issues? Any ideas on how we could combine the two fixture apps into a single app that could test both the old and new architecture? |
I did not test it, I just was hoping FlashList would get Fabric support :). I'm not experienced with Fabric so I'm not sure. |
Apologies for the delay, I'll try this out soon. Thanks a lot |
Let's goooo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Can we release this?? |
This is the last dependency our app preventing it from working with the new arch. Hopefully this can get released soon! |
@markrickert I tried your fork in my app and it seems to work perfectly with the new architecture enabled! |
e819396
to
05ab455
Compare
I rebased my work here on |
@markrickert could you maybe bump the version of |
That's a great idea. I'll work on that here in the next few days |
up please very important |
Can we get this lint check passed to unblock the PR from being approved? |
Tested at RN 0.73.1 android and running well ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add those changes so it works correctly on new arch in the newest version of RN and also makes it possible to use it from this commit?
11c0e20
to
32a7317
Compare
This PR should be ready to go. I've updated the PR based on suggestions as well as ensured that both the CI is finally passing all green ✅ and I rebased on The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments for now. Please answer them.
android/src/main/kotlin/com/shopify/reactnative/flash_list/AutoLayoutView.kt
Outdated
Show resolved
Hide resolved
return cellContainer | ||
} else if subview is AutoLayoutView { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe we should make the AutoLayoutView
not collapsable to avoid it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WoLewicki @markrickert just wanted to check: apart from this comment are there any other issues with this PR which is blocking the merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it looks ok
@@ -3,7 +3,7 @@ import Foundation | |||
@objc(CellContainerManager) | |||
class CellContainerManager: RCTViewManager { | |||
override func view() -> UIView! { | |||
return CellContainer() | |||
return CellContainerComponentView() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it work if there is no implementation of this class on paper? Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, this would be a question for @j-piasecki since he made all the changes to the native source code. I didn't delve into exactly how that all works, but both fixture apps are running so maybe some magic codegen going on here? I'm not as well versed in new arch native changes as I'd like to be right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I contacted him and I get it now. You can see such code at the end of CellContainerComponentView
:
@implementation CellContainerComponentView
@end
so it resolves to simple UIView
there 😅
02990f2
to
195d1f5
Compare
Rebased on |
Is this going to be merged soon? 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on this, @markrickert! (And @j-piasecki too!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
qq: is it compatible with latest 74 RN release?
What’s the status on this one? |
this is very important, is this going to be merged? |
@WoLewicki please your review |
I am not a maintainer of this library unfortunately. |
@naqvitalha @jenshenny Anyone maintaining this library? |
Any progress? |
We've started looking at this PR. I'll update soon. Thanks @markrickert @j-piasecki |
@@ -4,31 +4,33 @@ import UIKit | |||
|
|||
/// Container for all RecyclerListView children. This will automatically remove all gaps and overlaps for GridLayouts with flexible spans. | |||
/// Note: This cannot work for masonry layouts i.e, pinterest like layout | |||
@objc class AutoLayoutView: UIView { | |||
@objc public class AutoLayoutView: UIView { | |||
@objc public var onBlankAreaEventHandler: ((CGFloat, CGFloat) -> Void)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markrickert While testing I noticed that onBlankArea
event isn't working. On Android, the name of the event was emitBlankAreaEvent
instead of onBlankAreaEvent
so I fixed it. It also isn't working on iOS, I'm not sure if this is the right way to handle it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naqvitalha did you maybe check if it fails to enter this part of code: https://github.com/Shopify/flash-list/pull/931/files#diff-5fac05017cc8297ba991cb968f2703854339d60ae995e08e9cfe66545186f745R46 ? It is the place where the event should be sent to JS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the RCT_NEW_ARCH_ENABLED preprocessor directive isn't working as expected. @j-piasecki Can you check?
Let's merge it guys! |
s.source = { git: 'https://github.com/shopify/flash-list.git', tag: "v#{s.version}" } | ||
s.source_files = 'ios/Sources/**/*' | ||
s.requires_arc = true | ||
s.swift_version = '5.0' | ||
|
||
# Dependencies | ||
s.dependency 'React-Core' | ||
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@naqvitalha The RCT_NEW_ARCH_ENABLED
isn't actually set anywhere.
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. | |
if fabric_enabled | |
s.pod_target_xcconfig = { | |
'OTHER_SWIFT_FLAGS' => '-D RCT_NEW_ARCH_ENABLED', | |
} | |
end | |
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. |
And then it would also be required to check if the flag is set at the top level (cannot add suggestion there 😞):
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED']
Closing because #550 was merged. |
Description
Fixes #196, #811, & #886
This PR builds on @j-piasecki's work in #550 to enable Fabric/New Architecture. That PR is fairly old and was created with
[email protected]
(lots of performance issues) and[email protected]
.Here's what I did to bring things back up to date so that people can start testing this with the latest version of FlashList:
fabricfixture
app building properly.@shopify/flash-list@master
to bring the library up to the latest version (1.6.2
)fabricfixture
app from[email protected]
to0.72.5
ensuring that both iOS and android fixture apps built and displayed theFlashList
component with the new architecture turned on.Things I did NOT do:
Things I think we still need to do:
Investigate using react-native-test-app so we don't have to have two fixture apps in the repo anymore (one for new architecture and another for old architecture). This will get rid of a lot of duplicated code as suggested by @fortmarek hereFabric support now uses the main fixture app.Reviewers’ hat-rack 🎩
Screenshots or videos (if needed)
These videos are from the app built by the react native app in
./fabricfixture
. Get ready to have a seizure, lol.Checklist