Skip to content

feat: Support Turbo Modules #1101

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

Merged
merged 10 commits into from
Apr 2, 2025
Merged

feat: Support Turbo Modules #1101

merged 10 commits into from
Apr 2, 2025

Conversation

guabu
Copy link
Contributor

@guabu guabu commented Mar 13, 2025

Changes

This PR includes a number of changes to convert the existing Legacy Native Modules implementation to Turbo Modules to support the new architecture.

At a high-level, the changes are:

  1. Generated the turbo module specs (live under src/specs/NativeA0Auth0.ts)
  2. Added necessary codeGen to the package.json scripts
  3. Renamed A0Auth0.m to A0Auth0.mm to support C++ code
  4. Updated the podspec file to install the necessary dependencies when using the new arch
  5. Updated build.gradle to support new arch builds in Android
  6. Updated to use the new native specs

⚠️ The changes in this PR are considered as breaking changes to be released as part of a new major version. The minimum supported React Native version has been bumped to 0.76.0 and only supports the new architecture.

Testing

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@guabu guabu requested a review from a team as a code owner March 13, 2025 07:52
@guabu guabu changed the base branch from master to beta April 1, 2025 07:36
@subhankarmaiti subhankarmaiti merged commit 4a73548 into auth0:beta Apr 2, 2025
5 of 6 checks passed
@mazenchami
Copy link

@guabu thanks for putting this together. after review the docs on (turbo modules)[https://reactnative.dev/docs/next/turbo-native-modules-introduction]

we can see that steps 1-3 are completed:
step 1: added the specs with NativeA0Auth0.ts
step 2: configured the package.json
step 3: not required by a library as it is the App code to use the library

But step 4: implementing the native side of the code, was not completed:

For android, A0OAuthModule would have to implement the NativeA0OAuthSpec. You'd need to also modify the A0OAuthPackage.
For iOS, the A0Auth0 interface needs to conform to NativeA0OAuthSpec or inherit from NativeA0OAuthSpecBase if they need to emit events, as explained here.
For iOS, the package.json should be updated as explained here.

step 4 would be needed for full turbo modules compatibility, to get the full benefits of the new architecture and so the library will work even when support for interop is removed in the future!

@subhankarmaiti
Copy link
Contributor

Hi @mazenchami, thank you for the feedback. We're looking into it and will share updates in this thread.

@subhankarmaiti
Copy link
Contributor

@mazenchami , the PR is out #1204

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.

4 participants