diff --git a/package.json b/package.json index e0780a52..c65bff0b 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "eslint": "^6.1.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-prettier": "^3.1.0", - "firebase": "^7.2.3", + "firebase": "^8.1.1", "jest": "^25.1.0", "lerna": "^3.16.2", "prettier": "^1.18.2", diff --git a/packages/@posva/vuefire-core/__tests__/firestore/collection.spec.ts b/packages/@posva/vuefire-core/__tests__/firestore/collection.spec.ts index d100d148..f23eb371 100644 --- a/packages/@posva/vuefire-core/__tests__/firestore/collection.spec.ts +++ b/packages/@posva/vuefire-core/__tests__/firestore/collection.spec.ts @@ -1,10 +1,10 @@ import { bindCollection } from '../../src' import { db, createOps, spyUnbind } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { OperationsType } from '../../src/shared' describe('collections', () => { - let collection: firestore.CollectionReference, + let collection: firebase.firestore.CollectionReference, vm: Record, resolve: (data: any) => void, reject: (error: any) => void, diff --git a/packages/@posva/vuefire-core/__tests__/firestore/document.spec.ts b/packages/@posva/vuefire-core/__tests__/firestore/document.spec.ts index 4fdf1da5..dd4ab3d4 100644 --- a/packages/@posva/vuefire-core/__tests__/firestore/document.spec.ts +++ b/packages/@posva/vuefire-core/__tests__/firestore/document.spec.ts @@ -1,11 +1,11 @@ import { bindDocument } from '../../src' import { db, spyUnbind, createOps } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { OperationsType } from '../../src/shared' describe('documents', () => { - let collection: firestore.CollectionReference, - document: firestore.DocumentReference, + let collection: firebase.firestore.CollectionReference, + document: firebase.firestore.DocumentReference, vm: Record, resolve: (data: any) => void, reject: (error: any) => void, diff --git a/packages/@posva/vuefire-core/__tests__/firestore/options.spec.ts b/packages/@posva/vuefire-core/__tests__/firestore/options.spec.ts index b75cc2a4..9b4c015c 100644 --- a/packages/@posva/vuefire-core/__tests__/firestore/options.spec.ts +++ b/packages/@posva/vuefire-core/__tests__/firestore/options.spec.ts @@ -1,10 +1,10 @@ import { bindDocument, firestoreOptions, bindCollection } from '../../src' -import { db, createOps, CollectionReference, DocumentReference } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' +import { db, createOps } from '@posva/vuefire-test-helpers' +import firebase from 'firebase/app' describe('options', () => { - let collection: firestore.CollectionReference, - document: firestore.DocumentReference, + let collection: firebase.firestore.CollectionReference, + document: firebase.firestore.DocumentReference, vm: Record, resolve: (data: any) => void, reject: (error: any) => void diff --git a/packages/@posva/vuefire-core/__tests__/firestore/refs-collections.spec.ts b/packages/@posva/vuefire-core/__tests__/firestore/refs-collections.spec.ts index b3765979..a8abf046 100644 --- a/packages/@posva/vuefire-core/__tests__/firestore/refs-collections.spec.ts +++ b/packages/@posva/vuefire-core/__tests__/firestore/refs-collections.spec.ts @@ -1,16 +1,16 @@ import { bindCollection, FirestoreOptions } from '../../src' import { db, delay, spyUnbind, delayUpdate, createOps } from '@posva/vuefire-test-helpers' import { OperationsType } from '../../src/shared' -import { firestore } from 'firebase' +import firebase from 'firebase/app' describe('refs in collections', () => { - let collection: firestore.CollectionReference, - a: firestore.DocumentReference, - b: firestore.DocumentReference, + let collection: firebase.firestore.CollectionReference, + a: firebase.firestore.DocumentReference, + b: firebase.firestore.DocumentReference, vm: Record, bind: ( key: string, - collection: firestore.CollectionReference, + collection: firebase.firestore.CollectionReference, options?: FirestoreOptions ) => void, unbind: () => void, diff --git a/packages/@posva/vuefire-core/__tests__/firestore/refs-documents.spec.ts b/packages/@posva/vuefire-core/__tests__/firestore/refs-documents.spec.ts index ea30c73d..2d83f2e4 100644 --- a/packages/@posva/vuefire-core/__tests__/firestore/refs-documents.spec.ts +++ b/packages/@posva/vuefire-core/__tests__/firestore/refs-documents.spec.ts @@ -7,7 +7,7 @@ import { spyOnSnapshotCallback, createOps, } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { OperationsType } from '../../src/shared' describe('refs in documents', () => { @@ -15,15 +15,19 @@ describe('refs in documents', () => { // item is an empty ready to use object // empty is an empty object that is left empty // d has a ref to c - let collection: firestore.CollectionReference, - a: firestore.DocumentReference, - b: firestore.DocumentReference, - c: firestore.DocumentReference, - d: firestore.DocumentReference, - empty: firestore.DocumentReference, - item: firestore.DocumentReference, + let collection: firebase.firestore.CollectionReference, + a: firebase.firestore.DocumentReference, + b: firebase.firestore.DocumentReference, + c: firebase.firestore.DocumentReference, + d: firebase.firestore.DocumentReference, + empty: firebase.firestore.DocumentReference, + item: firebase.firestore.DocumentReference, vm: Record, - bind: (key: string, document: firestore.DocumentReference, options?: FirestoreOptions) => void, + bind: ( + key: string, + document: firebase.firestore.DocumentReference, + options?: FirestoreOptions + ) => void, unbind: () => void, ops: OperationsType diff --git a/packages/@posva/vuefire-core/src/firestore/index.ts b/packages/@posva/vuefire-core/src/firestore/index.ts index ce3fa85e..84b3ad20 100644 --- a/packages/@posva/vuefire-core/src/firestore/index.ts +++ b/packages/@posva/vuefire-core/src/firestore/index.ts @@ -1,6 +1,6 @@ import { createSnapshot, extractRefs, FirestoreSerializer } from './utils' import { walkGet, callOnceWithArg, OperationsType } from '../shared' -import { firestore } from 'firebase' +import firebase from 'firebase/app' export interface FirestoreOptions { maxRefDepth?: number @@ -21,7 +21,7 @@ interface FirestoreSubscription { unsub: () => void // Firestore unique key eg: items/12 path: string - data: () => firestore.DocumentData | null + data: () => firebase.firestore.DocumentData | null // // path inside the object to access the data items.3 // key: string } @@ -36,7 +36,7 @@ function updateDataFromDocumentSnapshot( options: Required, target: CommonBindOptionsParameter['vm'], path: string, - snapshot: firestore.DocumentSnapshot, + snapshot: firebase.firestore.DocumentSnapshot, subs: Record, ops: CommonBindOptionsParameter['ops'], depth: number, @@ -53,7 +53,7 @@ interface SubscribeToDocumentParamater { depth: number resolve: () => void ops: CommonBindOptionsParameter['ops'] - ref: firestore.DocumentReference + ref: firebase.firestore.DocumentReference } function subscribeToDocument( @@ -79,7 +79,7 @@ function subscribeToDocument( interface SubscribeToRefsParameter { subs: Record target: CommonBindOptionsParameter['vm'] - refs: Record + refs: Record path: string | number depth: number resolve: CommonBindOptionsParameter['resolve'] @@ -94,7 +94,7 @@ function subscribeToRefs( target: CommonBindOptionsParameter['vm'], path: string | number, subs: Record, - refs: Record, + refs: Record, ops: CommonBindOptionsParameter['ops'], depth: number, resolve: CommonBindOptionsParameter['resolve'] @@ -159,7 +159,7 @@ interface CommonBindOptionsParameter { } interface BindCollectionParamater extends CommonBindOptionsParameter { - collection: firestore.CollectionReference | firestore.Query + collection: firebase.firestore.CollectionReference | firebase.firestore.Query } // TODO: refactor without using an object to improve size like the other functions @@ -179,14 +179,14 @@ export function bindCollection( const arraySubs: Record[] = [] const change = { - added: ({ newIndex, doc }: firestore.DocumentChange) => { + added: ({ newIndex, doc }: firebase.firestore.DocumentChange) => { arraySubs.splice(newIndex, 0, Object.create(null)) const subs = arraySubs[newIndex] const [data, refs] = extractRefs(options.serialize(doc), undefined, subs) ops.add(array, newIndex, data) subscribeToRefs(options, array, newIndex, subs, refs, ops, 0, resolve.bind(null, doc)) }, - modified: ({ oldIndex, newIndex, doc }: firestore.DocumentChange) => { + modified: ({ oldIndex, newIndex, doc }: firebase.firestore.DocumentChange) => { const subs = arraySubs[oldIndex] const oldData = array[oldIndex] const [data, refs] = extractRefs(options.serialize(doc), oldData, subs) @@ -197,7 +197,7 @@ export function bindCollection( ops.add(array, newIndex, data) subscribeToRefs(options, array, newIndex, subs, refs, ops, 0, resolve) }, - removed: ({ oldIndex }: firestore.DocumentChange) => { + removed: ({ oldIndex }: firebase.firestore.DocumentChange) => { ops.remove(array, oldIndex) unsubscribeAll(arraySubs.splice(oldIndex, 1)[0]) }, @@ -215,7 +215,7 @@ export function bindCollection( typeof snapshot.docChanges === 'function' ? snapshot.docChanges() : /* istanbul ignore next to support firebase < 5*/ - ((snapshot.docChanges as unknown) as firestore.DocumentChange[]) + ((snapshot.docChanges as unknown) as firebase.firestore.DocumentChange[]) if (!isResolved && docChanges.length) { // isResolved is only meant to make sure we do the check only once @@ -263,7 +263,7 @@ export function bindCollection( } interface BindDocumentParamater extends CommonBindOptionsParameter { - document: firestore.DocumentReference + document: firebase.firestore.DocumentReference } /** diff --git a/packages/@posva/vuefire-core/src/firestore/utils.ts b/packages/@posva/vuefire-core/src/firestore/utils.ts index d075b00d..3fb3c6c5 100644 --- a/packages/@posva/vuefire-core/src/firestore/utils.ts +++ b/packages/@posva/vuefire-core/src/firestore/utils.ts @@ -1,13 +1,13 @@ -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { isTimestamp, isObject, isDocumentRef, TODO } from '../shared' export type FirestoreReference = - | firestore.Query - | firestore.DocumentReference - | firestore.CollectionReference + | firebase.firestore.Query + | firebase.firestore.DocumentReference + | firebase.firestore.CollectionReference // TODO: fix type not to be any -export function createSnapshot(doc: firestore.DocumentSnapshot): TODO { +export function createSnapshot(doc: firebase.firestore.DocumentSnapshot): TODO { // TODO: it should create a deep copy instead because otherwise we will modify internal data // defaults everything to false, so no need to set return Object.defineProperty(doc.data() || {}, 'id', { value: doc.id }) @@ -16,26 +16,26 @@ export function createSnapshot(doc: firestore.DocumentSnapshot): TODO { export type FirestoreSerializer = typeof createSnapshot export function extractRefs( - doc: firestore.DocumentData, - oldDoc: firestore.DocumentData | void, - subs: Record firestore.DocumentData | null }> -): [firestore.DocumentData, Record] { - const dataAndRefs: [firestore.DocumentData, Record] = [ - {}, - {}, - ] + doc: firebase.firestore.DocumentData, + oldDoc: firebase.firestore.DocumentData | void, + subs: Record firebase.firestore.DocumentData | null }> +): [firebase.firestore.DocumentData, Record] { + const dataAndRefs: [ + firebase.firestore.DocumentData, + Record + ] = [{}, {}] const subsByPath = Object.keys(subs).reduce((resultSubs, subKey) => { const sub = subs[subKey] resultSubs[sub.path] = sub.data() return resultSubs - }, {} as Record) + }, {} as Record) function recursiveExtract( - doc: firestore.DocumentData, - oldDoc: firestore.DocumentData | void, + doc: firebase.firestore.DocumentData, + oldDoc: firebase.firestore.DocumentData | void, path: string, - result: [firestore.DocumentData, Record] + result: [firebase.firestore.DocumentData, Record] ): void { // make it easier to later on access the value oldDoc = oldDoc || {} diff --git a/packages/@posva/vuefire-core/src/rtdb/index.ts b/packages/@posva/vuefire-core/src/rtdb/index.ts index 64cd23ff..2c369e1d 100644 --- a/packages/@posva/vuefire-core/src/rtdb/index.ts +++ b/packages/@posva/vuefire-core/src/rtdb/index.ts @@ -1,4 +1,4 @@ -import { database } from 'firebase' +import firebase from 'firebase/app' import { createRecordFromRTDBSnapshot, indexForKey, RTDBSerializer } from './utils' import { OperationsType, ResetOption } from '../shared' @@ -27,7 +27,7 @@ interface CommonBindOptionsParameter { // TODO: refactor using normal arguments instead of an array to improve size interface BindAsObjectParameter extends CommonBindOptionsParameter { - document: database.Reference | database.Query + document: firebase.database.Reference | firebase.database.Query } /** @@ -60,7 +60,7 @@ export function rtdbBindAsObject( } interface BindAsArrayParameter extends CommonBindOptionsParameter { - collection: database.Reference | database.Query + collection: firebase.database.Reference | firebase.database.Query } /** diff --git a/packages/@posva/vuefire-core/src/rtdb/utils.ts b/packages/@posva/vuefire-core/src/rtdb/utils.ts index f6fece5f..9e92f892 100644 --- a/packages/@posva/vuefire-core/src/rtdb/utils.ts +++ b/packages/@posva/vuefire-core/src/rtdb/utils.ts @@ -1,4 +1,4 @@ -import { database } from 'firebase' +import firebase from 'firebase/app' import { isObject } from '../shared' /** @@ -7,7 +7,7 @@ import { isObject } from '../shared' * @param snapshot * @return */ -export function createRecordFromRTDBSnapshot(snapshot: database.DataSnapshot): any { +export function createRecordFromRTDBSnapshot(snapshot: firebase.database.DataSnapshot): any { const value = snapshot.val() const res = isObject(value) ? value : Object.defineProperty({}, '.value', { value }) // if (isObject(value)) { diff --git a/packages/@posva/vuefire-core/src/shared.ts b/packages/@posva/vuefire-core/src/shared.ts index 245d84e0..a1008375 100644 --- a/packages/@posva/vuefire-core/src/shared.ts +++ b/packages/@posva/vuefire-core/src/shared.ts @@ -1,4 +1,4 @@ -import { firestore } from 'firebase' +import firebase from 'firebase/app' export interface OperationsType { set: (target: Record, key: string | number, value: any) => any @@ -62,7 +62,7 @@ export function isTimestamp(o: any): o is Date { * Checks if a variable is a Firestore Document Reference * @param o */ -export function isDocumentRef(o: any): o is firestore.DocumentReference { +export function isDocumentRef(o: any): o is firebase.firestore.DocumentReference { return o && o.onSnapshot } diff --git a/packages/@posva/vuefire-test-helpers/src/index.ts b/packages/@posva/vuefire-test-helpers/src/index.ts index 9dcbb787..f0a34198 100644 --- a/packages/@posva/vuefire-test-helpers/src/index.ts +++ b/packages/@posva/vuefire-test-helpers/src/index.ts @@ -1,6 +1,6 @@ import Vue from 'vue' import { MockFirebase, MockedReference } from 'firebase-mock' -import { firestore } from '../../../../node_modules/firebase/index' +import firebase from '../../../../node_modules/firebase/index' import { walkSet } from '@posva/vuefire-core' Vue.config.productionTip = false @@ -10,9 +10,9 @@ export { Vue, MockFirebase, MockedReference } export * from './mock' type FirestoreReference = - | firestore.CollectionReference - | firestore.DocumentReference - | firestore.Query + | firebase.firestore.CollectionReference + | firebase.firestore.DocumentReference + | firebase.firestore.Query export function spyUnbind(ref: FirestoreReference) { const unbindSpy = jest.fn() @@ -49,7 +49,7 @@ export function spyOnSnapshotCallback(ref: FirestoreReference) { } // This makes sure some tests fail by delaying callbacks -export function delayUpdate(ref: firestore.DocumentReference, time = 0) { +export function delayUpdate(ref: firebase.firestore.DocumentReference, time = 0) { const onSnapshot = ref.onSnapshot.bind(ref) // @ts-ignore ref.onSnapshot = fn => diff --git a/packages/global.d.ts b/packages/global.d.ts index 771a2190..be6283f2 100644 --- a/packages/global.d.ts +++ b/packages/global.d.ts @@ -1,13 +1,12 @@ declare module 'firebase-mock' { - import { database } from 'firebase' - + import firebase from 'firebase/app' type TODO = any interface MockFirebaseConstructor { new (): MockFirebaseI } - export interface MockedReference extends database.Reference { + export interface MockedReference extends firebase.database.Reference { flush: () => void forceCancel: (error: any) => void autoFlush: () => void diff --git a/packages/vuefire/__tests__/firestore/bind.spec.ts b/packages/vuefire/__tests__/firestore/bind.spec.ts index c48eaad7..a46e1c6a 100644 --- a/packages/vuefire/__tests__/firestore/bind.spec.ts +++ b/packages/vuefire/__tests__/firestore/bind.spec.ts @@ -1,13 +1,13 @@ import { firestorePlugin } from '../../src' import { db, tick, delayUpdate, Vue } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { CombinedVueInstance } from 'vue/types/vue' Vue.use(firestorePlugin) describe('Firestore: binding', () => { - let collection: firestore.CollectionReference, - document: firestore.DocumentReference, + let collection: firebase.firestore.CollectionReference, + document: firebase.firestore.DocumentReference, vm: CombinedVueInstance> beforeEach(async () => { // @ts-ignore @@ -59,7 +59,7 @@ describe('Firestore: binding', () => { it('unbinds previously bound refs', async () => { await document.update({ foo: 'foo' }) // @ts-ignore - const doc2: firestore.DocumentReference = db.collection().doc() + const doc2: firebase.firestore.DocumentReference = db.collection().doc() await doc2.update({ bar: 'bar' }) await vm.$bind('item', document) expect(vm.$firestoreRefs.item).toBe(document) @@ -74,7 +74,7 @@ describe('Firestore: binding', () => { it('waits for all refs in document', async () => { const a = db.collection().doc() // @ts-ignore - const b: firestore.DocumentReference = db.collection().doc() + const b: firebase.firestore.DocumentReference = db.collection().doc() delayUpdate(b) await document.update({ a, b }) @@ -89,7 +89,7 @@ describe('Firestore: binding', () => { test('waits for all refs in document with interrupting by new ref', async () => { const a = db.collection().doc() // @ts-ignore - const b: firestore.DocumentReference = db.collection().doc() + const b: firebase.firestore.DocumentReference = db.collection().doc() const c = db.collection().doc() delayUpdate(b) await document.update({ a, b }) @@ -110,7 +110,7 @@ describe('Firestore: binding', () => { it('waits for all refs in collection', async () => { const a = db.collection().doc() // @ts-ignore - const b: firestore.DocumentReference = db.collection().doc() + const b: firebase.firestore.DocumentReference = db.collection().doc() delayUpdate(b) await collection.add({ a }) await collection.add({ b }) @@ -123,9 +123,9 @@ describe('Firestore: binding', () => { it('waits for nested refs in document', async () => { const a = db.collection().doc() // @ts-ignore - const b: firestore.DocumentReference = db.collection().doc() + const b: firebase.firestore.DocumentReference = db.collection().doc() // @ts-ignore - const c: firestore.DocumentReference = db.collection().doc() + const c: firebase.firestore.DocumentReference = db.collection().doc() await b.update({ c }) delayUpdate(b) delayUpdate(c, 5) @@ -142,9 +142,9 @@ describe('Firestore: binding', () => { it('waits for nested refs with data in document', async () => { const a = db.collection().doc() // @ts-ignore - const b: firestore.DocumentReference = db.collection().doc() + const b: firebase.firestore.DocumentReference = db.collection().doc() // @ts-ignore - const c: firestore.DocumentReference = db.collection().doc() + const c: firebase.firestore.DocumentReference = db.collection().doc() await a.update({ isA: true }) await c.update({ isC: true }) await b.update({ c }) @@ -163,9 +163,9 @@ describe('Firestore: binding', () => { it('waits for nested refs in collections', async () => { const a = db.collection().doc() // @ts-ignore - const b: firestore.DocumentReference = db.collection().doc() + const b: firebase.firestore.DocumentReference = db.collection().doc() // @ts-ignore - const c: firestore.DocumentReference = db.collection().doc() + const c: firebase.firestore.DocumentReference = db.collection().doc() await b.update({ c }) delayUpdate(b) delayUpdate(c, 5) @@ -180,9 +180,9 @@ describe('Firestore: binding', () => { it('waits for nested refs with data in collections', async () => { const a = db.collection().doc() // @ts-ignore - const b: firestore.DocumentReference = db.collection().doc() + const b: firebase.firestore.DocumentReference = db.collection().doc() // @ts-ignore - const c: firestore.DocumentReference = db.collection().doc() + const c: firebase.firestore.DocumentReference = db.collection().doc() await a.update({ isA: true }) await c.update({ isC: true }) await b.update({ c }) @@ -199,7 +199,7 @@ describe('Firestore: binding', () => { it('can customize the reset option through $bind', async () => { await document.update({ foo: 'foo' }) // @ts-ignore - const doc2: firestore.DocumentReference = db.collection().doc() + const doc2: firebase.firestore.DocumentReference = db.collection().doc() await doc2.update({ bar: 'bar' }) await vm.$bind('item', document) expect(vm.item).toEqual({ foo: 'foo' }) @@ -214,7 +214,7 @@ describe('Firestore: binding', () => { it('can customize the reset option through $unbind', async () => { await document.update({ foo: 'foo' }) // @ts-ignore - const doc2: firestore.DocumentReference = db.collection().doc() + const doc2: firebase.firestore.DocumentReference = db.collection().doc() await doc2.update({ bar: 'bar' }) await vm.$bind('item', document) vm.$unbind('item', false) @@ -229,7 +229,7 @@ describe('Firestore: binding', () => { await collection.add({ foo: 'foo' }) await vm.$bind('items', collection) // @ts-ignore - const col2: firestore.CollectionReference = db.collection() + const col2: firebase.firestore.CollectionReference = db.collection() await col2.add({ bar: 'bar' }) const p = vm.$bind('items', col2, { wait: true, reset: true }) expect(vm.items).toEqual([{ foo: 'foo' }]) @@ -241,7 +241,7 @@ describe('Firestore: binding', () => { await collection.add({ foo: 'foo' }) await vm.$bind('items', collection) // @ts-ignore - const col2: firestore.CollectionReference = db.collection() + const col2: firebase.firestore.CollectionReference = db.collection() await col2.add({ bar: 'bar' }) const p = vm.$bind('items', col2, { wait: true, reset: () => ['foo'] }) expect(vm.items).toEqual(['foo']) diff --git a/packages/vuefire/__tests__/firestore/index.spec.ts b/packages/vuefire/__tests__/firestore/index.spec.ts index 88594686..5d52a5f9 100644 --- a/packages/vuefire/__tests__/firestore/index.spec.ts +++ b/packages/vuefire/__tests__/firestore/index.spec.ts @@ -1,13 +1,13 @@ import { firestorePlugin } from '../../src' import { db, tick, Vue } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { CombinedVueInstance } from 'vue/types/vue' Vue.use(firestorePlugin) describe('Firestore: firestore option', () => { - let collection: firestore.CollectionReference, - document: firestore.DocumentReference, + let collection: firebase.firestore.CollectionReference, + document: firebase.firestore.DocumentReference, vm: CombinedVueInstance> beforeEach(async () => { // @ts-ignore diff --git a/packages/vuefire/__tests__/firestore/merging.spec.ts b/packages/vuefire/__tests__/firestore/merging.spec.ts index c9821e1f..a3d11a33 100644 --- a/packages/vuefire/__tests__/firestore/merging.spec.ts +++ b/packages/vuefire/__tests__/firestore/merging.spec.ts @@ -1,6 +1,5 @@ import { firestorePlugin } from '../../src' import { db, Vue } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' Vue.use(firestorePlugin) diff --git a/packages/vuefire/__tests__/firestore/options.spec.ts b/packages/vuefire/__tests__/firestore/options.spec.ts index c09d9340..9f4ad727 100644 --- a/packages/vuefire/__tests__/firestore/options.spec.ts +++ b/packages/vuefire/__tests__/firestore/options.spec.ts @@ -1,6 +1,5 @@ import { firestorePlugin } from '../../src' import { db, Vue } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' const createLocalVue = () => { const newVue = Vue.extend() diff --git a/packages/vuefire/src/firestore.ts b/packages/vuefire/src/firestore.ts index 38545870..439c7857 100644 --- a/packages/vuefire/src/firestore.ts +++ b/packages/vuefire/src/firestore.ts @@ -6,7 +6,7 @@ import { FirestoreOptions, OperationsType, } from '@posva/vuefire-core' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import Vue, { PluginFunction } from 'vue' const ops: OperationsType = { @@ -18,7 +18,10 @@ const ops: OperationsType = { function bind( vm: Record, key: string, - ref: firestore.CollectionReference | firestore.Query | firestore.DocumentReference, + ref: + | firebase.firestore.CollectionReference + | firebase.firestore.Query + | firebase.firestore.DocumentReference, ops: OperationsType, options: FirestoreOptions ) { @@ -74,20 +77,20 @@ declare module 'vue/types/vue' { interface Vue { $bind( name: string, - reference: firestore.Query | firestore.CollectionReference, + reference: firebase.firestore.Query | firebase.firestore.CollectionReference, options?: FirestoreOptions - ): Promise + ): Promise $bind( name: string, - reference: firestore.DocumentReference, + reference: firebase.firestore.DocumentReference, options?: FirestoreOptions - ): Promise + ): Promise $unbind: (name: string, reset?: FirestoreOptions['reset']) => void $firestoreRefs: Readonly< - Record + Record > // _firestoreSources: Readonly< - // Record + // Record // > _firestoreUnbinds: Readonly< Record> @@ -97,7 +100,9 @@ declare module 'vue/types/vue' { type VueFirestoreObject = Record< string, - firestore.DocumentReference | firestore.Query | firestore.CollectionReference + | firebase.firestore.DocumentReference + | firebase.firestore.Query + | firebase.firestore.CollectionReference > type FirestoreOption = VueFirestoreObject | ((this: V) => VueFirestoreObject) @@ -129,7 +134,10 @@ export const firestorePlugin: PluginFunction = function firestore Vue.prototype[bindName] = function firestoreBind( this: Vue, key: string, - ref: firestore.Query | firestore.CollectionReference | firestore.DocumentReference, + ref: + | firebase.firestore.Query + | firebase.firestore.CollectionReference + | firebase.firestore.DocumentReference, userOptions?: FirestoreOptions ) { const options = Object.assign({}, globalOptions, userOptions) @@ -158,6 +166,7 @@ export const firestorePlugin: PluginFunction = function firestore const refs = typeof firestore === 'function' ? firestore.call(this) : firestore if (!refs) return for (const key in refs) { + // @ts-ignore this[bindName as keyof Vue](key, refs[key], globalOptions) } }, diff --git a/packages/vuefire/src/rtdb.ts b/packages/vuefire/src/rtdb.ts index 0290c149..afa29449 100644 --- a/packages/vuefire/src/rtdb.ts +++ b/packages/vuefire/src/rtdb.ts @@ -6,16 +6,18 @@ import { walkSet, OperationsType, } from '@posva/vuefire-core' -import { database } from 'firebase' +import firebase from 'firebase/app' import Vue, { PluginFunction } from 'vue' /** * Returns the original reference of a Firebase reference or query across SDK versions. * - * @param {firebase.database.Reference|firebase.database.Query} refOrQuery - * @return {firebase.database.Reference} + * @param {firebase.firebase.database.Reference|firebase.firebase.database.Query} refOrQuery + * @return {firebase.firebase.database.Reference} */ -function getRef(refOrQuery: database.Reference | database.Query): database.Reference { +function getRef( + refOrQuery: firebase.database.Reference | firebase.database.Query +): firebase.database.Reference { return refOrQuery.ref } @@ -28,7 +30,7 @@ const ops: OperationsType = { function bind( vm: Record, key: string, - source: database.Query | database.Reference, + source: firebase.database.Query | firebase.database.Reference, options: RTDBOptions ) { return new Promise((resolve, reject) => { @@ -89,17 +91,19 @@ declare module 'vue/types/vue' { interface Vue { $rtdbBind( name: string, - reference: database.Reference | database.Query, + reference: firebase.database.Reference | firebase.database.Query, options?: RTDBOptions - ): Promise + ): Promise $rtdbUnbind: (name: string, reset?: RTDBOptions['reset']) => void - $firebaseRefs: Readonly> - _firebaseSources: Readonly> + $firebaseRefs: Readonly> + _firebaseSources: Readonly< + Record + > _firebaseUnbinds: Readonly>> } } -type VueFirebaseObject = Record +type VueFirebaseObject = Record type FirebaseOption = VueFirebaseObject | ((this: V) => VueFirebaseObject) declare module 'vue/types/options' { @@ -126,7 +130,7 @@ export const rtdbPlugin: PluginFunction = function rtdbPlugin( Vue.prototype[bindName] = function rtdbBind( this: Vue, key: string, - source: database.Reference | database.Query, + source: firebase.database.Reference | firebase.database.Query, userOptions?: RTDBOptions ) { const options = Object.assign({}, globalOptions, userOptions) diff --git a/packages/vuexfire/__tests__/firestore.spec.ts b/packages/vuexfire/__tests__/firestore.spec.ts index de577eaa..30632e60 100644 --- a/packages/vuexfire/__tests__/firestore.spec.ts +++ b/packages/vuexfire/__tests__/firestore.spec.ts @@ -1,7 +1,7 @@ import Vuex from 'vuex' import { vuexfireMutations, firestoreAction } from '../src' import { db, tick, Vue, delayUpdate } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { FirestoreOptions } from '@posva/vuefire-core/dist/packages/@posva/vuefire-core/src' Vue.use(Vuex) @@ -36,18 +36,19 @@ describe('firestoreAction', () => { }) const setItems = ( - collection: firestore.CollectionReference | firestore.Query, + collection: firebase.firestore.CollectionReference | firebase.firestore.Query, options?: FirestoreOptions ) => // @ts-ignore store.dispatch('action', ({ bindFirestoreRef }) => bindFirestoreRef('items', collection, options) ) - const setItem = (document: firestore.DocumentReference) => + const setItem = (document: firebase.firestore.DocumentReference) => // @ts-ignore store.dispatch('action', ({ bindFirestoreRef }) => bindFirestoreRef('item', document)) - let collection: firestore.CollectionReference, document: firestore.DocumentReference + let collection: firebase.firestore.CollectionReference, + document: firebase.firestore.DocumentReference beforeEach(async () => { store.replaceState({ // @ts-ignore diff --git a/packages/vuexfire/__tests__/options.spec.ts b/packages/vuexfire/__tests__/options.spec.ts index 9b139d4a..45be7516 100644 --- a/packages/vuexfire/__tests__/options.spec.ts +++ b/packages/vuexfire/__tests__/options.spec.ts @@ -1,7 +1,7 @@ import Vuex from 'vuex' import { vuexfireMutations, firestoreAction } from '../src' import { db, tick, Vue } from '@posva/vuefire-test-helpers' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { FirestoreOptions } from '@posva/vuefire-core/dist/packages/@posva/vuefire-core/src' Vue.use(Vuex) @@ -27,18 +27,19 @@ describe('firestoreAction', () => { }) const setItems = ( - collection: firestore.CollectionReference | firestore.Query, + collection: firebase.firestore.CollectionReference | firebase.firestore.Query, options?: FirestoreOptions ) => // @ts-ignore store.dispatch('action', ({ bindFirestoreRef }) => bindFirestoreRef('items', collection, options) ) - const setItem = (document: firestore.DocumentReference, options?: FirestoreOptions) => + const setItem = (document: firebase.firestore.DocumentReference, options?: FirestoreOptions) => // @ts-ignore store.dispatch('action', ({ bindFirestoreRef }) => bindFirestoreRef('item', document, options)) - let collection: firestore.CollectionReference, document: firestore.DocumentReference + let collection: firebase.firestore.CollectionReference, + document: firebase.firestore.DocumentReference beforeEach(async () => { store.replaceState({ // @ts-ignore diff --git a/packages/vuexfire/__tests__/rtdb.spec.ts b/packages/vuexfire/__tests__/rtdb.spec.ts index f33f11ff..e2d67ffc 100644 --- a/packages/vuexfire/__tests__/rtdb.spec.ts +++ b/packages/vuexfire/__tests__/rtdb.spec.ts @@ -1,7 +1,8 @@ import Vuex from 'vuex' import { firebaseAction, vuexfireMutations } from '../src' import { MockFirebase, tick, Vue } from '@posva/vuefire-test-helpers' -import { database } from 'firebase' +import firebase from 'firebase/app' + import { RTDBOptions } from '@posva/vuefire-core/dist/packages/@posva/vuefire-core/src' Vue.use(Vuex) @@ -37,14 +38,14 @@ describe('RTDB: firebaseAction', () => { }, }) - const setItems = (query: database.Query, options?: RTDBOptions) => + const setItems = (query: firebase.database.Query, options?: RTDBOptions) => // @ts-ignore store.dispatch('action', ({ bindFirebaseRef }) => bindFirebaseRef('items', query, options)) - const setItem = (ref: database.Reference, options?: RTDBOptions) => + const setItem = (ref: firebase.database.Reference, options?: RTDBOptions) => // @ts-ignore store.dispatch('action', ({ bindFirebaseRef }) => bindFirebaseRef('item', ref, options)) - let collection: database.Reference, document: database.Reference + let collection: firebase.database.Reference, document: firebase.database.Reference beforeEach(async () => { store.replaceState({ items: [], diff --git a/packages/vuexfire/src/firestore.ts b/packages/vuexfire/src/firestore.ts index 5c8ca519..6396fcb7 100644 --- a/packages/vuexfire/src/firestore.ts +++ b/packages/vuexfire/src/firestore.ts @@ -7,7 +7,7 @@ import { firestoreOptions, } from '@posva/vuefire-core' import { CommitFunction } from './shared' -import { firestore } from 'firebase' +import firebase from 'firebase/app' import { ActionContext, Action } from 'vuex' const commitOptions = { root: true } @@ -21,26 +21,29 @@ function bind( state: Record, commit: CommitFunction, key: string, - ref: firestore.Query | firestore.CollectionReference, + ref: firebase.firestore.Query | firebase.firestore.CollectionReference, ops: OperationsType, options: FirestoreOptions -): Promise +): Promise function bind( state: Record, commit: CommitFunction, key: string, - ref: firestore.DocumentReference, + ref: firebase.firestore.DocumentReference, ops: OperationsType, options: FirestoreOptions -): Promise +): Promise function bind( state: Record, commit: CommitFunction, key: string, - ref: firestore.DocumentReference | firestore.Query | firestore.CollectionReference, + ref: + | firebase.firestore.DocumentReference + | firebase.firestore.Query + | firebase.firestore.CollectionReference, ops: OperationsType, options: FirestoreOptions -): Promise | Promise { +): Promise | Promise { // TODO: check ref is valid warning // TODO: check defined in state warning let sub = subscriptions.get(commit) @@ -97,14 +100,14 @@ function unbind(commit: CommitFunction, key: string, reset?: FirestoreOptions['r interface FirestoreActionContext extends ActionContext { bindFirestoreRef( key: string, - ref: firestore.Query | firestore.CollectionReference, + ref: firebase.firestore.Query | firebase.firestore.CollectionReference, options?: FirestoreOptions - ): Promise + ): Promise bindFirestoreRef( key: string, - ref: firestore.DocumentReference, + ref: firebase.firestore.DocumentReference, options?: FirestoreOptions - ): Promise + ): Promise unbindFirestoreRef(key: string, reset?: FirestoreOptions['reset']): void } @@ -142,7 +145,10 @@ export function firestoreAction( ...context, bindFirestoreRef: ( key: string, - ref: firestore.DocumentReference | firestore.Query | firestore.CollectionReference, + ref: + | firebase.firestore.DocumentReference + | firebase.firestore.Query + | firebase.firestore.CollectionReference, options?: FirestoreOptions ) => bind( diff --git a/packages/vuexfire/src/rtdb.ts b/packages/vuexfire/src/rtdb.ts index 2ccc3a7c..dc4a34e2 100644 --- a/packages/vuexfire/src/rtdb.ts +++ b/packages/vuexfire/src/rtdb.ts @@ -6,7 +6,7 @@ import { RTDBOptions, rtdbOptions, } from '@posva/vuefire-core' -import { database } from 'firebase' +import firebase from 'firebase/app' import { CommitFunction } from './shared' import { Action, ActionContext } from 'vuex' @@ -20,9 +20,9 @@ const subscriptions = new WeakMap() interface FirebaseActionContext extends ActionContext { bindFirebaseRef( key: string, - reference: database.Reference | database.Query, + reference: firebase.database.Reference | firebase.database.Query, options?: RTDBOptions - ): Promise + ): Promise unbindFirebaseRef(key: string, reset?: RTDBOptions['reset']): void } @@ -30,10 +30,10 @@ function bind( state: Record, commit: CommitFunction, key: string, - ref: database.Reference | database.Query, + ref: firebase.database.Reference | firebase.database.Query, ops: OperationsType, options: RTDBOptions -): Promise { +): Promise { // TODO check ref is valid // TODO check defined in state let sub = subscriptions.get(commit) @@ -116,7 +116,7 @@ export function firebaseAction( ...context, bindFirebaseRef: ( key: string, - ref: database.Reference | database.Query, + ref: firebase.database.Reference | firebase.database.Query, options?: RTDBOptions ) => bind(state, commit, key, ref, ops, Object.assign({}, rtdbOptions, options)), unbindFirebaseRef: (key: string, reset?: RTDBOptions['reset']) => diff --git a/rollup.config.js b/rollup.config.js index e9d93935..b30128f0 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -51,7 +51,7 @@ function createEntry( }), alias({ resolve: ['.ts', '.js'], - entries: [{ find: 'firebase', replacement: path.join(__dirname, './stub') }], + entries: [{ find: 'firebase/app', replacement: path.join(__dirname, './stub') }], }), ], output: { diff --git a/stub.ts b/stub.ts index 0a20edbd..6643b572 100644 --- a/stub.ts +++ b/stub.ts @@ -1,2 +1,3 @@ const database = {} export { database } +export default database diff --git a/yarn.lock b/yarn.lock index 642a57d2..de9c79c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -999,16 +999,16 @@ resolved "https://registry.yarnpkg.com/@firebase/analytics-types/-/analytics-types-0.4.0.tgz#d6716f9fa36a6e340bc0ecfe68af325aa6f60508" integrity sha512-Jj2xW+8+8XPfWGkv9HPv/uR+Qrmq37NPYT352wf7MvE9LrstpLVmFg3LqG6MCRr5miLAom5sen2gZ+iOhVDeRA== -"@firebase/analytics@0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.6.0.tgz#49f508d3f9f419f08c503f1171ef5fa1c3ba52eb" - integrity sha512-6qYEOPUVYrMhqvJ46Z5Uf1S4uULd6d7vGpMP5Qz+u8kIWuOQGcPdJKQap+Hla6Rq164or9gC2HRXuYXKlgWfpw== +"@firebase/analytics@0.6.2": + version "0.6.2" + resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.6.2.tgz#7f45675a1b524fff4d9e9fe318fd6e2ed067a325" + integrity sha512-4Ceov+rPfOEPIdbjlpTim/wbcUUneIesHag4UOzvmFsRRXqbxLwQpyZQWEbTSriUeU8uTKj9yOW32hsskV9Klg== dependencies: "@firebase/analytics-types" "0.4.0" - "@firebase/component" "0.1.19" - "@firebase/installations" "0.4.17" + "@firebase/component" "0.1.21" + "@firebase/installations" "0.4.19" "@firebase/logger" "0.2.6" - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" tslib "^1.11.1" "@firebase/app-types@0.6.1": @@ -1016,15 +1016,15 @@ resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.6.1.tgz#dcbd23030a71c0c74fc95d4a3f75ba81653850e9" integrity sha512-L/ZnJRAq7F++utfuoTKX4CLBG5YR7tFO3PLzG1/oXXKEezJ0kRL3CMRoueBEmTCzVb/6SIs2Qlaw++uDgi5Xyg== -"@firebase/app@0.6.11": - version "0.6.11" - resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.6.11.tgz#f73f9e4571ba62f4029d8f9c9880a97e5a94eb1d" - integrity sha512-FH++PaoyTzfTAVuJ0gITNYEIcjT5G+D0671La27MU8Vvr6MTko+5YUZ4xS9QItyotSeRF4rMJ1KR7G8LSyySiA== +"@firebase/app@0.6.13": + version "0.6.13" + resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.6.13.tgz#f2e9fa9e75815e54161dc34659a60f1fffd9a450" + integrity sha512-xGrJETzvCb89VYbGSHFHCW7O/y067HRxT7MGehUE1xMxdPVBDNayHnxEuKwzfGvXAjVmajXBKFlKxaCWpgSjCQ== dependencies: "@firebase/app-types" "0.6.1" - "@firebase/component" "0.1.19" + "@firebase/component" "0.1.21" "@firebase/logger" "0.2.6" - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" dom-storage "2.1.0" tslib "^1.11.1" xmlhttprequest "1.8.0" @@ -1039,73 +1039,73 @@ resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.10.1.tgz#7815e71c9c6f072034415524b29ca8f1d1770660" integrity sha512-/+gBHb1O9x/YlG7inXfxff/6X3BPZt4zgBv4kql6HEmdzNQCodIRlEYnI+/da+lN+dha7PjaFH7C7ewMmfV7rw== -"@firebase/auth@0.15.0": - version "0.15.0" - resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.15.0.tgz#45d6def6d6d9444432c005710df442991828275f" - integrity sha512-IFuzhxS+HtOQl7+SZ/Mhaghy/zTU7CENsJFWbC16tv2wfLZbayKF5jYGdAU3VFLehgC8KjlcIWd10akc3XivfQ== +"@firebase/auth@0.15.2": + version "0.15.2" + resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.15.2.tgz#9ada3f37620d131a1c56994138a599b5c9f9ca2e" + integrity sha512-2n32PBi6x9jVhc0E/ewKLUCYYTzFEXL4PNkvrrlGKbzeTBEkkyzfgUX7OV9UF5wUOG+gurtUthuur1zspZ/9hg== dependencies: "@firebase/auth-types" "0.10.1" -"@firebase/component@0.1.19": - version "0.1.19" - resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.1.19.tgz#bd2ac601652c22576b574c08c40da245933dbac7" - integrity sha512-L0S3g8eqaerg8y0zox3oOHSTwn/FE8RbcRHiurnbESvDViZtP5S5WnhuAPd7FnFxa8ElWK0z1Tr3ikzWDv1xdQ== +"@firebase/component@0.1.21": + version "0.1.21" + resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.1.21.tgz#56062eb0d449dc1e7bbef3c084a9b5fa48c7c14d" + integrity sha512-kd5sVmCLB95EK81Pj+yDTea8pzN2qo/1yr0ua9yVi6UgMzm6zAeih73iVUkaat96MAHy26yosMufkvd3zC4IKg== dependencies: - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" tslib "^1.11.1" -"@firebase/database-types@0.5.2": - version "0.5.2" - resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.5.2.tgz#23bec8477f84f519727f165c687761e29958b63c" - integrity sha512-ap2WQOS3LKmGuVFKUghFft7RxXTyZTDr0Xd8y2aqmWsbJVjgozi0huL/EUMgTjGFrATAjcf2A7aNs8AKKZ2a8g== +"@firebase/database-types@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.6.1.tgz#cf1cfc03e617ed4c2561703781f85ba4c707ff65" + integrity sha512-JtL3FUbWG+bM59iYuphfx9WOu2Mzf0OZNaqWiQ7lJR8wBe7bS9rIm9jlBFtksB7xcya1lZSQPA/GAy2jIlMIkA== dependencies: "@firebase/app-types" "0.6.1" -"@firebase/database@0.6.13": - version "0.6.13" - resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.6.13.tgz#b96fe0c53757dd6404ee085fdcb45c0f9f525c17" - integrity sha512-NommVkAPzU7CKd1gyehmi3lz0K78q0KOfiex7Nfy7MBMwknLm7oNqKovXSgQV1PCLvKXvvAplDSFhDhzIf9obA== +"@firebase/database@0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.8.1.tgz#a7bc1c01052d35817a242c21bfe09ab29ee485a3" + integrity sha512-/1HhR4ejpqUaM9Cn3KSeNdQvdlehWIhdfTVWFxS73ZlLYf7ayk9jITwH10H3ZOIm5yNzxF67p/U7Z/0IPhgWaQ== dependencies: "@firebase/auth-interop-types" "0.1.5" - "@firebase/component" "0.1.19" - "@firebase/database-types" "0.5.2" + "@firebase/component" "0.1.21" + "@firebase/database-types" "0.6.1" "@firebase/logger" "0.2.6" - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" faye-websocket "0.11.3" tslib "^1.11.1" -"@firebase/firestore-types@1.14.0": - version "1.14.0" - resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-1.14.0.tgz#4516249d3c181849fd3c856831944dbd5c8c55fc" - integrity sha512-WF8IBwHzZDhwyOgQnmB0pheVrLNP78A8PGxk1nxb/Nrgh1amo4/zYvFMGgSsTeaQK37xMYS/g7eS948te/dJxw== +"@firebase/firestore-types@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-2.0.0.tgz#1f6212553b240f1a8905bb8dcf1f87769138c5c0" + integrity sha512-ZGb7p1SSQJP0Z+kc9GAUi+Fx5rJatFddBrS1ikkayW+QHfSIz0omU23OgSHcBGTxe8dJCeKiKA2Yf+tkDKO/LA== -"@firebase/firestore@1.18.0": - version "1.18.0" - resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-1.18.0.tgz#3430e8c60d3e6be1d174b3a258838b1944c93a4d" - integrity sha512-maMq4ltkrwjDRusR2nt0qS4wldHQMp+0IDSfXIjC+SNmjnWY/t/+Skn9U3Po+dB38xpz3i7nsKbs+8utpDnPSw== +"@firebase/firestore@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-2.0.4.tgz#c4be6f3540f607fd8e200cfba83c4997c29447fe" + integrity sha512-fzJKj/4h4jOwPSfHB42XBJIC0zsPsepU6FcBO+8nSx7G2IPfTw8cMgSNin2gPqX6tR1w1NQtHiSlXiRKsbMZdA== dependencies: - "@firebase/component" "0.1.19" - "@firebase/firestore-types" "1.14.0" + "@firebase/component" "0.1.21" + "@firebase/firestore-types" "2.0.0" "@firebase/logger" "0.2.6" - "@firebase/util" "0.3.2" - "@firebase/webchannel-wrapper" "0.4.0" + "@firebase/util" "0.3.4" + "@firebase/webchannel-wrapper" "0.4.1" "@grpc/grpc-js" "^1.0.0" "@grpc/proto-loader" "^0.5.0" node-fetch "2.6.1" tslib "^1.11.1" -"@firebase/functions-types@0.3.17": - version "0.3.17" - resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.3.17.tgz#348bf5528b238eeeeeae1d52e8ca547b21d33a94" - integrity sha512-DGR4i3VI55KnYk4IxrIw7+VG7Q3gA65azHnZxo98Il8IvYLr2UTBlSh72dTLlDf25NW51HqvJgYJDKvSaAeyHQ== +"@firebase/functions-types@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.4.0.tgz#0b789f4fe9a9c0b987606c4da10139345b40f6b9" + integrity sha512-3KElyO3887HNxtxNF1ytGFrNmqD+hheqjwmT3sI09FaDCuaxGbOnsXAXH2eQ049XRXw9YQpHMgYws/aUNgXVyQ== -"@firebase/functions@0.5.1": - version "0.5.1" - resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.5.1.tgz#fa0568bdcdf7dfa7e5f4f66c1e06e376dc7e25b6" - integrity sha512-yyjPZXXvzFPjkGRSqFVS5Hc2Y7Y48GyyMH+M3i7hLGe69r/59w6wzgXKqTiSYmyE1pxfjxU4a1YqBDHNkQkrYQ== +"@firebase/functions@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.6.1.tgz#32640b8f877637057dfaaeb122be8c8e99ad1af7" + integrity sha512-xNCAY3cLlVWE8Azf+/84OjnaXMoyUstJ3vwVRG0ie22QhsdQuPa1tXTiPX4Tmm+Hbbd/Aw0A/7dkEnuW+zYzaQ== dependencies: - "@firebase/component" "0.1.19" - "@firebase/functions-types" "0.3.17" + "@firebase/component" "0.1.21" + "@firebase/functions-types" "0.4.0" "@firebase/messaging-types" "0.5.0" node-fetch "2.6.1" tslib "^1.11.1" @@ -1115,14 +1115,14 @@ resolved "https://registry.yarnpkg.com/@firebase/installations-types/-/installations-types-0.3.4.tgz#589a941d713f4f64bf9f4feb7f463505bab1afa2" integrity sha512-RfePJFovmdIXb6rYwtngyxuEcWnOrzdZd9m7xAW0gRxDIjBT20n3BOhjpmgRWXo/DAxRmS7bRjWAyTHY9cqN7Q== -"@firebase/installations@0.4.17": - version "0.4.17" - resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.4.17.tgz#1367b721e2c6c4880646bbc4f257e8616986a004" - integrity sha512-AE/TyzIpwkC4UayRJD419xTqZkKzxwk0FLht3Dci8WI2OEKHSwoZG9xv4hOBZebe+fDzoV2EzfatQY8c/6Avig== +"@firebase/installations@0.4.19": + version "0.4.19" + resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.4.19.tgz#53f50aeb022996963f89f59560d7b4cf801869da" + integrity sha512-QqAQzosKVVqIx7oMt5ujF4NsIXgtlTnej4JXGJ8sQQuJoMnt3T+PFQRHbr7uOfVaBiHYhEaXCcmmhfKUHwKftw== dependencies: - "@firebase/component" "0.1.19" + "@firebase/component" "0.1.21" "@firebase/installations-types" "0.3.4" - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" idb "3.0.2" tslib "^1.11.1" @@ -1136,15 +1136,15 @@ resolved "https://registry.yarnpkg.com/@firebase/messaging-types/-/messaging-types-0.5.0.tgz#c5d0ef309ced1758fda93ef3ac70a786de2e73c4" integrity sha512-QaaBswrU6umJYb/ZYvjR5JDSslCGOH6D9P136PhabFAHLTR4TWjsaACvbBXuvwrfCXu10DtcjMxqfhdNIB1Xfg== -"@firebase/messaging@0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.7.1.tgz#debbe7eb17c5b789231da6c166c506e19ecf1ed4" - integrity sha512-iev/ST9v0xd/8YpGYrZtDcqdD9J6ZWzSuceRn8EKy5vIgQvW/rk2eTQc8axzvDpQ36ZfphMYuhW6XuNrR3Pd2Q== +"@firebase/messaging@0.7.3": + version "0.7.3" + resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.7.3.tgz#31dded892455e4d0680e1452ff2fbfdfb9e4ce9b" + integrity sha512-63nOP2SmQJrj9jrhV3K96L5MRKS6AqmFVLX1XbGk6K6lz38ZC4LIoCcHxzUBXY7fCAuZvNmh/YB3pE8B2mTs8A== dependencies: - "@firebase/component" "0.1.19" - "@firebase/installations" "0.4.17" + "@firebase/component" "0.1.21" + "@firebase/installations" "0.4.19" "@firebase/messaging-types" "0.5.0" - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" idb "3.0.2" tslib "^1.11.1" @@ -1153,16 +1153,16 @@ resolved "https://registry.yarnpkg.com/@firebase/performance-types/-/performance-types-0.0.13.tgz#58ce5453f57e34b18186f74ef11550dfc558ede6" integrity sha512-6fZfIGjQpwo9S5OzMpPyqgYAUZcFzZxHFqOyNtorDIgNXq33nlldTL/vtaUZA8iT9TT5cJlCrF/jthKU7X21EA== -"@firebase/performance@0.4.2": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.4.2.tgz#d5f134674b429d095ce0edfb50fcb4ab279c3cbe" - integrity sha512-irHTCVWJ/sxJo0QHg+yQifBeVu8ZJPihiTqYzBUz/0AGc51YSt49FZwqSfknvCN2+OfHaazz/ARVBn87g7Ex8g== +"@firebase/performance@0.4.4": + version "0.4.4" + resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.4.4.tgz#5f13ea3b9a72a0ae9c36520c419be31448a0955a" + integrity sha512-CY/fzz7qGQ9hUkvOow22MeJhayHSjXmI4+0AqcxaUC4CWk4oQubyIC4pk62aH+yCwZNNeC7JJUEDbtqI/0rGkQ== dependencies: - "@firebase/component" "0.1.19" - "@firebase/installations" "0.4.17" + "@firebase/component" "0.1.21" + "@firebase/installations" "0.4.19" "@firebase/logger" "0.2.6" "@firebase/performance-types" "0.0.13" - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" tslib "^1.11.1" "@firebase/polyfill@0.3.36": @@ -1179,16 +1179,16 @@ resolved "https://registry.yarnpkg.com/@firebase/remote-config-types/-/remote-config-types-0.1.9.tgz#fe6bbe4d08f3b6e92fce30e4b7a9f4d6a96d6965" integrity sha512-G96qnF3RYGbZsTRut7NBX0sxyczxt1uyCgXQuH/eAfUCngxjEGcZQnBdy6mvSdqdJh5mC31rWPO4v9/s7HwtzA== -"@firebase/remote-config@0.1.28": - version "0.1.28" - resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.1.28.tgz#1c39916446f1ed82b4c07e556455bd232fcfd8e1" - integrity sha512-4zSdyxpt94jAnFhO8toNjG8oMKBD+xTuBIcK+Nw8BdQWeJhEamgXlupdBARUk1uf3AvYICngHH32+Si/dMVTbw== +"@firebase/remote-config@0.1.30": + version "0.1.30" + resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.1.30.tgz#2cd6bbbed526a98b154e13a2cc73e748a77d7c3d" + integrity sha512-LAfLDcp1AN0V/7AkxBuTKy+Qnq9fKYKxbA5clrXRNVzJbTVnF5eFGsaUOlkes0ESG6lbqKy5ZcDgdl73zBIhAA== dependencies: - "@firebase/component" "0.1.19" - "@firebase/installations" "0.4.17" + "@firebase/component" "0.1.21" + "@firebase/installations" "0.4.19" "@firebase/logger" "0.2.6" "@firebase/remote-config-types" "0.1.9" - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" tslib "^1.11.1" "@firebase/storage-types@0.3.13": @@ -1196,27 +1196,27 @@ resolved "https://registry.yarnpkg.com/@firebase/storage-types/-/storage-types-0.3.13.tgz#cd43e939a2ab5742e109eb639a313673a48b5458" integrity sha512-pL7b8d5kMNCCL0w9hF7pr16POyKkb3imOW7w0qYrhBnbyJTdVxMWZhb0HxCFyQWC0w3EiIFFmxoz8NTFZDEFog== -"@firebase/storage@0.3.43": - version "0.3.43" - resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.3.43.tgz#107fb5db2eff2561b5c4e35ee4cbff48f28c7e77" - integrity sha512-Jp54jcuyimLxPhZHFVAhNbQmgTu3Sda7vXjXrNpPEhlvvMSq4yuZBR6RrZxe/OrNVprLHh/6lTCjwjOVSo3bWA== +"@firebase/storage@0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.4.2.tgz#bc5924b87bd2fdd4ab0de49851c0125ebc236b89" + integrity sha512-87CrvKrf8kijVekRBmUs8htsNz7N5X/pDhv3BvJBqw8K65GsUolpyjx0f4QJRkCRUYmh3MSkpa5P08lpVbC6nQ== dependencies: - "@firebase/component" "0.1.19" + "@firebase/component" "0.1.21" "@firebase/storage-types" "0.3.13" - "@firebase/util" "0.3.2" + "@firebase/util" "0.3.4" tslib "^1.11.1" -"@firebase/util@0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@firebase/util/-/util-0.3.2.tgz#87de27f9cffc2324651cabf6ec133d0a9eb21b52" - integrity sha512-Dqs00++c8rwKky6KCKLLY2T1qYO4Q+X5t+lF7DInXDNF4ae1Oau35bkD+OpJ9u7l1pEv7KHowP6CUKuySCOc8g== +"@firebase/util@0.3.4": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@firebase/util/-/util-0.3.4.tgz#e389d0e0e2aac88a5235b06ba9431db999d4892b" + integrity sha512-VwjJUE2Vgr2UMfH63ZtIX9Hd7x+6gayi6RUXaTqEYxSbf/JmehLmAEYSuxS/NckfzAXWeGnKclvnXVibDgpjQQ== dependencies: tslib "^1.11.1" -"@firebase/webchannel-wrapper@0.4.0": - version "0.4.0" - resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.4.0.tgz#becce788818d3f47f0ac1a74c3c061ac1dcf4f6d" - integrity sha512-8cUA/mg0S+BxIZ72TdZRsXKBP5n5uRcE3k29TZhZw6oIiHBt9JA7CTb/4pE1uKtE/q5NeTY2tBDcagoZ+1zjXQ== +"@firebase/webchannel-wrapper@0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.4.1.tgz#600f2275ff54739ad5ac0102f1467b8963cd5f71" + integrity sha512-0yPjzuzGMkW1GkrC8yWsiN7vt1OzkMIi9HgxRmKREZl2wnNPOKo/yScTjXf/O57HM8dltqxPF6jlNLFVtc2qdw== "@grpc/grpc-js@^1.0.0": version "1.1.0" @@ -6351,25 +6351,25 @@ firebase-mock@^2.2.10: lodash.union "^4.6.0" rsvp "^3.6.2" -firebase@^7.2.3: - version "7.24.0" - resolved "https://registry.yarnpkg.com/firebase/-/firebase-7.24.0.tgz#dab53b9c0f1c9538d2d6f4f51769897b0b6d60d8" - integrity sha512-j6jIyGFFBlwWAmrlUg9HyQ/x+YpsPkc/TTkbTyeLwwAJrpAmmEHNPT6O9xtAnMV4g7d3RqLL/u9//aZlbY4rQA== +firebase@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/firebase/-/firebase-8.1.1.tgz#379094b724053931fda1086e9020a17b578e50d5" + integrity sha512-w1plr2jYvzBkx/rHE6A0EJf9318ufA5omShLuGocPlQtrvphel+KJcd+R02outE5E2lSDhyM0l3EoiA0YCD4hA== dependencies: - "@firebase/analytics" "0.6.0" - "@firebase/app" "0.6.11" + "@firebase/analytics" "0.6.2" + "@firebase/app" "0.6.13" "@firebase/app-types" "0.6.1" - "@firebase/auth" "0.15.0" - "@firebase/database" "0.6.13" - "@firebase/firestore" "1.18.0" - "@firebase/functions" "0.5.1" - "@firebase/installations" "0.4.17" - "@firebase/messaging" "0.7.1" - "@firebase/performance" "0.4.2" + "@firebase/auth" "0.15.2" + "@firebase/database" "0.8.1" + "@firebase/firestore" "2.0.4" + "@firebase/functions" "0.6.1" + "@firebase/installations" "0.4.19" + "@firebase/messaging" "0.7.3" + "@firebase/performance" "0.4.4" "@firebase/polyfill" "0.3.36" - "@firebase/remote-config" "0.1.28" - "@firebase/storage" "0.3.43" - "@firebase/util" "0.3.2" + "@firebase/remote-config" "0.1.30" + "@firebase/storage" "0.4.2" + "@firebase/util" "0.3.4" flat-cache@^2.0.1: version "2.0.1"