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

feat: add support for new architecture in compatibility mode #505

Merged

Conversation

gabrieldonadel
Copy link
Contributor

Summary

This PR adds Android and iOS support for the new architecture relying on the compatibility layer.

On Android

two main changes were required for this to work:

  1. Remove static from all functions annotated with @ReactMethod given that in bridgeless it would throw the following error
  1. Use the event dispatcher to send events from the native side to JS and adding a RCTLoginButtonEvent class

On iOS

Had to create a dedicated class for the RCTFBSDKLoginButton view in order to export the onChange view property of type RCTBubblingEventBlock and declare this property on the UIView wrapping the button (FBSDKLoginButton is a final class and can't be extended)

Test Plan:

Locally run refresh-example to update to the latest RC and tested Android and iOS on the old and new architectures

Screen.Recording.2024-03-25.at.12.41.18.mov
Screen.Recording.2024-03-25.at.12.45.50.mov

@mikehardy mikehardy force-pushed the @gabrieldonadel/new-arch-support branch from 22f391f to 92d4baa Compare April 10, 2024 20:34
Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @gabrieldonadel ! Looks good on review and appears to work locally
I've done a chunk of work here for QA purposes, to make sure CI can go green and to refresh the example, and things appear to work well at least on a backwards-compatibility check

Note that I have not initialized a react-native 0.74-rc project with new arch enabled to see if this works in bridgeless which is it's purpose, but I assume you've done so or what's the point 😆

@mikehardy mikehardy changed the title feat: Add support for the new architecture feat: add support for new architecture in compatibility mode Apr 10, 2024
@mikehardy mikehardy merged commit 7fda601 into thebergamo:master Apr 10, 2024
5 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 10, 2024
## [12.2.0](v12.1.5...v12.2.0) (2024-04-10)

### Features

* add support for new architecture in compatibility mode ([#505](#505)) ([7fda601](7fda601))
Copy link

🎉 This PR is included in version 12.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants