-
-
Notifications
You must be signed in to change notification settings - Fork 344
feat: Automatically load sentry.options.json
file
#4476
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
feat: Automatically load sentry.options.json
file
#4476
Conversation
…to kw-add-read-ios-options-file
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Automatically load `sentry.options.json` file ([#4476](https://github.com/getsentry/sentry-react-native/pull/4476)) If none of the above apply, you can opt out of this check by adding |
Android (legacy) Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
208f4af | 439.23 ms | 427.31 ms | -11.92 ms |
b75148e | 440.04 ms | 421.36 ms | -18.68 ms |
555070f | 438.67 ms | 428.30 ms | -10.37 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
208f4af | 17.75 MiB | 20.11 MiB | 2.37 MiB |
b75148e | 17.75 MiB | 20.11 MiB | 2.37 MiB |
555070f | 17.75 MiB | 20.11 MiB | 2.37 MiB |
Android (new) Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
b75148e+dirty | 428.91 ms | 461.26 ms | 32.35 ms |
208f4af+dirty | 346.93 ms | 402.77 ms | 55.84 ms |
555070f+dirty | 388.25 ms | 424.44 ms | 36.19 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
b75148e+dirty | 7.15 MiB | 8.38 MiB | 1.23 MiB |
208f4af+dirty | 7.15 MiB | 8.38 MiB | 1.23 MiB |
555070f+dirty | 7.15 MiB | 8.38 MiB | 1.23 MiB |
Previous results on branch: kw-add-options-file-init-to-js
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
7af80d6+dirty | 376.06 ms | 403.21 ms | 27.14 ms |
3d551aa+dirty | 398.75 ms | 439.94 ms | 41.19 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
7af80d6+dirty | 7.15 MiB | 8.38 MiB | 1.23 MiB |
3d551aa+dirty | 7.15 MiB | 8.38 MiB | 1.23 MiB |
iOS (legacy) Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
208f4af+dirty | 1209.44 ms | 1217.13 ms | 7.70 ms |
b75148e+dirty | 1221.53 ms | 1220.85 ms | -0.68 ms |
555070f+dirty | 1213.59 ms | 1217.79 ms | 4.20 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
208f4af+dirty | 2.63 MiB | 3.69 MiB | 1.05 MiB |
b75148e+dirty | 2.63 MiB | 3.69 MiB | 1.06 MiB |
555070f+dirty | 2.63 MiB | 3.69 MiB | 1.05 MiB |
Previous results on branch: kw-add-options-file-init-to-js
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
3d551aa+dirty | 1215.78 ms | 1221.58 ms | 5.81 ms |
7af80d6+dirty | 1219.13 ms | 1214.67 ms | -4.46 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
3d551aa+dirty | 2.63 MiB | 3.69 MiB | 1.05 MiB |
7af80d6+dirty | 2.63 MiB | 3.69 MiB | 1.05 MiB |
iOS (new) Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
208f4af+dirty | 1213.08 ms | 1223.82 ms | 10.73 ms |
b75148e+dirty | 1202.72 ms | 1212.04 ms | 9.32 ms |
555070f+dirty | 1223.61 ms | 1227.57 ms | 3.96 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
208f4af+dirty | 3.19 MiB | 4.25 MiB | 1.06 MiB |
b75148e+dirty | 3.19 MiB | 4.25 MiB | 1.07 MiB |
555070f+dirty | 3.19 MiB | 4.25 MiB | 1.06 MiB |
Previous results on branch: kw-add-options-file-init-to-js
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
3d551aa+dirty | 1219.31 ms | 1221.22 ms | 1.92 ms |
7af80d6+dirty | 1236.92 ms | 1230.04 ms | -6.88 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
3d551aa+dirty | 3.19 MiB | 4.25 MiB | 1.07 MiB |
7af80d6+dirty | 3.19 MiB | 4.25 MiB | 1.07 MiB |
…w-add-read-ios-options-file
…to kw-add-read-ios-options-file
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.
LGTM and worked as expected 🚀
Thank you for the added tests 🙇
l: should we add a changelog for this similar to the native side?
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.
LGTM!
But like @antonis mentioned, we should mention it on changelog since it is a new feature.
22a5f81
into
capture-app-start-errors
📢 Type of change
📜 Description
This PR adds
optionsFile
options to the Sentry Metro Plugin. This enabled the plugin to automatically load the options from the specified file to the created React Native Bundle.The plugin uses the
customSerializer
Metro interface to add apreModule
to the entry bundle of the application. This works for both RN and Expo project including Expo Web.I have not tested standalone React Native Web. Thus at the moment only Expo Web is supported.
Example usage
The
optionsFile
is enabled by default and loaded only if the file exists. Both relative path to the project root and absolute paths are allowed.The file specified in the metro config applies only to the JS code. To change the file path for Android and iOS native initialization build options of the respective platforms need to be used.
💡 Motivation and Context
💚 How did you test it?
sample apps, unit tests
📝 Checklist
sendDefaultPII
is enabled