Skip to content

Conversation

@CedricGuillemet
Copy link
Contributor

@CedricGuillemet CedricGuillemet commented Jun 6, 2025

WIP

Goal

Deliver 1 single self contained package with sources (no fetch, no secondary download) for all platform, for all RN versions.
Deprecated existing (Playground, tests, build script) in favor of a single RNTA Playground and simpler tooling.

Building the new NPM

  • Gather all sources (BabylonNative and dependencies) needed by Android/iOS/Windows builds
  • Remove unncessary dependencies (bgfx examples) and generate glue CMake files
  • Bundle previous iosAndroid and Windows Packages into a single NPM along gathered sources

Testing

  • Build RNTA for iOS, Android and Windows
  • Publish an artifact so it can be tested locally

PR Changes

  • Removed old system
  • Renamed BRNPlayground -> Playground
  • Moved react-native-iosandroid and react-native-windows content into Modules/@babylonjs/react-native folder
  • Added buildBabylonNativeSourceTree gulp export to gather BN sources
  • Update Android Gradle to use fetched content and build BabylonNative instead of using static libraries

TODO

  • Android Build
  • Windows Build
  • iOS Build
  • NPM Test publish job
  • Build .ts
  • Publish testable artifacts
  • Remove bgfx example/3rdparty folders
  • Permissions
  • Env var to disable XR and/or Camera plugins (BABYLON_NATIVE_PLUGIN_NATIVECAMERA=0, BABYLON_NATIVE_PLUGIN_NATIVEXR=0)
  • Webp
    - [ ] Script to change RN version for RNTA Left to users to get a working node environment
  • Documentation/Readme
  • Missing CI scripts (publish)
  • Test Playground Android
  • Test Playground iOS
  • Test Playground Windows
  • Test Package Android
  • Test Package iOS
  • Test Package Windows
  • Link error with react-native :
ld.lld: error: undefined symbol: facebook::react::CallInvokerHolder::getCallInvoker()
  >>> referenced by BabylonNativeInterop.cpp:39 (/Users/cedricguillemet/dev/BRNAnd/Apps/Playground/node_modules/@babylonjs/react-native/android/src/main/cpp/BabylonNativeInterop.cpp:39)
  >>>               CMakeFiles/BabylonNative.dir/src/main/cpp/BabylonNativeInterop.cpp.o:(Java_com_babylonreactnative_BabylonNativeInterop_00024BabylonNative_initialize)

issue with RN 0.78. fixed with RN 0.80. not tested with previous versions. To fix (if it happens) on user side.

Notes:

  • Android debug build asserts in spirv shader compilation. It works fine in release.
  • Android XR not tested because of missing ARCore dependency. I guess it should be part of the app and not the package. To confirm!
  • ios XR working correctly

Pros/Cons of sources in package

Pros

  • smaller disk footprint. no need to clear up space : https://github.com/BabylonJS/BabylonReactNative/tree/master/.github/workflows/macos_freespace
  • 1 single NPM package for all platforms and RN versions instead of 21
  • smaller NPMs (Windows is 700Mb per RN version)
  • put breakpoints anywhere
  • simpler builds (Android is handled by CMake, no need for Windows build scripts)
  • support for ABI breaking changes
  • unity build not needed anymore (windows binary size issue not relevant)
  • gulp script is reduced in scope
  • more precise control on components used (no more BASE_KIT package)
  • same podspec for dev and NPM
  • faster PR build/publish: ~15min Vs 1h
  • asserts firing!

Cons

  • need to build BN source with same toolchain flags as BRN (but same for prebuilt static libraries)
  • slower build for users (?). need testing for that
  • Xcode builds need CMake

Sizes

Binary packages

TS : 23Kb
Windows: 102Mb (700Mb Unzipped)
iOS-Android: 21Mb (65Mb Unzipped)

Source package

13Mb (74Mb Unzipped)

@CedricGuillemet CedricGuillemet marked this pull request as ready for review July 2, 2025 12:29
@bghgary bghgary requested a review from Copilot January 8, 2026 18:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes multiple React Native 0.64, 0.65, and 0.69 package test applications as part of consolidating the Babylon React Native package structure. The change removes old test infrastructure and scaffolding applications that were used to validate different React Native versions, streamlining the repository to support a single unified package.

  • Removes entire PackageTest apps for React Native versions 0.64, 0.65, and 0.69
  • Eliminates platform-specific test scaffolding for Android, iOS, and Windows
  • Clears out version-specific configuration files, build scripts, and native code

Reviewed changes

Copilot reviewed 227 out of 961 changed files in this pull request and generated no comments.

File Description
Apps/PackageTest/0.69.0/* Removed complete RN 0.69 test app including Android/iOS configs and native architecture code
Apps/PackageTest/0.65.0/* Removed complete RN 0.65 test app with all platform-specific files and build configurations
Apps/PackageTest/0.64.0/* Removed complete RN 0.64 test app including Windows-specific project files and native modules
Files not reviewed (3)
  • Apps/PackageTest/0.63.1/ios/PackageTest.xcworkspace/contents.xcworkspacedata: Language not supported
  • Apps/PackageTest/0.64.0/ios/PackageTest.xcworkspace/contents.xcworkspacedata: Language not supported
  • Apps/PackageTest/0.65.0/ios/PackageTest.xcworkspace/contents.xcworkspacedata: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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 quick scan. Looks good to me, but @ryantrem probably should approve before you merge.


Use the react native template to generate the app:
It's still getting fully wired up as a replacement, so if you are seeing this message it means that it's not in its final form yet!
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this still be here?

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.

4 participants