-
-
Notifications
You must be signed in to change notification settings - Fork 342
Firebase Auth tree shaking #1459
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
Comments
I wasn’t aware of this issue. It should be doable without breaking changes I believe |
@posva Thanks for the ability to customize the Auth dependencies. I would like to know if it would be possible to add a VueFireAuth module that accepts the Auth instance like:
I propose this as I am using Vuefire without ssr or nuxt and would like to use Firebase emulators but I am unable to get the Auth instance from Vuefire outside of injectable context. I configure all my Firebase configs in a files outside of Vue so it doesn't have injectable context. |
Sure. I added d5d5e1b. I think I should have gone for that solution rather than passing the dependencies. Hopefully I will publish a new version soon |
What problem is this solving
The current VueFire uses getAuth in the authentication module, but according to https://firebase.google.com/docs/auth/web/custom-dependencies that imports all of the authentication module and doesn't remove anything in the tree shaking process.
So I am trying to solve the tree shaking issue while adding more flexibility.
Proposed solution
I propose that we add the ability to optionally pass the Auth object into VueFire.
In my project I build the Auth object using initializeAuth which should properly tree shake. It would be awesome to pass that into VueFire so that VueFire doesn't use getAuth which in turn should allow proper tree shaking.
Describe alternatives you've considered
No response
The text was updated successfully, but these errors were encountered: