-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v49/next' into plat-8731
- Loading branch information
Showing
86 changed files
with
1,157 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
node_modules/ | ||
.expo/ | ||
dist/ | ||
npm-debug.* | ||
*.jks | ||
*.p8 | ||
*.p12 | ||
*.key | ||
*.mobileprovision | ||
*.orig.* | ||
web-build/ | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# Temporary files created by Metro to check the health of the file watcher | ||
.metro-health-check* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import Bugsnag from '@bugsnag/expo'; | ||
import React from 'react'; | ||
import BadButtons from './components/BadButtons'; | ||
import { StatusBar } from 'expo-status-bar'; | ||
import { StyleSheet, Text, View, Button, Image } from 'react-native'; | ||
|
||
const PlaceholderImage = require('./assets/favicon2-96.png'); | ||
|
||
Bugsnag.start(); | ||
|
||
const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React) | ||
|
||
const onError = (event) => { | ||
// callback will only run for errors caught by boundary | ||
} | ||
|
||
const ErrorView = ({ 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> | ||
|
||
const App = () => { | ||
return ( | ||
<View style={styles.screenContainer}> | ||
<Image source={PlaceholderImage}/> | ||
<Text style={styles.textContainer}>EXPO EXAMPLE APP</Text> | ||
<BadButtons /> | ||
</View> | ||
) | ||
}; | ||
|
||
export default () => | ||
<ErrorBoundary FallbackComponent={ErrorView} onError={onError}> | ||
<App /> | ||
</ErrorBoundary> | ||
|
||
|
||
const styles = StyleSheet.create({ | ||
screenContainer: { | ||
alignItems: "center", | ||
padding: 40, | ||
}, | ||
textContainer: { | ||
paddingVertical: 20, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Expo | ||
|
||
This is an example project showing how to use `@bugsnag/expo`. | ||
|
||
## Usage | ||
|
||
Clone the repo and `cd` into the directory of this example. | ||
|
||
Replace API_KEY with your own API key in the app.json file. | ||
|
||
``` | ||
npx expo start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"expo": { | ||
"name": "expo48", | ||
"slug": "expo48", | ||
"version": "1.0.0", | ||
"orientation": "portrait", | ||
"icon": "./assets/icon.png", | ||
"userInterfaceStyle": "light", | ||
"splash": { | ||
"image": "./assets/splash.png", | ||
"resizeMode": "contain", | ||
"backgroundColor": "#ffffff" | ||
}, | ||
"assetBundlePatterns": [ | ||
"**/*" | ||
], | ||
"ios": { | ||
"supportsTablet": true | ||
}, | ||
"android": { | ||
"adaptiveIcon": { | ||
"foregroundImage": "./assets/adaptive-icon.png", | ||
"backgroundColor": "#ffffff" | ||
} | ||
}, | ||
"web": { | ||
"favicon": "./assets/favicon.png" | ||
}, | ||
"extra": { | ||
"bugsnag": { | ||
"apiKey": "API_KEY" | ||
} | ||
}, | ||
"hooks": { | ||
"postPublish": [ | ||
{ | ||
"file": "@bugsnag/expo/hooks/post-publish.js", | ||
"config": {} | ||
} | ||
] | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = function(api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo'], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import Bugsnag from '@bugsnag/expo'; | ||
import React from 'react'; | ||
import { StatusBar } from 'expo-status-bar'; | ||
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'; | ||
|
||
class BadButtons extends React.Component { | ||
constructor (props) { | ||
super(props) | ||
this.state = { yeah: false } | ||
} | ||
|
||
triggerRenderError = () => { | ||
this.setState({ yeah: true }) | ||
} | ||
|
||
render() { | ||
return ( | ||
<View> | ||
<AppButton onPress={handledError} title="Handled error"/> | ||
<AppButton onPress={unhandledError} title="Unhandled error"/> | ||
<AppButton onPress={this.triggerRenderError} title="Render error"/> | ||
{this.state.yeah ? <span>{ this.state.yeah.non.existent.property }</span> : null} | ||
<StatusBar style="auto" /> | ||
</View> | ||
); | ||
} | ||
} | ||
export default BadButtons | ||
|
||
function unhandledError() { | ||
throw new Error('Unhandled error!') | ||
} | ||
|
||
function handledError() { | ||
Bugsnag.notify(new Error('Handled error!')) | ||
} | ||
|
||
const AppButton = ({ onPress, title }) => ( | ||
<View style={styles.buttonContainer}> | ||
<TouchableOpacity style={styles.button} onPress={onPress} > | ||
<Text style={styles.text}>{title}</Text> | ||
</TouchableOpacity> | ||
</View> | ||
); | ||
|
||
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, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "expo48", | ||
"version": "1.0.0", | ||
"main": "node_modules/expo/AppEntry.js", | ||
"scripts": { | ||
"start": "expo start", | ||
"android": "expo start --android", | ||
"ios": "expo start --ios", | ||
"web": "expo start --web" | ||
}, | ||
"dependencies": { | ||
"expo": "~48.0.6", | ||
"expo-status-bar": "~1.4.4", | ||
"react": "18.2.0", | ||
"react-native": "0.71.3", | ||
"@bugsnag/expo": "^48.0.0", | ||
"@react-native-community/netinfo": "9.3.7", | ||
"expo-application": "~5.1.1", | ||
"expo-constants": "~14.2.1", | ||
"expo-crypto": "~12.2.1", | ||
"expo-device": "~5.2.1", | ||
"expo-file-system": "~15.2.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.20.0" | ||
}, | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
features/fixtures/test-app/config-plugins/withAddClearTextTrafficAndroid.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { AndroidConfig, withAndroidManifest } = require('@expo/config-plugins') | ||
const { getMainApplicationOrThrow } = AndroidConfig.Manifest | ||
|
||
const withAddClearTextTrafficAndroid = config => { | ||
config = withAndroidManifest(config, config => { | ||
config.modResults = setUsesCleartextTraffic(config, config.modResults) | ||
return config | ||
}) | ||
|
||
return config | ||
} | ||
|
||
function setUsesCleartextTraffic(config, androidManifest) { | ||
const mainApplication = getMainApplicationOrThrow(androidManifest); | ||
mainApplication.$['android:usesCleartextTraffic'] = 'true' | ||
return androidManifest; | ||
} | ||
|
||
module.exports = withAddClearTextTrafficAndroid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "47.1.0" | ||
"version": "49.0.1" | ||
} |
Oops, something went wrong.