firebaseui-web icon indicating copy to clipboard operation
firebaseui-web copied to clipboard

Firebase JS SDK v9 support

Open sipity19 opened this issue 3 years ago • 27 comments

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 avatar Aug 28 '21 14:08 sipity19

For the immediate future 0.600.0 firebaseui@next which utilizes v9-compat is what is available https://github.com/firebase/firebaseui-web/pull/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.

jamesdaniels avatar Aug 28 '21 17:08 jamesdaniels

Can you update the docs, at very least for firebaseui. It retarded how billion dollar company can't track their shit engineering on docs.

janat08 avatar Sep 11 '21 22:09 janat08

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';

shivna-2020 avatar Sep 16 '21 08:09 shivna-2020

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

strom2357 avatar Sep 20 '21 19:09 strom2357

How do you install it?

janat08 avatar Sep 21 '21 03:09 janat08

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.

shivna-2020 avatar Sep 21 '21 04:09 shivna-2020

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).

jacob-8 avatar Sep 21 '21 04:09 jacob-8

@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?

jamesdaniels avatar Sep 29 '21 04:09 jamesdaniels

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]

katharosada avatar Oct 06 '21 05:10 katharosada

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

joshhsiao333 avatar Nov 08 '21 02:11 joshhsiao333

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

xil222 avatar Nov 08 '21 03:11 xil222

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.

ChromeQ avatar Nov 08 '21 04:11 ChromeQ

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

dalenguyen avatar Nov 09 '21 14:11 dalenguyen

@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

jacob-8 avatar Nov 23 '21 05:11 jacob-8

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.

colin-reid avatar Dec 14 '21 04:12 colin-reid

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

nathanpphillips avatar Dec 23 '21 18:12 nathanpphillips

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.

bojeil-google avatar Jan 04 '22 19:01 bojeil-google

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

dalenguyen avatar Jan 19 '22 22:01 dalenguyen

@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!

mikob avatar Feb 10 '22 05:02 mikob

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

maucaro avatar Mar 31 '22 16:03 maucaro

is there any updates? Is this issue dead?

hoanghadu avatar May 16 '22 08:05 hoanghadu

Any news on this?

avilao avatar Nov 07 '22 23:11 avilao

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

jamesdaniels avatar Nov 08 '22 17:11 jamesdaniels

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

rejhgadellaa avatar Nov 18 '22 05:11 rejhgadellaa

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

jacob-8 avatar Nov 18 '22 10:11 jacob-8

Any timeline for this issue?

nicolasalt avatar Nov 15 '23 14:11 nicolasalt

Related: https://github.com/firebase/firebaseui-web/issues/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.

davidstackio avatar Nov 15 '23 14:11 davidstackio