Skip to content

feat: add custom event handlers for HMRClient#1595

Open
tjzel wants to merge 1 commit intofacebook:mainfrom
tjzel:@tjzel/expose-HMRClient
Open

feat: add custom event handlers for HMRClient#1595
tjzel wants to merge 1 commit intofacebook:mainfrom
tjzel:@tjzel/expose-HMRClient

Conversation

@tjzel
Copy link

@tjzel tjzel commented Oct 8, 2025

Summary

Currently there's no API in JavaScript to listen to HMRClient updates. This is problematic if a library wants to replace modules used on JavaScript runtime different than the one created by React Native.

This PR adds a global array of event handlers, HMRClientOnUpdate, which is available very early and which every library can access to obtain HMR updates.

Changelog: [Feature] add custom event handlers for HMRClient

Test plan

I don't know how you'd test this change in the repo. I applied these changes in Reanimated monorepo and everything worked well.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 8, 2025
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants