Skip to content

Conversation

@ryantrem
Copy link
Member

@ryantrem ryantrem commented Dec 19, 2020

This change significantly overhauls the react native integration layers. The goal is to reduce duplication across platforms and simplify the code. The main shared integration code is in BabylonNative.cpp. This is similar to what we had for both Android and iOS, but is platform agnostic. Android and iOS have relatively thin platform specific layers on top of this. Additionally, the class defined in BabylonNative.cpp is now a JSI HostObject which is injected into the JavaScript engine so that JS code can call directly into it in a platform agnostic way (so we don't have to expose native functionality to JS through platform specific legacy bridge based modules). This object exposes a JS promise that JS Babylon React Native initialization code can await, which allowed me to remove all the platform specific native promise/callback related code. I was also able to remove all traces of the old usages of loopers, since we fully rely on the React Native CallInvoker to get onto the JS thread.

NOTE: This change requires a change in BabylonNative that is not merged yet, so I'll need to update that once BabylonJS/BabylonNative#550 is merged.

This also resolves #24

…3+, but is not needed for touch (button id is always 0 for touch inputs)
@ryantrem ryantrem requested a review from Alex-MSFT December 19, 2020 01:20
Copy link
Contributor

@bghgary bghgary left a comment

Choose a reason for hiding this comment

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

Did a pass on it, but I can't say I understand everything. Maybe good to go over in person (virtually).

Update to merged changes in BabylonNative
@ryantrem ryantrem merged commit 91cdda2 into BabylonJS:master Jan 8, 2021
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.

Replace usages of CompletableFuture

3 participants