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

Update to Firebase JS 10 compat #1032

Merged
merged 5 commits into from
Jul 31, 2023
Merged

Update to Firebase JS 10 compat #1032

merged 5 commits into from
Jul 31, 2023

Conversation

jhuleatt
Copy link
Collaborator

@jhuleatt jhuleatt commented Jul 17, 2023

Firebase JS 10.0.0 release notes

Adding Firebase JS SDK v10 compat as a valid peer version in addition to v9. Updating demos to v10.

FirebaseUI still uses compat instead of the modular SDK, this just allows v10 to be used as a peer dependency.

@jhuleatt jhuleatt marked this pull request as ready for review July 17, 2023 15:20
@jhuleatt jhuleatt requested a review from prameshj July 17, 2023 15:21
@prameshj
Copy link
Collaborator

We did make a couple of breaking changes in v10 - https://firebase.google.com/support/release-notes/js#authentication

Can we make sure these do not affect our current usage in UI Web? I assume CI passing will cover it, but worth manually testing/auditing.

@jhuleatt
Copy link
Collaborator Author

jhuleatt commented Jul 18, 2023

Good point, on first glance I thought the only Auth changes were related to React Native, but the RecaptchaVerifier change may affect us:

Reordered RecaptchaVerifier parameters so auth is the first parameter.

The tests mock RecaptchaVerifier so they won't catch errors with the new API:

/**
* Creates the fake firebase reCAPTCHA app verifier for the Firebase app
* provided.
*
* Usage for testing:
*
* var recaptchaVerifierInstance = null;
* firebase.auth.RecaptchaVerifier = function(container, params, app) {
* recaptchaVerifierInstance = new firebaseui.auth.testing.RecaptchaVerifier(
* container, params, app);
* recaptchaVerifierInstance.install();
* return recaptchaVerifierInstance;
* };
*/
class RecaptchaVerifier extends MockHelper {

And our externs will need to be redefined:

firebase.auth.RecaptchaVerifier = function (container, parameters, app) {};

Will drop this back to draft for now. We may have to do a major version bump to support v10

@jhuleatt jhuleatt marked this pull request as draft July 18, 2023 15:10
@jhuleatt jhuleatt changed the title Update to Firebase JS 10 Update to Firebase JS 10 compat Jul 27, 2023
@jhuleatt
Copy link
Collaborator Author

jhuleatt commented Jul 27, 2023

From what I can tell, the breaking change in v10 doesn't affect compat. The compat source still has the old API: https://github.com/firebase/firebase-js-sdk/blob/503ca1eda8b0df1af9f039257117d973ec8c9f45/packages/auth-compat/src/recaptcha_verifier.ts#L25-L34

I'm testing now in the demo app to confirm

Update: Phone auth in the demo app works!

@jhuleatt jhuleatt marked this pull request as ready for review July 27, 2023 19:36
@jhuleatt jhuleatt merged commit 3b254b8 into master Jul 31, 2023
2 checks passed
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.

2 participants