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

Support for Firebase v9 (compat) #850

Merged
merged 46 commits into from
Oct 28, 2021
Merged

Support for Firebase v9 (compat) #850

merged 46 commits into from
Oct 28, 2021

Conversation

jamesdaniels
Copy link
Member

@jamesdaniels jamesdaniels commented May 25, 2021

  • No API changes
  • Depends on JS SDK v9-compat, which has the same API as v8
  • Rewrite the imports/require from firebase/* to firebase/compat/* in the build step
  • Versioning as 6.0.0 due to the break in peer and import paths
  • Firebase JS SDK v9 does not ship with closure externs. Bring them in manually.
  • Updated /demo to use Firebase JS SDK v9.1.2 from the CDN
  • Updated gulp-concat-css as the version in the package.json was not working for me, it was bailing during the inline images step
  • Various Github Actions cleanup to get the build green, this work is also captured in Porting over some Github Actions fixes from the v9 PR #886

Usage:

npm i --save firebaseui@next firebase

import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import * as firebaseui from 'firebaseui';

const response = await fetch('/__/firebase/init.json');
const app = firebase.initializeApp(await response.json());
const ui = new firebaseui.auth.AuthUI(app.auth());

ui.start('#firebaseui-auth-container', ...);

@jamesdaniels jamesdaniels changed the title WIP vNext compat Firebase v9 compat (LLFB) Aug 12, 2021
@jamesdaniels
Copy link
Member Author

jamesdaniels commented Aug 19, 2021

A release candidate for this has been cut to NPM for external testing, npm i --save firebaseui@next firebase@next

@jamesdaniels jamesdaniels marked this pull request as ready for review August 20, 2021 01:35
@jamesdaniels jamesdaniels changed the title Firebase v9 compat (LLFB) FirebaseUI + Firebase v9-compat (LLFB, DO NOT MERGE) Aug 20, 2021
@xil222

This comment has been minimized.

@jamesdaniels

This comment has been minimized.

@renegng

This comment has been minimized.

@jamesdaniels

This comment has been minimized.

@renegng

This comment has been minimized.

@xil222
Copy link
Contributor

xil222 commented Oct 8, 2021

Looks like new firebase sdk is out, any chance this branch could be pushed out as a "next" tag on npm so we can test it out? I'm really hoping it fixes #887 .

I responded to that one, looks like its been fixed in Firebase v9.1.2

bower.json Outdated Show resolved Hide resolved
demo/public/index.html Outdated Show resolved Hide resolved
demo/public/widget.html Outdated Show resolved Hide resolved
@jamesdaniels
Copy link
Member Author

@treeder there should be no need for a new version on @next as we've not made material changes to the implementation on this PR since then, just lots of housekeeping. The version up there should accept the new Firebase peer.

@jamesdaniels jamesdaniels requested a review from xil222 October 13, 2021 18:34
@OrhanTozan
Copy link

What is currently stopping this PR to be merged to master?

@jamesdaniels
Copy link
Member Author

@OrhanTozan waiting for review and a green light from the FirebaseUI team.

@bojeil-google
Copy link
Contributor

We will focus on the remaining review and getting this in this week. Sorry for the delay. We had to make sure we tested all the flows first (in dependent libraries too) and fixed any issues in the compat layer.

Copy link
Contributor

@bojeil-google bojeil-google left a comment

Choose a reason for hiding this comment

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

Thank you for putting this together @jamesdaniels! Changes look great! I just have a bunch of nits and minor requests. Should be straightforward to resolve.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -1939,6 +1923,26 @@ can verify in the [demo app](https://fir-ui-demo-84a6c.firebaseapp.com/)).

**For v1.0.0 and superior:** https://github.com/firebase/firebaseui-web/releases

### 6.0.0

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I agree with @jamesdaniels (let's not communicate any plans yet). Let's just focus on informing customers that v6.0.0 should be used with firebase version v9 (compat)and higher. We can also explain some of the changes needed when switching from v8 to v9 (such as the difference in how app and auth are imported or included via cdn, etc.) We can also mention the benefit when using firebaseui v6.0.0 with other v9 firebase services, such as firestore (when it comes to modularization). The description below seems to cover most of that.

demo/public/index.html Outdated Show resolved Hide resolved
demo/public/widget.html Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@xil222

This comment has been minimized.

@bojeil-google
Copy link
Contributor

@xil222 please help with the release for this change. Thank you.

@thanhtutzaw
Copy link

thanhtutzaw commented Jul 13, 2022

  • No API changes
  • Depends on JS SDK v9-compat, which has the same API as v8
  • Rewrite the imports/require from firebase/* to firebase/compat/* in the build step
  • Versioning as 6.0.0 due to the break in peer and import paths
  • Firebase JS SDK v9 does not ship with closure externs. Bring them in manually.
  • Updated /demo to use Firebase JS SDK v9.1.2 from the CDN
  • Updated gulp-concat-css as the version in the package.json was not working for me, it was bailing during the inline images step
  • Various Github Actions cleanup to get the build green, this work is also captured in Porting over some Github Actions fixes from the v9 PR #886

Usage:

npm i --save firebaseui@next firebase

import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import * as firebaseui from 'firebaseui';

const response = await fetch('/__/firebase/init.json');
const app = firebase.initializeApp(await response.json());
const ui = new firebaseui.auth.AuthUI(app.auth());

ui.start('#firebaseui-auth-container', ...);

I have issue with Firebase v9.9 and Firebaseui v 6.0
I use together with next-firebase-auth package
It works with Firebase v8 and firebaseui v6
I need to know it is problem with these two version or What I am missing
Error Message :
firebaseerror: firebase: no firebase app '[default]' has been created - call firebase app.initializeapp() (app-compat/no-app).

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.

7 participants