Skip to content

Commit

Permalink
Merge branch 'v49/next' into plat-8731
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Skinner committed Oct 2, 2023
2 parents 27cc9ea + 502a2d2 commit 67fda16
Show file tree
Hide file tree
Showing 86 changed files with 1,157 additions and 436 deletions.
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ steps:
- --a11y-locator
- --fail-fast
- --retry=2
concurrency: 9
concurrency: 5
concurrency_group: 'browserstack-app'
concurrency_method: eager

Expand All @@ -90,7 +90,7 @@ steps:
- --appium-version=1.21.0
- --retry=2
- --order=random
concurrency: 9
concurrency: 5
concurrency_group: 'browserstack-app'
concurrency_method: eager

Expand All @@ -114,6 +114,6 @@ steps:
- --appium-version=1.17.0
- --retry=2
- --order=random
concurrency: 9
concurrency: 5
concurrency_group: 'browserstack-app'
concurrency_method: eager
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Changelog

## v49.0.1 (2023-08-03)

### Fixed

- Fix a crash in configuration when Constants.expoGoConfig is null [#145](https://github.com/bugsnag/bugsnag-expo/pull/145)

## v49.0.0 (2023-07-13)

This release adds support for expo 49

### Changed

- Replace deprecated Constants.manifest [#141](https://github.com/bugsnag/bugsnag-expo/pull/141)

## v48.1.0 (2023-03-27)

### Added

- (bugsnag-expo-cli) Updated bugsnag-expo-cli to support Typescript [#98](https://github.com/bugsnag/bugsnag-expo/pull/98)
- Read API key and app version from `Constants.expoConfig` [#119](https://github.com/bugsnag/bugsnag-expo/pull/119)

### Fixed

- (plugin-expo-eas-sourcemaps) Reinstate API key in Android manifest [#117](https://github.com/bugsnag/bugsnag-expo/pull/117)
- (plugin-expo-eas-sourcemaps) Support dynamic configuration files in EAS Build lifecycle hook [#117](https://github.com/bugsnag/bugsnag-expo/pull/117)

## v48.0.0 (2023-03-07)

This release adds support for expo 48

### Fixed

- (bugsnag-expo-cli) CLI tool now installs a sourcemap plugin version that matches the Expo SDK version [#111](https://github.com/bugsnag/bugsnag-expo/pull/111)
- (plugin-expo-eas-sourcemaps) Use EAS Build lifecycle hook for Android source map uploads [#112](https://github.com/bugsnag/bugsnag-expo/pull/112)

## v47.1.1 (2023-03-02)

### Fixed

- (plugin-expo-eas-sourcemaps) Restrict Bugsnag Android Gradle Plugin dependency to v7 [#104](https://github.com/bugsnag/bugsnag-expo/pull/104)

## v47.1.0 (2023-01-09)

### Fixed
Expand Down
17 changes: 17 additions & 0 deletions examples/expo48/.gitignore
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*
48 changes: 48 additions & 0 deletions examples/expo48/App.js
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,
},
});
13 changes: 13 additions & 0 deletions examples/expo48/README.md
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
```
43 changes: 43 additions & 0 deletions examples/expo48/app.json
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": {}
}
]
}
}
}
Binary file added examples/expo48/assets/adaptive-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/expo48/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/expo48/assets/favicon2-96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/expo48/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/expo48/assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions examples/expo48/babel.config.js
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'],
};
};
62 changes: 62 additions & 0 deletions examples/expo48/components/BadButtons.js
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,
},
});
28 changes: 28 additions & 0 deletions examples/expo48/package.json
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
}
2 changes: 1 addition & 1 deletion features/fixtures/test-app/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": ["./config-plugins/withRemoveiOSNotificationEntitlement"],
"plugins": ["./config-plugins/withRemoveiOSNotificationEntitlement", "./config-plugins/withAddClearTextTrafficAndroid"],
"extra": {
"eas": {
"projectId": "EXPO_EAS_PROJECT_ID"
Expand Down
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
3 changes: 3 additions & 0 deletions features/fixtures/test-app/eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"credentialsSource": "local",
"android": {
"buildType": "apk"
},
"ios": {
"enterpriseProvisioning": "universal"
}
}
},
Expand Down
27 changes: 12 additions & 15 deletions features/fixtures/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,20 @@
"web": "expo start --web"
},
"dependencies": {
"@react-native-community/netinfo": "9.3.5",
"expo": "~47.0.3",
"expo-application": "~5.0.1",
"expo-constants": "~14.0.2",
"expo-crypto": "~12.0.0",
"expo-device": "~5.0.0",
"expo-file-system": "~15.1.1",
"expo-screen-orientation": "~5.0.1",
"expo-status-bar": "~1.4.2",
"react": "18.1.0",
"react-native": "0.70.5"
},
"resolutions": {
"expo-modules-core": "1.0.4"
"@react-native-community/netinfo": "9.3.10",
"expo": "^49.0.0",
"expo-application": "~5.3.0",
"expo-constants": "~14.4.2",
"expo-crypto": "~12.4.1",
"expo-device": "~5.4.0",
"expo-file-system": "~15.4.2",
"expo-screen-orientation": "~6.0.2",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.3"
},
"devDependencies": {
"@babel/core": "^7.19.3"
"@babel/core": "^7.20.0"
},
"private": true
}
2 changes: 1 addition & 1 deletion features/fixtures/test-app/run-bugsnag-expo-cli-install
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set timeout -1
# add-hook
spawn npx bugsnag-expo-cli upload-sourcemaps

expect "Do you want to automatically upload source maps to Bugsnag? (this will modify your app.json)"
expect "Do you want to automatically upload source maps to Bugsnag? (this will modify your app.json and package.json)"
send -- "\r"

expect eof
Expand Down
2 changes: 1 addition & 1 deletion features/scripts/build-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ yarn import

./run-bugsnag-expo-cli-install

cp $EXPO_CREDENTIALS_DIR/* .
cp $EXPO_UNIVERSAL_CREDENTIALS_DIR/* .

echo "Common setup complete"
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "47.1.0"
"version": "49.0.1"
}
Loading

0 comments on commit 67fda16

Please sign in to comment.