feat(core): Add includeFeedback Metro option to exclude feedback widget from bundle#6025
Merged
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
Contributor
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. |
Contributor
|
antonis
commented
Apr 20, 2026
Contributor
Author
|
@sentry review |
Contributor
Author
|
@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.
alwx
reviewed
Apr 21, 2026
…eExcludeResolver Addresses review feedback: bare `include` is ambiguous in the helper — `includePackage` makes the intent obvious alongside `moduleRegex`.
7 tasks
| - 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)) |
Collaborator
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.
antonis
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Apr 24, 2026
- 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.
3 tasks
antonis
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Apr 30, 2026
…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/)
coolguyzone
pushed a commit
to getsentry/sentry-docs
that referenced
this pull request
May 1, 2026
…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/)
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
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