fix(core): Exclude additional server-only modules from native bundles#6263
Merged
Merged
Conversation
Expand the Metro resolver's server-only module exclusion regex to cover express, postgresjs, requestdata, consola, and spanStreaming integrations. Also fix the regex terminator to match single-file modules (`.js` suffix). Closes #6262 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
Plus 1 more 🤖 This preview updates automatically when you update the PR. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0f8183c. Configure here.
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5569641+dirty | 406.43 ms | 428.51 ms | 22.08 ms |
| ae37560+dirty | 470.40 ms | 564.12 ms | 93.72 ms |
| 2c735cc+dirty | 414.09 ms | 438.47 ms | 24.38 ms |
| d2eadf8+dirty | 414.64 ms | 454.56 ms | 39.92 ms |
| 7ff4d0f+dirty | 413.81 ms | 450.64 ms | 36.83 ms |
| a0d8cf8+dirty | 411.71 ms | 467.57 ms | 55.87 ms |
| 71abba0+dirty | 496.54 ms | 525.16 ms | 28.63 ms |
| 038a6d7+dirty | 524.82 ms | 531.92 ms | 7.10 ms |
| 0b5120f+dirty | 503.22 ms | 538.60 ms | 35.38 ms |
| 7d6fd3a+dirty | 403.02 ms | 422.56 ms | 19.54 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5569641+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| ae37560+dirty | 48.30 MiB | 53.60 MiB | 5.29 MiB |
| 2c735cc+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
| d2eadf8+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 7ff4d0f+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| a0d8cf8+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 71abba0+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 038a6d7+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| 0b5120f+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 7d6fd3a+dirty | 43.75 MiB | 48.14 MiB | 4.39 MiB |
📲 Install BuildsAndroid
|
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5c1e987+dirty | 1204.30 ms | 1222.15 ms | 17.85 ms |
| 3817909+dirty | 1183.90 ms | 1187.50 ms | 3.60 ms |
| 7d6fd3a+dirty | 1223.29 ms | 1229.57 ms | 6.28 ms |
| 5569641+dirty | 3839.22 ms | 1231.30 ms | -2607.91 ms |
| 0b5120f+dirty | 3838.39 ms | 1232.91 ms | -2605.48 ms |
| 7ac3378+dirty | 1213.37 ms | 1218.15 ms | 4.78 ms |
| 4b87b12+dirty | 1212.90 ms | 1222.09 ms | 9.19 ms |
| 890d145+dirty | 1223.59 ms | 1231.37 ms | 7.78 ms |
| ef27341+dirty | 3856.13 ms | 1231.42 ms | -2624.71 ms |
| ad66da3+dirty | 3820.96 ms | 1214.43 ms | -2606.52 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5c1e987+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 3817909+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 7d6fd3a+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 5569641+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 0b5120f+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 7ac3378+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| 4b87b12+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 890d145+dirty | 3.38 MiB | 4.77 MiB | 1.38 MiB |
| ef27341+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| ad66da3+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5c1e987+dirty | 1208.43 ms | 1220.72 ms | 12.29 ms |
| 3817909+dirty | 1210.76 ms | 1215.64 ms | 4.89 ms |
| 7d6fd3a+dirty | 1210.89 ms | 1217.63 ms | 6.74 ms |
| 5569641+dirty | 3824.35 ms | 1210.78 ms | -2613.57 ms |
| 0b5120f+dirty | 3843.24 ms | 1223.00 ms | -2620.24 ms |
| 7ac3378+dirty | 1202.35 ms | 1198.31 ms | -4.04 ms |
| 4b87b12+dirty | 1199.49 ms | 1199.78 ms | 0.29 ms |
| 890d145+dirty | 1212.98 ms | 1220.10 ms | 7.12 ms |
| ef27341+dirty | 3835.20 ms | 1212.23 ms | -2622.97 ms |
| ad66da3+dirty | 3855.02 ms | 1213.43 ms | -2641.59 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5c1e987+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 3817909+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 7d6fd3a+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 5569641+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 0b5120f+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 7ac3378+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| 4b87b12+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 890d145+dirty | 3.38 MiB | 4.77 MiB | 1.38 MiB |
| ef27341+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| ad66da3+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8929511+dirty | 469.49 ms | 502.65 ms | 33.16 ms |
| a736b76+dirty | 405.78 ms | 458.74 ms | 52.96 ms |
| 5c1e987+dirty | 444.71 ms | 475.13 ms | 30.42 ms |
| 5569641+dirty | 465.92 ms | 532.22 ms | 66.30 ms |
| ae37560+dirty | 428.96 ms | 456.86 ms | 27.90 ms |
| d2eadf8+dirty | 468.02 ms | 530.37 ms | 62.35 ms |
| 7ff4d0f+dirty | 403.38 ms | 427.06 ms | 23.68 ms |
| a0d8cf8+dirty | 533.71 ms | 564.25 ms | 30.54 ms |
| 71abba0+dirty | 411.04 ms | 453.67 ms | 42.63 ms |
| 038a6d7+dirty | 499.02 ms | 527.68 ms | 28.66 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8929511+dirty | 43.94 MiB | 49.02 MiB | 5.08 MiB |
| a736b76+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 5c1e987+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 5569641+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| ae37560+dirty | 48.30 MiB | 53.60 MiB | 5.29 MiB |
| d2eadf8+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 7ff4d0f+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| a0d8cf8+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 71abba0+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 038a6d7+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
Contributor
antonis
commented
Jun 9, 2026
| - Exclude additional server-only modules (`express`, `postgresjs`, `requestdata`, `consola`, `spanStreaming`) from native bundles ([#6263](https://github.com/getsentry/sentry-react-native/pull/6263)) | ||
| - Enable fetch instrumentation when Expo SDK 56's native `expo/fetch` is active ([#6226](https://github.com/getsentry/sentry-react-native/pull/6226)) | ||
|
|
||
| ### Fixes |
Contributor
Author
There was a problem hiding this comment.
Removing the duplicate section from previous merge
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Expands the Metro resolver's
SERVER_ONLY_MODULE_REregex to exclude additional server-only modules from Android/iOS bundles:integrations/expressintegrations/postgresjsintegrations/requestdataintegrations/consolaintegrations/spanStreamingAlso fixes the regex terminator from
(\/|$)to(\/|\.js|$)so it correctly matches single-file modules likepostgresjs.js(not just directory-style paths likemcp-server/).💡 Motivation and Context
Related: #6262
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps