Skip to content
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

[WIP] enable new arch #3244

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 17 additions & 14 deletions package/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@ find_library(LOG_LIB log)
add_definitions(-DEGL_EGLEXT_PROTOTYPES)
add_definitions(-DGL_GLEXT_PROTOTYPES)

if (ENABLE_FRAME_PROCESSORS)
if(ENABLE_FRAME_PROCESSORS)
add_definitions(-DVISION_CAMERA_ENABLE_FRAME_PROCESSORS=true)
else()
add_definitions(-DVISION_CAMERA_ENABLE_FRAME_PROCESSORS=false)
endif()


# Add react-native-vision-camera sources
add_library(
${PACKAGE_NAME}
SHARED

# Java JNI
src/main/cpp/VisionCamera.cpp
src/main/cpp/MutableJByteBuffer.cpp

# Frame Processor
src/main/cpp/frameprocessors/FrameHostObject.cpp
src/main/cpp/frameprocessors/FrameProcessorPluginHostObject.cpp
Expand Down Expand Up @@ -57,20 +58,22 @@ target_include_directories(
# Link everything together
target_link_libraries(
${PACKAGE_NAME}
${LOG_LIB} # <-- Logcat logger
android # <-- Android JNI core
ReactAndroid::jsi # <-- RN: JSI
ReactAndroid::reactnativejni # <-- RN: React Native JNI bindings
fbjni::fbjni # <-- fbjni
${LOG_LIB} # <-- Logcat logger
android # <-- Android JNI core
ReactAndroid::jsi # <-- RN: JSI
ReactAndroid::reactnativejni # <-- RN: React Native JNI bindings
fbjni::fbjni # <-- fbjni
)

# Optionally also add Frame Processors here
message("VisionCamera: Frame Processors: ${ENABLE_FRAME_PROCESSORS}!")
if (ENABLE_FRAME_PROCESSORS)
message("VisionCamera: Linking react-native-worklets...")
find_package(react-native-worklets-core REQUIRED CONFIG)
target_link_libraries(
${PACKAGE_NAME}
react-native-worklets-core::rnworklets
)

if(ENABLE_FRAME_PROCESSORS)
message("VisionCamera: Linking react-native-worklets...")

find_package(react-native-worklets-core REQUIRED CONFIG)
target_link_libraries(
${PACKAGE_NAME}
react-native-worklets-core::rnworklets
)
endif()
2 changes: 1 addition & 1 deletion package/example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
4 changes: 4 additions & 0 deletions package/example/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ echo "rm -rf android/.gradle"
rm -rf android/.gradle
echo "rm -rf android/build"
rm -rf android/build
echo "rm -rf android/app/build"
rm -rf android/app/build
echo "rm -rf android/app/.cxx"
rm -rf android/app/.cxx

cd ios
echo "pod deintegrate"
Expand Down
178 changes: 148 additions & 30 deletions package/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ PODS:
- hermes-engine (0.75.4):
- hermes-engine/Pre-built (= 0.75.4)
- hermes-engine/Pre-built (0.75.4)
- MMKV (1.3.9):
- MMKVCore (~> 1.3.9)
- MMKVCore (1.3.9)
- RCT-Folly (2024.01.01.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -1282,11 +1279,10 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-mmkv (2.12.2):
- react-native-mmkv (3.0.2):
- DoubleConversion
- glog
- hermes-engine
- MMKV (>= 1.3.3)
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
Expand All @@ -1305,7 +1301,71 @@ PODS:
- ReactCommon/turbomodule/core
- Yoga
- react-native-safe-area-context (4.11.0):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- react-native-safe-area-context/common (= 4.11.0)
- react-native-safe-area-context/fabric (= 4.11.0)
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-safe-area-context/common (4.11.0):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-safe-area-context/fabric (4.11.0):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- react-native-safe-area-context/common
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-skia (1.4.2):
- DoubleConversion
- glog
Expand Down Expand Up @@ -1351,6 +1411,27 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-video/Fabric (6.6.4):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-video/Video (6.6.4):
- DoubleConversion
- glog
Expand All @@ -1364,6 +1445,7 @@ PODS:
- React-featureflags
- React-graphics
- React-ImageManager
- react-native-video/Fabric
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
Expand All @@ -1372,10 +1454,27 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-worklets-core (1.3.3):
- React
- React-callinvoker
- react-native-worklets-core (2.0.0-beta.4):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- React-nativeconfig (0.75.4)
- React-NativeModulesApple (0.75.4):
- glog
Expand Down Expand Up @@ -1723,6 +1822,29 @@ PODS:
- ReactCommon/turbomodule/core
- Yoga
- RNScreens (3.34.0):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-RCTImage
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNScreens/common (= 3.34.0)
- Yoga
- RNScreens/common (3.34.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1863,8 +1985,6 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- MMKV
- MMKVCore
- SocketRocket

EXTERNAL SOURCES:
Expand Down Expand Up @@ -2027,8 +2147,6 @@ SPEC CHECKSUMS:
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0
MMKV: 817ba1eea17421547e01e087285606eb270a8dcb
MMKVCore: af055b00e27d88cd92fad301c5fecd1ff9b26dd9
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1
RCTRequired: a94e7febda6db0345d207e854323c37e3a31d93b
Expand All @@ -2039,16 +2157,16 @@ SPEC CHECKSUMS:
React-CoreModules: 9fac2d31803c0ed03e4ddaa17f1481714f8633a5
React-cxxreact: a979810a3ca4045ceb09407a17563046a7f71494
React-debug: 3d21f69d8def0656f8b8ec25c0f05954f4d862c5
React-defaultsnativemodule: 2fa2bdb7bd03ff9764facc04aa8520ebf14febae
React-domnativemodule: 986e6fe7569e1383dce452a7b013b6c843a752df
React-defaultsnativemodule: 5bb91842d2bd91c5e9d23f67f5913a1226e8d1f2
React-domnativemodule: a8ff57705d8372d7182e9277110ad290d50ffeed
React-Fabric: 3bc7be9e3a6b7581fc828dc2aa041e107fc8ffb8
React-FabricComponents: 668e0cb02344c2942e4c8921a643648faa6dc364
React-FabricImage: 3f44dd25a2b020ed5215d4438a1bb1f3461cd4f1
React-featureflags: ee1abd6f71555604a36cda6476e3c502ca9a48e5
React-featureflagsnativemodule: 7ccc0cd666c2a6257401dceb7920818ac2b42803
React-featureflagsnativemodule: d91903b8ad0e82b1eee3e7845d08024fbd6c758f
React-graphics: d7dd9c8d75cad5af19e19911fa370f78f2febd96
React-hermes: 2069b08e965e48b7f8aa2c0ca0a2f383349ed55d
React-idlecallbacksnativemodule: e211b2099b6dced97959cb58257bab2b2de4d7ef
React-idlecallbacksnativemodule: 568f7db5c625852e3eac25a5686760da152f0225
React-ImageManager: ab7a7d17dd0ff1ef1d4e1e88197d1119da9957ce
React-jserrorhandler: d9e867bb83b868472f3f7601883f0403b3e3942d
React-jsi: d68f1d516e5120a510afe356647a6a1e1f98f2db
Expand All @@ -2057,23 +2175,23 @@ SPEC CHECKSUMS:
React-jsitracing: 0e8c0aadb1fcec6b1e4f2a66ee3b0da80f0f8615
React-logger: d79b704bf215af194f5213a6b7deec50ba8e6a9b
React-Mapbuffer: b982d5bba94a8bc073bda48f0d27c9b28417fae3
React-microtasksnativemodule: 2b73e68f0462f3175f98782db08896f8501afd20
react-native-blur: a1bf334589f44658a58a859b1f3defe28e367fcf
react-native-cameraroll: b3395629565d1663b4f340c7314e7c04e88c9b3c
react-native-mmkv: 7d0b6c2a79e73100b933f2947a9c8741d664e18b
react-native-safe-area-context: 851c62c48dce80ccaa5637b6aa5991a1bc36eca9
react-native-skia: 8cbbeae25285ade497b646696103832e67ffd64b
react-native-video: 155a792d16b64f1fb68b1795d805808f34e60488
react-native-worklets-core: f51430dd07bf5343d4918d28a4bb00fe8f98b982
React-microtasksnativemodule: 2cec1d6e126598df0f165268afa231174dd1a611
react-native-blur: 28b0a731ed804bed3e88757c2414305896e6b47e
react-native-cameraroll: 6407cec6b16f9c00404bb34bd1d80c4752b31673
react-native-mmkv: 2435b053067cff3698fa2a68221e2954c5bfa0e9
react-native-safe-area-context: f1fda705dfe14355f41933debb5932887e234cc5
react-native-skia: c825cb272f6129fe148989eaf662c302d4f60587
react-native-video: 5673f1661e4422dcf6529c9c1eb2094b1867da42
react-native-worklets-core: afea29f54881e75d5ff50c6fcc1597cd2a3c9255
React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794
React-NativeModulesApple: 9f7920224a3b0c7d04d77990067ded14cee3c614
React-perflogger: 59e1a3182dca2cee7b9f1f7aab204018d46d1914
React-performancetimeline: a9d05533ff834c6aa1f532e05e571f3fd2e3c1ed
React-RCTActionSheet: d80e68d3baa163e4012a47c1f42ddd8bcd9672cc
React-RCTAnimation: bde981f6bd7f8493696564da9b3bd05721d3b3cc
React-RCTAppDelegate: 0176615c51476c88212bf3edbafb840d39ea7631
React-RCTAppDelegate: b21d50ec42f18fedae765629d56850538a8c98d7
React-RCTBlob: 520a0382bf8e89b9153d60e3c6293e51615834e9
React-RCTFabric: c9da097b19b30017a99498b8c66a69c72f3ce689
React-RCTFabric: a083f6c78c6084a0ac332934fc5cfc4271bab61f
React-RCTImage: 90448d2882464af6015ed57c98f463f8748be465
React-RCTLinking: 1bd95d0a704c271d21d758e0f0388cced768d77d
React-RCTNetwork: 218af6e63eb9b47935cc5a775b7a1396cf10ff91
Expand All @@ -2091,11 +2209,11 @@ SPEC CHECKSUMS:
React-utils: cbe8b8b3d7b2ac282e018e46f0e7b25cdc87c5a0
ReactCodegen: 4bcb34e6b5ebf6eef5cee34f55aa39991ea1c1f1
ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad
RNGestureHandler: 6dfe7692a191ee224748964127114edf057a1475
RNReanimated: 625f9e7f53cba61d7b3436e8e6e209d1dd4e6e9b
RNScreens: 19719a9c326e925498ac3b2d35c4e50fe87afc06
RNGestureHandler: c374c750a0a9bacd95f5c740d146ab9428549d6b
RNReanimated: 879fb9842e45340799f45f5c6d9f483f45e76bc2
RNScreens: de6e57426ba0e6cbc3fb5b4f496e7f08cb2773c2
RNStaticSafeAreaInsets: 055ddbf5e476321720457cdaeec0ff2ba40ec1b8
RNVectorIcons: 6382277afab3c54658e9d555ee0faa7a37827136
RNVectorIcons: 07792a9538e8577c1263fcad187712e90d65d8fb
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
VisionCamera: 3b7cfecebbcb3871c4dd3fb47791b96a47fe5371
Yoga: aa3df615739504eebb91925fc9c58b4922ea9a08
Expand Down
8 changes: 3 additions & 5 deletions package/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"pods": "cd ios && pod install",
"pods": "cd ios && RCT_NEW_ARCH_ENABLED=1 pod install",
"lint": "eslint . --fix",
"lint-ci": "yarn lint -f ../node_modules/@firmnav/eslint-github-actions-formatter/dist/formatter.js",
"typescript": "tsc --noEmit"
Expand All @@ -21,15 +21,14 @@
"react": "^18.3.1",
"react-native": "^0.75.4",
"react-native-gesture-handler": "^2.20.0",
"react-native-mmkv": "^2.12.2",
"react-native-mmkv": "^3.0.2",
"react-native-pressable-opacity": "^1.0.10",
"react-native-reanimated": "^3.15.5",
"react-native-safe-area-context": "^4.11.0",
"react-native-screens": "^3.34.0",
"react-native-static-safe-area-insets": "^2.2.0",
"react-native-vector-icons": "^10.2.0",
"react-native-video": "^6.6.4",
"react-native-worklets-core": "^1.3.3"
"react-native-worklets-core": "^2.0.0-beta.4"
},
"devDependencies": {
"@babel/core": "^7.24.7",
Expand All @@ -41,7 +40,6 @@
"@react-native/typescript-config": "0.75.4",
"@types/react": "^18.3.3",
"@types/react-native-vector-icons": "^6.4.13",
"@types/react-native-video": "^5.0.20",
"babel-plugin-module-resolver": "^5.0.2",
"eslint": "^8.46.0",
"eslint-plugin-prettier": "^5.1.3",
Expand Down
Loading