-
Notifications
You must be signed in to change notification settings - Fork 291
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 Modular Firebase 9 #164
Comments
It looks like the upgrade path would be:
|
So yeah, if you choose to have an incremental upgrade path, you could do two stages, compat and then the modular. Here's why I think you should skip the compat phase:
I'm obviously in favor of the |
@litewarp I appreciate your thoughts and agree with the As a note on a limitation, because we use FirebaseUI for the demo app:
|
Ahh, nuts. Not having FirebaseUI is a pain. That would definitely be a roadblock to adoption. Once again, we are at the mercy of the Googleplex. I'll start hacking away on it at some point, but guess there's not really a rush now. |
@litewarp Still good to move forward with this. Not sure how many developers rely on FirebaseUI, plus I'd guess Firebase will add support as v9 moves out of beta. |
So this may be trickier than I anticipated. In the new modular scheme, there's no guard against a redundant initialization -- i.e., there's no However, even guarding for that with a try/catch initialization block, there's still some sort of race condition where firebase isn't initialized before the app tries to render which causes the I'm going to create a new app from scratch soon and see if I can get firebase 9 working before adding in next-firebase-auth, and go from there, but I thought I'd post here as an update and as a request for anyone who might have tried firebase 9 already to offer more insight. |
@litewarp You're right that import { initializeApp, getApps } from "firebase/app";
import config from "./config";
export const fire = getApps().length === 0 ? initializeApp(config) : getApps()[0]; |
I actually figured that part out and got it working BUT there was no way to use firebaseui or the compat library without having to initialize a second app instance using the compat library which caused all sorts of problems ... so I put it off for a bit. Also my current project is using MS auth, so haven't had much time in firebase land lately. Will try and share what I've done so far this weekend so others can pick it up if they have time. |
FYI: Firebase UI support is being worked on in this PR: firebase/firebaseui-web#850 |
Firebase v9 is now GA! 🎉 |
Closed in #291 and available on v1 |
Is your feature request related to a problem? Please describe.
Firebase bundle size is huge. Version 9 introduces a new import strategy that significantly reduces bundle size.
Describe the solution you'd like and how you'd implement it
Ideally a beta or "@next" version of the package that opts into the 'modular' (and not the 'compat' bridge) version 9 loading strategy.
Is this a breaking change?
Would this require existing users to change how they're using
next-firebase-auth
?Likely. Functions are now modular which means you need to pass the app instance into the function.
The text was updated successfully, but these errors were encountered: