Skip to content

Commit

Permalink
Use Babylon Native's XMLHttpRequest (#94)
Browse files Browse the repository at this point in the history
React Native's XMLHttpRequest uses too much memory and is too slow for use with Babylon.js. This change brings in Babylon Native's XMLHttpRequest, but does not replace the globally scoped one provided by React Native. Instead, it exposes it from the _native object, which WebRequest will specifically look for in @babylonjs/core@4.2.0-beta.12 or newer.

- Update Babylon.js to 4.2.0-beta.12.
- Update Babylon Native to latest (for corresponding XMLHttpRequest related changes).
- Add XMLHttpRequest to the Android and iOS build.
- Initialize XMLHttpRequest in the Android and iOS interop layers.
- Add XMLHttpRequest related libs to the pod file and package build validation.

Other unrelated changes included in this PR:

- Updating some GitHub build tasks to the latest to see if it resolves some confusing build warnings.
- Update iOS test app project files to use iOS 12 to match what the Babylon React Native podspec requires (otherwise I get errors when building Release in XCode 12).
- Revert to the old workaround for the promise continuation issue (it turns out the new approach doesn't work on iOS in Release builds).
- Add @react-native-community/cli as a dev dependency to the test apps as it seems we can use it to convert a Hermes profile to CDT profiler format and view it in Chrome (still trying to get this to work).
  • Loading branch information
ryantrem authored Oct 12, 2020
1 parent 61a3a8f commit 925179d
Show file tree
Hide file tree
Showing 19 changed files with 725 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.3.3
with:
submodules: 'recursive'
- name: Setup Ninja
Expand All @@ -28,7 +28,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.3.3
with:
submodules: 'recursive'
- name: NPM Install (Playground)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2.3.1
uses: actions/checkout@v2.3.3
with:
submodules: 'recursive'
- name: Setup Ninja
Expand All @@ -23,7 +23,7 @@ jobs:
run: npx gulp
working-directory: ./Package
- name: Setup Node.js
uses: actions/setup-node@v2.1.0
uses: actions/setup-node@v2.1.2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
Expand Down
9 changes: 4 additions & 5 deletions Apps/PackageTest/ios/PackageTest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@
D5B2C53165757B8DB1E88994 /* Pods-PackageTest-PackageTestTests.debug.xcconfig */,
920AE01196CF291853BA329C /* Pods-PackageTest-PackageTestTests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -554,7 +553,7 @@
"$(inherited)",
);
INFOPLIST_FILE = PackageTestTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = (
"-ObjC",
Expand All @@ -574,7 +573,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = PackageTestTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -784,7 +783,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
Expand Down Expand Up @@ -837,7 +836,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "/usr/lib/swift $(inherited)";
LIBRARY_SEARCH_PATHS = (
"\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
Expand Down
Loading

0 comments on commit 925179d

Please sign in to comment.