Repository navigation
Conversation
RNSentryPackage now implements ViewManagerOnDemandReactPackage. With the New Architecture, React Native builds the view configs of every eager package's view managers when JS first reads UIManager, on the JS thread before the first screen renders. On-demand packages only report their names, and React Native creates a view manager and builds its config the first time JS uses it. Apps that never render RNSentryOnDrawReporter, RNSentryReplayMask or RNSentryReplayUnmask no longer pay for their configs at startup. The gain needs React Native 0.89+, which keeps lazy view manager getters lazy (react/react-native@da7c29f). Older versions still create the managers through the same path. createViewManagers stays unchanged for setups that load view managers eagerly, such as the old architecture without lazy view managers. getViewManagerNames returns List<String> so it compiles against both the Java (List/Collection) and Kotlin versions of the interface.
Replace the PR_NUMBER placeholder with #7049 now that the PR exists.
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
alwx
marked this pull request as ready for review
November 17, 2026 13:16
antonis
reviewed
Nov 18, 2026
antonis
left a comment
Contributor
There was a problem hiding this comment.
LGTM once the tests are 🟢
Tested with the following configurations:
| RN version | Arch | Setup | main |
This PR |
|---|---|---|---|---|
| 0.89.0-rc.1 | New | Default | All 3 created at startup | ✅ Created on first render |
| 0.88.1 | New | Default | All 3 created at startup | ⚪ No gain (needs react-native#58097, in 0.89), no regressions |
| 0.73.11 | Old | lazyViewManagersEnabled |
❌ Views missing; TTD/Mask do nothing | ✅ Created on demand (fixed) |
| 0.71.19 | Old | Default | Eager createViewManagers |
✅ Unchanged |
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
RNSentryPackagenow implementsViewManagerOnDemandReactPackage. React Native gets only the names of the three Sentry view managers at startup. It creates a manager and builds its view config the first time JS uses it.createViewManagersdoes not change.💡 Motivation and Context
Closes #7032. With the New Architecture on Android, React Native builds the view configs of all eager packages on the JS thread before the first screen renders. Apps that never render the time-to-display or replay mask views pay this cost too. The gain needs React Native 0.89+, which includes react/react-native@da7c29f.
💚 How did you test it?
I added unit tests for
getViewManagerNamesandcreateViewManagerinRNSentryAndroidTester. I ran a release build of the RN sample (RN 0.88.1, New Architecture) on an Android 16 emulator. React Native created the three Sentry managers throughcreateViewManagerand did not callcreateViewManagers.📝 Checklist
sendDefaultPIIis enabled.