diff --git a/package.json b/package.json index a43132183..8953069b8 100644 --- a/package.json +++ b/package.json @@ -34,19 +34,19 @@ "@angular/core": "^5.0.0", "@angular/platform-browser": "^5.0.0", "@angular/platform-browser-dynamic": "^5.0.0", - "@firebase/app": "^0.1.6", - "@firebase/app-types": "^0.1.1", - "@firebase/auth": "^0.3.2", - "@firebase/auth-types": "^0.1.1", - "@firebase/database": "^0.1.7", - "@firebase/database-types": "^0.1.1", - "@firebase/firestore": "^0.2.3", - "@firebase/firestore-types": "^0.1.1", - "@firebase/messaging-types": "^0.1.1", - "@firebase/storage": "^0.1.6", - "@firebase/storage-types": "^0.1.1", + "@firebase/app": "^0.2.0", + "@firebase/app-types": "^0.2.0", + "@firebase/auth": "^0.4.2", + "@firebase/auth-types": "^0.2.1", + "@firebase/database": "^0.2.2", + "@firebase/database-types": "^0.2.1", + "@firebase/firestore": "^0.4.1", + "@firebase/firestore-types": "^0.3.0", + "@firebase/messaging-types": "^0.1.3", + "@firebase/storage": "^0.1.9", + "@firebase/storage-types": "^0.1.3", "bufferutil": "^3.0.3", - "firebase": "^4.8.2", + "firebase": "^4.13.0", "rxjs": "^5.5.4", "utf-8-validate": "^4.0.0", "ws": "^3.3.2", diff --git a/src/auth/auth.spec.ts b/src/auth/auth.spec.ts index 84f7f44f1..d8f16fb57 100644 --- a/src/auth/auth.spec.ts +++ b/src/auth/auth.spec.ts @@ -2,7 +2,7 @@ import { User } from '@firebase/auth-types'; import { ReflectiveInjector, Provider } from '@angular/core'; import { Observable, Subject } from 'rxjs' import { TestBed, inject } from '@angular/core/testing'; -import { FirebaseApp, FirebaseAppConfig, AngularFireModule, FirebaseAppName } from 'angularfire2'; +import { FirebaseApp, FirebaseOptionsToken, AngularFireModule, FirebaseAppNameToken } from 'angularfire2'; import { AngularFireAuth, AngularFireAuthModule } from 'angularfire2/auth'; import { COMMON_CONFIG } from './test-config'; import { take, skip } from 'rxjs/operators'; @@ -136,8 +136,8 @@ describe('AngularFireAuth with different app', () => { AngularFireAuthModule ], providers: [ - { provide: FirebaseAppName, useValue: FIREBASE_APP_NAME_TOO }, - { provide: FirebaseAppConfig, useValue: COMMON_CONFIG } + { provide: FirebaseAppNameToken, useValue: FIREBASE_APP_NAME_TOO }, + { provide: FirebaseOptionsToken, useValue: COMMON_CONFIG } ] }); inject([FirebaseApp, AngularFireAuth], (app_: FirebaseApp, _afAuth: AngularFireAuth) => { diff --git a/src/auth/auth.ts b/src/auth/auth.ts index 3ee817741..092bfcfe1 100644 --- a/src/auth/auth.ts +++ b/src/auth/auth.ts @@ -1,12 +1,12 @@ import { FirebaseAuth, User } from '@firebase/auth-types'; -import { FirebaseOptions } from '@firebase/app-types'; +import { FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types'; import { Injectable, Inject, Optional, NgZone, PLATFORM_ID } from '@angular/core'; import { Observable } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { of } from 'rxjs/observable/of'; import { from } from 'rxjs/observable/from'; -import { FirebaseAppConfig, FirebaseAppName, _firebaseAppFactory, FirebaseZoneScheduler } from 'angularfire2'; +import { FirebaseOptionsToken, FirebaseAppConfigToken, FirebaseAppNameToken, _firebaseAppFactory, FirebaseZoneScheduler } from 'angularfire2'; @Injectable() @@ -28,14 +28,15 @@ export class AngularFireAuth { public readonly idToken: Observable; constructor( - @Inject(FirebaseAppConfig) config:FirebaseOptions, - @Optional() @Inject(FirebaseAppName) name:string, + @Inject(FirebaseOptionsToken) options:FirebaseOptions, + @Optional() @Inject(FirebaseAppConfigToken) config:FirebaseAppConfig, + @Optional() @Inject(FirebaseAppNameToken) name:string, @Inject(PLATFORM_ID) platformId: Object, private zone: NgZone ) { const scheduler = new FirebaseZoneScheduler(zone, platformId); this.auth = zone.runOutsideAngular(() => { - const app = _firebaseAppFactory(config, name); + const app = _firebaseAppFactory(options, name, config); return app.auth(); }); diff --git a/src/core/angularfire2.spec.ts b/src/core/angularfire2.spec.ts index f59b02394..96c9728dd 100644 --- a/src/core/angularfire2.spec.ts +++ b/src/core/angularfire2.spec.ts @@ -2,7 +2,7 @@ import { Reference } from '@firebase/database-types'; import { TestBed, inject, withModule, async } from '@angular/core/testing'; import { ReflectiveInjector, Provider, PlatformRef, NgModule, Compiler, ApplicationRef, CompilerFactory } from '@angular/core'; -import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from 'angularfire2'; +import { FirebaseApp, AngularFireModule } from 'angularfire2'; import { Subscription } from 'rxjs'; import { COMMON_CONFIG } from './test-config'; import { BrowserModule } from '@angular/platform-browser'; diff --git a/src/core/angularfire2.ts b/src/core/angularfire2.ts index d0f2cee9e..01bdb96fe 100644 --- a/src/core/angularfire2.ts +++ b/src/core/angularfire2.ts @@ -5,12 +5,13 @@ import { queue } from 'rxjs/scheduler/queue'; import { first } from 'rxjs/operators'; import firebase from '@firebase/app'; -import { FirebaseApp, FirebaseOptions } from '@firebase/app-types'; +import { FirebaseApp, FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types'; import {} from 'zone.js'; -export const FirebaseAppName = new InjectionToken('angularfire2.appName'); -export const FirebaseAppConfig = new InjectionToken('angularfire2.config'); +export const FirebaseAppNameToken = new InjectionToken('angularfire2.app.name'); +export const FirebaseOptionsToken = new InjectionToken('angularfire2.app.options'); +export const FirebaseAppConfigToken = new InjectionToken('angularfire2.app.config'); // Put in database.ts when we drop database-depreciated export const RealtimeDatabaseURL = new InjectionToken('angularfire2.realtimeDatabaseURL'); diff --git a/src/core/firebase.app.module.ts b/src/core/firebase.app.module.ts index 62b733b1d..3a3e1afee 100644 --- a/src/core/firebase.app.module.ts +++ b/src/core/firebase.app.module.ts @@ -1,9 +1,9 @@ import { InjectionToken, NgZone, NgModule } from '@angular/core'; -import { FirebaseAppConfig, FirebaseAppName } from './angularfire2'; +import { FirebaseOptionsToken, FirebaseAppNameToken, FirebaseAppConfigToken } from './angularfire2'; import firebase from '@firebase/app'; -import { FirebaseApp as _FirebaseApp, FirebaseOptions } from '@firebase/app-types'; +import { FirebaseApp as _FirebaseApp, FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types'; import { FirebaseAuth } from '@firebase/auth-types'; import { FirebaseDatabase } from '@firebase/database-types'; import { FirebaseMessaging } from '@firebase/messaging-types'; @@ -22,29 +22,36 @@ export class FirebaseApp implements _FirebaseApp { firestore: () => FirebaseFirestore; } -export function _firebaseAppFactory(config: FirebaseOptions, name?: string): FirebaseApp { - const appName = name || '[DEFAULT]'; - const existingApp = firebase.apps.filter(app => app.name == appName)[0] as FirebaseApp; - return existingApp || firebase.initializeApp(config, appName) as FirebaseApp; +export function _firebaseAppFactory(options: FirebaseOptions, name?: string, appConfig?: FirebaseAppConfig): FirebaseApp { + const config = appConfig || {}; + if (name && config.name && config.name !== name) { + console.warn('FirebaseAppNameToken and FirebaseAppConfigToken.name don\'t match, FirebaseAppNameToken takes precedence.'); + } + config.name = name || config.name || '[DEFAULT]'; + const existingApp = firebase.apps.filter(app => app.name === config.name)[0]; + return (existingApp || firebase.initializeApp(options, config)) as FirebaseApp; } const FirebaseAppProvider = { provide: FirebaseApp, useFactory: _firebaseAppFactory, - deps: [ FirebaseAppConfig, FirebaseAppName ] + deps: [ FirebaseOptionsToken, FirebaseAppNameToken, FirebaseAppConfigToken ] }; @NgModule({ providers: [ FirebaseAppProvider ], }) export class AngularFireModule { - static initializeApp(config: FirebaseOptions, appName?: string) { + static initializeApp(options: FirebaseOptions, appNameOrConfig?: string | FirebaseAppConfig) { + const name = typeof appNameOrConfig === 'string' && appNameOrConfig || undefined + const config = typeof appNameOrConfig === 'object' && appNameOrConfig || undefined return { ngModule: AngularFireModule, providers: [ - { provide: FirebaseAppConfig, useValue: config }, - { provide: FirebaseAppName, useValue: appName } + { provide: FirebaseOptionsToken, useValue: options }, + { provide: FirebaseAppNameToken, useValue: name }, + { provide: FirebaseAppConfigToken, useValue: config } ] } } -} +} \ No newline at end of file diff --git a/src/database-deprecated/database.ts b/src/database-deprecated/database.ts index 7f0ed1175..7abfd8c33 100644 --- a/src/database-deprecated/database.ts +++ b/src/database-deprecated/database.ts @@ -6,8 +6,8 @@ import { FirebaseListFactoryOpts, FirebaseObjectFactoryOpts, PathReference } fro import { FirebaseObjectFactory } from './firebase_object_factory'; import { FirebaseObjectObservable } from './firebase_object_observable'; import * as utils from './utils'; -import { FirebaseOptions } from '@firebase/app-types'; -import { FirebaseAppConfig, FirebaseAppName, RealtimeDatabaseURL, _firebaseAppFactory } from 'angularfire2'; +import { FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types'; +import { FirebaseAppConfigToken, FirebaseOptionsToken, FirebaseAppNameToken, RealtimeDatabaseURL, _firebaseAppFactory } from 'angularfire2'; @Injectable() export class AngularFireDatabase { @@ -18,8 +18,9 @@ export class AngularFireDatabase { database: FirebaseDatabase; constructor( - @Inject(FirebaseAppConfig) config:FirebaseOptions, - @Optional() @Inject(FirebaseAppName) name:string, + @Inject(FirebaseOptionsToken) options:FirebaseOptions, + @Inject(FirebaseAppConfigToken) config:FirebaseAppConfig, + @Optional() @Inject(FirebaseAppNameToken) name:string, @Optional() @Inject(RealtimeDatabaseURL) databaseURL:string, zone: NgZone ) { diff --git a/src/database/database.spec.ts b/src/database/database.spec.ts index e9fe72b45..b51acb6cb 100644 --- a/src/database/database.spec.ts +++ b/src/database/database.spec.ts @@ -1,4 +1,4 @@ -import { FirebaseApp, FirebaseAppConfig, AngularFireModule, FirebaseAppName } from 'angularfire2'; +import { FirebaseApp, AngularFireModule, FirebaseOptionsToken, FirebaseAppNameToken } from 'angularfire2'; import { AngularFireDatabase, AngularFireDatabaseModule, RealtimeDatabaseURL } from 'angularfire2/database'; import { TestBed, inject } from '@angular/core/testing'; import { COMMON_CONFIG } from './test-config'; @@ -42,7 +42,7 @@ describe('AngularFireDatabase', () => { }); it('should accept a Firebase App in the constructor', () => { - const __db = new AngularFireDatabase(app.options, app.name, null!, {}, zone); + const __db = new AngularFireDatabase(app.options, undefined!, app.name, undefined!, {}, zone); expect(__db instanceof AngularFireDatabase).toEqual(true); }); @@ -69,9 +69,9 @@ describe('AngularFireDatabase w/options', () => { AngularFireDatabaseModule ], providers: [ - { provide: FirebaseAppName, useValue: FIREBASE_APP_NAME_TOO }, - { provide: FirebaseAppConfig, useValue: COMMON_CONFIG }, - { provide: RealtimeDatabaseURL, useValue: FIREBASE_DB_NAME } + { provide: FirebaseAppNameToken, useValue: FIREBASE_APP_NAME_TOO }, + { provide: FirebaseOptionsToken, useValue: COMMON_CONFIG }, + { provide: RealtimeDatabaseURL, useValue: FIREBASE_DB_NAME } ] }); inject([FirebaseApp, AngularFireDatabase], (app_: FirebaseApp, _db: AngularFireDatabase) => { diff --git a/src/database/database.ts b/src/database/database.ts index ca44d26a8..665023b7b 100644 --- a/src/database/database.ts +++ b/src/database/database.ts @@ -3,10 +3,10 @@ import { FirebaseDatabase } from '@firebase/database-types'; import { PathReference, DatabaseQuery, DatabaseReference, DatabaseSnapshot, ChildEvent, ListenEvent, QueryFn, AngularFireList, AngularFireObject } from './interfaces'; import { getRef } from './utils'; import { InjectionToken } from '@angular/core'; -import { FirebaseOptions } from '@firebase/app-types'; +import { FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types'; import { createListReference } from './list/create-reference'; import { createObjectReference } from './object/create-reference'; -import { FirebaseAppConfig, FirebaseAppName, RealtimeDatabaseURL, _firebaseAppFactory, FirebaseZoneScheduler } from 'angularfire2'; +import { FirebaseOptionsToken, FirebaseAppConfigToken, FirebaseAppNameToken, RealtimeDatabaseURL, _firebaseAppFactory, FirebaseZoneScheduler } from 'angularfire2'; @Injectable() export class AngularFireDatabase { @@ -14,15 +14,16 @@ export class AngularFireDatabase { public readonly scheduler: FirebaseZoneScheduler; constructor( - @Inject(FirebaseAppConfig) config:FirebaseOptions, - @Optional() @Inject(FirebaseAppName) name:string, + @Inject(FirebaseOptionsToken) options:FirebaseOptions, + @Optional() @Inject(FirebaseAppConfigToken) config:FirebaseAppConfig, + @Optional() @Inject(FirebaseAppNameToken) name:string, @Optional() @Inject(RealtimeDatabaseURL) databaseURL:string, @Inject(PLATFORM_ID) platformId: Object, zone: NgZone ) { this.scheduler = new FirebaseZoneScheduler(zone, platformId); this.database = zone.runOutsideAngular(() => { - const app = _firebaseAppFactory(config, name); + const app = _firebaseAppFactory(options, name, config); return app.database(databaseURL || undefined); }); } diff --git a/src/database/list/changes.spec.ts b/src/database/list/changes.spec.ts index 05d083e6d..58116ebac 100644 --- a/src/database/list/changes.spec.ts +++ b/src/database/list/changes.spec.ts @@ -1,5 +1,5 @@ import { Reference } from '@firebase/database-types'; -import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from 'angularfire2'; +import { FirebaseApp, AngularFireModule } from 'angularfire2'; import { AngularFireDatabase, AngularFireDatabaseModule, listChanges } from 'angularfire2/database'; import { TestBed, inject } from '@angular/core/testing'; import { COMMON_CONFIG } from '../test-config'; diff --git a/src/database/list/snapshot-changes.spec.ts b/src/database/list/snapshot-changes.spec.ts index 61ae4233d..514c1e936 100644 --- a/src/database/list/snapshot-changes.spec.ts +++ b/src/database/list/snapshot-changes.spec.ts @@ -1,5 +1,5 @@ import { Reference } from '@firebase/database-types'; -import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from 'angularfire2'; +import { FirebaseApp, AngularFireModule } from 'angularfire2'; import { AngularFireDatabase, AngularFireDatabaseModule, snapshotChanges, ChildEvent } from 'angularfire2/database'; import { TestBed, inject } from '@angular/core/testing'; import { COMMON_CONFIG } from '../test-config'; diff --git a/src/database/list/state-changes.spec.ts b/src/database/list/state-changes.spec.ts index 9fba508fb..d42e0a4ca 100644 --- a/src/database/list/state-changes.spec.ts +++ b/src/database/list/state-changes.spec.ts @@ -1,5 +1,5 @@ import { Reference } from '@firebase/database-types'; -import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from 'angularfire2'; +import { FirebaseApp, AngularFireModule } from 'angularfire2'; import { AngularFireDatabase, AngularFireDatabaseModule, stateChanges, ChildEvent } from 'angularfire2/database'; import { TestBed, inject } from '@angular/core/testing'; import { COMMON_CONFIG } from '../test-config'; diff --git a/src/firestore/collection/collection.spec.ts b/src/firestore/collection/collection.spec.ts index a41714510..1b9fea45e 100644 --- a/src/firestore/collection/collection.spec.ts +++ b/src/firestore/collection/collection.spec.ts @@ -1,4 +1,4 @@ -import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from 'angularfire2'; +import { FirebaseApp, AngularFireModule } from 'angularfire2'; import { AngularFirestore } from '../firestore'; import { AngularFirestoreModule } from '../firestore.module'; import { AngularFirestoreDocument } from '../document/document'; diff --git a/src/firestore/document/document.spec.ts b/src/firestore/document/document.spec.ts index c4a87801d..06421e3f1 100644 --- a/src/firestore/document/document.spec.ts +++ b/src/firestore/document/document.spec.ts @@ -1,4 +1,4 @@ -import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from 'angularfire2'; +import { FirebaseApp, AngularFireModule } from 'angularfire2'; import { AngularFirestore } from '../firestore'; import { AngularFirestoreModule } from '../firestore.module'; import { AngularFirestoreDocument } from '../document/document'; diff --git a/src/firestore/firestore.spec.ts b/src/firestore/firestore.spec.ts index b09256a26..a9c193587 100644 --- a/src/firestore/firestore.spec.ts +++ b/src/firestore/firestore.spec.ts @@ -1,4 +1,4 @@ -import { FirebaseApp, FirebaseAppConfig, AngularFireModule, FirebaseAppName } from 'angularfire2'; +import { FirebaseApp, FirebaseOptionsToken, AngularFireModule, FirebaseAppNameToken } from 'angularfire2'; import { AngularFirestore } from './firestore'; import { AngularFirestoreModule } from './firestore.module'; import { AngularFirestoreDocument } from './document/document'; @@ -105,8 +105,8 @@ describe('AngularFirestore with different app', () => { AngularFirestoreModule ], providers: [ - { provide: FirebaseAppName, useValue: FIREBASE_APP_NAME_TOO }, - { provide: FirebaseAppConfig, useValue: COMMON_CONFIG } + { provide: FirebaseAppNameToken, useValue: FIREBASE_APP_NAME_TOO }, + { provide: FirebaseOptionsToken, useValue: COMMON_CONFIG } ] }); inject([FirebaseApp, AngularFirestore], (app_: FirebaseApp, _afs: AngularFirestore) => { diff --git a/src/firestore/firestore.ts b/src/firestore/firestore.ts index 7d04cc98f..65216ff5f 100644 --- a/src/firestore/firestore.ts +++ b/src/firestore/firestore.ts @@ -5,14 +5,14 @@ import { Observable, Subscriber } from 'rxjs'; import { map, catchError } from 'rxjs/operators'; import { of } from 'rxjs/observable/of'; import { from } from 'rxjs/observable/from'; -import { FirebaseOptions } from '@firebase/app-types'; +import { FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types'; import { Injectable, Inject, Optional } from '@angular/core'; import { QueryFn, AssociatedReference } from './interfaces'; import { AngularFirestoreDocument } from './document/document'; import { AngularFirestoreCollection } from './collection/collection'; -import { FirebaseAppConfig, FirebaseAppName, _firebaseAppFactory, FirebaseZoneScheduler } from 'angularfire2'; +import { FirebaseAppConfigToken, FirebaseOptionsToken, FirebaseAppNameToken, _firebaseAppFactory, FirebaseZoneScheduler } from 'angularfire2'; /** * The value of this token determines whether or not the firestore will have persistance enabled @@ -106,15 +106,16 @@ export class AngularFirestore { * @param app */ constructor( - @Inject(FirebaseAppConfig) config:FirebaseOptions, - @Optional() @Inject(FirebaseAppName) name:string, + @Inject(FirebaseOptionsToken) options:FirebaseOptions, + @Optional() @Inject(FirebaseAppConfigToken) config:FirebaseAppConfig, + @Optional() @Inject(FirebaseAppNameToken) name:string, @Optional() @Inject(EnablePersistenceToken) shouldEnablePersistence: boolean, @Inject(PLATFORM_ID) platformId: Object, zone: NgZone ) { this.scheduler = new FirebaseZoneScheduler(zone, platformId); this.firestore = zone.runOutsideAngular(() => { - const app = _firebaseAppFactory(config, name); + const app = _firebaseAppFactory(options, name, config); return app.firestore(); }); diff --git a/src/storage/storage.spec.ts b/src/storage/storage.spec.ts index 06fb8c8a8..f2bfcc470 100644 --- a/src/storage/storage.spec.ts +++ b/src/storage/storage.spec.ts @@ -2,7 +2,7 @@ import { Observable } from 'rxjs' import { forkJoin } from 'rxjs/observable/forkJoin'; import { map, mergeMap, tap } from 'rxjs/operators'; import { TestBed, inject } from '@angular/core/testing'; -import { FirebaseApp, FirebaseAppConfig, AngularFireModule, FirebaseAppName } from 'angularfire2'; +import { FirebaseApp, FirebaseOptionsToken, AngularFireModule, FirebaseAppNameToken } from 'angularfire2'; import { AngularFireStorageModule, AngularFireStorage, AngularFireUploadTask, StorageBucket } from 'angularfire2/storage'; import { COMMON_CONFIG } from './test-config'; @@ -140,8 +140,8 @@ describe('AngularFireStorage w/options', () => { AngularFireStorageModule ], providers: [ - { provide: FirebaseAppName, useValue: FIREBASE_APP_NAME_TOO }, - { provide: FirebaseAppConfig, useValue: COMMON_CONFIG }, + { provide: FirebaseAppNameToken, useValue: FIREBASE_APP_NAME_TOO }, + { provide: FirebaseOptionsToken, useValue: COMMON_CONFIG }, { provide: StorageBucket, useValue: FIREBASE_STORAGE_BUCKET } ] }); diff --git a/src/storage/storage.ts b/src/storage/storage.ts index 5ef92c9de..de80842f9 100644 --- a/src/storage/storage.ts +++ b/src/storage/storage.ts @@ -3,8 +3,8 @@ import { FirebaseStorage, UploadMetadata } from '@firebase/storage-types'; import { createStorageRef, AngularFireStorageReference } from './ref'; import { createUploadTask, AngularFireUploadTask } from './task'; import { Observable } from 'rxjs'; -import { FirebaseAppConfig, FirebaseAppName, FirebaseZoneScheduler, _firebaseAppFactory } from 'angularfire2'; -import { FirebaseOptions } from '@firebase/app-types'; +import { FirebaseAppConfigToken, FirebaseOptionsToken, FirebaseAppNameToken, FirebaseZoneScheduler, _firebaseAppFactory } from 'angularfire2'; +import { FirebaseOptions, FirebaseAppConfig } from '@firebase/app-types'; export const StorageBucket = new InjectionToken('angularfire2.storageBucket'); @@ -21,15 +21,16 @@ export class AngularFireStorage { public readonly scheduler: FirebaseZoneScheduler; constructor( - @Inject(FirebaseAppConfig) config:FirebaseOptions, - @Optional() @Inject(FirebaseAppName) name:string, + @Inject(FirebaseOptionsToken) options:FirebaseOptions, + @Optional() @Inject(FirebaseAppConfigToken) config:FirebaseAppConfig, + @Optional() @Inject(FirebaseAppNameToken) name:string, @Optional() @Inject(StorageBucket) storageBucket:string, @Inject(PLATFORM_ID) platformId: Object, zone: NgZone ) { this.scheduler = new FirebaseZoneScheduler(zone, platformId); this.storage = zone.runOutsideAngular(() => { - const app = _firebaseAppFactory(config, name); + const app = _firebaseAppFactory(options, name, config); return app.storage(storageBucket || undefined); }); } diff --git a/yarn.lock b/yarn.lock index 0d95ea185..b515956cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -49,15 +49,11 @@ tslib "^1.7.1" xhr2 "^0.1.4" -"@firebase/app-types@0.1.2", "@firebase/app-types@^0.1.1": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.1.2.tgz#a20cb346e3be374c0bdee6b102de0ea5e8e6fa27" - -"@firebase/app-types@0.2.0": +"@firebase/app-types@0.2.0", "@firebase/app-types@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.2.0.tgz#2a0e9c433d5f39e428358c5cd8065010d5a07985" -"@firebase/app@0.2.0": +"@firebase/app@0.2.0", "@firebase/app@^0.2.0": version "0.2.0" resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.2.0.tgz#015c270f07be2b01cf64129a2d0f9b3b87f3c135" dependencies: @@ -65,43 +61,21 @@ "@firebase/util" "0.1.11" tslib "1.9.0" -"@firebase/app@^0.1.6": - version "0.1.10" - resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.1.10.tgz#fc80c62dbe4d601cad1495bc095309adb9074f85" - dependencies: - "@firebase/app-types" "0.1.2" - "@firebase/util" "0.1.10" - tslib "^1.9.0" - -"@firebase/auth-types@0.1.2", "@firebase/auth-types@^0.1.1": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.1.2.tgz#15415ed12b038356f79f22f9059002a29873a15a" - -"@firebase/auth-types@0.2.1": +"@firebase/auth-types@0.2.1", "@firebase/auth-types@^0.2.1": version "0.2.1" resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.2.1.tgz#83a03939358ce8a59de85404b9ed7ca13a51548f" -"@firebase/auth@0.4.2": +"@firebase/auth@0.4.2", "@firebase/auth@^0.4.2": version "0.4.2" resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.4.2.tgz#63044e6ca6fb98ddc2de5a442f56f9d612ed1903" dependencies: "@firebase/auth-types" "0.2.1" -"@firebase/auth@^0.3.2": - version "0.3.4" - resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.3.4.tgz#79dd0b9d86d51fd6874fa2fff2e3c06ceef07d41" - dependencies: - "@firebase/auth-types" "0.1.2" - -"@firebase/database-types@0.1.2", "@firebase/database-types@^0.1.1": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.1.2.tgz#c6a23b8aa721ca16951c752430167ee764659916" - -"@firebase/database-types@0.2.1": +"@firebase/database-types@0.2.1", "@firebase/database-types@^0.2.1": version "0.2.1" resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.2.1.tgz#f83a6d03af5f8c93276ceb89e1f31e4664c9df1b" -"@firebase/database@0.2.2": +"@firebase/database@0.2.2", "@firebase/database@^0.2.2": version "0.2.2" resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.2.2.tgz#a8a0709644d7f281b400e983c71c8c65fba90c70" dependencies: @@ -111,24 +85,11 @@ faye-websocket "0.11.1" tslib "1.9.0" -"@firebase/database@^0.1.7": - version "0.1.11" - resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.1.11.tgz#652731bfd844bb858ab616e3dc8a3d5b8181101c" - dependencies: - "@firebase/database-types" "0.1.2" - "@firebase/util" "0.1.10" - faye-websocket "0.11.1" - tslib "^1.9.0" - -"@firebase/firestore-types@0.1.1", "@firebase/firestore-types@^0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-0.1.1.tgz#c711a0dcc440cdc668662b6017b1f730cc124586" - -"@firebase/firestore-types@0.3.0": +"@firebase/firestore-types@0.3.0", "@firebase/firestore-types@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-0.3.0.tgz#9df0af784145c568c6d306eda1dd25198b5a2b50" -"@firebase/firestore@0.4.1": +"@firebase/firestore@0.4.1", "@firebase/firestore@^0.4.1": version "0.4.1" resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-0.4.1.tgz#c42e0c7aebab96eecec5e8ac4a3fe944d573458f" dependencies: @@ -138,14 +99,6 @@ grpc "1.10.1" tslib "1.9.0" -"@firebase/firestore@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-0.2.3.tgz#1d0bc56319b9eb17db449d85d47cd46290604dc5" - dependencies: - "@firebase/firestore-types" "0.1.1" - "@firebase/webchannel-wrapper" "0.2.6" - grpc "^1.7.1" - "@firebase/functions-types@0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.1.1.tgz#3b2176bdb30a4682321eb2ff79e796f6d9c010e0" @@ -162,7 +115,7 @@ version "0.1.1" resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.1.1.tgz#af5df54253286993f4b367c3dabe569c848860d3" -"@firebase/messaging-types@0.1.3", "@firebase/messaging-types@^0.1.1": +"@firebase/messaging-types@0.1.3", "@firebase/messaging-types@^0.1.3": version "0.1.3" resolved "https://registry.yarnpkg.com/@firebase/messaging-types/-/messaging-types-0.1.3.tgz#0a80c69c8f791e3aa94b28f4d2e296d0ea2571bc" @@ -182,33 +135,23 @@ promise-polyfill "7.1.2" whatwg-fetch "2.0.4" -"@firebase/storage-types@0.1.3", "@firebase/storage-types@^0.1.1": +"@firebase/storage-types@0.1.3", "@firebase/storage-types@^0.1.3": version "0.1.3" resolved "https://registry.yarnpkg.com/@firebase/storage-types/-/storage-types-0.1.3.tgz#3e68942c5aab9f5f7180a797dff22d239821668e" -"@firebase/storage@0.1.9", "@firebase/storage@^0.1.6": +"@firebase/storage@0.1.9", "@firebase/storage@^0.1.9": version "0.1.9" resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.1.9.tgz#1a32bd3f48a98f7eb1472cb3e5e4e37e04464c48" dependencies: "@firebase/storage-types" "0.1.3" tslib "1.9.0" -"@firebase/util@0.1.10": - version "0.1.10" - resolved "https://registry.yarnpkg.com/@firebase/util/-/util-0.1.10.tgz#7898f6e36c8231c287c4024c313000df677b1363" - dependencies: - tslib "^1.9.0" - "@firebase/util@0.1.11": version "0.1.11" resolved "https://registry.yarnpkg.com/@firebase/util/-/util-0.1.11.tgz#9990dff53930aa9fcae31494ebe8de5c5b8e815c" dependencies: tslib "1.9.0" -"@firebase/webchannel-wrapper@0.2.6": - version "0.2.6" - resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.6.tgz#a4b81ca8cdeb1acbc7923289a4a514f61b59db86" - "@firebase/webchannel-wrapper@0.2.8": version "0.2.8" resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.8.tgz#38a936b60b898a1ad0f3719543ff1a1031f60f8b" @@ -1961,7 +1904,7 @@ fined@^1.0.1: object.pick "^1.2.0" parse-filepath "^1.0.1" -firebase@^4.8.2: +firebase@^4.13.0: version "4.13.1" resolved "https://registry.yarnpkg.com/firebase/-/firebase-4.13.1.tgz#87ab64bbb7f707244fb878f2a28235b0e3aed3ec" dependencies: @@ -2384,15 +2327,6 @@ grpc@1.10.1: node-pre-gyp "0.7.0" protobufjs "^5.0.0" -grpc@^1.7.1: - version "1.11.0" - resolved "https://registry.yarnpkg.com/grpc/-/grpc-1.11.0.tgz#89d761726f1bc2d8485426b762e70308efc61b21" - dependencies: - lodash "^4.15.0" - nan "^2.0.0" - node-pre-gyp "0.7.0" - protobufjs "^5.0.0" - gulp-jasmine@^2.2.1: version "2.4.2" resolved "https://registry.yarnpkg.com/gulp-jasmine/-/gulp-jasmine-2.4.2.tgz#5a7f47e27370c3619ac0a2a442be399671409db3" @@ -3778,7 +3712,7 @@ multipipe@^0.1.2: dependencies: duplexer2 "0.0.2" -nan@^2.0.0, nan@^2.0.5, nan@^2.10.0, nan@^2.9.2, nan@~2.10.0: +nan@^2.0.5, nan@^2.10.0, nan@^2.9.2, nan@~2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" @@ -5571,7 +5505,7 @@ tsickle@^0.27.2: source-map "^0.6.0" source-map-support "^0.5.0" -tslib@1.9.0, tslib@^1.7.1, tslib@^1.9.0: +tslib@1.9.0, tslib@^1.7.1: version "1.9.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"