Skip to content

Add support for event information in React scheduler tracks in React Native#647

Closed
everettbu wants to merge 1 commit into
mainfrom
show-event-into-in-react-perf-tracks-in-rn
Closed

Add support for event information in React scheduler tracks in React Native#647
everettbu wants to merge 1 commit into
mainfrom
show-event-into-in-react-perf-tracks-in-rn

Conversation

@everettbu

Copy link
Copy Markdown

Mirror of facebook/react#35947
Original author: rubennorte


Summary

This defines the same fiber configuration for RN as used in DOM, so we can expose event timing information in the React scheduler tracks in performance traces.

This was unblocked by #35913 and #35912.

How did you test this change?

Manually compiled the renderer and tested e2e in FB infra:
Screenshot 2026-03-03 at 10 10 44

@greptile-apps

greptile-apps Bot commented Mar 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR enables event timing information in React scheduler performance tracks for React Native (Fabric renderer), bringing it to parity with the DOM renderer.

  • Implements trackSchedulerEvent(), resolveEventType(), and resolveEventTimeStamp() in ReactFiberConfigFabric.js to read from global.event (the RN equivalent of window.event in DOM)
  • Adds a getEventType() helper with a legacy fallback that extracts event types from dispatchConfig.phasedRegistrationNames for older RN event objects that don't set the type property
  • The non-Fabric renderer (ReactFiberConfigNative.js) is not updated and still uses no-op stubs — this is intentional as the feature targets Fabric only

Confidence Score: 4/5

  • This PR is safe to merge — it mirrors an established DOM pattern with appropriate RN-specific adaptations and includes a well-structured legacy fallback.
  • Score of 4 reflects that the change closely follows the existing DOM implementation pattern, correctly adapts it for React Native (using global.event instead of window.event), and the legacy fallback handles the RN-specific dispatchConfig event format properly. Minor deduction because the legacy fallback path introduces RN-specific complexity that could benefit from more explicit test coverage.
  • No files require special attention.

Important Files Changed

Filename Overview
packages/react-native-renderer/src/ReactFiberConfigFabric.js Implements event tracking for React scheduler tracks in RN Fabric, mirroring the DOM config pattern with global.event instead of window.event and adding a legacy fallback via dispatchConfig.phasedRegistrationNames for older RN event objects.

Last reviewed commit: 627fa8f

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Mar 3, 2026
@everettbu
everettbu deleted the show-event-into-in-react-perf-tracks-in-rn branch March 3, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants