Skip to content

Commit 9e48135

Browse files
authored
Enable resizing on iOS (#50)
- Enable resizing on iOS (uncomment commented out code, and add a comment about it). - Disable Metal API Validation for the test projects. - Add documentation about disabling Metal API Validation. - Do a general pass on updating docs.
1 parent 684535d commit 9e48135

File tree

8 files changed

+38
-27
lines changed

8 files changed

+38
-27
lines changed

Apps/PackageTest/ios/PackageTest.xcodeproj/xcshareddata/xcschemes/PackageTest.xcscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
ignoresPersistentStateOnLaunch = "NO"
5050
debugDocumentVersioning = "YES"
5151
debugServiceExtension = "internal"
52+
enableGPUValidationMode = "1"
5253
allowLocationSimulation = "YES">
5354
<BuildableProductRunnable
5455
runnableDebuggingMode = "0">

Apps/PackageTest/ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ DEPENDENCIES:
359359
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
360360

361361
SPEC REPOS:
362-
https://github.com/cocoapods/specs.git:
362+
https://github.com/CocoaPods/Specs.git:
363363
- boost-for-react-native
364364
- CocoaAsyncSocket
365365
- CocoaLibEvent
@@ -476,6 +476,6 @@ SPEC CHECKSUMS:
476476
Yoga: 7d2edc5b410474191962e6dee88ee67f9b328b6b
477477
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
478478

479-
PODFILE CHECKSUM: b26865836ae3178eaa7e5446020aad2493d60909
479+
PODFILE CHECKSUM: 62c5fe3e1509657d6d39ffc17a80798ed2216cac
480480

481-
COCOAPODS: 1.6.1
481+
COCOAPODS: 1.9.3

Apps/Playground/ios/Playground.xcodeproj/xcshareddata/xcschemes/Playground.xcscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
ignoresPersistentStateOnLaunch = "NO"
5050
debugDocumentVersioning = "YES"
5151
debugServiceExtension = "internal"
52+
enableGPUValidationMode = "1"
5253
allowLocationSimulation = "YES">
5354
<BuildableProductRunnable
5455
runnableDebuggingMode = "0">

Apps/Playground/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ DEPENDENCIES:
362362
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
363363

364364
SPEC REPOS:
365-
https://github.com/cocoapods/specs.git:
365+
https://github.com/CocoaPods/Specs.git:
366366
- boost-for-react-native
367367
- CocoaAsyncSocket
368368
- CocoaLibEvent
@@ -484,4 +484,4 @@ SPEC CHECKSUMS:
484484

485485
PODFILE CHECKSUM: d5b2ddada6b82d7ff2f0c4518b88942d30cc3d95
486486

487-
COCOAPODS: 1.6.1
487+
COCOAPODS: 1.9.3

Apps/Playground/node_modules/@babylonjs/react-native/README.md

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Apps/Playground/node_modules/@babylonjs/react-native/ios/BabylonNative.cpp

Lines changed: 5 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Apps/Playground/node_modules/@babylonjs/react-native/ios/BabylonNativeInterop.mm

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
This project provides Babylon Native integration into React Native.
44

5+
[![](https://github.com/BabylonJS/BabylonReactNative/workflows/Publish%20Package/badge.svg)](https://github.com/BabylonJS/BabylonReactNative/actions?query=workflow%3A%22Publish+Package%22)
6+
[![npm version](https://badge.fury.io/js/%40babylonjs%2Freact-native.svg)](https://badge.fury.io/js/%40babylonjs%2Freact-native)
7+
58
## Current Status
69

710
Babylon React Native is in the early phase of its development, and has the following limitations:
811

9-
1. Android support only - support for both iOS and Windows is planned.
10-
1. JavaScriptCore only - support for Hermes is planned, and support for other JavaScript engines used by React Native is uncertain.
12+
1. Android and iOS support only - support for Windows is planned, but the timeline is currently unknown.
13+
1. JavaScriptCore (JSC) only - the published @babylonjs/react-native package is configured specifically for JSC, though it is possible to rebuild it and target other JavaScript engines supported by React Native. In the future, the published package will directly support all JavaScript engines that can be used with React Native.
1114

1215
## Usage
1316

14-
See the [package usage](Apps/Playground/node_modules/@babylonjs/react-native/README.md) or the Playground app's [App.tsx](Apps/Playground/App.tsx) for example usage.
17+
See the [package usage](Apps/Playground/node_modules/@babylonjs/react-native/README.md) for installation instructions and/or the Playground app's [App.tsx](Apps/Playground/App.tsx) for example usage.
1518

1619
## Contributing
1720

18-
This quick overview will help you get started developing in the Babylon React Native repository. We support development on Windows and macOS, but assume the use of [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell) in the instructions below.
21+
This quick overview will help you get started developing in the Babylon React Native repository. We support development on Windows and MacOS, but assume the use of [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell) in the instructions below (unless otherwise noted).
1922

2023
If you are interested in making contributions, be sure to also review [CONTRIBUTING.md](CONTRIBUTING.md).
2124

@@ -84,33 +87,35 @@ export JAVA_HOME=$(/usr/libexec/java_home -v 13)
8487

8588
### **Building and Running the Playground App**
8689

87-
On either Mac or Windows, NPX is used to build and run the Playground sample/test app from the command line. Open a command prompt at the root of the BabylonReactNative repo if you don't have one already open.
90+
On either Mac or Windows, NPM is used to build and run the Playground sample/test app from the command line. Open a command prompt at the root of the BabylonReactNative repo if you don't have one already open.
8891

8992
#### Android
9093

9194
```
9295
cd Apps/Playground
93-
npx react-native run-android
96+
npm run android
9497
```
9598

9699
After having run the above commands, you can also open `Apps/Playground/android` in Android Studio and run the app from there.
97100

98101
#### iOS
99102

103+
iOS can only be built on a Mac. Additionally, `CMake` must manually be run to generate the XCode project that the [Playground XCode workspace](Apps/Playground/ios/Playground.xcworkspace/contents.xcworkspacedata) includes.
104+
100105
```
101106
pushd Apps/Playground/node_modules/@babylonjs/react-native/ios
102107
cmake -G Xcode -DCMAKE_TOOLCHAIN_FILE=../submodules/BabylonNative/Dependencies/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64COMBINED -DENABLE_ARC=0 -DENABLE_BITCODE=1 -DDEPLOYMENT_TARGET=12 -DENABLE_GLSLANG_BINARIES=OFF -DSPIRV_CROSS_CLI=OFF .
103108
popd
104109
105110
cd Apps/Playground
106-
npx react-native run-ios
111+
npm run ios
107112
```
108113

109114
After having run the above commands, you can also open `Apps/Playground/ios/Playground.xcworkspace` in XCode and run the app from there.
110115

111116
### **Building the NPM Package**
112117

113-
An NPM package can be built in two different ways: as source, and as binaries. Source is useful if you want to debug the Babylon React Native source in the context of the project consuming it, though configuration is a bit more involved. Binaries are useful in that they simplify configuration in the consuming app, though they cannot be debugged so easily.
118+
An NPM package can be built in two different ways: as source, and as binaries. Source is useful if you want to debug the Babylon React Native source in the context of the project consuming it, though configuration is a bit more involved. Binaries are useful in that they simplify configuration in the consuming app, though they cannot be debugged so easily. The binary package is what is published to [npmjs.org](https://www.npmjs.com/package/@babylonjs/react-native).
114119

115120
#### Source Package
116121

@@ -121,7 +126,7 @@ cd Apps/Playground/node_modules/@babylonjs/react-native
121126
npm pack
122127
```
123128

124-
This will produce a zipped local NPM source-based package that can be installed into a React Native application for testing purposes.
129+
This will produce a zipped local NPM source-based package that can be installed into a React Native application for testing purposes. Note that when testing a source based package for iOS, the XCode project needs to be generated with `CMake` as described [above](#ios).
125130

126131
#### Binary Package
127132

0 commit comments

Comments
 (0)