-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix(): Switching over to firebase
from @firebase/*
#1677
Conversation
664c2d6
to
d04ebd0
Compare
database: (databaseURL?: string) => FirebaseDatabase; | ||
// automaticDataCollectionEnabled is now private? _automaticDataCollectionEnabled? | ||
// automaticDataCollectionEnabled: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @jshcrowthe, if this goes public again it's going to be a breaking change for us; as it was the first time; as we need to export an "implementing" class to ngModule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a lot better for us if firebase/app
exported FirebaseAppImpl
, not just an interface; then we wouldn't have the chance of breaking changes.
options: {}; | ||
auth: () => FirebaseAuth; | ||
// app.App database() doesn't take a databaseURL arg in the public types? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @jshcrowthe
return (existingApp || firebase.initializeApp(options, config)) as FirebaseApp; | ||
const existingApp = apps.filter(app => app && app.name === config.name)[0]; | ||
// We support FirebaseConfig, initializeApp's public type only accepts string; need to cast as any | ||
return (existingApp || (initializeApp as any)(options, config)) as FirebaseApp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @jshcrowthe
@@ -37,7 +36,7 @@ export function sortedChanges<T>(query: Query, events: DocumentChangeType[]): Ob | |||
* @param changes | |||
* @param events | |||
*/ | |||
export function combineChanges(current: DocumentChange[], changes: DocumentChange[], events: DocumentChangeType[]) { | |||
export function combineChanges<T>(current: DocumentChange<T>[], changes: DocumentChange<T>[], events: DocumentChangeType[]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These <T>
's are needed because we're pulling in our DocumentChange
now.
'angularfire2': 'angularfire2', | ||
'angularfire2/auth': 'angularfire2.auth', | ||
'angularfire2/database': 'angularfire2.database', | ||
'angularfire2/database-deprecated': 'angularfire2.database_deprecated', | ||
'angularfire2/firestore': 'angularfire2.firestore', | ||
'angularfire2/functions': 'angularfire2.functions', | ||
'angularfire2/storage': 'angularfire2.storage', | ||
'zone.js': 'Zone' | ||
'angularfire2/storage': 'angularfire2.storage' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zone.js
and @angular/compiler
were not needed, dropped while I was in here.
import { FirebaseOptionsToken, FirebaseNameOrConfigToken } from './angularfire2'; | ||
// Public types don't expose FirebaseOptions or FirebaseAppConfig | ||
export type FirebaseOptions = {[key:string]: any}; | ||
export type FirebaseAppConfig = {[key:string]: any}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @jshcrowthe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Checklist
yarn install
,yarn test
run successfully? yesDescription
Per firebase/firebase-js-sdk#853 we're moving over to the
firebase
dependency and it's public types, rather than@firebase/*
and@firebase/*-types
.