Skip to content
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

Fabric support on iOS #549

Closed
wants to merge 12 commits into from

Conversation

j-piasecki
Copy link
Contributor

Description

This PR adds Fabric integration to the FlashList on iOS. Here are some more important highlights:

  • I've merged CellContainer with CellContainerComponentView as keeping a CellContainer in every CellContainerComponentView didn't look like a very good idea performance-wise
  • In case of AutoLayoutView, I stayed with wrapping it with the Fabric Component (AutoLayoutViewComponentView). I didn't want to accidentally break the functionality converting in to obj-c. It may be possible that they can be merged via inheritance but I'm not that knowledgeable in interop between swift and obj-c and couldn't get it to work
  • Event dispatchers on Fabric are auto generated so I added a field to AutoLayoutView containing a closure, which in turn is set by the AutoLayoutViewComponentView. This way the code in swift has access to the generated obj-c++ method.
  • Due to the view flattening and the fact that the AutoLayoutView needs to be wrapped with respective ComponentView, the view hierarchy is different on Fabric. I added a getSubviews() method that has a different implementation when building for the new architecture.
  • I've added a separate fabricfixture app to test Fabric integration without changing the original one.

I have tested the TwitterBenchmark and the performance there didn't seem to differ between architectures.
Fabric:

Device Avg FPS Min FPS Max FPS Max blank area Cumulative blank area
iPhone 13 mini 60.1 59.9 60.9 0 0
iPhone 6s 59.1 54.9 60.3 0 0

Paper:

Device Avg FPS Min FPS Max FPS Max blank area Cumulative blank area
iPhone 13 mini 60.1 59.9 60.6 0 0
iPhone 6s 58.1 54.6 60 0 0

The fabricfixture app is pretty basic at the moment (only TwitterBenchmark and commented out Paginated list) due to the compatibility of other libraries.

Reviewers’ hat-rack 🎩

  • [ ]

Screenshots or videos (if needed)

Checklist

@fortmarek fortmarek mentioned this pull request Aug 18, 2022
1 task
@j-piasecki
Copy link
Contributor Author

Closed in favor of #550.

@j-piasecki j-piasecki closed this Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant