Skip to content

feat(react-native): Document includeWebReplay and includeFeedback Metro options#17423

Merged
antonis merged 4 commits intomasterfrom
antonis/rn-metro-include-feedback-docs
Apr 30, 2026
Merged

feat(react-native): Document includeWebReplay and includeFeedback Metro options#17423
antonis merged 4 commits intomasterfrom
antonis/rn-metro-include-feedback-docs

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Apr 21, 2026

DESCRIBE YOUR PR

Adds a new "Reduce Bundle Size" section to the React Native 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:

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:
  • 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
  • SDK version for `includeFeedback` confirmed in the Alert callout

EXTRA RESOURCES

…ro options

Adds a "Reduce Bundle Size" section to the React Native Metro page
describing how to exclude the web Session Replay and User Feedback
packages from the bundle for users who don't need them.

includeFeedback is new in the upcoming Sentry React Native SDK release
(getsentry/sentry-react-native#6025). includeWebReplay has existed for
a while but was previously undocumented.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Apr 24, 2026 9:16am
sentry-docs Ready Ready Preview, Comment Apr 24, 2026 9:16am

Request Review

@codeowner-assignment codeowner-assignment Bot requested a review from a team April 21, 2026 12:32
Comment thread docs/platforms/react-native/manual-setup/metro.mdx Outdated
| Option | Default | Effect when set to `false` |
| ------------------ | ------- | ------------------------------------------------------------------------ |
| `includeWebReplay` | `true` | Excludes `@sentry/replay` and `@sentry-internal/replay` from the bundle. |
| `includeFeedback` | `true` | Excludes `@sentry-internal/feedback` from the bundle. |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may change includeFeedback to includeWebReplay if getsentry/sentry-react-native#6025 (comment) is accepted

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with 48d2236


### Reduce Bundle Size

If you're not using the Session Replay or User Feedback features, you can exclude their web-only packages from the bundle by opting out via the Metro Plugin options. When set to `false`, the Sentry Metro Plugin resolves the matching Sentry sub-packages to an empty module so they're not included in the output bundle.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we simplify this mentioning if users aren't targeting React Native for web, here is an idea:

Suggested change
If you're not using the Session Replay or User Feedback features, you can exclude their web-only packages from the bundle by opting out via the Metro Plugin options. When set to `false`, the Sentry Metro Plugin resolves the matching Sentry sub-packages to an empty module so they're not included in the output bundle.
If you're not using the React Native for Web, you can exclude their web-only packages like session replay and user feedback from the bundle by opting out via the Metro Plugin options. When set to false, the Sentry Metro Plugin resolves the matching Sentry sub-packages to an empty module so they're not included in the output bundle.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with 48d2236

antonis and others added 2 commits April 24, 2026 11:01
- 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.
@antonis antonis requested a review from lucas-zimerman April 24, 2026 09:23
@antonis antonis merged commit 5b00145 into master Apr 30, 2026
19 checks passed
@antonis antonis deleted the antonis/rn-metro-include-feedback-docs branch April 30, 2026 12:59
coolguyzone pushed a commit 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/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Metro config flag (similar to includeWebReplay) to remove @sentry-internal/feedback from the bundle

3 participants