Skip to content
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

fix: make it possible to add multiple mountingOverrideDelegates #44927

Conversation

WoLewicki
Copy link
Contributor

Summary:

PR changing the single mountingOverrideDelegate to a vector of those, so other listeners can operate on the transaction. Used by react-native-screens in software-mansion/react-native-screens#2134 and react-native-reanimated in software-mansion/react-native-reanimated#6055.

Till now, only one listener could be added there, meaning that e.g. Layout Animations from react-native, Layout Animations from react-native-reanimated and listening for Screen removal in react-native-screens could not operate at the same time.

Changelog:

[GENERAL] [FIXED] - Add option for multiple mountingOverrideDelegates

Test Plan:

The code of LayoutAnimations inside react-native should work the same since it will add just one listener then. For other cases, different libraries can read/mutate transactions.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Software Mansion Partner: Software Mansion Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jun 13, 2024
@WoLewicki
Copy link
Contributor Author

I am aware that the name of the method should be probably changed from setMountingOverrideDelegate to addMountingOverrideDelegate but this way we keep the compatibility between versions.

@analysis-bot
Copy link

analysis-bot commented Jun 13, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 20,365,514 +993
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 23,569,569 -62
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 8b53d41
Branch: main

@@ -203,7 +206,7 @@ ShadowTreeRevision MountingCoordinator::getBaseRevision() const {
void MountingCoordinator::setMountingOverrideDelegate(
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be renamed to 'addMountingOverrideDelegate'?

@facebook-github-bot
Copy link
Contributor

@sammy-SC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@sammy-SC
Copy link
Contributor

looks good. I'm importing the diff. If you manage to do the rename, that's great. Otherwise, it can be done in subsequent diff.

Thank you

@WoLewicki
Copy link
Contributor Author

As mentioned in #44927 (comment), not changing the name would make it work for different RN versions, but since we don't care too much about it on new arch right now, I'll change it 😅

@WoLewicki
Copy link
Contributor Author

@sammy-SC changed from set to add.

@facebook-github-bot
Copy link
Contributor

@sammy-SC merged this pull request in 358fe46.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 14, 2024
Copy link

This pull request was successfully merged by @WoLewicki in 358fe46.

When will my fix make it into a release? | How to file a pick request?

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. Merged This PR has been merged. p: Software Mansion Partner: Software Mansion Partner 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.

5 participants