refactor(auth)!: migrate to TypeScript and bring auth closer in alignment with firebase-js-sdk API#8991
Draft
russellwheatley wants to merge 44 commits intomainfrom
Draft
refactor(auth)!: migrate to TypeScript and bring auth closer in alignment with firebase-js-sdk API#8991russellwheatley wants to merge 44 commits intomainfrom
russellwheatley wants to merge 44 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request introduces the modular API for the Auth package and refactors the namespaced API with improved TypeScript support. Key updates include the integration of react-native-builder-bob for builds, a fix for a logic error in TOTP secret handling, and the addition of type comparison configurations. Feedback was provided to improve the clarity of an error message in the password validation logic and to refine the emulator URL parsing to handle missing ports more explicitly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated to main and re-pushed to verify things still work since we're not using a merge queue here
release notes will come from the commit, so here's the draft of the commit message pulled from the description:
BREAKING CHANGE: auth types now match firebase-js-sdk as closely as possible
Please see https://rnfirebase.io/migrating-to-v25 for help migrating if needed.
react-native-firebase has a goal to be a drop-in replacement for firebase-js-sdk, with native extensions and performance. It has always worked that way at the javascript level but the typescript types have been divergent.
We are fixing that as we refactor to typescript. Please bear with us as we get closer to our goal of react-native-firebase matching firebase-js-sdk both in functionality where possible, but also in exact typescript typing.
Specifics for Auth:
Auth,User,UserCredential,ActionCodeInfo,MultiFactorResolver, andMultiFactorUserno longer use the deprecatedFirebaseAuthTypesnamespace types in their public signatures; TypeScript consumers should import the modular types directly from@react-native-firebase/auth.initializeRecaptchaConfigexport from@react-native-firebase/auth; RN Firebase uses native SDK phone-auth verification rather than the browser reCAPTCHA bootstrap flow.sendSignInLinkToEmail(auth, email, actionCodeSettings)soactionCodeSettingsis required, matching the firebase-js-sdk modular signature.signInWithPhoneNumber(auth, phoneNumber, appVerifier?)so the old RNFBforceResendfourth argument is no longer part of the modular signature; use the RNFB-specificverifyPhoneNumber(...)helper for the native listener / force-resend flow.signInWithRedirect(...)andlinkWithRedirect(...)now returnPromise<UserCredential>because RN Firebase native provider flows resolve immediately with credentials instead of following the browser redirect contract.FirebaseAuthTypesAPI for backwards compatibility, but marked it deprecated and separated it from the modular public types; consumers should prefer direct exported modular types going forward.FirebaseAuthTypes.UserInfonullable profile fields andfirebase.auth().confignow typed asRecord<string, never>rather thanMap<any, any>.Related issues
Release Summary
Checklist
AndroidiOSOther(macOS, web)e2etests added or updated inpackages/\*\*/e2ejesttests added or updated inpackages/\*\*/__tests__Test Plan
Think
react-native-firebaseis great? Please consider supporting the project with any of the below:React Native FirebaseandInvertaseon Twitter