-
-
Notifications
You must be signed in to change notification settings - Fork 344
add Expo config plugin #3391
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
add Expo config plugin #3391
Conversation
@kbrandwijk Thank you, this is a good start. There are a few minor things we'll need to adjust. I've changed the target to I would also like to add a simple Expo app to test a build with the plugin in CI. But we can do that in another PR. |
We can move the test to We keep all tests in |
@kbrandwijk So with this PR the configuration of the plugin would look like this:
const { withSentry } = require('@sentry/react-native/plugin/build/withSentry');
const config = {
name: 'my app',
};
module.exports = withSentry(config, {
url: 'https://example.sentry.url/',
authToken: 'example-token',
project: 'project-slug',
organization: 'org-slug',
}); OR in JSON {
"name": "my app",
"plugins": [
[
"@sentry/react-native/plugin/build/withSentry",
{
"url": "https://example.sentry.url/",
"authToken": "example-token",
"project": "project-slug",
"organization": "org-slug"
}
]
]
} |
To keep the PR small and easy to understand I created some follow-up tasks. |
Correct |
Thank you for the PR feedback. After applying the lint suggestion, I addressed most of the issues, but was left with a few nasty ones that probably require a bit more work to fix (around the xcode types for example). I disabled those for now, I suggest we circle back to these in a follow up ticket. |
@kbrandwijk Sounds good. Thank you. |
Actually, for end user purposes, it would just be: {
"name": "my app",
"plugins": [
[
"@sentry/react-native",
{
"url": "https://example.sentry.url/",
"authToken": "example-token",
"project": "project-slug",
"organization": "org-slug"
}
]
]
} |
Thank you. Looks good. 👍 |
cfg = withSentryAndroid(cfg, sentryProperties); | ||
} catch (e) { | ||
WarningAggregator.addWarningAndroid( | ||
'sentry-expo', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like we left some sentry-expo references in here, should update to this lib name
if (!buildGradle.match(pattern)) { | ||
WarningAggregator.addWarningAndroid( | ||
'sentry-expo', | ||
'Could not find react.gradle script in android/app/build.gradle. Please open a bug report at https://github.com/expo/sentry-expo.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should replace this url with https://github.com/getsentry/sentry-react-native
Any update on when this release will be stable? We are setting up Sentry for our app that uses Expo 49 and I am having issues with source maps when using Expo's sentry library. If this alpha is almost ready then we might just wait to use this instead. |
@objectiveSee We are planning two releases before the stable, which should come in the upcoming weeks. |
📢 Type of change
📜 Description
This PR adds the Expo config plugin that used to be part of the
sentry-expo
package.The plugin implementation is identical, except for moving the configuration properties over from the (deprecated)
postPublish
configuration in app.json to config plugin properties that is the default for config plugins.💡 Motivation and Context
Closes #3263
For more details, see the linked issue and the parent issue.
💚 How did you test it?
Tested by building and testing the config plugin locally, and adding it to a local Expo test project to see if the config plugin was applied successfully.
📝 Checklist
sendDefaultPII
is enabled🔮 Next steps