-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for turbomodule eventemitters, and codegen #13555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Contributor
vmoroz
reviewed
Aug 12, 2024
vmoroz
reviewed
Aug 12, 2024
vmoroz
reviewed
Aug 12, 2024
vmoroz
reviewed
Aug 12, 2024
vmoroz
approved these changes
Aug 12, 2024
marlenecota
approved these changes
Aug 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: Turbo Modules
New Architecture
Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric
Parity: React Native
RNW does not look or behave like upstream RN platforms
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.
Description
In a recent integration RN core added support for module specs to have
EventEmitters. This modifies our REACT_EVENT macro to use the new EventEmitters. These new EventEmitters work slightly differently than our previous REACT_EVENT macro, and only work on TurboModules. To avoid making the new behavior a breaking change, we will only use the new behavior when the module uses a new REACT_TURBO_MODULE macro instead of REACT_MODULE. This allows us to also modify the behavior of AddAttributedModules to always register those modules as TurboModules rather than NativeModules. Which provides a more incremental way of adopting TurboModules than the previous change of a bool param on AddAttributedModules which made all the attributed modules TurboModules.I also updated the codegen to generate new native spec files that will verify that you have a REACT_EVENT for every EventEmitter decalred in the JS spec file. The current implementation does not verify the arguments to the function aligns with the JS spec. That can be added in a subsequent change.
Type of Change
Why
What is the motivation for this change? Add a few sentences describing the context and overall goals of the pull request's commits.
Resolves #13532
What
What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.
Screenshots
Add any relevant screen captures here from before or after your changes.
Testing
Uncommented the code that runs this in RNTester and verified that the events fire correctly.
Changelog
Yes
Microsoft Reviewers: Open in CodeFlow