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

upgrade from Expo 46 to 49 #82

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions config/firebase.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
import { initializeApp } from 'firebase/app';
import { initializeAuth, getReactNativePersistence } from 'firebase/auth';
import Constants from 'expo-constants';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { initializeApp } from "firebase/app";
// import { initializeAuth, getReactNativePersistence } from "firebase/auth";
import { initializeAuth } from "firebase/auth";
import Constants from "expo-constants";
// import AsyncStorage from "@react-native-async-storage/async-storage";

// add firebase config
const firebaseConfig = {
apiKey: Constants.manifest.extra.apiKey,
authDomain: Constants.manifest.extra.authDomain,
projectId: Constants.manifest.extra.projectId,
storageBucket: Constants.manifest.extra.storageBucket,
messagingSenderId: Constants.manifest.extra.messagingSenderId,
appId: Constants.manifest.extra.appId,
apiKey: Constants.expoConfig?.extra?.apiKey,
authDomain: Constants.expoConfig?.extra?.authDomain,
projectId: Constants.expoConfig?.extra?.projectId,
storageBucket: Constants.expoConfig?.extra?.storageBucket,
messagingSenderId: Constants.expoConfig?.extra?.messagingSenderId,
appId: Constants.expoConfig?.extra?.appId,
};

// initialize firebase
const app = initializeApp(firebaseConfig);

// initialize auth
const auth = initializeAuth(app, {
persistence: getReactNativePersistence(AsyncStorage),
});
//
// Need to upgrade to Expo with typescrip inorder getReactNativePersistence to work.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will follow up this on quickly after merging this PR as I have changes to upgrade to SDK 50 stacked up.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgraded to SDK 50 in #84 and tested this and it works without the need to use TypeScript.

//

//initialize auth
// const auth = initializeAuth(app, {
// persistence: getReactNativePersistence(AsyncStorage),
// });

const auth = initializeAuth(app);

export { auth };
10 changes: 10 additions & 0 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Learn more https://docs.expo.io/guides/customizing-metro
amandeepmittal marked this conversation as resolved.
Show resolved Hide resolved
const { getDefaultConfig } = require("expo/metro-config");

/** @type {import('expo/metro-config').MetroConfig} */
const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.resolver.sourceExts.push("cjs");

defaultConfig.resolver.mainFields = ["react-native", "browser", "main"];

module.exports = defaultConfig;
38 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,32 @@
"eject": "expo eject"
},
"dependencies": {
"@react-native-async-storage/async-storage": "~1.17.3",
"@react-native-masked-view/masked-view": "0.2.7",
"@react-navigation/native": "^6.0.11",
"@react-navigation/stack": "^6.2.2",
"@expo/webpack-config": "^19.0.0",
"@react-native-async-storage/async-storage": "1.18.2",
"@react-native-masked-view/masked-view": "^0.2.7",
"@react-navigation/native": "^6.1.16",
"@react-navigation/stack": "^6.3.28",
"dotenv": "^10.0.0",
"expo": "^46.0.0",
"expo-constants": "~13.2.3",
"firebase": "9.6.11",
"expo": "^49.0.15",
"expo-constants": "~14.4.2",
"firebase": "^10.5.2",
"formik": "2.1.4",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-native": "0.69.4",
"react-native-gesture-handler": "~2.5.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.72.10",
"react-native-gesture-handler": "2.12.0",
"react-native-keyboard-aware-scroll-view": "^0.9.4",
"react-native-reanimated": "~2.9.1",
"react-native-safe-area-context": "4.3.1",
"react-native-screens": "~3.15.0",
"react-native-web": "~0.18.7",
"yup": "0.27.0"
"react-native-reanimated": "3.3.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "3.22.0",
"react-native-web": "0.19.10",
"yup": "^0.27.0"
},
"devDependencies": {
"@babel/core": "^7.18.6",
"@babel/core": "^7.20.0",
"@babel/runtime": "^7.9.0",
"babel-preset-expo": "~9.2.0"
"@types/react": "^18.2.65",
amandeepmittal marked this conversation as resolved.
Show resolved Hide resolved
"babel-preset-expo": "^9.5.0",
},
"private": true
}
Loading