-
Notifications
You must be signed in to change notification settings - Fork 936
Fixing the types for firebase/app #1206
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
Conversation
FYI @davideast |
@jshcrowthe this will break anyone pulling in the namespaces from import { default as firebase, auth, database } from 'firebase/app'; Are we ok with that? If not, we could fix with the following lines in export import auth = firebase.auth;
export import database = firebase.database;
export import firestore = firebase.firestore;
// and so on for all the exported types This quick export wouldn't address them being exported as both namespace and callable however, which would be poor typing (e.g, That said, I don't know if exporting the namespaces is worth it however; as a quick skim of Github search results (not thorough/scientific) shows more people importing types from Thoughts? |
Alternatively we could do the reverse; move the types I did in #1184 to import * as firebase from 'app';
export = firebase;
export as namespace firebase; |
@jamesdaniels Wouldn't the change break import * as firebase from 'firebase/app', unless we reexport everything from firebase namespace in firebase/app? Maybe we can migrate the index.d.ts file at the root of firebase to esm with both named and default exports? Is there any downside to this approach? I'm probably missing something, but I'm not sure why we chose cjs format for the root index.d.ts. |
@Feiyang1
|
74a46b3
to
651e56a
Compare
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
651e56a
to
74a46b3
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Closing #1184 in favor of this... While my heart was in the right place (in terms of
firebase/app
) I was modifying the types forfirebase
and introducing breaking changes.Let's start fresh shall we, the root cause is that the typings for
firebase/app
are pointing to that offirebase
. Which is not correct.firebase/app
is an ESM+CJS with a default export, the types as defined in the root useexport = ...
which suggests AMD and does not play nice with ESM.This fix simply reexports
firebase
from..
in a newindex.d.ts
.