Skip to content

Commit

Permalink
Enable resizing on iOS (#50)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
ryantrem authored Jul 21, 2020
1 parent 684535d commit 9e48135
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
6 changes: 3 additions & 3 deletions Apps/PackageTest/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ DEPENDENCIES:
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
https://github.com/CocoaPods/Specs.git:
- boost-for-react-native
- CocoaAsyncSocket
- CocoaLibEvent
Expand Down Expand Up @@ -476,6 +476,6 @@ SPEC CHECKSUMS:
Yoga: 7d2edc5b410474191962e6dee88ee67f9b328b6b
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: b26865836ae3178eaa7e5446020aad2493d60909
PODFILE CHECKSUM: 62c5fe3e1509657d6d39ffc17a80798ed2216cac

COCOAPODS: 1.6.1
COCOAPODS: 1.9.3
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
4 changes: 2 additions & 2 deletions Apps/Playground/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ DEPENDENCIES:
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
https://github.com/CocoaPods/Specs.git:
- boost-for-react-native
- CocoaAsyncSocket
- CocoaLibEvent
Expand Down Expand Up @@ -484,4 +484,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: d5b2ddada6b82d7ff2f0c4518b88942d30cc3d95

COCOAPODS: 1.6.1
COCOAPODS: 1.9.3
10 changes: 9 additions & 1 deletion Apps/Playground/node_modules/@babylonjs/react-native/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

This project provides Babylon Native integration into React Native.

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

## Current Status

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

1. Android support only - support for both iOS and Windows is planned.
1. JavaScriptCore only - support for Hermes is planned, and support for other JavaScript engines used by React Native is uncertain.
1. Android and iOS support only - support for Windows is planned, but the timeline is currently unknown.
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.

## Usage

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.
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.

## Contributing

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.
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).

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

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

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

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.
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.

#### Android

```
cd Apps/Playground
npx react-native run-android
npm run android
```

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

#### iOS

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.

```
pushd Apps/Playground/node_modules/@babylonjs/react-native/ios
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 .
popd
cd Apps/Playground
npx react-native run-ios
npm run ios
```

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

### **Building the NPM Package**

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.
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).

#### Source Package

Expand All @@ -121,7 +126,7 @@ cd Apps/Playground/node_modules/@babylonjs/react-native
npm pack
```

This will produce a zipped local NPM source-based package that can be installed into a React Native application for testing purposes.
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).

#### Binary Package

Expand Down

0 comments on commit 9e48135

Please sign in to comment.