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

Firebase 8 ➡️ 9 #213

Open
charliejlevine opened this issue Apr 14, 2022 · 4 comments
Open

Firebase 8 ➡️ 9 #213

charliejlevine opened this issue Apr 14, 2022 · 4 comments

Comments

@charliejlevine
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Firebase 8 ➡️ 9

Here is the diff that solved my problem:

diff --git a/node_modules/capacitor-firebase-auth/dist/esm/alternative/alternative.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/alternative/alternative.d.ts
index c5e3b4f..c664c8e 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/alternative/alternative.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/alternative/alternative.d.ts
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 import { Observable } from 'rxjs';
 import { AppleSignInResult, FacebookSignInResult, GoogleSignInResult, PhoneSignInResult, SignInOptions, SignInResult, TwitterSignInResult } from '../definitions';
 /**
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/alternative/alternative.js b/node_modules/capacitor-firebase-auth/dist/esm/alternative/alternative.js
index 5c375eb..4651ede 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/alternative/alternative.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/alternative/alternative.js
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 import { Observable, throwError } from 'rxjs';
 import { CapacitorFirebaseAuth } from '../';
 /**
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/definitions.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/definitions.d.ts
index a84415e..a6a6be5 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/definitions.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/definitions.d.ts
@@ -1,4 +1,4 @@
-import 'firebase/auth';
+import 'firebase/compat/auth';
 export interface SignInResult {
 }
 export interface CapacitorFirebaseAuthPlugin {
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/definitions.js b/node_modules/capacitor-firebase-auth/dist/esm/definitions.js
index fdde090..a785399 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/definitions.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/definitions.js
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 export class GoogleSignInResult {
     constructor(idToken) {
         this.idToken = idToken;
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/facades.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/facades.d.ts
index 700e1df..991d1c1 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/facades.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/facades.d.ts
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 import { Observable } from 'rxjs';
 import { CapacitorFirebaseAuthPlugin, SignInOptions } from './definitions';
 export declare const CapacitorFirebaseAuth: CapacitorFirebaseAuthPlugin;
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/facades.js b/node_modules/capacitor-firebase-auth/dist/esm/facades.js
index 95b7b21..a86b204 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/facades.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/facades.js
@@ -1,6 +1,6 @@
-import 'firebase/auth';
+import 'firebase/compat/auth';
 import { registerPlugin } from '@capacitor/core';
-import firebase from 'firebase/app';
+import firebase from 'firebase/compat/app';
 import { Observable, throwError } from 'rxjs';
 export const CapacitorFirebaseAuth = registerPlugin('CapacitorFirebaseAuth', {
     web: () => import('./web').then(m => new m.CapacitorFirebaseAuthWeb()),
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/operators.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/operators.d.ts
index af9cb5c..7078675 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/operators.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/operators.d.ts
@@ -1,4 +1,4 @@
-import firebase from 'firebase/app';
+import firebase from 'firebase/compat/app';
 import { Observable, UnaryFunction } from 'rxjs';
 /**
  * Operator to map firebase.User to firebase.UserInfo.
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/apple.provider.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/providers/apple.provider.d.ts
index f3b2ec9..c35694f 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/apple.provider.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/apple.provider.d.ts
@@ -1,4 +1,4 @@
-import 'firebase/auth';
+import 'firebase/compat/auth';
 import { AppleSignInResult, SignInOptions } from '../definitions';
 export declare const appleSignInWeb: (options: {
     providerId: string;
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/apple.provider.js b/node_modules/capacitor-firebase-auth/dist/esm/providers/apple.provider.js
index a4e3100..0e42e7a 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/apple.provider.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/apple.provider.js
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 import { AppleSignInResult } from '../definitions';
 export const appleSignInWeb = async () => {
     var _a;
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/facebook.provider.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/providers/facebook.provider.d.ts
index 6905dc9..45119ae 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/facebook.provider.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/facebook.provider.d.ts
@@ -1,4 +1,4 @@
-import 'firebase/auth';
+import 'firebase/compat/auth';
 import { FacebookSignInResult, SignInOptions } from '../definitions';
 export declare const facebookSignInWeb: (options: {
     providerId: string;
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/facebook.provider.js b/node_modules/capacitor-firebase-auth/dist/esm/providers/facebook.provider.js
index b70c9df..4a7feeb 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/facebook.provider.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/facebook.provider.js
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 import { FacebookSignInResult } from '../definitions';
 export const facebookSignInWeb = async () => {
     const provider = new firebase.auth.FacebookAuthProvider();
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/google.provider.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/providers/google.provider.d.ts
index a9ca10d..793930b 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/google.provider.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/google.provider.d.ts
@@ -1,4 +1,4 @@
-import 'firebase/auth';
+import 'firebase/compat/auth';
 import { GoogleSignInResult, SignInOptions } from '../definitions';
 export declare const googleSignInWeb: (options: {
     providerId: string;
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/google.provider.js b/node_modules/capacitor-firebase-auth/dist/esm/providers/google.provider.js
index 695c1a9..397f406 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/google.provider.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/google.provider.js
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 import { GoogleSignInResult } from '../definitions';
 export const googleSignInWeb = async () => {
     const provider = new firebase.auth.GoogleAuthProvider();
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/phone.provider.js b/node_modules/capacitor-firebase-auth/dist/esm/providers/phone.provider.js
index 57b9cf5..f222ae9 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/phone.provider.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/phone.provider.js
@@ -1,4 +1,4 @@
-import firebase from 'firebase/app';
+import firebase from 'firebase/compat/app';
 import { PhoneSignInResult } from '../definitions';
 export const phoneSignInWeb = async (options) => {
     var _a, _b, _c, _d;
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/twitter.provider.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/providers/twitter.provider.d.ts
index 41b7f6f..c059486 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/twitter.provider.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/twitter.provider.d.ts
@@ -1,4 +1,4 @@
-import 'firebase/auth';
+import 'firebase/compat/auth';
 import { SignInOptions, TwitterSignInResult } from '../definitions';
 export declare const twitterSignInWeb: (options: {
     providerId: string;
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/providers/twitter.provider.js b/node_modules/capacitor-firebase-auth/dist/esm/providers/twitter.provider.js
index 67be57d..991a505 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/providers/twitter.provider.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/providers/twitter.provider.js
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 import { TwitterSignInResult } from '../definitions';
 export const twitterSignInWeb = async () => {
     const provider = new firebase.auth.TwitterAuthProvider();
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/web.d.ts b/node_modules/capacitor-firebase-auth/dist/esm/web.d.ts
index d6f6822..cb853c0 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/web.d.ts
+++ b/node_modules/capacitor-firebase-auth/dist/esm/web.d.ts
@@ -1,4 +1,4 @@
-import 'firebase/auth';
+import 'firebase/compat/auth';
 import { WebPlugin } from '@capacitor/core';
 import { CapacitorFirebaseAuthPlugin, SignInOptions, SignInResult } from './definitions';
 export declare class CapacitorFirebaseAuthWeb extends WebPlugin implements CapacitorFirebaseAuthPlugin {
diff --git a/node_modules/capacitor-firebase-auth/dist/esm/web.js b/node_modules/capacitor-firebase-auth/dist/esm/web.js
index 148ac66..62823dc 100644
--- a/node_modules/capacitor-firebase-auth/dist/esm/web.js
+++ b/node_modules/capacitor-firebase-auth/dist/esm/web.js
@@ -1,5 +1,5 @@
-import 'firebase/auth';
-import firebase from 'firebase/app';
+import 'firebase/compat/auth';
+import firebase from 'firebase/compat/app';
 import { WebPlugin } from '@capacitor/core';
 import { appleSignInWeb } from './providers/apple.provider';
 import { facebookSignInWeb } from './providers/facebook.provider';

This issue body was partially generated by patch-package.

@charliejlevine
Copy link
Author

#190

@charliejlevine
Copy link
Author

Peer dependency and examples probably need to be updated too, but this functionally moves the plugin from firebase v8 to firebase v9 compat API (https://firebase.google.com/docs/web/modular-upgrade)

@anandsathe67
Copy link

You could also use PR #204 if you don't want to use compatibility mode. Should be easy enough to create a patch off of that as well

@charliejlevine
Copy link
Author

Perfect, thank you!

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

No branches or pull requests

2 participants