feat(core): Add includeFeedback Metro option to exclude feedback widget from bundle#6025
Open
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.
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
includeFeedbackoption alongsideincludeWebReplay.