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

Remove REAInitializerRCTFabricSurface #6837

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

piaskowyk
Copy link
Member

Summary

This PR cleans up the Reanimated initialization process for iOS on Fabric. The primary motivation for these changes is to remove REAInitializerRCTFabricSurface, which was used as a workaround to access the surface presenter on the new architecture in bridge-full mode.

⚠️ Please note that this PR drops support for bridge-full mode on the new architecture.

Test plan

I need to wait until the reload issue is fixed on the main branch 😞

@tomekzaw
Copy link
Member

Finally! 😮

}

- (void)attachReactEventListener
- (void)attachReactEventListener:(std::shared_ptr<ReanimatedModuleProxy>)reanimatedModuleProxy
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- (void)attachReactEventListener:(std::shared_ptr<ReanimatedModuleProxy>)reanimatedModuleProxy
- (void)attachReactEventListener:(const std::shared_ptr<ReanimatedModuleProxy> &)reanimatedModuleProxy

Copy link
Member Author

Choose a reason for hiding this comment

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

Here, I can't pass a reference to a pointer because attachReactEventListener is called with a local pointer. If I pass a reference to smart pointer here and use that reference asynchronously in a block, the pointer will already be destroyed :/

[scheduler addEventListener:eventListener];
}
auto eventListener =
std::make_shared<facebook::react::EventListener>([reanimatedModuleProxy](const RawEvent &rawEvent) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should pass reanimatedModuleProxy as std::weak_ptr?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think using a shared pointer should be fine, but just to be safe, we could use a weak_ptr instead 🫡

Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

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

Why are all those other changes done here, are they strictly connected to REAInitializerRCTFabricSurface removal? Or do they remove the bridge path completely? Or is there some other reason?

@piaskowyk
Copy link
Member Author

Why are all those other changes done here, are they strictly connected to REAInitializerRCTFabricSurface removal? Or do they remove the bridge path completely? Or is there some other reason?

@WoLewicki That PR also drops support for bridge-full mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants