Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: firebase imports to allow tree shaking

Andrew Bastine6c503253bfa
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"