-
Notifications
You must be signed in to change notification settings - Fork 63
New NPM #665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
New NPM #665
Conversation
@ryantrem Now using cmake-runtime. Its use will appear in the log : |
"dependencies": { | ||
"base-64": "^0.1.0", | ||
"semver": "^7.3.2", | ||
"cmake-runtime": "3.31.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in devDependencies, right?
extraNodeModules: { | ||
'@babylonjs/core': path.resolve(__dirname, './node_modules/@babylonjs/core'), | ||
'@babylonjs/loaders': path.resolve(__dirname, './node_modules/@babylonjs/loaders'), | ||
'@babylonjs/react-native': path.resolve(__dirname, './node_modules/@babylonjs/tract-native'), | ||
'base-64': path.resolve(__dirname, './node_modules/base-64'), | ||
'semver': path.resolve(__dirname, './node_modules/semver'), | ||
'react-native-permissions': path.resolve(__dirname, './node_modules/react-native-permissions') | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's all this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we don't need all the sym linking stuff anymore because metro now supports that natively?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When testing the app I had unresolved imports that were solved by these symlinks. Not sure why it happens or if it's the best solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a windows specific package.json? Not sure how this works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, Windows specific package.json. I could not find a configuration that worked for iOS/Android and Windows. I tried this script (with a few modifications) https://github.com/microsoft/react-native-test-app/blob/trunk/scripts/internal/set-react-version.mts but I could not find a good configuration either. At the end, a simple file copy solved the issue for the test app.
@@ -50,9 +52,11 @@ namespace BabylonNative | |||
Babylon::JsRuntime::CreateForJavaScript(m_env, Babylon::CreateJsRuntimeDispatcher(m_env, jsiRuntime, m_jsDispatcher, m_isRunning)); | |||
|
|||
// Initialize Babylon Native plugins | |||
#ifndef BASEKIT_BUILD | |||
#if BABYLON_NATIVE_PLUGIN_NATIVEXR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If people want these features, does it mean they have to add these defines to their project and then re-run the cmake command that is normally run at npm install
time? Should these be opt-out instead of opt-in, such that by default BRN includes all BN features?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plugins are opt-out using env var. For Windows/Android, no need to re-run npm install
. Setting the env var and running msbuild/gradlew is enough. for iOS, pod install needs to be run again.
"dependencies": { | ||
"@babylonjs/core": "8.14.1", | ||
"@babylonjs/loaders": "8.14.1", | ||
"@babylonjs/react-native": "file:../../Modules/@babylonjs/react-native", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the PackageTest directory and app are gone, can we test published packages (or locally built packages) by just installing that package into this project (temporarily overwriting the local source pakcage)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can add a step after package build to test produced packed .tgz
related to BabylonJS/BabylonReactNative#665 Some dependencies are fetched only for the platform being built. `BABYLON_NATIVE_BUILD_SOURCETREE` variable has been added to allow fetching independently of active platform. --------- Co-authored-by: Drew Fillebrown <[email protected]>
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
Testing
PR Changes
react-native-iosandroid
andreact-native-windows
content intoModules/@babylonjs/react-native
folderbuildBabylonNativeSourceTree
gulp export to gather BN sourcesTODO
BABYLON_NATIVE_PLUGIN_NATIVECAMERA=0
,BABYLON_NATIVE_PLUGIN_NATIVEXR=0
)- [ ] Script to change RN version for RNTALeft to users to get a working node environmentissue with RN 0.78. fixed with RN 0.80. not tested with previous versions. To fix (if it happens) on user side.
Notes:
Pros/Cons of sources in package
Pros
BASE_KIT
package)Cons
Sizes
Binary packages
TS : 23Kb
Windows: 102Mb (700Mb Unzipped)
iOS-Android: 21Mb (65Mb Unzipped)
Source package
13Mb (74Mb Unzipped)