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

Support Expo 52 #202

Merged
merged 16 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
41 changes: 34 additions & 7 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,33 @@ steps:
- bundle install
- features/scripts/build-ios.sh

- label: ':runner: expo Android 15'
depends_on:
- "build-expo-apk"
timeout_in_minutes: 50
plugins:
artifacts#v1.5.0:
download: "build/output.apk"
docker-compose#v3.9.0:
pull: expo-maze-runner
run: expo-maze-runner
use-aliases: true
command:
- --app=build/output.apk
- --farm=bs
- --device=ANDROID_15
- --a11y-locator
- --fail-fast
- --retry=2
- --order=random
test-collector#v1.10.2:
files: "reports/TEST-*.xml"
format: "junit"
branch: "^v52$"
concurrency: 5
concurrency_group: 'browserstack-app'
concurrency_method: eager

- label: ':runner: expo Android 12'
depends_on:
- "build-expo-apk"
Expand All @@ -62,12 +89,12 @@ steps:
test-collector#v1.10.2:
files: "reports/TEST-*.xml"
format: "junit"
branch: "^v51$"
branch: "^v52$"
concurrency: 5
concurrency_group: 'browserstack-app'
concurrency_method: eager

- label: ':runner: expo iOS 16'
- label: ':runner: expo iOS 18'
depends_on:
- "build-expo-ipa"
timeout_in_minutes: 50
Expand All @@ -81,20 +108,20 @@ steps:
command:
- --app=build/output.ipa
- --farm=bs
- --device=IOS_16
- --device=IOS_18
- --a11y-locator
- --fail-fast
- --retry=2
- --order=random
test-collector#v1.10.2:
files: "reports/TEST-*.xml"
format: "junit"
branch: "^v51$"
branch: "^v52$"
concurrency: 5
concurrency_group: 'browserstack-app'
concurrency_method: eager

- label: ':runner: expo iOS 14'
- label: ':runner: expo iOS 16'
Copy link
Member Author

Choose a reason for hiding this comment

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

Minimum supported version for Expo 52 is 15.1 but browserstack capabilities do not appear to match up, so we'll up(down?)date this later.

depends_on:
- "build-expo-ipa"
timeout_in_minutes: 50
Expand All @@ -108,15 +135,15 @@ steps:
command:
- --app=build/output.ipa
- --farm=bs
- --device=IOS_14
- --device=IOS_16
- --a11y-locator
- --fail-fast
- --retry=2
- --order=random
test-collector#v1.10.2:
files: "reports/TEST-*.xml"
format: "junit"
branch: "^v51$"
branch: "^v52$"
concurrency: 5
concurrency_group: 'browserstack-app'
concurrency_method: eager
38 changes: 38 additions & 0 deletions examples/expo-52/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

app-example
33 changes: 33 additions & 0 deletions examples/expo-52/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Bugsnag from "@bugsnag/expo";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import Controls from "./components/Controls";
import ErrorView from "./components/ErrorView";

Bugsnag.start();

// Create the error boundary...
const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React);

const onError = (event: any) => {
// callback will only run for errors caught by boundary
}

export default function Index() {
return (
<ErrorBoundary FallbackComponent={ErrorView} onError={onError}>
<View style={styles.screenContainer}>
<Text>Expo example app</Text>
<Controls />
</View>
</ErrorBoundary>
)
}

const styles = StyleSheet.create({
screenContainer: {
flex: 1,
justifyContent: "center",
alignItems: "center"
}
});
File renamed without changes.
17 changes: 17 additions & 0 deletions examples/expo-52/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"expo": {
"name": "expo-example-52",
"slug": "expo-example-52",
"version": "1.0.0",
"newArchEnabled": true,
"platforms": [
"ios",
"android"
],
"extra": {
"bugsnag": {
"apiKey": "API_KEY"
}
}
}
}
File renamed without changes.
34 changes: 34 additions & 0 deletions examples/expo-52/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';

interface Props {
onPress: () => void
title: string
}

const Button: React.FunctionComponent<Props> = ({ onPress, title }) => (
<View style={styles.buttonContainer}>
<TouchableOpacity style={styles.button} onPress={onPress} >
<Text style={styles.text}>{title}</Text>
</TouchableOpacity>
</View>
);

export default Button

const styles = StyleSheet.create({
button: {
backgroundColor: '#003366',
borderRadius: 4,
paddingVertical: 10,
paddingHorizontal: 25,
},
text: {
fontSize: 16,
lineHeight: 21,
letterSpacing: 0.25,
color: 'white',
},
buttonContainer: {
paddingVertical: 10,
}
});
32 changes: 32 additions & 0 deletions examples/expo-52/components/Controls.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Bugsnag from '@bugsnag/expo';
import React from 'react';
import { View } from 'react-native';
import Button from './Button';

function unhandledError() {
throw new Error('Unhandled error!');
}

function handledError() {
Bugsnag.notify(new Error('Handled error!'));
}

const Controls = () => {
const [yeah, setYeah] = React.useState(false);

const triggerRenderError = () => {
setYeah(true)
}

return (
<View>
<Button onPress={handledError} title='Handled error' />
<Button onPress={unhandledError} title='Unhandled error' />
<Button onPress={triggerRenderError} title='Render error' />
{/* @ts-expect-error This will throw an error because the property doesn't exist */}
{yeah ? <span>{yeah.non.existent.property}</span> : null}
</View>
)
}

export default Controls
23 changes: 23 additions & 0 deletions examples/expo-52/components/ErrorView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Button, StyleSheet, Text, View } from 'react-native';

interface Props {
clearError: () => void
}

const ErrorView: React.FunctionComponent<Props> = ({ clearError }) => (
<View style={styles.screenContainer}>
<Text>Inform users of an error in the component tree.
Use clearError to reset ErrorBoundary state and re-render child tree.</Text>
<Button onPress={clearError} title='Reset' />
</View>
);

export default ErrorView

const styles = StyleSheet.create({
screenContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}
});
20 changes: 20 additions & 0 deletions examples/expo-52/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "expo-52",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios"
},
"dependencies": {
"@bugsnag/expo": "^52.0.0",
"expo": "~52.0.11",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-native": "0.76.3"
},
"devDependencies": {
"@babel/core": "^7.19.3"
}
}
15 changes: 15 additions & 0 deletions examples/expo-52/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true,
"paths": {
"@/*": [
"./*"
]
}
},
"include": [
"**/*.ts",
"**/*.tsx"
]
}
17 changes: 0 additions & 17 deletions examples/expo48/.gitignore

This file was deleted.

48 changes: 0 additions & 48 deletions examples/expo48/App.js

This file was deleted.

Loading