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

fix(): Switching over to firebase from @firebase/* #1677

Merged
merged 3 commits into from
May 22, 2018
Merged

Conversation

jamesdaniels
Copy link
Member

@jamesdaniels jamesdaniels commented May 22, 2018

Checklist

Description

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.

database: (databaseURL?: string) => FirebaseDatabase;
// automaticDataCollectionEnabled is now private? _automaticDataCollectionEnabled?
// automaticDataCollectionEnabled: true,
Copy link
Member Author

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.

Copy link
Member Author

@jamesdaniels jamesdaniels May 22, 2018

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?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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[]) {
Copy link
Member Author

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'
Copy link
Member Author

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};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@davideast davideast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

3 participants