diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 587afac3a..5045777e7 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -4,7 +4,7 @@ on: jobs: build-android: - runs-on: macos-latest + runs-on: macos-15 steps: - name: Checkout Repo uses: actions/checkout@v4.2.2 diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 647e40dff..e2f074826 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -5,7 +5,7 @@ on: jobs: build-iOS: - runs-on: macos-latest + runs-on: macos-15 steps: - name: Checkout Repo uses: actions/checkout@v4.2.2 diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index acec94c3a..3317003ed 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -4,7 +4,7 @@ on: jobs: package: - runs-on: macos-latest + runs-on: macos-15 steps: - name: Checkout Repo uses: actions/checkout@v4.2.2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 43291c2f1..ead4c1b27 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: uses: ./.github/workflows/package.yml publish: - runs-on: macos-latest + runs-on: macos-15 needs: [package] steps: - name: Setup Node.js diff --git a/.github/workflows/publish_preview.yml b/.github/workflows/publish_preview.yml index e632f7f5c..fb96e64d8 100644 --- a/.github/workflows/publish_preview.yml +++ b/.github/workflows/publish_preview.yml @@ -22,7 +22,7 @@ jobs: uses: ./.github/workflows/package.yml publish: - runs-on: macos-latest + runs-on: macos-15 needs: [package] steps: - name: Setup Node.js diff --git a/.github/workflows/test_android.yml b/.github/workflows/test_android.yml index 44101829e..ee71632dd 100644 --- a/.github/workflows/test_android.yml +++ b/.github/workflows/test_android.yml @@ -5,7 +5,7 @@ on: jobs: build-test-android: - runs-on: macos-latest + runs-on: macos-15 steps: - name: Checkout Repo uses: actions/checkout@v4.2.2 diff --git a/.github/workflows/test_ios.yml b/.github/workflows/test_ios.yml index 1512f7591..38a9123b9 100644 --- a/.github/workflows/test_ios.yml +++ b/.github/workflows/test_ios.yml @@ -5,7 +5,7 @@ on: jobs: build-test-iOS: - runs-on: macos-latest + runs-on: macos-15 steps: - name: Checkout Repo uses: actions/checkout@v4.2.2 diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml index 7fd954d80..70a833b70 100644 --- a/.github/workflows/typescript.yml +++ b/.github/workflows/typescript.yml @@ -4,7 +4,7 @@ on: workflow_call jobs: Build: - runs-on: macos-latest + runs-on: macos-15 steps: - name: Checkout Repo uses: actions/checkout@v4.2.2 diff --git a/Apps/Playground/android/gradle.properties b/Apps/Playground/android/gradle.properties index 2a9e5673c..10e55c7dd 100644 --- a/Apps/Playground/android/gradle.properties +++ b/Apps/Playground/android/gradle.properties @@ -32,7 +32,9 @@ android.jetifier.ignorelist=hermes-android # Use this property to specify which architecture you want to build. # You can also override it from the CLI using # ./gradlew -PreactNativeArchitectures=x86_64 -reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 +# NOTE: the 32-bit x86 ABI is not supported. bgfx's bx requires SSE4.x +# intrinsics, which are above the Android x86 ABI baseline (SSSE3). +reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86_64 # Use this property to enable support to the new architecture. # This will allow you to use TurboModules and the Fabric render in diff --git a/Apps/Playground/babel.config.js b/Apps/Playground/babel.config.js index f7b3da3b3..676c4fb46 100644 --- a/Apps/Playground/babel.config.js +++ b/Apps/Playground/babel.config.js @@ -1,3 +1,4 @@ module.exports = { presets: ['module:@react-native/babel-preset'], + plugins: ['dynamic-import-node'], }; diff --git a/Apps/Playground/metro.config.js b/Apps/Playground/metro.config.js index 76c069047..d9be65889 100644 --- a/Apps/Playground/metro.config.js +++ b/Apps/Playground/metro.config.js @@ -1,7 +1,12 @@ const path = require("path"); -const { makeMetroConfig } = require("@rnx-kit/metro-config"); -module.exports = makeMetroConfig({ +const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config"); + +module.exports = mergeConfig(getDefaultConfig(__dirname), { + resolver: { + disableHierarchicalLookup: true, + nodeModulesPaths: [path.resolve(__dirname, "node_modules")], + }, transformer: { getTransformOptions: async () => ({ transform: { diff --git a/Apps/Playground/package-lock-windows.json b/Apps/Playground/package-lock-windows.json index 2b4c0fe9a..4efbb488d 100644 --- a/Apps/Playground/package-lock-windows.json +++ b/Apps/Playground/package-lock-windows.json @@ -8,12 +8,11 @@ "name": "Playground", "version": "0.0.1", "dependencies": { - "@babylonjs/core": "9.0.0", - "@babylonjs/loaders": "9.0.0", + "@babylonjs/core": "9.22.2", + "@babylonjs/loaders": "9.22.2", "@babylonjs/react-native": "file:../../Modules/@babylonjs/react-native", "@react-native-community/slider": "^4.2.2", "@react-native/new-app-screen": "^0.81.4", - "@rnx-kit/metro-config": "2.1.0", "base-64": "^1.0.0", "react": "19.1.4", "react-native": "^0.81.4", @@ -32,6 +31,7 @@ "@types/jest": "^29.5.13", "@types/react": "^19.1.0", "@types/react-test-renderer": "^19.1.0", + "babel-plugin-dynamic-import-node": "^2.3.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", @@ -10461,11 +10461,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "9.0.0", + "version": "9.22.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-9.22.2.tgz", + "integrity": "sha512-jCtGm33D9BLdcEivgaaulhcCzOfYDib0oO7lPL2Yk2N3aITpaI/xgbyLscFlUVIerdma3WRs7sI/NZNlbNAo0A==", "license": "Apache-2.0" }, "node_modules/@babylonjs/loaders": { - "version": "9.0.0", + "version": "9.22.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-9.22.2.tgz", + "integrity": "sha512-OhT6o+xhjT58FUAcOC5SuIpbFCkV6urV8JPRDlE5SgKIzZlc+T5JPLrdzJaoC4ZosgJFcHWFVQKomaByWLua6w==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^9.0.0", @@ -12062,28 +12066,6 @@ } } }, - "node_modules/@rnx-kit/metro-config": { - "version": "2.1.0", - "license": "MIT", - "dependencies": { - "@rnx-kit/tools-node": "^3.0.0", - "@rnx-kit/tools-react-native": "^2.0.0", - "@rnx-kit/tools-workspaces": "^0.2.0" - }, - "engines": { - "node": ">=16.17" - }, - "peerDependencies": { - "@react-native/metro-config": "*", - "react": "*", - "react-native": "*" - }, - "peerDependenciesMeta": { - "@react-native/metro-config": { - "optional": true - } - } - }, "node_modules/@rnx-kit/react-native-host": { "version": "0.5.16", "dev": true, @@ -12097,6 +12079,7 @@ }, "node_modules/@rnx-kit/tools-filesystem": { "version": "0.2.0", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -12112,6 +12095,7 @@ }, "node_modules/@rnx-kit/tools-node": { "version": "3.0.4", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/types-node": "^1.0.0" @@ -12122,6 +12106,7 @@ }, "node_modules/@rnx-kit/tools-react-native": { "version": "2.3.7", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/tools-filesystem": "^0.2.0", @@ -12132,22 +12117,9 @@ "node": ">=16.17" } }, - "node_modules/@rnx-kit/tools-workspaces": { - "version": "0.2.3", - "license": "MIT", - "dependencies": { - "fast-glob": "^3.2.7", - "find-up": "^5.0.0", - "micromatch": "^4.0.0", - "read-yaml-file": "^2.1.0", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": ">=16.17" - } - }, "node_modules/@rnx-kit/types-bundle-config": { "version": "1.0.0", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/types-metro-serializer-esbuild": "^1.0.0", @@ -12169,6 +12141,7 @@ }, "node_modules/@rnx-kit/types-kit-config": { "version": "1.0.0", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/types-bundle-config": "^1.0.0" @@ -12179,6 +12152,7 @@ }, "node_modules/@rnx-kit/types-metro-serializer-esbuild": { "version": "1.0.1", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -12186,6 +12160,7 @@ }, "node_modules/@rnx-kit/types-node": { "version": "1.0.0", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/types-kit-config": "^1.0.0" @@ -12196,6 +12171,7 @@ }, "node_modules/@rnx-kit/types-plugin-cyclic-dependencies": { "version": "1.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -12203,6 +12179,7 @@ }, "node_modules/@rnx-kit/types-plugin-duplicates-checker": { "version": "1.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -12210,6 +12187,7 @@ }, "node_modules/@rnx-kit/types-plugin-typescript": { "version": "1.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -12933,6 +12911,16 @@ "@babel/core": "^7.8.0" } }, + "node_modules/babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "object.assign": "^4.1.0" + } + }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "license": "BSD-3-Clause", @@ -18695,17 +18683,6 @@ "dev": true, "license": "MIT" }, - "node_modules/read-yaml-file": { - "version": "2.1.0", - "license": "MIT", - "dependencies": { - "js-yaml": "^4.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": ">=10.13" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "license": "MIT", @@ -19535,6 +19512,7 @@ }, "node_modules/strip-bom": { "version": "4.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -19556,6 +19534,7 @@ }, "node_modules/strip-json-comments": { "version": "3.1.1", + "dev": true, "license": "MIT", "engines": { "node": ">=8" diff --git a/Apps/Playground/package-lock.json b/Apps/Playground/package-lock.json index b78e5b7c2..470d2c578 100644 --- a/Apps/Playground/package-lock.json +++ b/Apps/Playground/package-lock.json @@ -8,12 +8,11 @@ "name": "Playground", "version": "0.0.1", "dependencies": { - "@babylonjs/core": "9.0.0", - "@babylonjs/loaders": "9.0.0", + "@babylonjs/core": "9.22.2", + "@babylonjs/loaders": "9.22.2", "@babylonjs/react-native": "file:../../Modules/@babylonjs/react-native", "@react-native-community/slider": "^4.2.2", "@react-native/new-app-screen": "^0.81.6", - "@rnx-kit/metro-config": "2.1.0", "base-64": "^1.0.0", "react": "19.1.4", "react-native": "^0.81.6", @@ -33,6 +32,7 @@ "@types/jest": "^29.5.13", "@types/react": "^19.1.0", "@types/react-test-renderer": "^19.1.0", + "babel-plugin-dynamic-import-node": "^2.3.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", @@ -2031,15 +2031,15 @@ } }, "node_modules/@babylonjs/core": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-9.0.0.tgz", - "integrity": "sha512-Y4xbHFUw28X4EC5C7NOSzPCOaenxZQgztCB1QZ64y0C85FjZaq5DfWd6gy+EUYklbigmcMIFzCpLj78Wc8EwVw==", + "version": "9.22.2", + "resolved": "https://registry.npmjs.org/@babylonjs/core/-/core-9.22.2.tgz", + "integrity": "sha512-jCtGm33D9BLdcEivgaaulhcCzOfYDib0oO7lPL2Yk2N3aITpaI/xgbyLscFlUVIerdma3WRs7sI/NZNlbNAo0A==", "license": "Apache-2.0" }, "node_modules/@babylonjs/loaders": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-9.0.0.tgz", - "integrity": "sha512-zK8Mh5DmYOj6QILV1ljaEwNqSIxwPLKxFD0U6U8c9x5RbjcMGC0X5KUT05FIVr8tcZI2XCJp6LOd00Xj2NXPIA==", + "version": "9.22.2", + "resolved": "https://registry.npmjs.org/@babylonjs/loaders/-/loaders-9.22.2.tgz", + "integrity": "sha512-OhT6o+xhjT58FUAcOC5SuIpbFCkV6urV8JPRDlE5SgKIzZlc+T5JPLrdzJaoC4ZosgJFcHWFVQKomaByWLua6w==", "license": "Apache-2.0", "peerDependencies": { "@babylonjs/core": "^9.0.0", @@ -3900,30 +3900,6 @@ } } }, - "node_modules/@rnx-kit/metro-config": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@rnx-kit/metro-config/-/metro-config-2.1.0.tgz", - "integrity": "sha512-gkGA+X3ALf7CaV9mKWqUjIp/JLI+Em5mi82GfloyLAJBa4VtDmjbHMI+4xkwa9syr7h2RKfjTTfr6Kl8vgq5/w==", - "license": "MIT", - "dependencies": { - "@rnx-kit/tools-node": "^3.0.0", - "@rnx-kit/tools-react-native": "^2.0.0", - "@rnx-kit/tools-workspaces": "^0.2.0" - }, - "engines": { - "node": ">=16.17" - }, - "peerDependencies": { - "@react-native/metro-config": "*", - "react": "*", - "react-native": "*" - }, - "peerDependenciesMeta": { - "@react-native/metro-config": { - "optional": true - } - } - }, "node_modules/@rnx-kit/react-native-host": { "version": "0.5.16", "resolved": "https://registry.npmjs.org/@rnx-kit/react-native-host/-/react-native-host-0.5.16.tgz", @@ -3941,6 +3917,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/@rnx-kit/tools-filesystem/-/tools-filesystem-0.2.0.tgz", "integrity": "sha512-r5YTy8yy8DWMGdM8yNFlFdX8gE71CHJ2KtpsdSAQN4mol9FFMoAYMwIHrz1i5TyUbtdLd7N/lwWCAK0ZxJYqyQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -3958,6 +3935,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/@rnx-kit/tools-node/-/tools-node-3.0.4.tgz", "integrity": "sha512-jkBrQC71S1rjuWH3y+YPtT/1rgjF69z0EhzY7znUzQJGajKHtb4jjGjS85G41ZB0Bnt45N3NjliiVqUo4O1dzA==", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/types-node": "^1.0.0" @@ -3970,6 +3948,7 @@ "version": "2.3.7", "resolved": "https://registry.npmjs.org/@rnx-kit/tools-react-native/-/tools-react-native-2.3.7.tgz", "integrity": "sha512-AkJJPnpgfrp3pU+AFuM5OIz3stpzZZKMeoREGND85b0q38RcRAiBhk9wH/meTdVvxIsx1dRl9Nysj0v8T0XGqg==", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/tools-filesystem": "^0.2.0", @@ -3980,26 +3959,11 @@ "node": ">=16.17" } }, - "node_modules/@rnx-kit/tools-workspaces": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@rnx-kit/tools-workspaces/-/tools-workspaces-0.2.3.tgz", - "integrity": "sha512-nJ1aRBqUoEPYVdc9cYZtpR6k5F+DcdtLWdlSAGd9f1HU2tqvDpRJhOId9uY3T57fC+YVtPijlp9/55gNGsaiJw==", - "license": "MIT", - "dependencies": { - "fast-glob": "^3.2.7", - "find-up": "^5.0.0", - "micromatch": "^4.0.0", - "read-yaml-file": "^2.1.0", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": ">=16.17" - } - }, "node_modules/@rnx-kit/types-bundle-config": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@rnx-kit/types-bundle-config/-/types-bundle-config-1.0.0.tgz", "integrity": "sha512-nM5EEWr1pvi1bxKLBfHyj5LB5tv5cpRP0e4Pms8OIhIBMdhRJg6JWYDJSZTL57ZB7FigrAXESBYTWi8CjyqTog==", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/types-metro-serializer-esbuild": "^1.0.0", @@ -4023,6 +3987,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@rnx-kit/types-kit-config/-/types-kit-config-1.0.0.tgz", "integrity": "sha512-2ZeAWxgqbnK5rUdty0OeUHn6R9sc8fxSYzjQsa3OYxCwY2ASfKb/8zMr8M7KH2maAU2AQofFi8ud90WPoP9CQQ==", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/types-bundle-config": "^1.0.0" @@ -4035,6 +4000,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@rnx-kit/types-metro-serializer-esbuild/-/types-metro-serializer-esbuild-1.0.1.tgz", "integrity": "sha512-GgSMtc7VHmAdsARLzWFDiLXCP/+S2FQ57Xm7BVpFeyAdYm0vYxhscFqxCAYKgDc4Q7ZzV2DLNg+Z74AyZekeXQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -4044,6 +4010,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@rnx-kit/types-node/-/types-node-1.0.0.tgz", "integrity": "sha512-MSSb47OqfpcboyLQfSN/UfDk5zeUP7mMGBDbBIGXyhBwkKfHKEhSj/rY32uv8B0qIsxLaQ7o6+QLx2kLKGOd3Q==", + "dev": true, "license": "MIT", "dependencies": { "@rnx-kit/types-kit-config": "^1.0.0" @@ -4056,6 +4023,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@rnx-kit/types-plugin-cyclic-dependencies/-/types-plugin-cyclic-dependencies-1.0.0.tgz", "integrity": "sha512-L/Gi2OzKHYJxqe+w9mOnXBu9uhsLi5LvdCf1Xu/xSWOlHFG/M20qt22iaAiIlWnHSoDKkNQEmHTrBpKZd43HIQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -4065,6 +4033,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@rnx-kit/types-plugin-duplicates-checker/-/types-plugin-duplicates-checker-1.0.0.tgz", "integrity": "sha512-y3JjElRuDe9+jdUQxalLb1nQlhaTpId39Qr4vdXjdOR4Z3/NEi9SUcmxWzgtsIh5rwaq/1AXDsSx7llEEASEjg==", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -4074,6 +4043,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/@rnx-kit/types-plugin-typescript/-/types-plugin-typescript-1.0.0.tgz", "integrity": "sha512-5zFk5wPiAEinfT5XH+t7Ka5I/CUnRf/fqnCS7LDj21ReOgGfdrUQ1wXVsV7EoClCNCgUHvWFDdWkbNOFeFa60A==", + "dev": true, "license": "MIT", "engines": { "node": ">=18.12" @@ -4936,6 +4906,16 @@ "@babel/core": "^7.8.0" } }, + "node_modules/babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "object.assign": "^4.1.0" + } + }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -11735,19 +11715,6 @@ "dev": true, "license": "MIT" }, - "node_modules/read-yaml-file": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-2.1.0.tgz", - "integrity": "sha512-UkRNRIwnhG+y7hpqnycCL/xbTk7+ia9VuVTC0S+zVbwd65DI9eUpRMfsWIGrCWxTU/mi+JW8cHQCrv+zfCbEPQ==", - "license": "MIT", - "dependencies": { - "js-yaml": "^4.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": ">=10.13" - } - }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -12738,6 +12705,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -12765,6 +12733,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" diff --git a/Apps/Playground/package-windows.json b/Apps/Playground/package-windows.json index 361b874dd..8bed6cfaa 100644 --- a/Apps/Playground/package-windows.json +++ b/Apps/Playground/package-windows.json @@ -10,12 +10,11 @@ "windows": "react-native run-windows --sln windows/Playground.sln" }, "dependencies": { - "@babylonjs/core": "9.0.0", - "@babylonjs/loaders": "9.0.0", + "@babylonjs/core": "9.22.2", + "@babylonjs/loaders": "9.22.2", "@babylonjs/react-native": "file:../../Modules/@babylonjs/react-native", "@react-native-community/slider": "^4.2.2", "@react-native/new-app-screen": "^0.81.4", - "@rnx-kit/metro-config": "2.1.0", "base-64": "^1.0.0", "react": "19.1.4", "react-native": "^0.81.4", @@ -34,6 +33,7 @@ "@types/jest": "^29.5.13", "@types/react": "^19.1.0", "@types/react-test-renderer": "^19.1.0", + "babel-plugin-dynamic-import-node": "^2.3.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", diff --git a/Apps/Playground/package.json b/Apps/Playground/package.json index 0c7876016..82b6e2fce 100644 --- a/Apps/Playground/package.json +++ b/Apps/Playground/package.json @@ -10,18 +10,17 @@ "windows": "react-native run-windows --sln windows/Playground.sln" }, "dependencies": { - "@babylonjs/core": "9.0.0", - "@babylonjs/loaders": "9.0.0", + "@babylonjs/core": "9.22.2", + "@babylonjs/loaders": "9.22.2", "@babylonjs/react-native": "file:../../Modules/@babylonjs/react-native", "@react-native-community/slider": "^4.2.2", "@react-native/new-app-screen": "^0.81.6", - "@rnx-kit/metro-config": "2.1.0", "base-64": "^1.0.0", "react": "19.1.4", "react-native": "^0.81.6", + "react-native-config": "1.5.5", "react-native-permissions": "^5.4.1", - "react-native-windows": "^0.81.4", - "react-native-config": "1.5.5" + "react-native-windows": "^0.81.4" }, "devDependencies": { "@babel/core": "^7.25.2", @@ -35,11 +34,12 @@ "@types/jest": "^29.5.13", "@types/react": "^19.1.0", "@types/react-test-renderer": "^19.1.0", + "babel-plugin-dynamic-import-node": "^2.3.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", - "react-test-renderer": "19.1.0", "react-native-test-app": "^5.0.0", + "react-test-renderer": "19.1.0", "typescript": "5.0.4" }, "engines": { diff --git a/Modules/@babylonjs/react-native/README.md b/Modules/@babylonjs/react-native/README.md index 166e8d4f0..f3843e8e7 100644 --- a/Modules/@babylonjs/react-native/README.md +++ b/Modules/@babylonjs/react-native/README.md @@ -74,7 +74,7 @@ Babylon.js minimal version: |BabylonReactNative version | Babylon.js version | BabylonNative commit | | ----------- | ------------------------ | --- | -|2.0.2 | 9.0.0 | ce2edf0851e0c8483559832a4f8eb9d39c6b2f53 +|2.0.2 | 9.22.2 | c7f7895f11262a5731ae99ba91b1618dbd09a0aa |2.0.0 | 8.3.0 | 6c25966e8f8c0f3a0c13fdf77064f1bde790391f diff --git a/Modules/@babylonjs/react-native/android/CMakeLists.txt b/Modules/@babylonjs/react-native/android/CMakeLists.txt index 79782c3b9..0fedb037b 100644 --- a/Modules/@babylonjs/react-native/android/CMakeLists.txt +++ b/Modules/@babylonjs/react-native/android/CMakeLists.txt @@ -66,13 +66,37 @@ else() endif() message("-- JSI : " ${JSI_LIB}) -add_library(jsi ALIAS ReactAndroid::jsi) +if(${REACT_NATIVE_VERSION} GREATER_EQUAL 71) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/jsi_bridge.cpp" "") + add_library(jsi STATIC "${CMAKE_CURRENT_BINARY_DIR}/jsi_bridge.cpp") + target_link_libraries(jsi PUBLIC ReactAndroid::jsi) +endif() set(BABYLON_NATIVE_BUILD_APPS OFF CACHE BOOL "") set(BABYLON_REACT_NATIVE_SHARED_DIR "${CMAKE_CURRENT_LIST_DIR}/../shared") set(BABYLON_NATIVE_PLUGIN_NATIVEENGINE_WEBP OFF CACHE BOOL "") add_subdirectory(${BABYLON_REACT_NATIVE_SHARED_DIR} ${CMAKE_CURRENT_BINARY_DIR}/shared) +function(enable_babylon_native_rtti directory) + get_property(targets DIRECTORY "${directory}" PROPERTY BUILDSYSTEM_TARGETS) + foreach(target IN LISTS targets) + get_target_property(target_type ${target} TYPE) + get_target_property(imported ${target} IMPORTED) + if(NOT imported AND target_type MATCHES "^(STATIC_LIBRARY|SHARED_LIBRARY|MODULE_LIBRARY|OBJECT_LIBRARY|EXECUTABLE)$") + target_compile_options(${target} PRIVATE $<$:-frtti>) + endif() + endforeach() + + get_property(subdirectories DIRECTORY "${directory}" PROPERTY SUBDIRECTORIES) + foreach(subdirectory IN LISTS subdirectories) + enable_babylon_native_rtti("${subdirectory}") + endforeach() +endfunction() + +# React Native's JSI headers use dynamic_cast, including from templates +# instantiated by BabylonNative targets. +enable_babylon_native_rtti("${BABYLON_REACT_NATIVE_SHARED_DIR}") + if (TARGET NativeXr) disable_warnings(NativeXr) endif() diff --git a/Modules/@babylonjs/react-native/android/build.gradle b/Modules/@babylonjs/react-native/android/build.gradle index 52894ac97..eceddcac2 100644 --- a/Modules/@babylonjs/react-native/android/build.gradle +++ b/Modules/@babylonjs/react-native/android/build.gradle @@ -39,7 +39,16 @@ apply plugin: 'kotlin-android' def reactNativeArchitectures() { def value = project.getProperties().get("reactNativeArchitectures") - return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] + def architectures = value ? value.split(",").collect { it.trim() } : ["armeabi-v7a", "x86_64", "arm64-v8a"] + // The 32-bit x86 ABI is not supported: bgfx's bx uses SSE4.x intrinsics + // (_mm_blendv_ps, _mm_round_ps), which are above the Android x86 ABI baseline + // of SSSE3 and fail to compile. Drop it rather than break the whole build for + // consumers still carrying x86 in the React Native default property. + def unsupported = architectures.findAll { it == "x86" } + if (!unsupported.isEmpty()) { + logger.warn("BabylonReactNative: skipping unsupported ABI 'x86' (requires SSE4.x, unavailable on the Android x86 baseline).") + } + return architectures - unsupported } static def findNodeModules(baseDir) { diff --git a/Modules/@babylonjs/react-native/react-native-babylon.podspec b/Modules/@babylonjs/react-native/react-native-babylon.podspec index c1e80889d..8e2ffe593 100644 --- a/Modules/@babylonjs/react-native/react-native-babylon.podspec +++ b/Modules/@babylonjs/react-native/react-native-babylon.podspec @@ -32,7 +32,6 @@ items = ['/shared/BabylonNative/Repo/Polyfills/Canvas', '/_deps/glslang-build/OGLCompilersDLL', '/_deps/glslang-build/SPIRV', '/_deps/urllib-build', - '/_deps/libwebp-build', '/_deps/jsruntimehost-build/Polyfills/XMLHttpRequest', '/_deps/jsruntimehost-build/Polyfills/Scheduling', '/_deps/jsruntimehost-build/Core/JsRuntime', @@ -102,10 +101,7 @@ Pod::Spec.new do |s| 'Window', 'XMLHttpRequest', 'ShaderCache', - 'ShaderCompiler', - 'webp', - 'metal-cpp', - 'sharpyuv'] + 'ShaderCompiler'] if ENV['BABYLON_NATIVE_PLUGIN_NATIVECAMERA'] != '0' libs << 'NativeCamera' diff --git a/Modules/@babylonjs/react-native/shared/BabylonNative/CMakeLists.txt b/Modules/@babylonjs/react-native/shared/BabylonNative/CMakeLists.txt index be49daed7..5e0aa01c2 100644 --- a/Modules/@babylonjs/react-native/shared/BabylonNative/CMakeLists.txt +++ b/Modules/@babylonjs/react-native/shared/BabylonNative/CMakeLists.txt @@ -10,7 +10,6 @@ set(FETCHCONTENT_SOURCE_DIR_CMAKEEXTENSIONS "${CMAKE_CURRENT_SOURCE_DIR}/deps/cm set(FETCHCONTENT_SOURCE_DIR_JSRUNTIMEHOST "${CMAKE_CURRENT_SOURCE_DIR}/deps/jsruntimehost-src") set(FETCHCONTENT_SOURCE_DIR_URLLIB "${CMAKE_CURRENT_SOURCE_DIR}/deps/urllib-src") set(FETCHCONTENT_SOURCE_DIR_SPIRV-CROSS "${CMAKE_CURRENT_SOURCE_DIR}/deps/spirv-cross-src") -set(FETCHCONTENT_SOURCE_DIR_LIBWEBP "${CMAKE_CURRENT_SOURCE_DIR}/deps/libwebp-src") set(FETCHCONTENT_SOURCE_DIR_GLSLANG "${CMAKE_CURRENT_SOURCE_DIR}/deps/glslang-src") set(FETCHCONTENT_SOURCE_DIR_BASE-N "${CMAKE_CURRENT_SOURCE_DIR}/deps/base-n-src") set(FETCHCONTENT_SOURCE_DIR_IOS-CMAKE "${CMAKE_CURRENT_SOURCE_DIR}/deps/ios-cmake-src") diff --git a/Modules/@babylonjs/react-native/windows/BabylonReactNative/BabylonReactNative.vcxproj b/Modules/@babylonjs/react-native/windows/BabylonReactNative/BabylonReactNative.vcxproj index 9fdeec3b5..557fab908 100644 --- a/Modules/@babylonjs/react-native/windows/BabylonReactNative/BabylonReactNative.vcxproj +++ b/Modules/@babylonjs/react-native/windows/BabylonReactNative/BabylonReactNative.vcxproj @@ -148,7 +148,6 @@ $(BabylonNativeBuildDir)_deps\jsruntimehost-build\Polyfills\XMLHttpRequest\$(Configuration); $(BabylonNativeBuildDir)_deps\jsruntimehost-build\Core\Foundation\$(Configuration); $(BabylonNativeBuildDir)_deps\urllib-build\$(Configuration); - $(BabylonNativeBuildDir)_deps\libwebp-build\$(Configuration); $(BabylonNativeBuildDir)_deps\bgfx.cmake-build\cmake\bgfx\$(Configuration); $(BabylonNativeBuildDir)_deps\bgfx.cmake-build\cmake\bx\$(Configuration); $(BabylonNativeBuildDir)_deps\bgfx.cmake-build\cmake\bimg\$(Configuration); @@ -207,8 +206,6 @@ SPIRVd.lib; UrlLib.lib; Window.lib; - libwebp.lib; - libsharpyuv.lib; Scheduling.lib; XMLHttpRequest.lib; WindowsApp.lib; @@ -269,8 +266,6 @@ Scheduling.lib; XMLHttpRequest.lib; WindowsApp.lib; - libwebp.lib; - libsharpyuv.lib; %(AdditionalDependencies); %(AdditionalOptions) diff --git a/Package/gulpfile.js b/Package/gulpfile.js index 2d498c74e..6886c054f 100644 --- a/Package/gulpfile.js +++ b/Package/gulpfile.js @@ -230,7 +230,7 @@ const createPackage = async () => { exec('npm pack', 'Assembled'); }; -const COMMIT_ID = 'ce2edf0851e0c8483559832a4f8eb9d39c6b2f53'; +const COMMIT_ID = 'c7f7895f11262a5731ae99ba91b1618dbd09a0aa'; const ZIP_URL = `https://github.com/BabylonJS/BabylonNative/archive/${COMMIT_ID}.zip`; const TARGET_DIR = path.resolve(__dirname, '../Modules/@babylonjs/react-native/shared/BabylonNative'); const ZIP_PATH = path.join(TARGET_DIR, `${COMMIT_ID}.zip`); @@ -274,6 +274,20 @@ function deleteFile(filePath) { return fs.promises.unlink(filePath); } +async function renameWithRetries(source, destination) { + for (let attempt = 1; attempt <= 5; attempt++) { + try { + await fs.promises.rename(source, destination); + return; + } catch (error) { + if (error.code !== 'EPERM' || attempt === 5) { + throw error; + } + await new Promise(resolve => setTimeout(resolve, attempt * 250)); + } + } +} + function runCMake(buildDir) { let cmakeCommand = `cmake -S . -B ../tempBuild -DBABYLON_NATIVE_BUILD_SOURCETREE=ON -DBABYLON_NATIVE_BUILD_APPS=OFF -DBABYLON_NATIVE_PLUGIN_TESTUTILS=OFF -DBABYLON_NATIVE_INSTALL=OFF`; @@ -359,10 +373,8 @@ const buildBabylonNativeSourceTree = async () => { await deleteFile(ZIP_PATH); console.log('Renaming BabylonNative-xxx folder ...'); - await fs.rename(`${TARGET_DIR}/BabylonNative-${COMMIT_ID}`, `${TARGET_DIR}/Repo`, (err) => { - if (err) throw err; - console.log('Rename complete!'); - }); + await renameWithRetries(`${TARGET_DIR}/BabylonNative-${COMMIT_ID}`, `${TARGET_DIR}/Repo`); + console.log('Rename complete!'); console.log('Running CMake...'); await runCMake(UNZIP_FOLDER); @@ -380,7 +392,10 @@ const buildBabylonNativeSourceTree = async () => { deleteFolderRecursive(`${UNZIP_FOLDER}/Install`); // dependencies cleanup - deleteFolderRecursive(`${DEPS_OUTPUT_DIR}/bgfx.cmake-src/bgfx/3rdparty`, ['renderdoc', 'stb', 'sdf']); + // Keep only the 3rdparty folders that bgfx/src actually includes: + // renderdoc (debug_renderdoc.cpp), metal-cpp (renderer_mtl.h), h264 (video.h), + // plus stb/sdf. + deleteFolderRecursive(`${DEPS_OUTPUT_DIR}/bgfx.cmake-src/bgfx/3rdparty`, ['renderdoc', 'stb', 'sdf', 'metal-cpp', 'h264']); deleteFolderRecursive(`${DEPS_OUTPUT_DIR}/bgfx.cmake-src/bgfx/examples`,['common']); deleteFolderRecursive(`${DEPS_OUTPUT_DIR}/bgfx.cmake-src/bgfx/bindings`); deleteFolderRecursive(`${DEPS_OUTPUT_DIR}/bgfx.cmake-src/bgfx/docs`);