React Native New Architecture

Hi! Does React Native Babylon support the new react native architecture?

cc @Cedric

Hi @Narek_Avanesyan and welcome to the forum!
As you can see in this page : GitHub - BabylonJS/BabylonReactNative: Build React Native applications with the power of Babylon Native

BRN supports React Native 0.72. I believe new architecture has been released with 0.71. Let me know if I miss something.

Hi @Cedric
By default, the new architecture of React Native is disabled, and you need to enable it in order to use it.

After enabling it, I received this message on both Android and iOS.


Looks like something is missing. Do you have experience with RN New architecture @ryantrem ?

We need to make changes to have BRN support the new architecture (TurboModules and Fabric). Docs start here: Prerequisites for Libraries · React Native

It is possible to make a RN module support both the old and the new architecture so it will work with either. Several RN OSS projects have done this, so there are examples we can follow.

Also, there is now a compatibility layer to enable RN modules that have not been migrated in the new architecture. Not everything is supported, but maybe everything that BRN uses. Someone should try it out: New Renderer Interop Layer · reactwg/react-native-new-architecture · Discussion #135 · GitHub

1 Like

I’ve open a github issue to keep track React Native New Architecture · Issue #595 · BabylonJS/BabylonReactNative · GitHub

3 Likes

Cross-posting here, for folks who search here but not in the GItHub issues :slight_smile:
@okwasniewski has been working on making 6DOF head tracking work well on Apple Vision Pro within BGFX (a prerequisite for BabylonNative) here:
callstack/bgfx@1bb0b5d

If we’re very lucky, a pull request should be up in the BabylonNative repo soon that integrates the BGFX changes and then he’ll be able to do a trial integration pass in Babylon React Native. That trial integration will probably necessitate the migration to New Architecture, as React Native visionOS has been developed with that as a default assumption. His full-time commitment on my project is up at the end of this month, so we’ll be looking for funding/staffing partners at that point to keep the OSS vibes going. :crossed_fingers:

It’s taken hundreds of commits (and issue creation/comments) across dozens of open-source repos over the last ~8 months to get to this point, and we are self-funded so it’s very single-threaded. I appreciate everybody’s patience and support in the home stretch here that should enable hundreds of BGFX and BabylonJS experiences to make the leap to modern React Native and Apple Vision Pro :smiley:

2 Likes