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

New Arch + Refactors #54

Closed
wants to merge 3 commits into from
Closed

New Arch + Refactors #54

wants to merge 3 commits into from

Conversation

WadhahEssam
Copy link
Collaborator

This PR mainly includes 3 features:

  • New arch renderer (Fabric) support (currently only iOS is implemented).
  • Old arch renderer improvements.
  • Example app improvements.

New Arch Support (Fabric)

  • Supporting fabric for this package is not quite straight forward, as the cpp (shadow tree) layer should be manually implemented to match the behaviour of react-native core component. however getting there is possible and this PR currently fully supports iOS Fabric new arch.

  • Since both andorid/ios should both be using the same c++ implementation, in theory the same method should work in iOS too, but for some a limitation on react-native 75, android doesn't fully expose its internal c++ as dynamic modules for devs to link their libraries against. and starting from react-native 76 they will be doing that which will make android support possible. check this for more info [Linking android internal cmake libraries against a custom fabric component reactwg/react-native-new-architecture#234] .

Old Arch Improvements:

  • In the old arch support, the package has been implemented by forking most of the core component native files with very minor changes to achieve the desired behaviour. with a bit of tinkering we were able to achieve the same result with a much less amount of code. (there was no magic in there, but instead of duplicating files, we went to use the core classes and extending them with the modified behavoiur)

This achieves a better maintainability experience where we (hopefully) wouldn't need to upgrade the package with every new react-native release.

Example app improvements.

  • Finally we switched the example to use expo instead of react-native-cli which will improve the process of switching react-native versions or switching between old/new arch. and to follow the new standard of expo being the default way of building react-native apps.
Screen.Recording.2024-10-15.at.6.43.59.PM.mov

Currently this PR will be drafted until at least the Android new arch support is done. which will happen with react-native 76

What is left to do:
[ ] Android new arch support.
[ ] Fix typescript warnings.
[ ] Docs improvements.

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