Uh oh!
There was an error while loading. Please reload this page.
feat(core): Add includeFeedback Metro option to exclude feedback widget from bundle - #6025
Conversation
…et from bundle Mirrors the existing `includeWebReplay` option. When set to `false`, `@sentry-internal/feedback` (and related subpackages) are resolved to an empty module, removing the web user-feedback widget from the bundle. Refactored the shared resolver logic into `buildSentryPackageExcludeResolver` so `withSentryResolver` and the new `withSentryFeedbackResolver` both call into it instead of duplicating the resolver body. Closes#5629
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
|
Uh oh!
There was an error while loading. Please reload this page.
antonis
commented
Apr 20, 2026
@sentry review |
antonis
commented
Apr 20, 2026
@cursor review |
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 d82da05. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
…eExcludeResolver Addresses review feedback: bare `include` is ambiguous in the helper — `includePackage` makes the intent obvious alongside `moduleRegex`.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| - Expose scope-level attributes API (`setAttribute`, `setAttributes`, `removeAttribute`) bridging to native SDKs ([#6009](https://github.com/getsentry/sentry-react-native/pull/6009)) | ||
| - Expose screenshot masking options (`screenshot.maskAllText`, `screenshot.maskAllImages`, `screenshot.maskedViewClasses`, `screenshot.unmaskedViewClasses`) for error screenshots ([#6007](https://github.com/getsentry/sentry-react-native/pull/6007)) | ||
| - Warn Expo users at Metro startup when prebuilt native projects are missing Sentry configuration ([#5984](https://github.com/getsentry/sentry-react-native/pull/5984)) | ||
| - Add `includeFeedback` Metro config option to exclude `@sentry-internal/feedback` from the bundle ([#6025](https://github.com/getsentry/sentry-react-native/pull/6025)) |
There was a problem hiding this comment.
since a release was done on main branch, this changelog may be out of sync
Addresses review feedback from @lucas-zimerman: mirror the `includeWebReplay` naming to make it obvious the option only affects the web feedback package, not the native feedback integration. Also moves the changelog entry from 8.9.1 (where it landed during the merge with main) to Unreleased since this change hasn't shipped yet.
- Rename `includeFeedback` to `includeWebFeedback` (mirrors the SDK rename in getsentry/sentry-react-native#6025 after @lucas-zimerman's feedback). - Reword the intro to frame the bundle-size options around "not targeting React Native for Web", per @lucas-zimerman's suggestion.
Uh oh!
There was an error while loading. Please reload this page.
…ro options (#17423) ## DESCRIBE YOUR PR Adds a new \"Reduce Bundle Size\" section to the [React Native Metro](https://docs.sentry.io/platforms/react-native/manual-setup/metro/) page describing how to exclude the web Session Replay and User Feedback packages from the bundle for users who don't need them. Covers two Metro Plugin options: - \`includeWebReplay\` — already exists in the SDK but was previously undocumented. - \`includeFeedback\` — new in an upcoming Sentry React Native SDK release, added in [getsentry/sentry-react-native#6025](getsentry/sentry-react-native#6025) (closes [getsentry/sentry-react-native#5629](getsentry/sentry-react-native#5629)). > Note: there's a \`TODO\` in the doc pinning the exact SDK version for \`includeFeedback\` — will update before merge once the SDK release is cut. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [x] None: Not urgent, can wait up to 1 week+⚠️ Should be merged after getsentry/sentry-react-native#6025 is shipped ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) - [ ] SDK version for \`includeFeedback\` confirmed in the Alert callout ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
…ro options (#17423) ## DESCRIBE YOUR PR Adds a new \"Reduce Bundle Size\" section to the [React Native Metro](https://docs.sentry.io/platforms/react-native/manual-setup/metro/) page describing how to exclude the web Session Replay and User Feedback packages from the bundle for users who don't need them. Covers two Metro Plugin options: - \`includeWebReplay\` — already exists in the SDK but was previously undocumented. - \`includeFeedback\` — new in an upcoming Sentry React Native SDK release, added in [getsentry/sentry-react-native#6025](getsentry/sentry-react-native#6025) (closes [getsentry/sentry-react-native#5629](getsentry/sentry-react-native#5629)). > Note: there's a \`TODO\` in the doc pinning the exact SDK version for \`includeFeedback\` — will update before merge once the SDK release is cut. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [x] None: Not urgent, can wait up to 1 week+⚠️ Should be merged after getsentry/sentry-react-native#6025 is shipped ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) - [ ] SDK version for \`includeFeedback\` confirmed in the Alert callout ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
…ro options (#17423) ## DESCRIBE YOUR PR Adds a new \"Reduce Bundle Size\" section to the [React Native Metro](https://docs.sentry.io/platforms/react-native/manual-setup/metro/) page describing how to exclude the web Session Replay and User Feedback packages from the bundle for users who don't need them. Covers two Metro Plugin options: - \`includeWebReplay\` — already exists in the SDK but was previously undocumented. - \`includeFeedback\` — new in an upcoming Sentry React Native SDK release, added in [getsentry/sentry-react-native#6025](getsentry/sentry-react-native#6025) (closes [getsentry/sentry-react-native#5629](getsentry/sentry-react-native#5629)). > Note: there's a \`TODO\` in the doc pinning the exact SDK version for \`includeFeedback\` — will update before merge once the SDK release is cut. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [x] None: Not urgent, can wait up to 1 week+⚠️ Should be merged after getsentry/sentry-react-native#6025 is shipped ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) - [ ] SDK version for \`includeFeedback\` confirmed in the Alert callout ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
📢 Type of change
📜 Description
Adds an
includeFeedbackoption toSentryMetroConfigOptions(used by bothwithSentryConfigandgetSentryExpoConfig). When set tofalse, a Metro resolver returns{ type: 'empty' }for any module matching@sentry(?:-internal)?/feedback, removing the web user-feedback widget from the bundle.Example:
Also factored the shared resolver logic into
buildSentryPackageExcludeResolver, sowithSentryResolver(replay) and the newwithSentryFeedbackResolverno longer duplicate the resolver body.💡 Motivation and Context
Users who do not use the feedback feature are still paying for
@sentry-internal/feedbackin their bundle (see the expo-atlas screenshot in the linked issue). The existingincludeWebReplayoption solves the same problem for replay; this PR mirrors that pattern for feedback.Closes#5629
💚 How did you test it?
packages/core/test/tools/metroconfig.test.tsfor the newwithSentryFeedbackResolver, covering:includeFeedbacktrue/false/undefined acrossweb/android/ios/nullplatforms@sentry-internal/feedbackand@sentry/feedbackmodule namesprocess.exit(-1)yarn test:tools— 254 passedyarn test(full suite) — passingyarn lint— passingyarn circularDepCheck— passingyarn build— passing📝 Checklist
sendDefaultPIIis enabled🔮 Next steps