From e6c503253bfa1487b28cd8495a269a52d7fcdc84 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Sun, 8 Aug 2021 13:25:54 +0530 Subject: [PATCH] fix: firebase imports to allow tree shaking --- helpers/fb/analytics.ts | 3 ++- helpers/fb/auth.ts | 4 +++- helpers/fb/collections.ts | 3 ++- helpers/fb/environments.ts | 3 ++- helpers/fb/history.ts | 3 ++- helpers/fb/index.ts | 2 +- helpers/fb/settings.ts | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/helpers/fb/analytics.ts b/helpers/fb/analytics.ts index 08a5f5e03..1a303e2f2 100644 --- a/helpers/fb/analytics.ts +++ b/helpers/fb/analytics.ts @@ -1,4 +1,5 @@ -import firebase from "firebase" +import firebase from "firebase/app" +import "firebase/analytics" import { authEvents$ } from "./auth" import { HoppAccentColor, diff --git a/helpers/fb/auth.ts b/helpers/fb/auth.ts index 08a7c0874..88fc88bdd 100644 --- a/helpers/fb/auth.ts +++ b/helpers/fb/auth.ts @@ -1,4 +1,6 @@ -import firebase from "firebase" +import firebase from "firebase/app" +import "firebase/firestore" +import "firebase/auth" import { BehaviorSubject, Subject } from "rxjs" export type HoppUser = firebase.User & { diff --git a/helpers/fb/collections.ts b/helpers/fb/collections.ts index 95cb785e2..80ad0c0d4 100644 --- a/helpers/fb/collections.ts +++ b/helpers/fb/collections.ts @@ -1,4 +1,5 @@ -import firebase from "firebase" +import firebase from "firebase/app" +import "firebase/firestore" import { currentUser$ } from "./auth" import { restCollections$, diff --git a/helpers/fb/environments.ts b/helpers/fb/environments.ts index c4fc2e556..1cd3b63bf 100644 --- a/helpers/fb/environments.ts +++ b/helpers/fb/environments.ts @@ -1,4 +1,5 @@ -import firebase from "firebase" +import firebase from "firebase/app" +import "firebase/firestore" import { currentUser$ } from "./auth" import { Environment, diff --git a/helpers/fb/history.ts b/helpers/fb/history.ts index f806e18a5..cfc0d9984 100644 --- a/helpers/fb/history.ts +++ b/helpers/fb/history.ts @@ -1,4 +1,5 @@ -import firebase from "firebase" +import firebase from "firebase/app" +import "firebase/firestore" import { currentUser$ } from "./auth" import { settingsStore } from "~/newstore/settings" import { diff --git a/helpers/fb/index.ts b/helpers/fb/index.ts index 68cacb1f8..603510c6d 100644 --- a/helpers/fb/index.ts +++ b/helpers/fb/index.ts @@ -1,4 +1,4 @@ -import firebase from "firebase" +import firebase from "firebase/app" import { initAnalytics } from "./analytics" import { initAuth } from "./auth" import { initCollections } from "./collections" diff --git a/helpers/fb/settings.ts b/helpers/fb/settings.ts index e51b127a6..77493cf8f 100644 --- a/helpers/fb/settings.ts +++ b/helpers/fb/settings.ts @@ -1,4 +1,5 @@ -import firebase from "firebase" +import firebase from "firebase/app" +import "firebase/firestore" import { currentUser$ } from "./auth" import { applySetting, settingsStore, SettingsType } from "~/newstore/settings"