Skip to content

Commit

Permalink
Update to sdk 52
Browse files Browse the repository at this point in the history
  • Loading branch information
jthoward64 committed Nov 17, 2024
1 parent ba0345e commit d0155f6
Show file tree
Hide file tree
Showing 23 changed files with 5,126 additions and 10,814 deletions.
4 changes: 3 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@
"skipFiles": ["<node_internals>/**"],
"type": "node",
"console": "integratedTerminal",
"cwd": "${workspaceFolder}/packages/mobile",
"presentation": {
"group": "4mobile"
},
"env": {
"REACT_NATIVE_PACKAGER_HOSTNAME": "0.0.0.0"
"REACT_NATIVE_PACKAGER_HOSTNAME": "0.0.0.0",
"REACT_EDITOR": "code"
},
"autoAttachChildProcesses": false
},
Expand Down
2 changes: 1 addition & 1 deletion DISCLAIMER
Original file line number Diff line number Diff line change
Expand Up @@ -1952,7 +1952,7 @@ SOFTWARE.

-----

The following software may be included in this product: @jonasmerlin/react-native-markdown-display. A copy of the source code may be downloaded from git+https://github.com/jonasmerlin/react-native-markdown-display.git. This software contains the following license and notice below:
The following software may be included in this product: @ukdanceblue/react-native-markdown-display. A copy of the source code may be downloaded from git+https://github.com/jonasmerlin/react-native-markdown-display.git. This software contains the following license and notice below:

MIT License

Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
"urijs": "npm:uri-js-replace"
},
"devDependencies": {
"@eslint/compat": "^1.2.2",
"@eslint/compat": "^1.2.3",
"@eslint/config-inspector": "^0.5.6",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@expo/ngrok": "^4.1.3",
"@graphql-codegen/cli": "^5.0.3",
"@graphql-codegen/client-preset": "patch:@graphql-codegen/client-preset@npm%3A4.4.0#~/.yarn/patches/@graphql-codegen-client-preset-npm-4.4.0-d441b92060.patch",
Expand All @@ -74,14 +74,14 @@
"@types/eslint__js": "^8.42.3",
"@types/react": "~18.3.12",
"@types/react-dom": "~18.3.1",
"@vitest/coverage-v8": "^2.1.4",
"@vitest/ui": "^2.1.4",
"@vitest/coverage-v8": "^2.1.5",
"@vitest/ui": "^2.1.5",
"@yarnpkg/types": "^4.0.0",
"babel-cli": "^6.26.0",
"chokidar-cli": "^3.0.0",
"eslint": "^9.14.0",
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-n": "^17.13.1",
"eslint-plugin-n": "^17.13.2",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-native": "^4.1.0",
Expand All @@ -98,7 +98,7 @@
"ts-node": "^10.9.2",
"typescript": "^5.6.3",
"typescript-eslint": "^8.14.0",
"vitest": "^2.1.4"
"vitest": "^2.1.5"
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@types/react": "~18.3.12",
"@types/validator": "^13.12.2",
"typescript": "^5.6.3",
"vitest": "^2.1.4"
"vitest": "^2.1.5"
},
"packageManager": "[email protected]"
}
119 changes: 117 additions & 2 deletions packages/mobile/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
// Import third-party dependencies
import { useAsyncStorageDevTools } from "@dev-plugins/async-storage";
import AsyncStorage from "@react-native-async-storage/async-storage";
import NetInfo from "@react-native-community/netinfo";
import {
configureScope as configureSentryScope,
init as initSentry,
ReactNativeTracing,
wrap as wrapWithSentry,
} from "@sentry/react-native";
import { isRunningInExpoGo } from "expo";
import { DevMenu, isDevelopmentBuild } from "expo-dev-client";
import { useFonts } from "expo-font";
import { setNotificationHandler } from "expo-notifications";
import { hideAsync } from "expo-splash-screen";
import { preventAutoHideAsync } from "expo-splash-screen";
// TODO: Switch away from native-base https://nativebase.io/blogs/road-ahead-with-gluestack-ui
import { isEmergencyLaunch } from "expo-updates";
import { channel, isEmbeddedLaunch, manifest, updateId } from "expo-updates";
import type { ICustomTheme } from "native-base";
import { NativeBaseProvider } from "native-base";
import React, { useEffect, useRef, useState } from "react";
Expand All @@ -21,6 +33,7 @@ import { DeviceDataProvider } from "@/context/device";
import { LoadingWrapper } from "@/context/loading";
import { UrqlContext } from "@/context/urql";

import { overrideApiBaseUrl } from "./src/common/apiUrl";
// import BoldoniFlfBoldFont from "./assets/fonts/bodoni-flf-font/Bodoni-FLF-Bold.ttf";
// import BoldoniFlfBoldItalicFont from "./assets/fonts/bodoni-flf-font/Bodoni-FLF-Bold-Italic.ttf";
// import BoldoniFlfItalicFont from "./assets/fonts/bodoni-flf-font/Bodoni-FLF-Italic.ttf";
Expand All @@ -29,19 +42,121 @@ import { UrqlContext } from "@/context/urql";
// import OpenSansCondensedLightFont from "./assets/fonts/opensans-condensed/OpenSans-Condensed-Light.ttf";
// import OpenSansCondensedLightItalicFont from "./assets/fonts/opensans-condensed/OpenSans-Condensed-Light-Italic.ttf";
import { FilledNavigationContainer } from "./src/navigation/NavigationContainer";
import { routingInstrumentation } from "./src/navigation/routingInstrumentation";
import { getCustomTheme } from "./src/theme";

const metadata = "metadata" in manifest ? manifest.metadata : undefined;
const extra = "extra" in manifest ? manifest.extra : undefined;
const updateGroup =
metadata && "updateGroup" in metadata ? metadata.updateGroup : undefined;

if (isEmergencyLaunch) {
Alert.alert(
"A CRITICAL ERROR HAS OCCURRED!",
"You are running a fallback version of the app and will likely experience issues. Please try to restart the app to fix this issue. If the issue persists, please contact the Tech Committee."
);
}

Logger.debug("Starting app");

void preventAutoHideAsync();

initSentry({
dsn: "https://f8d08f6f2a9dd8d627a9ed4b99fb4ba4@o4507762130681856.ingest.us.sentry.io/4507762137825280",
tracesSampleRate: 0.2,
_experiments: {
profilesSampleRate: 0.2,
},
debug: false,
integrations: [
new ReactNativeTracing({
routingInstrumentation,
enableNativeFramesTracking: !isRunningInExpoGo(),
}),
],
environment: channel ?? (isDevelopmentBuild() ? "dev-client" : "unknown"),
enabled: !__DEV__,
});

configureSentryScope((scope) => {
scope.setTag("expo-update-id", updateId);
scope.setTag("expo-is-embedded-update", isEmbeddedLaunch);

if (typeof updateGroup === "string") {
scope.setTag("expo-update-group-id", updateGroup);

const owner = extra?.expoClient?.owner ?? "[account]";
const slug = extra?.expoClient?.slug ?? "[project]";
scope.setTag(
"expo-update-debug-url",
`https://expo.dev/accounts/${owner}/projects/${slug}/updates/${updateGroup}`
);
} else if (isEmbeddedLaunch) {
// This will be `true` if the update is the one embedded in the build, and not one downloaded from the updates server.
scope.setTag("expo-update-debug-url", "embedded");
}
});

if (isDevelopmentBuild()) {
DevMenu.registerDevMenuItems([
{
name: "Clear AsyncStorage",
callback: () => {
Logger.log("Clearing AsyncStorage");
AsyncStorage.clear()
.then(() => {
Alert.alert("AsyncStorage cleared successfully");
})
.catch((error) => {
Logger.error("Error clearing AsyncStorage", { error });
Alert.alert("Error clearing AsyncStorage");
});
},
},
{
name: "Print AsyncStorage",
callback: () => {
Logger.log("Printing AsyncStorage");
AsyncStorage.getAllKeys()
.then((keys) => AsyncStorage.multiGet(keys))
.then((values) => {
Logger.log(
`AsyncStorage values:\n${JSON.stringify(values, null, 2)}`
);
})
.catch((error) => {
Logger.error("Error printing AsyncStorage", { error });
});
},
},
{
name: "Override url",
callback: () => {
Logger.log("Overriding url");
Alert.prompt(
"Enter the url to override or blank for default",
"",
overrideApiBaseUrl
);
},
},
]).catch(/** @param {unknown} error */ (error) => console.error(error));
}

// Configure the notifications handler to decide what to do when a notification is received if the app is open
setNotificationHandler({
handleNotification: () =>
Promise.resolve({
shouldShowAlert: true,
shouldPlaySound: false,
shouldSetBadge: false,
}),
});

/**
* Main app container
*/
const App = () => {
const App = wrapWithSentry(() => {
const isOfflineInternal = useRef(false);
const [theme, setTheme] = useState<ICustomTheme | undefined>(undefined);

Expand Down Expand Up @@ -116,7 +231,7 @@ const App = () => {
</NativeBaseProvider>
)
);
};
});

function AppWrapper() {
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/app.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "UK DanceBlue",
"description": "University of Kentucky DanceBlue Mobile Application",
"slug": "danceblue-mobile",
"privacy": "unlisted",
"newArchEnabled": true,
"owner": "ukdanceblue",
"scheme": "danceblue",
"jsEngine": "hermes",
Expand Down
32 changes: 3 additions & 29 deletions packages/mobile/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -1,36 +1,10 @@
/**
*
* @param {import('@babel/core').ConfigAPI} api
* @returns {import('@babel/core').TransformOptions}
*/
module.exports = function babel(api) {
const config = {
module.exports = function babel() {
return {
presets: ["babel-preset-expo"],
plugins: [
[
"module-resolver",
{
root: ["./src"],
extensions: [
".ios.js",
".android.js",
".js",
".ts",
".tsx",
".json",
".png",
".jpg",
".ttf",
],
alias: {
"type-graphql": "./node_modules/type-graphql/build/cjs/shim.js",
},
},
],
"@babel/plugin-proposal-export-namespace-from",
"react-native-reanimated/plugin",
],
plugins: ["react-native-reanimated/plugin"],
};
api.cache.using(() => JSON.stringify(config));
return config;
};
Loading

0 comments on commit d0155f6

Please sign in to comment.