Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
3256064
setup react windows project
Oct 26, 2020
6e55b8c
start on cmake definition for babylon react native for uwp
Oct 26, 2020
1e96682
cache some helper logic
Oct 26, 2020
0c3b117
change setup to x64 for local testing
Oct 26, 2020
7cb9a19
add source files
Oct 26, 2020
f8cb2b1
add some needed files
Oct 26, 2020
e5c243c
working winrt plugin initialization
Nov 12, 2020
5500b7d
more windows work
Nov 20, 2020
740cdd1
complete merge
Nov 20, 2020
6e0642b
failing during linker
Nov 23, 2020
f46a5d4
add options to vcxproj to try and unblock debug builds
Nov 23, 2020
ba04d8d
move to use jsi
Nov 24, 2020
321625f
fix modules
Nov 30, 2020
6d7eec3
add react-native-windows dependency
Nov 30, 2020
344aa12
merge master
Nov 30, 2020
0c3cbd6
working compilation
Dec 1, 2020
2d9ef2d
current state
Dec 11, 2020
5e18391
current proto changes
Dec 11, 2020
4c5778f
working native input compilation
Dec 14, 2020
f0bed54
fix playground solution
Dec 14, 2020
d98762d
close to working
Dec 16, 2020
fd3335e
working windows logic
Dec 16, 2020
c28b098
hacked app setup to support working windows logic
Dec 16, 2020
07b127f
working vr
Dec 17, 2020
9ac1c23
move BabylonNative dll definition and add arm64 support
Dec 18, 2020
0fe138a
fix babylonnative to build in module folder
Jan 4, 2021
b8c0384
fix submodule declarations
Jan 4, 2021
7962233
remove unneeded build scripts
Jan 4, 2021
0d7e725
add clean solution
Jan 4, 2021
4adc50c
working build
Jan 5, 2021
caa66e4
working build
Jan 5, 2021
8498e69
typescript content needs cleaned up
Jan 6, 2021
a6c8486
things need cleaned up but we will try a clean repo
Jan 6, 2021
4abc4f8
fix package.json definition
Jan 6, 2021
ba05041
remove debug logic
Jan 6, 2021
09b0090
get metro to play nice with new exclusion list
Jan 6, 2021
9b012f2
add x86, arm build support
Jan 6, 2021
6055788
revert files
Jan 6, 2021
6339293
packages working
Jan 6, 2021
ce79ce9
complete merge
Jan 6, 2021
d3d9413
add reset function and allow babylonnative to build from modules folder
Jan 7, 2021
910f79f
fix package path resolution for react native windows
Jan 7, 2021
e2b0e98
prepare for draft review
Jan 7, 2021
1b7f62a
comment out slider, needs work to fix
Jan 7, 2021
fd740a8
move to newest babylonnative and fix gitmodule repo
Jan 7, 2021
4442fac
remove unneeded package-lock
Jan 7, 2021
2aeeb7f
remove untrue comments
Jan 7, 2021
37f80fe
remove unneeded comments
Jan 7, 2021
8e92ef3
fix namespace comment names
Jan 7, 2021
e2e5086
avoid checking in bin log
Jan 7, 2021
d89f4e0
revert unneeded metro.config.js changes
Jan 7, 2021
0300c5d
get npm install working vs using yarn
Jan 7, 2021
1ae6ee7
get project to work with npm install
Jan 7, 2021
efa7fb4
add readme tips
Jan 7, 2021
130874b
fix permissions and slider initialization issues
Jan 13, 2021
cd326b3
add step value to fix windows slider usage
Jan 13, 2021
af82b5a
rename babylon native component to avoid lib collisions
Jan 13, 2021
a775a06
rename to BabylonReactNative
Jan 13, 2021
72606db
complete merge
Jan 14, 2021
af5f0b6
ready for review
Jan 14, 2021
90daed8
update build steps
Jan 14, 2021
d6050ba
cleanup some unneeded changes
Jan 14, 2021
1a33cf9
avoid moving to new commit
Jan 14, 2021
ecc21cb
add event revokers
Jan 14, 2021
98e1d5d
add uwp build logic
Jan 15, 2021
5585d9f
revert settings file
Jan 19, 2021
6d9b1bb
Merge branch 'uwpPackage' into uwp
Jan 19, 2021
0dc287a
remove files and update documentation
Jan 19, 2021
3f2a26b
address review comments
Jan 19, 2021
466f94d
address more review comments
Jan 19, 2021
874dbc3
Update Modules/@babylonjs/react-native/EngineHook.ts
chrisfromwork Jan 19, 2021
3ec80d2
address review comments
Jan 19, 2021
910c952
Merge branch 'uwp' of https://github.com/chrisfromwork/BabylonReactNa…
Jan 19, 2021
465d9c3
move hmd render behaviors to enginehook
Jan 19, 2021
336535f
remove unneeded dev dependencies
Jan 19, 2021
874fa7f
move engine logic into engineview
Jan 20, 2021
78b388a
Update Modules/@babylonjs/react-native/EngineHook.ts
chrisfromwork Jan 20, 2021
3f1ccf2
working windows packaging
Jan 21, 2021
d731115
avoid combining gulp files
Jan 21, 2021
4515879
address review comments
Jan 21, 2021
d211e8f
remove unneeded reference
Jan 21, 2021
6501196
Merge branch 'uwp' into uwpPackage
Jan 21, 2021
02dc933
update vcxproj and package choices
Jan 21, 2021
f7711af
remove additional solution to prevent react-native-windows version co…
Jan 21, 2021
fd09fd5
remove unneeded solution and update module
Jan 21, 2021
01818b6
merge master branch
Jan 21, 2021
0674b86
packages appear ready for usage
Jan 22, 2021
61cbfa2
clean up things for review
Jan 22, 2021
113a360
execute file copies in parallel
Jan 22, 2021
9874ec3
revert unneeded changes
Jan 22, 2021
7223a9e
revert settings file
Jan 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Apps/PackageTest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ buck-out/

# CocoaPods
/ios/Pods/

deploy.binlog
msbuild.binlog
14 changes: 13 additions & 1 deletion Apps/PackageTest/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@
*
* @format
*/
const path = require('path');
const exclusionList = require('metro-config/src/defaults/exclusionList');

module.exports = {
resolver: {
blockList: exclusionList([
// This stops "react-native run-windows" from causing the metro server to crash if its already running
new RegExp(
`${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
),
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip
/.*\.ProjectImports\.zip/,
]),
},
Comment on lines +11 to +20
Copy link
Member

Choose a reason for hiding this comment

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

So at this point, any consumer of the NPM package will additionally need to make these changes to their metro.config.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

react-native-windows on setup overwrites this file to contain this logic, and when other custom things are in this file it doesn't seem to merge them. If there are thoughts on how things could be improved, we should relay this feedback to the react-native-windows team.

Copy link
Member

Choose a reason for hiding this comment

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

Yea that's pretty bad. I guess their assumption is that people will diff the file and manually fix it up. One thing that would help would be to put this logic in a separate file that is bundled with RNW and import it into this file. That might be good feedback for the rnw folks.

transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
inlineRequires: true,
},
}),
},
Expand Down
4,290 changes: 3,533 additions & 757 deletions Apps/PackageTest/package-lock.json

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions Apps/PackageTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,37 @@
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"windows": "react-native run-windows --arch x64",
"windows-verbose": "react-native run-windows --arch x64 --logging",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@babylonjs/core": "^5.0.0-alpha.6",
"@babylonjs/react-native": "file:../../Package/Assembled/babylonjs-react-native-0.0.1.tgz",
"react": "16.13.1",
"react-native": "0.63.1",
"react-native-permissions": "^2.1.5"
"react": "^17.0.1",
"react-native": "^0.64.0-rc.0",
"react-native-permissions": "^3.0.0",
"react-native-windows": "^0.64.0-0"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@react-native-community/cli": "^4.13.0",
"@react-native-community/eslint-config": "^1.1.0",
"@types/jest": "^25.2.3",
"@types/react-native": "0.63.1",
"@types/react-native": "^0.63.18",
"@types/react-test-renderer": "^16.9.2",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-config": "^0.64.0",
"metro-react-native-babel-preset": "^0.59.0",
"prettier": "^2.0.4",
"react-test-renderer": "16.13.1",
"react-test-renderer": "^17.0.1",
"typescript": "^3.8.3"
},
"jest": {
Expand Down
92 changes: 92 additions & 0 deletions Apps/PackageTest/windows/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
*AppPackages*
*BundleArtifacts*

#OS junk files
[Tt]humbs.db
*.DS_Store

#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.opendb
*.unsuccessfulbuild
ipch/
[Oo]bj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

#MonoDevelop
*.pidb
*.userprefs

#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*
*.sass-cache

#Project files
[Bb]uild/

#Subversion files
.svn

# Office Temp Files
~$*

# vim Temp Files
*~

#NuGet
packages/
*.nupkg

#ncrunch
*ncrunch*
*crunch*.local.xml

# visual studio database projects
*.dbmdl

#Test files
*.testsettings

#Other files
*.DotSettings
.vs/
*project.lock.json

#Files generated by the VS build
**/Generated Files/**

10 changes: 10 additions & 0 deletions Apps/PackageTest/windows/BuildFlags.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Flags can be added here to effect the compilation of Microsoft.ReactNative -->
<PropertyGroup Label="Microsoft.ReactNative Build Flags">
<UseWinUI3>false</UseWinUI3>
<UseHermes>false</UseHermes>
</PropertyGroup>

</Project>
223 changes: 223 additions & 0 deletions Apps/PackageTest/windows/PackageTest.sln

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Apps/PackageTest/windows/PackageTest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Bundle
79 changes: 79 additions & 0 deletions Apps/PackageTest/windows/PackageTest/App.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#include "pch.h"

#include "App.h"

#include "AutolinkedNativeModules.g.h"
#include "ReactPackageProvider.h"

using namespace winrt::PackageTest;
using namespace winrt::PackageTest::implementation;
using namespace winrt;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::ApplicationModel;

/// <summary>
/// Initializes the singleton application object. This is the first line of
/// authored code executed, and as such is the logical equivalent of main() or
/// WinMain().
/// </summary>
App::App() noexcept
{
#if BUNDLE
JavaScriptBundleFile(L"index.windows");
InstanceSettings().UseWebDebugger(false);
InstanceSettings().UseFastRefresh(false);
#else
JavaScriptBundleFile(L"index");
InstanceSettings().UseWebDebugger(true);
InstanceSettings().UseFastRefresh(true);
#endif

#if _DEBUG
InstanceSettings().UseDeveloperSupport(true);
#else
InstanceSettings().UseDeveloperSupport(false);
#endif

RegisterAutolinkedNativeModulePackages(PackageProviders()); // Includes any autolinked modules

PackageProviders().Append(make<ReactPackageProvider>()); // Includes all modules in this project

InitializeComponent();
}

/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
void App::OnLaunched(activation::LaunchActivatedEventArgs const& e)
{
super::OnLaunched(e);

Frame rootFrame = Window::Current().Content().as<Frame>();
rootFrame.Navigate(xaml_typename<PackageTest::MainPage>(), box_value(e.Arguments()));
}

/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
void App::OnSuspending([[maybe_unused]] IInspectable const& sender, [[maybe_unused]] SuspendingEventArgs const& e)
{
// Save application state and stop any background activity
}

/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void App::OnNavigationFailed(IInspectable const&, NavigationFailedEventArgs const& e)
{
throw hresult_error(E_FAIL, hstring(L"Failed to load Page ") + e.SourcePageType().Name);
}
18 changes: 18 additions & 0 deletions Apps/PackageTest/windows/PackageTest/App.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include "App.xaml.g.h"

namespace activation = winrt::Windows::ApplicationModel::Activation;

namespace winrt::PackageTest::implementation
{
struct App : AppT<App>
{
App() noexcept;
void OnLaunched(activation::LaunchActivatedEventArgs const&);
void OnSuspending(IInspectable const&, Windows::ApplicationModel::SuspendingEventArgs const&);
void OnNavigationFailed(IInspectable const&, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const&);
private:
using super = AppT<App>;
};
} // namespace winrt::PackageTest::implementation
3 changes: 3 additions & 0 deletions Apps/PackageTest/windows/PackageTest/App.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace PackageTest
{
}
10 changes: 10 additions & 0 deletions Apps/PackageTest/windows/PackageTest/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<react:ReactApplication
x:Class="PackageTest.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:PackageTest"
xmlns:react="using:Microsoft.ReactNative">
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</Application.Resources>
</react:ReactApplication>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions Apps/PackageTest/windows/PackageTest/AutolinkedNativeModules.g.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// AutolinkedNativeModules.g.cpp contents generated by "react-native autolink-windows"
// clang-format off
#include "pch.h"
#include "AutolinkedNativeModules.g.h"

// Includes from @babylonjs/react-native
#include <winrt/BabylonReactNative.h>

// Includes from react-native-permissions
#include <winrt/RNPermissions.h>

namespace winrt::Microsoft::ReactNative
{

void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector<winrt::Microsoft::ReactNative::IReactPackageProvider> const& packageProviders)
{
// IReactPackageProviders from @babylonjs/react-native
packageProviders.Append(winrt::BabylonReactNative::ReactPackageProvider());
// IReactPackageProviders from react-native-permissions
packageProviders.Append(winrt::RNPermissions::ReactPackageProvider());
}

}
10 changes: 10 additions & 0 deletions Apps/PackageTest/windows/PackageTest/AutolinkedNativeModules.g.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// AutolinkedNativeModules.g.h contents generated by "react-native autolink-windows"
// clang-format off
#pragma once

namespace winrt::Microsoft::ReactNative
{

void RegisterAutolinkedNativeModulePackages(winrt::Windows::Foundation::Collections::IVector<winrt::Microsoft::ReactNative::IReactPackageProvider> const& packageProviders);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- AutolinkedNativeModules.g.props contents generated by "react-native autolink-windows" -->
<PropertyGroup>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- AutolinkedNativeModules.g.targets contents generated by "react-native autolink-windows" -->
<ItemGroup>
<!-- Projects from @babylonjs/react-native -->
<ProjectReference Include="$(ProjectDir)..\..\node_modules\@babylonjs\react-native\windows\BabylonReactNative\BabylonReactNative.vcxproj">
<Project>{240FBB7A-EC3B-43E4-B4D8-16C7C092D192}</Project>
</ProjectReference>
<!-- Projects from react-native-permissions -->
<ProjectReference Include="$(ProjectDir)..\..\node_modules\react-native-permissions\windows\RNPermissions\RNPermissions.vcxproj">
<Project>{99677b9d-a27b-4239-930e-c36c8d339c54}</Project>
</ProjectReference>
</ItemGroup>
</Project>
20 changes: 20 additions & 0 deletions Apps/PackageTest/windows/PackageTest/MainPage.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "pch.h"
#include "MainPage.h"
#if __has_include("MainPage.g.cpp")
#include "MainPage.g.cpp"
#endif

#include "App.h"

using namespace winrt;
using namespace Windows::UI::Xaml;

namespace winrt::PackageTest::implementation
{
MainPage::MainPage()
{
InitializeComponent();
auto app = Application::Current().as<App>();
ReactRootView().ReactNativeHost(app->Host());
}
}
19 changes: 19 additions & 0 deletions Apps/PackageTest/windows/PackageTest/MainPage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once
#include "MainPage.g.h"
#include <winrt/Microsoft.ReactNative.h>

namespace winrt::PackageTest::implementation
{
struct MainPage : MainPageT<MainPage>
{
MainPage();
};
}

namespace winrt::PackageTest::factory_implementation
{
struct MainPage : MainPageT<MainPage, implementation::MainPage>
{
};
}

Loading