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

Firebase JS SDK v9 support #877

Open
sipity19 opened this issue Aug 28, 2021 · 27 comments
Open

Firebase JS SDK v9 support #877

sipity19 opened this issue Aug 28, 2021 · 27 comments

Comments

@sipity19
Copy link

sipity19 commented Aug 28, 2021

Now that the v9 SDK is in production, is there an ETA on supporting it?

This is holding up migration as the bundle size reduction is really attractive for us (and most others, I believe) So, not the compatibility thing, but proper v9 support is needed.

Thanks,

@sipity19 sipity19 changed the title Fire base JS SDK v9 support Firebase JS SDK v9 support Aug 28, 2021
@jamesdaniels
Copy link
Member

For the immediate future 0.600.0 firebaseui@next which utilizes v9-compat is what is available #850

Proper tree-shaking support would require a considerable API / build-process change & while we are thinking about what that might look like, I wouldn't expect any headway to be made for a while.

@janat08

This comment has been minimized.

@shivna-2020
Copy link

For the immediate future 0.600.0 firebaseui@next which utilizes v9-compat is what is available #850

Proper tree-shaking support would require a considerable API / build-process change & while we are thinking about what that might look like, I wouldn't expect any headway to be made for a while.

firebaseui@next does not seem to support SAML.

Getting the following error:
Uncaught TypeError: firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__.default.auth.SAMLAuthProvider is not a constructor

Importing firebase as follows:
import 'firebase/compat/auth';

@strom2357
Copy link

As a workaround, using JS SDK v8 should resolve this issue with SAML in the meantime

@janat08
Copy link

janat08 commented Sep 21, 2021

How do you install it?

@shivna-2020
Copy link

As a workaround, using JS SDK v8 should resolve this issue with SAML in the meantime

JSD SDK v8 does not load in the browser when bundled using webpack if auth (8.10.0) and compatible messaging (0.8.0) is included. Hence, we are forced to use SDK v9.

@jacob-8
Copy link

jacob-8 commented Sep 21, 2021

Workaround option: I'm using Firebase 9 in several projects and didn't want to use the v9 compat library so I decided to dynamically import the Firebase 8 SDK via CDN for FirebaseUI just when visitors open my authentication modal. This will save you from bundler bugs. You can see the SvelteKit implementation at https://github.com/jacobbowdoin/sveltefirets/blob/main/src/lib/components/FirebaseUiAuth.svelte but there's nothing really about this implementation that requires Svelte and you could do this same thing quite easily in any framework. That repo is a work in progress of my base implementation which I hope to turn into an easily installable library for SvelteKit users. For a live example you can see it in action at https://livingdictionaries.app/ (click "Sign In") and view the code at https://github.com/livingtongues/living-dictionaries/blob/main/src/sveltefire/components/FirebaseUiAuth.svelte (this version has i18n baked in).

@jamesdaniels
Copy link
Member

@jacobbowdoin why not dynamically import v9 compat instead? that way you're on a supported version of the SDK that is compatible with v9 modular?

@katharosada
Copy link

Just adding a +1 to please add v9 support. In the meantime could you update the README to tell people to install a specific version? e.g. npm install --save [email protected]

@joshhsiao333
Copy link

hope there is v9 support soon. I spend 1 day convert my code to v9 but stuck in firebaseui

@xil222
Copy link
Contributor

xil222 commented Nov 8, 2021

hope there is v9 support soon. I spend 1 day convert my code to v9 but stuck in firebaseui

There is support for v9 with compat library now, with FirebaseUI v6.0.0 and Firebase JS SDK v9.2.0 following this format link

@ChromeQ
Copy link

ChromeQ commented Nov 8, 2021

If you are using v9 fully on your site (not the compat) then I suggest you MUST lazy load the firebaseui as it is extra bulky and essentially doubling up the firebase code. The compat packages are not going to save you much/any bundle size.

@dalenguyen
Copy link

@ChromeQ do you have an example on how to lazy load firebaseui with plain javascript?

@jacob-8
Copy link

jacob-8 commented Nov 23, 2021

@jacobbowdoin why not dynamically import v9 compat instead? that way you're on a supported version of the SDK that is compatible with v9 modular?

Thanks for pointing out the obvious that I clearly missed, @jamesdaniels ! I've had a chance to further improve SvelteFire TS and now have Firebase 9.5.0 working smoothly with FirebaseUI 6.0.0 + v9 compat being pulled in via CDN only when needed (and I copied in the types as well). You can see it in action in 3 languages at https://sveltefirets.vercel.app/ (proper documentation is still needed but at least it's a useful playground!) Those working in Svelte can use SvelteFire TS and others can just learn from the implementation starting in https://github.com/jacobbowdoin/sveltefirets/blob/main/src/lib/client/components/FirebaseUiAuth.svelte

@ChromeQ do you have an example on how to lazy load firebaseui with plain javascript?

There's a bit more here than you're asking for @dalenguyen - but you could copy the ideas from my example as most of the functionality is not Svelte but is Javascript. Start here: https://github.com/jacobbowdoin/sveltefirets/blob/main/src/lib/client/components/FirebaseUiAuth.svelte#L30-L42 and https://github.com/jacobbowdoin/sveltefirets/blob/main/src/lib/client/loader.ts#L3-L8 then compare those with the basic javascript example given in this repo: https://github.com/firebase/firebaseui-web#starting-the-sign-in-flow

@colin-reid
Copy link

Be careful with the current v9 compat support. If you switch your app off of compat mode entirely it may break autoUpgradeAnonymousUsers because firebaseui relies on methods like linkWithRedirect that are not available on the native v9 Firebase User type.

@nathanpphillips
Copy link

To add onto Colin's message, linkWithPopup also is not available.

kizahasi added a commit to flocon-trpg/servers that referenced this issue Dec 28, 2021
firebaseuiはコミットの頻度が低く、firebase@9で匿名アカウントをアップグレードできないバグなどが直りそうな気配がないため
firebase/firebaseui-web#877 (comment)
@bojeil-google
Copy link
Contributor

Hey folks, the compat layer should provide feature parity with the v8 library. Any issues you encounter, please report them to the firebase-js-sdk repo so they can be addressed.

@dalenguyen
Copy link

Thanks, @jacobbowdoin. Updated the v9 compat to my WordPress website. Everything works fine 👍

@mikob
Copy link

mikob commented Feb 10, 2022

@bojeil-google @jamesdaniels sorry for repeating the OP, but it seems like it wasn't answered and I would like to know too, is there any ETA on a firebaseui version that does not rely on the compatibility build? Thanks!

@maucaro
Copy link

maucaro commented Mar 31, 2022

@bojeil-google @jamesdaniels , echoing @mikob , please give us guidance on this topic.

@hoanghadu
Copy link

is there any updates? Is this issue dead?

@avilao
Copy link

avilao commented Nov 7, 2022

Any news on this?

@jamesdaniels
Copy link
Member

We are looking into this but no timeline to share ATM.

@rejhgadellaa
Copy link

I noticed a new release of firebaseUI that's based on firebase 9.13 - does that mean support for 9 is finally here?

@jacob-8
Copy link

jacob-8 commented Nov 18, 2022

I noticed a new release of firebaseUI that's based on firebase 9.13 - does that mean support for 9 is finally here?

No. If you check the latest commits you'll see they just updated 9.1.3/firebase-app-compat.js to 9.13.0/firebase-app-compat.js

@jhuleatt jhuleatt added feature:auth feature:ui UI feature requests labels Jul 31, 2023
@nicolasalt
Copy link

Any timeline for this issue?

@davidstackio
Copy link

davidstackio commented Nov 15, 2023

Related: #1015

Edit: I've been using Firebase directly for my projects as adding v9+ support no longer appears to be a priority for the maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests