Changes to get Fabric building for production (#3119)

* rm expo-updates for now

* rm expo-updates for now

* push podfile
This commit is contained in:
Hailey
2024-03-05 19:41:49 -08:00
committed by GitHub
parent abad9c92ae
commit b42edb1b76
7 changed files with 68 additions and 146 deletions
-11
View File
@@ -108,11 +108,6 @@ module.exports = function (config) {
web: { web: {
favicon: './assets/favicon.png', favicon: './assets/favicon.png',
}, },
updates: {
enabled: true,
fallbackToCacheTimeout: 1000,
url: 'https://u.expo.dev/55bd077a-d905-4184-9c7f-94789ba0f302',
},
plugins: [ plugins: [
'expo-localization', 'expo-localization',
Boolean(process.env.SENTRY_AUTH_TOKEN) && 'sentry-expo', Boolean(process.env.SENTRY_AUTH_TOKEN) && 'sentry-expo',
@@ -132,12 +127,6 @@ module.exports = function (config) {
}, },
}, },
], ],
[
'expo-updates',
{
username: 'blueskysocial',
},
],
[ [
'expo-notifications', 'expo-notifications',
{ {
+1 -2
View File
@@ -117,7 +117,6 @@
"expo-status-bar": "~1.11.1", "expo-status-bar": "~1.11.1",
"expo-system-ui": "~2.9.3", "expo-system-ui": "~2.9.3",
"expo-task-manager": "~11.7.2", "expo-task-manager": "~11.7.2",
"expo-updates": "~0.24.10",
"expo-web-browser": "~12.8.2", "expo-web-browser": "~12.8.2",
"fast-text-encoding": "^1.0.6", "fast-text-encoding": "^1.0.6",
"history": "^5.3.0", "history": "^5.3.0",
@@ -147,7 +146,7 @@
"react-native": "~0.73.5", "react-native": "~0.73.5",
"react-native-date-picker": "^4.4.0", "react-native-date-picker": "^4.4.0",
"react-native-drawer-layout": "^4.0.0-alpha.3", "react-native-drawer-layout": "^4.0.0-alpha.3",
"react-native-gesture-handler": "~2.15.0", "react-native-gesture-handler": "~2.16.0-rc.0",
"react-native-get-random-values": "~1.8.0", "react-native-get-random-values": "~1.8.0",
"react-native-image-crop-picker": "~0.40.3", "react-native-image-crop-picker": "~0.40.3",
"react-native-ios-context-menu": "^1.15.3", "react-native-ios-context-menu": "^1.15.3",
-2
View File
@@ -1,4 +1,2 @@
import {nativeBuildVersion, nativeApplicationVersion} from 'expo-application' import {nativeBuildVersion, nativeApplicationVersion} from 'expo-application'
import {channel} from 'expo-updates'
export const updateChannel = channel
export const appVersion = `${nativeApplicationVersion} (${nativeBuildVersion})` export const appVersion = `${nativeApplicationVersion} (${nativeBuildVersion})`
+57 -66
View File
@@ -1,78 +1,69 @@
import * as Updates from 'expo-updates' import {useEffect} from 'react'
import {useCallback, useEffect} from 'react'
import {AppState} from 'react-native'
import {logger} from '#/logger' import {logger} from '#/logger'
import {useModalControls} from '#/state/modals'
import {t} from '@lingui/macro'
export function useOTAUpdate() { export function useOTAUpdate() {
const {openModal} = useModalControls() // // HELPER FUNCTIONS
// const showUpdatePopup = useCallback(() => {
// HELPER FUNCTIONS // openModal({
const showUpdatePopup = useCallback(() => { // name: 'confirm',
openModal({ // title: t`Update Available`,
name: 'confirm', // message: t`A new version of the app is available. Please update to continue using the app.`,
title: t`Update Available`, // onPressConfirm: async () => {
message: t`A new version of the app is available. Please update to continue using the app.`, // // Updates.reloadAsync().catch(err => {
onPressConfirm: async () => { // // throw err
Updates.reloadAsync().catch(err => { // // })
throw err // },
}) // })
}, // }, [openModal])
}) // const checkForUpdate = useCallback(async () => {
}, [openModal]) // logger.debug('useOTAUpdate: Checking for update...')
const checkForUpdate = useCallback(async () => { // try {
logger.debug('useOTAUpdate: Checking for update...') // // Check if new OTA update is available
try { // // const update = await Updates.checkForUpdateAsync()
// Check if new OTA update is available // // If updates aren't available stop the function execution
const update = await Updates.checkForUpdateAsync() // // if (!update.isAvailable) {
// If updates aren't available stop the function execution // // return
if (!update.isAvailable) { // // }
return // // // Otherwise fetch the update in the background, so even if the user rejects switching to latest version it will be done automatically on next relaunch.
} // // await Updates.fetchUpdateAsync()
// Otherwise fetch the update in the background, so even if the user rejects switching to latest version it will be done automatically on next relaunch. // // show a popup modal
await Updates.fetchUpdateAsync() // showUpdatePopup()
// show a popup modal // } catch (e) {
showUpdatePopup() // logger.error('useOTAUpdate: Error while checking for update', {
} catch (e) { // message: e,
logger.error('useOTAUpdate: Error while checking for update', { // })
message: e, // }
}) // }, [showUpdatePopup])
} // const updateEventListener = useCallback((event: Updates.UpdateEvent) => {
}, [showUpdatePopup]) logger.debug('useOTAUpdate: Listening for update...')
const updateEventListener = useCallback( // if (event.type === Updates.UpdateEventType.ERROR) {
(event: Updates.UpdateEvent) => { // logger.error('useOTAUpdate: Error while listening for update', {
logger.debug('useOTAUpdate: Listening for update...') // message: event.message,
if (event.type === Updates.UpdateEventType.ERROR) { // })
logger.error('useOTAUpdate: Error while listening for update', { // } else if (event.type === Updates.UpdateEventType.NO_UPDATE_AVAILABLE) {
message: event.message, // // Handle no update available
}) // // do nothing
} else if (event.type === Updates.UpdateEventType.NO_UPDATE_AVAILABLE) { // } else if (event.type === Updates.UpdateEventType.UPDATE_AVAILABLE) {
// Handle no update available // // Handle update available
// do nothing // // open modal, ask for user confirmation, and reload the app
} else if (event.type === Updates.UpdateEventType.UPDATE_AVAILABLE) { // showUpdatePopup()
// Handle update available // }
// open modal, ask for user confirmation, and reload the app // }, [])
showUpdatePopup()
}
},
[showUpdatePopup],
)
useEffect(() => { useEffect(() => {
// ADD EVENT LISTENERS // ADD EVENT LISTENERS
const updateEventSubscription = Updates.addListener(updateEventListener) // const updateEventSubscription = Updates.addListener(updateEventListener)
const appStateSubscription = AppState.addEventListener('change', state => { // const appStateSubscription = AppState.addEventListener('change', state => {
if (state === 'active' && !__DEV__) { // if (state === 'active' && !__DEV__) {
checkForUpdate() // checkForUpdate()
} // }
}) // })
// REMOVE EVENT LISTENERS (CLEANUP) // REMOVE EVENT LISTENERS (CLEANUP)
return () => { return () => {
updateEventSubscription.remove() // updateEventSubscription.remove()
appStateSubscription.remove() // appStateSubscription.remove()
} }
}, []) // eslint-disable-line react-hooks/exhaustive-deps }, [])
// disable exhaustive deps because we don't want to run this effect again // disable exhaustive deps because we don't want to run this effect again
} }
+2 -5
View File
@@ -4,17 +4,14 @@
*/ */
import {Platform} from 'react-native' import {Platform} from 'react-native'
import * as info from 'expo-updates'
import {init} from 'sentry-expo' import {init} from 'sentry-expo'
import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application' import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application'
/** /**
* Matches the build profile `channel` props in `eas.json` * Matches the build profile `channel` props in `eas.json`
*/ */
const buildChannel = (info.channel || 'development') as // TODO FABRIC expo updates .info
| 'development' const buildChannel = 'development' as 'development' | 'preview' | 'production'
| 'preview'
| 'production'
/** /**
* Examples: * Examples:
+1 -3
View File
@@ -856,9 +856,7 @@ export function SettingsScreen({}: Props) {
accessibilityRole="button" accessibilityRole="button"
onPress={onPressBuildInfo}> onPress={onPressBuildInfo}>
<Text type="sm" style={[styles.buildInfo, pal.textLight]}> <Text type="sm" style={[styles.buildInfo, pal.textLight]}>
<Trans> <Trans>Build version {AppInfo.appVersion}</Trans>
Build version {AppInfo.appVersion} {AppInfo.updateChannel}
</Trans>
</Text> </Text>
</TouchableOpacity> </TouchableOpacity>
<Text type="sm" style={[pal.textLight]}> <Text type="sm" style={[pal.textLight]}>
+7 -57
View File
@@ -2044,9 +2044,9 @@
"@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-syntax-numeric-separator" "^7.10.4"
"@babel/plugin-transform-object-assign@^7.16.7": "@babel/plugin-transform-object-assign@^7.16.7":
version "7.22.5" version "7.23.3"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.22.5.tgz#290c1b9555dcea48bb2c29ad94237777600d04f9" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.23.3.tgz#64177e8cf943460c7f0e1c410277546804f59625"
integrity sha512-iDhx9ARkXq4vhZ2CYOSnQXkmxkDgosLi3J8Z17mKz7LyzthtkdVchLD7WZ3aXeCuvJDOW3+1I5TpJmwIbF9MKQ== integrity sha512-TPJ6O7gVC2rlQH2hvQGRH273G1xdoloCj9Pc07Q7JbIZYDi+Sv5gaE2fu+r5E7qK4zyt6vj0FbZaZTRU5C3OMA==
dependencies: dependencies:
"@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-plugin-utils" "^7.22.5"
@@ -8288,11 +8288,6 @@ application-config-path@^0.1.0:
resolved "https://registry.yarnpkg.com/application-config-path/-/application-config-path-0.1.1.tgz#8b5ac64ff6afdd9bd70ce69f6f64b6998f5f756e" resolved "https://registry.yarnpkg.com/application-config-path/-/application-config-path-0.1.1.tgz#8b5ac64ff6afdd9bd70ce69f6f64b6998f5f756e"
integrity sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw== integrity sha512-zy9cHePtMP0YhwG+CfHm0bgwdnga2X3gZexpdCwEj//dpb+TKajtiC8REEUJUSq6Ab4f9cgNy2l8ObXzCXFkEw==
arg@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.0.tgz#583c518199419e0037abb74062c37f8519e575f0"
integrity sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==
arg@5.0.2, arg@^5.0.2: arg@5.0.2, arg@^5.0.2:
version "5.0.2" version "5.0.2"
resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c"
@@ -11639,11 +11634,6 @@ expo-device@~5.9.3:
dependencies: dependencies:
ua-parser-js "^0.7.33" ua-parser-js "^0.7.33"
expo-eas-client@~0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/expo-eas-client/-/expo-eas-client-0.11.0.tgz#0f25aa497849cade7ebef55c0631093a87e58b07"
integrity sha512-99W0MUGe3U4/MY1E9UeJ4uKNI39mN8/sOGA0Le8XC47MTbwbLoVegHR3C5y2fXLwLn7EpfNxAn5nlxYjY3gD2A==
expo-file-system@^16.0.7, expo-file-system@~16.0.7: expo-file-system@^16.0.7, expo-file-system@~16.0.7:
version "16.0.7" version "16.0.7"
resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-16.0.7.tgz#0b3bd920a602b1c474d57a6b51202986113e1ef8" resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-16.0.7.tgz#0b3bd920a602b1c474d57a6b51202986113e1ef8"
@@ -11692,11 +11682,6 @@ expo-image@~1.10.6:
dependencies: dependencies:
"@react-native/assets-registry" "~0.73.1" "@react-native/assets-registry" "~0.73.1"
expo-json-utils@~0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/expo-json-utils/-/expo-json-utils-0.12.0.tgz#15ad797e9518a6a47eae9b95599e6373e641f8f2"
integrity sha512-xsUsPUZcXZWoT4RY3FhEPYGYvr2iThMNNU5drdmkC/vmkePvqy5kK4aIqlIKzQboXxj7k1dXoNSSLg5mKy8uKg==
expo-keep-awake@~12.8.2: expo-keep-awake@~12.8.2:
version "12.8.2" version "12.8.2"
resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-12.8.2.tgz#6cfdf8ad02b5fa130f99d4a1eb98e459d5b4332e" resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-12.8.2.tgz#6cfdf8ad02b5fa130f99d4a1eb98e459d5b4332e"
@@ -11722,14 +11707,6 @@ expo-localization@~14.8.3:
dependencies: dependencies:
rtl-detect "^1.0.2" rtl-detect "^1.0.2"
expo-manifests@~0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/expo-manifests/-/expo-manifests-0.13.0.tgz#20f163f84a414c6c50b8079e5fd0685d7c5b8ce2"
integrity sha512-N3adl3edSga3jdatLXjXiltdSwQkB1rOI5uyGEE5OwR/bpxc/5OUgHdRZjJgY6jJmVY4BCAiw0RXFoVRBbgE0Q==
dependencies:
"@expo/config" "~8.5.0"
expo-json-utils "~0.12.0"
expo-media-library@~15.9.1: expo-media-library@~15.9.1:
version "15.9.1" version "15.9.1"
resolved "https://registry.yarnpkg.com/expo-media-library/-/expo-media-library-15.9.1.tgz#1eaf5a0c8f51669f6f86d385a8fa411226042216" resolved "https://registry.yarnpkg.com/expo-media-library/-/expo-media-library-15.9.1.tgz#1eaf5a0c8f51669f6f86d385a8fa411226042216"
@@ -11795,11 +11772,6 @@ expo-status-bar@~1.11.1:
resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.11.1.tgz#a11318741d361048c11db2b16c4364a79a74af30" resolved "https://registry.yarnpkg.com/expo-status-bar/-/expo-status-bar-1.11.1.tgz#a11318741d361048c11db2b16c4364a79a74af30"
integrity sha512-ddQEtCOgYHTLlFUe/yH67dDBIoct5VIULthyT3LRJbEwdpzAgueKsX2FYK02ldh440V87PWKCamh7R9evk1rrg== integrity sha512-ddQEtCOgYHTLlFUe/yH67dDBIoct5VIULthyT3LRJbEwdpzAgueKsX2FYK02ldh440V87PWKCamh7R9evk1rrg==
expo-structured-headers@~3.7.0:
version "3.7.0"
resolved "https://registry.yarnpkg.com/expo-structured-headers/-/expo-structured-headers-3.7.0.tgz#69b752cf43515535eccd30513da428688634a7ec"
integrity sha512-uGcU65gzP4trfmVtntAg3rU/pytTGpCUXN+hQmCwCCvQb9qK1aoCXvVlqlW5zP8SZ04tzF1WXKR+P8RSEn5rSw==
expo-system-ui@~2.9.3: expo-system-ui@~2.9.3:
version "2.9.3" version "2.9.3"
resolved "https://registry.yarnpkg.com/expo-system-ui/-/expo-system-ui-2.9.3.tgz#845c7615a6ede9d959dff1719df3d9392a43c080" resolved "https://registry.yarnpkg.com/expo-system-ui/-/expo-system-ui-2.9.3.tgz#845c7615a6ede9d959dff1719df3d9392a43c080"
@@ -11815,28 +11787,6 @@ expo-task-manager@~11.7.2:
dependencies: dependencies:
unimodules-app-loader "~4.5.0" unimodules-app-loader "~4.5.0"
expo-updates-interface@~0.15.1:
version "0.15.1"
resolved "https://registry.yarnpkg.com/expo-updates-interface/-/expo-updates-interface-0.15.1.tgz#b0242fa7ba05768ada2f0faf83b90aa8b8fa65d7"
integrity sha512-B42oOB0pw4TaPoOGE/yzt9ggwNNxo3PEJRU0kIOurQ8hW5UEUC8cAbGQDYWGbTyNGp8gLBG+T2MCg+YYaCYJUw==
expo-updates@~0.24.10:
version "0.24.11"
resolved "https://registry.yarnpkg.com/expo-updates/-/expo-updates-0.24.11.tgz#605692a246103c29d0ca8a4b1134e8957f35b913"
integrity sha512-SWpjZj7VGWBZJtbVj0gbGY7uZYrE7b+sRRoj/K1ma2ckHwXtAAB8gYI95Zp0joBdRNAbEtoMHYXP66Nrj5l8Ng==
dependencies:
"@expo/code-signing-certificates" "0.0.5"
"@expo/config" "~8.5.0"
"@expo/config-plugins" "~7.8.0"
arg "4.1.0"
chalk "^4.1.2"
expo-eas-client "~0.11.0"
expo-manifests "~0.13.0"
expo-structured-headers "~3.7.0"
expo-updates-interface "~0.15.1"
fbemitter "^3.0.0"
resolve-from "^5.0.0"
expo-web-browser@~12.8.2: expo-web-browser@~12.8.2:
version "12.8.2" version "12.8.2"
resolved "https://registry.yarnpkg.com/expo-web-browser/-/expo-web-browser-12.8.2.tgz#f34fb85c80031e0dddd4f9b9efd03cb60333b089" resolved "https://registry.yarnpkg.com/expo-web-browser/-/expo-web-browser-12.8.2.tgz#f34fb85c80031e0dddd4f9b9efd03cb60333b089"
@@ -18320,10 +18270,10 @@ react-native-drawer-layout@^4.0.0-alpha.3:
dependencies: dependencies:
use-latest-callback "^0.1.9" use-latest-callback "^0.1.9"
react-native-gesture-handler@~2.15.0: react-native-gesture-handler@~2.16.0-rc.0:
version "2.15.0" version "2.16.0-rc.0"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.15.0.tgz#f8e6c0451a7bdf065edb7b9be605480db402baa0" resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.16.0-rc.0.tgz#ed9bbd7840fe84446402ec1d26c65e8e3ab07323"
integrity sha512-cmMGW8k86o/xgVTBZZOPohvR5re4Vh65PUxH4HbBBJAYTog4aN4wTVTUlnoky01HuSN8/X4h3tI/K3XLPoDnsg== integrity sha512-7y7UKLnDBq5BndVZQed1BC0CtXSVYg27XNL6Fu2vhmkvxVPtsHFOW1XMMCVajIi4ySnf4JNO/LbEQeOlJVXsYQ==
dependencies: dependencies:
"@egjs/hammerjs" "^2.0.17" "@egjs/hammerjs" "^2.0.17"
hoist-non-react-statics "^3.3.0" hoist-non-react-statics "^3.3.0"