diff --git a/.github/workflows/pr-realm-js.yml b/.github/workflows/pr-realm-js.yml index f6b14bc816..e0777696f3 100644 --- a/.github/workflows/pr-realm-js.yml +++ b/.github/workflows/pr-realm-js.yml @@ -602,8 +602,8 @@ jobs: env: USE_CCACHE: 1 USE_HERMES: 1 - USE_BRIDGELESS: 0 # Disabling for now - RCT_NEW_ARCH_ENABLED: 0 # Disabled for now + USE_BRIDGELESS: 1 + RCT_NEW_ARCH_ENABLED: 1 working-directory: integration-tests/environments/react-native-test-app/ios timeout-minutes: 15 run: pod install --verbose @@ -630,8 +630,6 @@ jobs: - build-ts - generate-jsi - prebuild-android - env: - SPAWN_LOGCAT: true runs-on: macos-latest-large timeout-minutes: 60 steps: diff --git a/integration-tests/environments/react-native-test-app/android/gradle.properties b/integration-tests/environments/react-native-test-app/android/gradle.properties index b4687e9b30..0db4fc64f5 100644 --- a/integration-tests/environments/react-native-test-app/android/gradle.properties +++ b/integration-tests/environments/react-native-test-app/android/gradle.properties @@ -40,8 +40,8 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 # to write custom TurboModules/Fabric components OR use libraries that # are providing them. # Note that this is incompatible with web debugging. -#newArchEnabled=true -#bridgelessEnabled=true +newArchEnabled=true +bridgelessEnabled=true # Uncomment the line below to build React Native from source. #react.buildFromSource=true diff --git a/integration-tests/environments/react-native-test-app/harness/runner.js b/integration-tests/environments/react-native-test-app/harness/runner.js index b2d2c660fc..c49aa5fc07 100644 --- a/integration-tests/environments/react-native-test-app/harness/runner.js +++ b/integration-tests/environments/react-native-test-app/harness/runner.js @@ -139,7 +139,7 @@ async function run(spawnLogcat) { if (PLATFORM === "android") { // Start the log cat (skipping any initial pid from an old run) if (spawnLogcat) { - logcat.start("com.realmreactnativetests", true).catch(console.error); + logcat.start("com.microsoft.reacttestapp", true).catch(console.error); } // Ask React Native to build and run the app // Using --active-arch-only as per https://reactnative.dev/docs/build-speed#build-only-one-abi-during-development-android-only diff --git a/integration-tests/environments/react-native-test-app/ios/Podfile.lock b/integration-tests/environments/react-native-test-app/ios/Podfile.lock index 761dd28c2c..3f1ec42c0a 100644 --- a/integration-tests/environments/react-native-test-app/ios/Podfile.lock +++ b/integration-tests/environments/react-native-test-app/ios/Podfile.lock @@ -1,12 +1,12 @@ PODS: - boost (1.83.0) - DoubleConversion (1.1.6) - - FBLazyVector (0.74.1) + - FBLazyVector (0.74.2) - fmt (9.1.0) - glog (0.3.5) - - hermes-engine (0.74.1): - - hermes-engine/Pre-built (= 0.74.1) - - hermes-engine/Pre-built (0.74.1) + - hermes-engine (0.74.2): + - hermes-engine/Pre-built (= 0.74.2) + - hermes-engine/Pre-built (0.74.2) - RCT-Folly (2024.01.01.00): - boost - DoubleConversion @@ -23,27 +23,27 @@ PODS: - DoubleConversion - fmt (= 9.1.0) - glog - - RCTDeprecation (0.74.1) - - RCTRequired (0.74.1) - - RCTTypeSafety (0.74.1): - - FBLazyVector (= 0.74.1) - - RCTRequired (= 0.74.1) - - React-Core (= 0.74.1) - - React (0.74.1): - - React-Core (= 0.74.1) - - React-Core/DevSupport (= 0.74.1) - - React-Core/RCTWebSocket (= 0.74.1) - - React-RCTActionSheet (= 0.74.1) - - React-RCTAnimation (= 0.74.1) - - React-RCTBlob (= 0.74.1) - - React-RCTImage (= 0.74.1) - - React-RCTLinking (= 0.74.1) - - React-RCTNetwork (= 0.74.1) - - React-RCTSettings (= 0.74.1) - - React-RCTText (= 0.74.1) - - React-RCTVibration (= 0.74.1) - - React-callinvoker (0.74.1) - - React-Codegen (0.74.1): + - RCTDeprecation (0.74.2) + - RCTRequired (0.74.2) + - RCTTypeSafety (0.74.2): + - FBLazyVector (= 0.74.2) + - RCTRequired (= 0.74.2) + - React-Core (= 0.74.2) + - React (0.74.2): + - React-Core (= 0.74.2) + - React-Core/DevSupport (= 0.74.2) + - React-Core/RCTWebSocket (= 0.74.2) + - React-RCTActionSheet (= 0.74.2) + - React-RCTAnimation (= 0.74.2) + - React-RCTBlob (= 0.74.2) + - React-RCTImage (= 0.74.2) + - React-RCTLinking (= 0.74.2) + - React-RCTNetwork (= 0.74.2) + - React-RCTSettings (= 0.74.2) + - React-RCTText (= 0.74.2) + - React-RCTVibration (= 0.74.2) + - React-callinvoker (0.74.2) + - React-Codegen (0.74.2): - DoubleConversion - glog - hermes-engine @@ -63,12 +63,12 @@ PODS: - React-utils - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - React-Core (0.74.1): + - React-Core (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - RCTDeprecation - - React-Core/Default (= 0.74.1) + - React-Core/Default (= 0.74.2) - React-cxxreact - React-featureflags - React-hermes @@ -80,7 +80,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/CoreModulesHeaders (0.74.1): + - React-Core/CoreModulesHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -97,7 +97,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/Default (0.74.1): + - React-Core/Default (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -113,13 +113,13 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/DevSupport (0.74.1): + - React-Core/DevSupport (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - RCTDeprecation - - React-Core/Default (= 0.74.1) - - React-Core/RCTWebSocket (= 0.74.1) + - React-Core/Default (= 0.74.2) + - React-Core/RCTWebSocket (= 0.74.2) - React-cxxreact - React-featureflags - React-hermes @@ -131,7 +131,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTActionSheetHeaders (0.74.1): + - React-Core/RCTActionSheetHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -148,7 +148,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTAnimationHeaders (0.74.1): + - React-Core/RCTAnimationHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -165,7 +165,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTBlobHeaders (0.74.1): + - React-Core/RCTBlobHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -182,7 +182,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTImageHeaders (0.74.1): + - React-Core/RCTImageHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -199,7 +199,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTLinkingHeaders (0.74.1): + - React-Core/RCTLinkingHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -216,7 +216,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTNetworkHeaders (0.74.1): + - React-Core/RCTNetworkHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -233,7 +233,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTSettingsHeaders (0.74.1): + - React-Core/RCTSettingsHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -250,7 +250,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTTextHeaders (0.74.1): + - React-Core/RCTTextHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -267,7 +267,7 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTVibrationHeaders (0.74.1): + - React-Core/RCTVibrationHeaders (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -284,12 +284,12 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-Core/RCTWebSocket (0.74.1): + - React-Core/RCTWebSocket (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - RCTDeprecation - - React-Core/Default (= 0.74.1) + - React-Core/Default (= 0.74.2) - React-cxxreact - React-featureflags - React-hermes @@ -301,36 +301,36 @@ PODS: - React-utils - SocketRocket (= 0.7.0) - Yoga - - React-CoreModules (0.74.1): + - React-CoreModules (0.74.2): - DoubleConversion - fmt (= 9.1.0) - RCT-Folly (= 2024.01.01.00) - - RCTTypeSafety (= 0.74.1) + - RCTTypeSafety (= 0.74.2) - React-Codegen - - React-Core/CoreModulesHeaders (= 0.74.1) - - React-jsi (= 0.74.1) + - React-Core/CoreModulesHeaders (= 0.74.2) + - React-jsi (= 0.74.2) - React-jsinspector - React-NativeModulesApple - React-RCTBlob - - React-RCTImage (= 0.74.1) + - React-RCTImage (= 0.74.2) - ReactCommon - SocketRocket (= 0.7.0) - - React-cxxreact (0.74.1): + - React-cxxreact (0.74.2): - boost (= 1.83.0) - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-callinvoker (= 0.74.1) - - React-debug (= 0.74.1) - - React-jsi (= 0.74.1) + - React-callinvoker (= 0.74.2) + - React-debug (= 0.74.2) + - React-jsi (= 0.74.2) - React-jsinspector - - React-logger (= 0.74.1) - - React-perflogger (= 0.74.1) - - React-runtimeexecutor (= 0.74.1) - - React-debug (0.74.1) - - React-Fabric (0.74.1): + - React-logger (= 0.74.2) + - React-perflogger (= 0.74.2) + - React-runtimeexecutor (= 0.74.2) + - React-debug (0.74.2) + - React-Fabric (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -341,20 +341,20 @@ PODS: - React-Core - React-cxxreact - React-debug - - React-Fabric/animations (= 0.74.1) - - React-Fabric/attributedstring (= 0.74.1) - - React-Fabric/componentregistry (= 0.74.1) - - React-Fabric/componentregistrynative (= 0.74.1) - - React-Fabric/components (= 0.74.1) - - React-Fabric/core (= 0.74.1) - - React-Fabric/imagemanager (= 0.74.1) - - React-Fabric/leakchecker (= 0.74.1) - - React-Fabric/mounting (= 0.74.1) - - React-Fabric/scheduler (= 0.74.1) - - React-Fabric/telemetry (= 0.74.1) - - React-Fabric/templateprocessor (= 0.74.1) - - React-Fabric/textlayoutmanager (= 0.74.1) - - React-Fabric/uimanager (= 0.74.1) + - React-Fabric/animations (= 0.74.2) + - React-Fabric/attributedstring (= 0.74.2) + - React-Fabric/componentregistry (= 0.74.2) + - React-Fabric/componentregistrynative (= 0.74.2) + - React-Fabric/components (= 0.74.2) + - React-Fabric/core (= 0.74.2) + - React-Fabric/imagemanager (= 0.74.2) + - React-Fabric/leakchecker (= 0.74.2) + - React-Fabric/mounting (= 0.74.2) + - React-Fabric/scheduler (= 0.74.2) + - React-Fabric/telemetry (= 0.74.2) + - React-Fabric/templateprocessor (= 0.74.2) + - React-Fabric/textlayoutmanager (= 0.74.2) + - React-Fabric/uimanager (= 0.74.2) - React-graphics - React-jsi - React-jsiexecutor @@ -363,7 +363,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/animations (0.74.1): + - React-Fabric/animations (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -382,7 +382,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/attributedstring (0.74.1): + - React-Fabric/attributedstring (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -401,7 +401,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/componentregistry (0.74.1): + - React-Fabric/componentregistry (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -420,7 +420,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/componentregistrynative (0.74.1): + - React-Fabric/componentregistrynative (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -439,7 +439,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components (0.74.1): + - React-Fabric/components (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -450,17 +450,17 @@ PODS: - React-Core - React-cxxreact - React-debug - - React-Fabric/components/inputaccessory (= 0.74.1) - - React-Fabric/components/legacyviewmanagerinterop (= 0.74.1) - - React-Fabric/components/modal (= 0.74.1) - - React-Fabric/components/rncore (= 0.74.1) - - React-Fabric/components/root (= 0.74.1) - - React-Fabric/components/safeareaview (= 0.74.1) - - React-Fabric/components/scrollview (= 0.74.1) - - React-Fabric/components/text (= 0.74.1) - - React-Fabric/components/textinput (= 0.74.1) - - React-Fabric/components/unimplementedview (= 0.74.1) - - React-Fabric/components/view (= 0.74.1) + - React-Fabric/components/inputaccessory (= 0.74.2) + - React-Fabric/components/legacyviewmanagerinterop (= 0.74.2) + - React-Fabric/components/modal (= 0.74.2) + - React-Fabric/components/rncore (= 0.74.2) + - React-Fabric/components/root (= 0.74.2) + - React-Fabric/components/safeareaview (= 0.74.2) + - React-Fabric/components/scrollview (= 0.74.2) + - React-Fabric/components/text (= 0.74.2) + - React-Fabric/components/textinput (= 0.74.2) + - React-Fabric/components/unimplementedview (= 0.74.2) + - React-Fabric/components/view (= 0.74.2) - React-graphics - React-jsi - React-jsiexecutor @@ -469,7 +469,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/inputaccessory (0.74.1): + - React-Fabric/components/inputaccessory (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -488,7 +488,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/legacyviewmanagerinterop (0.74.1): + - React-Fabric/components/legacyviewmanagerinterop (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -507,7 +507,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/modal (0.74.1): + - React-Fabric/components/modal (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -526,7 +526,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/rncore (0.74.1): + - React-Fabric/components/rncore (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -545,7 +545,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/root (0.74.1): + - React-Fabric/components/root (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -564,7 +564,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/safeareaview (0.74.1): + - React-Fabric/components/safeareaview (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -583,7 +583,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/scrollview (0.74.1): + - React-Fabric/components/scrollview (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -602,7 +602,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/text (0.74.1): + - React-Fabric/components/text (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -621,7 +621,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/textinput (0.74.1): + - React-Fabric/components/textinput (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -640,7 +640,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/unimplementedview (0.74.1): + - React-Fabric/components/unimplementedview (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -659,7 +659,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/view (0.74.1): + - React-Fabric/components/view (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -679,7 +679,7 @@ PODS: - React-utils - ReactCommon/turbomodule/core - Yoga - - React-Fabric/core (0.74.1): + - React-Fabric/core (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -698,7 +698,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/imagemanager (0.74.1): + - React-Fabric/imagemanager (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -717,7 +717,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/leakchecker (0.74.1): + - React-Fabric/leakchecker (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -736,7 +736,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/mounting (0.74.1): + - React-Fabric/mounting (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -755,7 +755,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/scheduler (0.74.1): + - React-Fabric/scheduler (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -774,7 +774,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/telemetry (0.74.1): + - React-Fabric/telemetry (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -793,7 +793,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/templateprocessor (0.74.1): + - React-Fabric/templateprocessor (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -812,7 +812,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/textlayoutmanager (0.74.1): + - React-Fabric/textlayoutmanager (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -832,7 +832,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/uimanager (0.74.1): + - React-Fabric/uimanager (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog @@ -851,45 +851,45 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-FabricImage (0.74.1): + - React-FabricImage (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) - - RCTRequired (= 0.74.1) - - RCTTypeSafety (= 0.74.1) + - RCTRequired (= 0.74.2) + - RCTTypeSafety (= 0.74.2) - React-Fabric - React-graphics - React-ImageManager - React-jsi - - React-jsiexecutor (= 0.74.1) + - React-jsiexecutor (= 0.74.2) - React-logger - React-rendererdebug - React-utils - ReactCommon - Yoga - - React-featureflags (0.74.1) - - React-graphics (0.74.1): + - React-featureflags (0.74.2) + - React-graphics (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog - RCT-Folly/Fabric (= 2024.01.01.00) - - React-Core/Default (= 0.74.1) + - React-Core/Default (= 0.74.2) - React-utils - - React-hermes (0.74.1): + - React-hermes (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-cxxreact (= 0.74.1) + - React-cxxreact (= 0.74.2) - React-jsi - - React-jsiexecutor (= 0.74.1) + - React-jsiexecutor (= 0.74.2) - React-jsinspector - - React-perflogger (= 0.74.1) + - React-perflogger (= 0.74.2) - React-runtimeexecutor - - React-ImageManager (0.74.1): + - React-ImageManager (0.74.2): - glog - RCT-Folly/Fabric - React-Core/Default @@ -898,47 +898,47 @@ PODS: - React-graphics - React-rendererdebug - React-utils - - React-jserrorhandler (0.74.1): + - React-jserrorhandler (0.74.2): - RCT-Folly/Fabric (= 2024.01.01.00) - React-debug - React-jsi - React-Mapbuffer - - React-jsi (0.74.1): + - React-jsi (0.74.2): - boost (= 1.83.0) - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-jsiexecutor (0.74.1): + - React-jsiexecutor (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-cxxreact (= 0.74.1) - - React-jsi (= 0.74.1) + - React-cxxreact (= 0.74.2) + - React-jsi (= 0.74.2) - React-jsinspector - - React-perflogger (= 0.74.1) - - React-jsinspector (0.74.1): + - React-perflogger (= 0.74.2) + - React-jsinspector (0.74.2): - DoubleConversion - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - React-featureflags - React-jsi - - React-runtimeexecutor (= 0.74.1) - - React-jsitracing (0.74.1): + - React-runtimeexecutor (= 0.74.2) + - React-jsitracing (0.74.2): - React-jsi - - React-logger (0.74.1): + - React-logger (0.74.2): - glog - - React-Mapbuffer (0.74.1): + - React-Mapbuffer (0.74.2): - glog - React-debug - react-native-get-random-values (1.11.0): - React-Core - - React-nativeconfig (0.74.1) - - React-NativeModulesApple (0.74.1): + - React-nativeconfig (0.74.2) + - React-NativeModulesApple (0.74.2): - glog - hermes-engine - React-callinvoker @@ -949,10 +949,10 @@ PODS: - React-runtimeexecutor - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - React-perflogger (0.74.1) - - React-RCTActionSheet (0.74.1): - - React-Core/RCTActionSheetHeaders (= 0.74.1) - - React-RCTAnimation (0.74.1): + - React-perflogger (0.74.2) + - React-RCTActionSheet (0.74.2): + - React-Core/RCTActionSheetHeaders (= 0.74.2) + - React-RCTAnimation (0.74.2): - RCT-Folly (= 2024.01.01.00) - RCTTypeSafety - React-Codegen @@ -960,7 +960,7 @@ PODS: - React-jsi - React-NativeModulesApple - ReactCommon - - React-RCTAppDelegate (0.74.1): + - React-RCTAppDelegate (0.74.2): - RCT-Folly (= 2024.01.01.00) - RCTRequired - RCTTypeSafety @@ -984,7 +984,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon - - React-RCTBlob (0.74.1): + - React-RCTBlob (0.74.2): - DoubleConversion - fmt (= 9.1.0) - hermes-engine @@ -997,7 +997,7 @@ PODS: - React-NativeModulesApple - React-RCTNetwork - ReactCommon - - React-RCTFabric (0.74.1): + - React-RCTFabric (0.74.2): - glog - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) @@ -1017,7 +1017,7 @@ PODS: - React-runtimescheduler - React-utils - Yoga - - React-RCTImage (0.74.1): + - React-RCTImage (0.74.2): - RCT-Folly (= 2024.01.01.00) - RCTTypeSafety - React-Codegen @@ -1026,14 +1026,14 @@ PODS: - React-NativeModulesApple - React-RCTNetwork - ReactCommon - - React-RCTLinking (0.74.1): + - React-RCTLinking (0.74.2): - React-Codegen - - React-Core/RCTLinkingHeaders (= 0.74.1) - - React-jsi (= 0.74.1) + - React-Core/RCTLinkingHeaders (= 0.74.2) + - React-jsi (= 0.74.2) - React-NativeModulesApple - ReactCommon - - ReactCommon/turbomodule/core (= 0.74.1) - - React-RCTNetwork (0.74.1): + - ReactCommon/turbomodule/core (= 0.74.2) + - React-RCTNetwork (0.74.2): - RCT-Folly (= 2024.01.01.00) - RCTTypeSafety - React-Codegen @@ -1041,7 +1041,7 @@ PODS: - React-jsi - React-NativeModulesApple - ReactCommon - - React-RCTSettings (0.74.1): + - React-RCTSettings (0.74.2): - RCT-Folly (= 2024.01.01.00) - RCTTypeSafety - React-Codegen @@ -1049,23 +1049,23 @@ PODS: - React-jsi - React-NativeModulesApple - ReactCommon - - React-RCTText (0.74.1): - - React-Core/RCTTextHeaders (= 0.74.1) + - React-RCTText (0.74.2): + - React-Core/RCTTextHeaders (= 0.74.2) - Yoga - - React-RCTVibration (0.74.1): + - React-RCTVibration (0.74.2): - RCT-Folly (= 2024.01.01.00) - React-Codegen - React-Core/RCTVibrationHeaders - React-jsi - React-NativeModulesApple - ReactCommon - - React-rendererdebug (0.74.1): + - React-rendererdebug (0.74.2): - DoubleConversion - fmt (= 9.1.0) - RCT-Folly (= 2024.01.01.00) - React-debug - - React-rncore (0.74.1) - - React-RuntimeApple (0.74.1): + - React-rncore (0.74.2) + - React-RuntimeApple (0.74.2): - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) - React-callinvoker @@ -1083,7 +1083,7 @@ PODS: - React-runtimeexecutor - React-RuntimeHermes - React-utils - - React-RuntimeCore (0.74.1): + - React-RuntimeCore (0.74.2): - glog - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) @@ -1096,9 +1096,9 @@ PODS: - React-runtimeexecutor - React-runtimescheduler - React-utils - - React-runtimeexecutor (0.74.1): - - React-jsi (= 0.74.1) - - React-RuntimeHermes (0.74.1): + - React-runtimeexecutor (0.74.2): + - React-jsi (= 0.74.2) + - React-RuntimeHermes (0.74.2): - hermes-engine - RCT-Folly/Fabric (= 2024.01.01.00) - React-featureflags @@ -1109,7 +1109,7 @@ PODS: - React-nativeconfig - React-RuntimeCore - React-utils - - React-runtimescheduler (0.74.1): + - React-runtimescheduler (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) @@ -1121,52 +1121,52 @@ PODS: - React-rendererdebug - React-runtimeexecutor - React-utils - - React-utils (0.74.1): + - React-utils (0.74.2): - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - React-debug - - React-jsi (= 0.74.1) - - ReactCommon (0.74.1): - - ReactCommon/turbomodule (= 0.74.1) - - ReactCommon/turbomodule (0.74.1): + - React-jsi (= 0.74.2) + - ReactCommon (0.74.2): + - ReactCommon/turbomodule (= 0.74.2) + - ReactCommon/turbomodule (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-callinvoker (= 0.74.1) - - React-cxxreact (= 0.74.1) - - React-jsi (= 0.74.1) - - React-logger (= 0.74.1) - - React-perflogger (= 0.74.1) - - ReactCommon/turbomodule/bridging (= 0.74.1) - - ReactCommon/turbomodule/core (= 0.74.1) - - ReactCommon/turbomodule/bridging (0.74.1): + - React-callinvoker (= 0.74.2) + - React-cxxreact (= 0.74.2) + - React-jsi (= 0.74.2) + - React-logger (= 0.74.2) + - React-perflogger (= 0.74.2) + - ReactCommon/turbomodule/bridging (= 0.74.2) + - ReactCommon/turbomodule/core (= 0.74.2) + - ReactCommon/turbomodule/bridging (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-callinvoker (= 0.74.1) - - React-cxxreact (= 0.74.1) - - React-jsi (= 0.74.1) - - React-logger (= 0.74.1) - - React-perflogger (= 0.74.1) - - ReactCommon/turbomodule/core (0.74.1): + - React-callinvoker (= 0.74.2) + - React-cxxreact (= 0.74.2) + - React-jsi (= 0.74.2) + - React-logger (= 0.74.2) + - React-perflogger (= 0.74.2) + - ReactCommon/turbomodule/core (0.74.2): - DoubleConversion - fmt (= 9.1.0) - glog - hermes-engine - RCT-Folly (= 2024.01.01.00) - - React-callinvoker (= 0.74.1) - - React-cxxreact (= 0.74.1) - - React-debug (= 0.74.1) - - React-jsi (= 0.74.1) - - React-logger (= 0.74.1) - - React-perflogger (= 0.74.1) - - React-utils (= 0.74.1) - - ReactNativeHost (0.4.9): + - React-callinvoker (= 0.74.2) + - React-cxxreact (= 0.74.2) + - React-debug (= 0.74.2) + - React-jsi (= 0.74.2) + - React-logger (= 0.74.2) + - React-perflogger (= 0.74.2) + - React-utils (= 0.74.2) + - ReactNativeHost (0.4.10): - DoubleConversion - glog - hermes-engine @@ -1182,13 +1182,14 @@ PODS: - React-graphics - React-ImageManager - React-NativeModulesApple + - React-RCTAppDelegate - React-RCTFabric - React-rendererdebug - React-utils - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - ReactTestApp-DevSupport (3.7.3): + - ReactTestApp-DevSupport (3.8.7): - React-Core - React-jsi - ReactTestApp-Resources (1.0.0-dev) @@ -1280,7 +1281,7 @@ EXTERNAL SOURCES: :podspec: "../../../../node_modules/react-native/third-party-podspecs/glog.podspec" hermes-engine: :podspec: "../../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" - :tag: hermes-2024-04-25-RNv0.74.1-b54a3a01c531f4f5f1904cb0770033e8b7153dff + :tag: hermes-2024-06-03-RNv0.74.2-bb1e74fe1e95c2b5a2f4f9311152da052badc2bc RCT-Folly: :podspec: "../../../../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" RCTDeprecation: @@ -1393,65 +1394,65 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 - FBLazyVector: 898d14d17bf19e2435cafd9ea2a1033efe445709 + FBLazyVector: 4bc164e5b5e6cfc288d2b5ff28643ea15fa1a589 fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 - glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 - hermes-engine: 16b8530de1b383cdada1476cf52d1b52f0692cbc + glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f + hermes-engine: 01d3e052018c2a13937aca1860fbedbccd4a41b7 RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47 - RCTDeprecation: efb313d8126259e9294dc4ee0002f44a6f676aba - RCTRequired: f49ea29cece52aee20db633ae7edc4b271435562 - RCTTypeSafety: a11979ff0570d230d74de9f604f7d19692157bc4 - React: 88794fad7f460349dbc9df8a274d95f37a009f5d - React-callinvoker: 7a7023e34a55c89ea2aa62486bb3c1164ab0be0c - React-Codegen: 7f39b6f7d0d9b36d816ccc6ff1e14111b3804b24 - React-Core: 60075333bc22b5a793d3f62e207368b79bff2e64 - React-CoreModules: 147c314d6b3b1e069c9ad64cbbbeba604854ff86 - React-cxxreact: 5de27fd8bff4764acb2eac3ee66001e0e2b910e7 - React-debug: 6397f0baf751b40511d01e984b01467d7e6d8127 - React-Fabric: 6fa475e16e0a37b38d462cec32b70fd5cf886305 - React-FabricImage: 7e09b3704e3fa084b4d44b5b5ef6e2e3d3334ec0 - React-featureflags: 2eb79dd9df4095bff519379f2a4c915069e330bb - React-graphics: 82a482a3aa5d9659b74cdf2c8b57faf67eaa10fb - React-hermes: d93936b02de2fd7e67c11e92c16d4278a14d0134 - React-ImageManager: ebb3c4812e2c5acba5a89728c2d77729471329ad - React-jserrorhandler: a08e0adcf1612900dde82b8bf8e93e7d2ad953b3 - React-jsi: f46d09ee5079a4f3b637d30d0e59b8ea6470632c - React-jsiexecutor: e73579560957aa3ca9dc02ab90e163454279d48c - React-jsinspector: e8ba20dde269c7c1d45784b858fa1cf4383f0bbb - React-jsitracing: 233d1a798fe0ff33b8e630b8f00f62c4a8115fbc - React-logger: 7e7403a2b14c97f847d90763af76b84b152b6fce - React-Mapbuffer: 11029dcd47c5c9e057a4092ab9c2a8d10a496a33 + RCTDeprecation: b03c35057846b685b3ccadc9bfe43e349989cdb2 + RCTRequired: 194626909cfa8d39ca6663138c417bc6c431648c + RCTTypeSafety: 552aff5b8e8341660594db00e53ac889682bc120 + React: a57fe42044fe6ed3e828f8867ce070a6c5872754 + React-callinvoker: 6bedefb354a8848b534752417954caa3a5cf34f9 + React-Codegen: 4bf8f084710196b5db5fe9c127066ac6827da527 + React-Core: 289ee3dfc1639bb9058c1e77427bb48169c26d7a + React-CoreModules: eda5ce541a1f552158317abd90a5a0f6a4f8d6f7 + React-cxxreact: 56bd17ccc6d4248116f7f95884ddb8c528379fb6 + React-debug: 164b8e302404d92d4bec39778a5e03bcb1b6eb08 + React-Fabric: 05620c36074e3ab397dd8f9db0deb6d3c38b4efa + React-FabricImage: 2a8a7f5729f5c44e32e6f58f7225ee1017ed0704 + React-featureflags: d97a6393993052e951e16a3b81206e22110be8d2 + React-graphics: ef07d701f4eb72ae6fca6ed0a7260a04f2a58dec + React-hermes: 6ccc301ababfa17a9aad25a7e33faf325fd024b4 + React-ImageManager: 00404bfe122626bc6493621f2a31ce802115a9b3 + React-jserrorhandler: 5e2632590a84363855b2083e6b3d501e93bc3f04 + React-jsi: 828703c235f4eea1647897ee8030efdc6e8e9f14 + React-jsiexecutor: 713d7bbef0a410cee5b3b78f73ed1fc16e177ba7 + React-jsinspector: e1fa5325a47f34645195c63e3312ddb6a2efef5d + React-jsitracing: 0fa7f78d8fdda794667cb2e6f19c874c1cf31d7e + React-logger: 29fa3e048f5f67fe396bc08af7606426d9bd7b5d + React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326 react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06 - React-nativeconfig: b0073a590774e8b35192fead188a36d1dca23dec - React-NativeModulesApple: df46ff3e3de5b842b30b4ca8a6caae6d7c8ab09f - React-perflogger: 3d31e0d1e8ad891e43a09ac70b7b17a79773003a - React-RCTActionSheet: c4a3a134f3434c9d7b0c1054f1a8cfed30c7a093 - React-RCTAnimation: 0e5d15320eeece667fcceb6c785acf9a184e9da1 - React-RCTAppDelegate: c4f6c0700b8950a8b18c2e004996eec1807d430a - React-RCTBlob: c46aaaee693d371a1c7cae2a8c8ee2aa7fbc1adb - React-RCTFabric: 0dbf28ce96c7f2843483e32a725a5b5793584ff3 - React-RCTImage: a04dba5fcc823244f5822192c130ecf09623a57f - React-RCTLinking: 533bf13c745fcb2a0c14e0e49fd149586a7f0d14 - React-RCTNetwork: a29e371e0d363d7b4c10ab907bc4d6ae610541e9 - React-RCTSettings: 127813224780861d0d30ecda17a40d1dfebe7d73 - React-RCTText: 8a823f245ecf82edb7569646e3c4d8041deb800a - React-RCTVibration: 46b5fae74e63f240f22f39de16ad6433da3b65d9 - React-rendererdebug: 4653f8da6ab1d7b01af796bdf8ca47a927539e39 - React-rncore: 4f1e645acb5107bd4b4cf29eff17b04a7cd422f3 - React-RuntimeApple: 013b606e743efb5ee14ef03c32379b78bfe74354 - React-RuntimeCore: 7205be45a25713b5418bbf2db91ddfcca0761d8b - React-runtimeexecutor: a278d4249921853d4a3f24e4d6e0ff30688f3c16 - React-RuntimeHermes: 44c628568ce8feedc3acfbd48fc07b7f0f6d2731 - React-runtimescheduler: e2152ed146b6a35c07386fc2ac4827b27e6aad12 - React-utils: 3285151c9d1e3a28a9586571fc81d521678c196d - ReactCommon: f42444e384d82ab89184aed5d6f3142748b54768 - ReactNativeHost: a365307db1ece0c4825b9d0f8b35de1bb2a61b0a - ReactTestApp-DevSupport: 9052e9a0ba3a96a3cc574ee66c7b6089ee76b341 + React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1 + React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0 + React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994 + React-RCTActionSheet: 19f967ddaea258182b56ef11437133b056ba2adf + React-RCTAnimation: d7f4137fc44a08bba465267ea7cb1dbdb7c4ec87 + React-RCTAppDelegate: dca95e1a6194f7ae06c2b5f1d5f891c61af00ec8 + React-RCTBlob: c6c3e1e0251700b7bea036b893913f22e2b9cb47 + React-RCTFabric: a7874c54aea18f64677446efc5f839ec4fa5e931 + React-RCTImage: 40528ab74a4fef0f0e2ee797a074b26d120b6cc6 + React-RCTLinking: 385b5beb96749aae9ae1606746e883e1c9f8a6a7 + React-RCTNetwork: ffc9f05bd8fa5b3bce562199ba41235ad0af645c + React-RCTSettings: 21914178bb65cb2c20c655ae1fb401617ae74618 + React-RCTText: 7f8dba1a311e99f4de15bbace2350e805f33f024 + React-RCTVibration: e4ccf673579d0d94a96b3a0b64492db08f8324d5 + React-rendererdebug: ac70f40de137ce7bdbc55eaee60c467a215d9923 + React-rncore: edfff7a3f7f82ca1e0ba26978c6d84c7a8970dac + React-RuntimeApple: a0c98b75571aa5f44ddc7c6e9fd55803fa4db00f + React-RuntimeCore: 4b8db1fe2f3f4a3a5ecb22e1a419824e3e2cd7ef + React-runtimeexecutor: 5961acc7a77b69f964e1645a5d6069e124ce6b37 + React-RuntimeHermes: c5825bfae4815fdf4e9e639340c3a986a491884c + React-runtimescheduler: 56b642bf605ba5afa500d35790928fc1d51565ad + React-utils: 4476b7fcbbd95cfd002f3e778616155241d86e31 + ReactCommon: ecad995f26e0d1e24061f60f4e5d74782f003f12 + ReactNativeHost: fd9d65f6ee7947f468537d35b3fefe8b2bf546da + ReactTestApp-DevSupport: 33a7ae9bf22161f359629a9607f5ef27e9c91fd0 ReactTestApp-Resources: d200e68756fa45c648f369210bd7ee0c14759f5a - RealmJS: ecd23895a68689ce2c048d28df3d699cf76cedb7 + RealmJS: b7ed9bcfaac0946479403b684d158d922f41384e RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 348f8b538c3ed4423eb58a8e5730feec50bce372 + Yoga: ae3c32c514802d30f687a04a6a35b348506d411f PODFILE CHECKSUM: 31a428908a285ec58ff867a2a56fd19780e5be51 diff --git a/integration-tests/environments/react-native-test-app/package.json b/integration-tests/environments/react-native-test-app/package.json index a788bfbd5c..95442b54c1 100644 --- a/integration-tests/environments/react-native-test-app/package.json +++ b/integration-tests/environments/react-native-test-app/package.json @@ -23,6 +23,7 @@ "command": "mocha-remote --reporter @realm/mocha-reporter -- concurrently --kill-others-on-fail npm:metro npm:runner", "dependencies": [ "../../../packages/realm:build:ts", + "../../../packages/realm:bindgen:jsi", "../../../packages/mocha-reporter:bundle" ], "env": { @@ -37,7 +38,7 @@ }, "ORG_GRADLE_PROJECT_bridgelessEnabled": { "external": true, - "default": "false" + "default": "true" } } }, @@ -78,11 +79,11 @@ }, "RCT_NEW_ARCH_ENABLED": { "external": true, - "default": "0" + "default": "1" }, "USE_BRIDGELESS": { "external": true, - "default": "0" + "default": "1" } } }, @@ -108,11 +109,11 @@ }, "RCT_NEW_ARCH_ENABLED": { "external": true, - "default": "0" + "default": "1" }, "USE_BRIDGELESS": { "external": true, - "default": "0" + "default": "1" } } }, @@ -134,7 +135,7 @@ "mocha-remote-react-native": "^1.12.3", "path-browserify": "^1.0.1", "react": "18.2.0", - "react-native": "0.74.1", + "react-native": "0.74.2", "react-native-fetch-api": "^3.0.0", "react-native-fs": "^2.20.0", "react-native-get-random-values": "^1.11.0", diff --git a/package-lock.json b/package-lock.json index 19ef2eb192..a662b53275 100644 --- a/package-lock.json +++ b/package-lock.json @@ -208,7 +208,7 @@ "mocha-remote-react-native": "^1.12.3", "path-browserify": "^1.0.1", "react": "18.2.0", - "react-native": "0.74.1", + "react-native": "0.74.2", "react-native-fetch-api": "^3.0.0", "react-native-fs": "^2.20.0", "react-native-get-random-values": "^1.11.0", @@ -232,21 +232,6 @@ "react-native-test-app": "^3.8.7" } }, - "integration-tests/environments/react-native-test-app/node_modules/@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" - }, - "engines": { - "node": ">= 10.14.2" - } - }, "integration-tests/environments/react-native-test-app/node_modules/@react-native/babel-plugin-codegen": { "version": "0.74.83", "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.74.83.tgz", @@ -336,6 +321,170 @@ "@babel/preset-env": "^7.1.6" } }, + "integration-tests/environments/react-native-test-app/node_modules/@react-native/community-cli-plugin": { + "version": "0.74.84", + "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.74.84.tgz", + "integrity": "sha512-GBKE+1sUh86fS2XXV46gMCNHMc1KetshMbYJ0AhDhldpaILZHqRBX50mdVsiYVvkzp4QjM0nmYqefuJ9NVwicQ==", + "dependencies": { + "@react-native-community/cli-server-api": "13.6.8", + "@react-native-community/cli-tools": "13.6.8", + "@react-native/dev-middleware": "0.74.84", + "@react-native/metro-babel-transformer": "0.74.84", + "chalk": "^4.0.0", + "execa": "^5.1.1", + "metro": "^0.80.3", + "metro-config": "^0.80.3", + "metro-core": "^0.80.3", + "node-fetch": "^2.2.0", + "querystring": "^0.2.1", + "readline": "^1.3.0" + }, + "engines": { + "node": ">=18" + } + }, + "integration-tests/environments/react-native-test-app/node_modules/@react-native/community-cli-plugin/node_modules/@react-native/babel-plugin-codegen": { + "version": "0.74.84", + "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.74.84.tgz", + "integrity": "sha512-UR4uiii5szIJA84mSC6GJOfYKDq7/ThyetOQT62+BBcyGeHVtHlNLNRzgaMeLqIQaT8Fq4pccMI+7QqLOMXzdw==", + "dependencies": { + "@react-native/codegen": "0.74.84" + }, + "engines": { + "node": ">=18" + } + }, + "integration-tests/environments/react-native-test-app/node_modules/@react-native/community-cli-plugin/node_modules/@react-native/babel-preset": { + "version": "0.74.84", + "resolved": "https://registry.npmjs.org/@react-native/babel-preset/-/babel-preset-0.74.84.tgz", + "integrity": "sha512-WUfu6Y4aGuVdocQZvx33BJiQWFH6kRCHYbZfBn2psgFrSRLgQWEQrDCxqPFObNAVSayM0rNhp2FvI5K/Eyeqlg==", + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/plugin-proposal-async-generator-functions": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.18.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.18.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.20.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.20.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-default-from": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.18.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-syntax-optional-chaining": "^7.0.0", + "@babel/plugin-transform-arrow-functions": "^7.0.0", + "@babel/plugin-transform-async-to-generator": "^7.20.0", + "@babel/plugin-transform-block-scoping": "^7.0.0", + "@babel/plugin-transform-classes": "^7.0.0", + "@babel/plugin-transform-computed-properties": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.20.0", + "@babel/plugin-transform-flow-strip-types": "^7.20.0", + "@babel/plugin-transform-function-name": "^7.0.0", + "@babel/plugin-transform-literals": "^7.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.0.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.0.0", + "@babel/plugin-transform-parameters": "^7.0.0", + "@babel/plugin-transform-private-methods": "^7.22.5", + "@babel/plugin-transform-private-property-in-object": "^7.22.11", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx-self": "^7.0.0", + "@babel/plugin-transform-react-jsx-source": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0", + "@babel/plugin-transform-spread": "^7.0.0", + "@babel/plugin-transform-sticky-regex": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.5.0", + "@babel/plugin-transform-unicode-regex": "^7.0.0", + "@babel/template": "^7.0.0", + "@react-native/babel-plugin-codegen": "0.74.84", + "babel-plugin-transform-flow-enums": "^0.0.2", + "react-refresh": "^0.14.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "integration-tests/environments/react-native-test-app/node_modules/@react-native/community-cli-plugin/node_modules/@react-native/codegen": { + "version": "0.74.84", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.74.84.tgz", + "integrity": "sha512-0hXlnu9i0o8v+gXKQi+x6T471L85kCDwW4WrJiYAeOheWrQdNNW6rC3g8+LL7HXAf7QcHGU/8/d57iYfdVK2BQ==", + "dependencies": { + "@babel/parser": "^7.20.0", + "glob": "^7.1.1", + "hermes-parser": "0.19.1", + "invariant": "^2.2.4", + "jscodeshift": "^0.14.0", + "mkdirp": "^0.5.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@babel/preset-env": "^7.1.6" + } + }, + "integration-tests/environments/react-native-test-app/node_modules/@react-native/community-cli-plugin/node_modules/@react-native/metro-babel-transformer": { + "version": "0.74.84", + "resolved": "https://registry.npmjs.org/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.74.84.tgz", + "integrity": "sha512-YtVGq7jkgyUECv5yt4BOFbOXyW4ddUn8+dnwGGpJKdfhXYL5o5++AxNdE+2x+SZdkj3JUVekGKPwRabFECABaw==", + "dependencies": { + "@babel/core": "^7.20.0", + "@react-native/babel-preset": "0.74.84", + "hermes-parser": "0.19.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "integration-tests/environments/react-native-test-app/node_modules/@react-native/dev-middleware": { + "version": "0.74.84", + "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.74.84.tgz", + "integrity": "sha512-veYw/WmyrAOQHUiIeULzn2duJQnXDPiKq2jZ/lcmDo6jsLirpp+Q73lx09TYgy/oVoPRuV0nfmU3x9B6EV/7qQ==", + "dependencies": { + "@isaacs/ttlcache": "^1.4.1", + "@react-native/debugger-frontend": "0.74.84", + "@rnx-kit/chromium-edge-launcher": "^1.0.0", + "chrome-launcher": "^0.15.2", + "connect": "^3.6.5", + "debug": "^2.2.0", + "node-fetch": "^2.2.0", + "nullthrows": "^1.1.1", + "open": "^7.0.3", + "selfsigned": "^2.4.1", + "serve-static": "^1.13.1", + "temp-dir": "^2.0.0", + "ws": "^6.2.2" + }, + "engines": { + "node": ">=18" + } + }, + "integration-tests/environments/react-native-test-app/node_modules/@react-native/dev-middleware/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "integration-tests/environments/react-native-test-app/node_modules/@react-native/js-polyfills": { "version": "0.74.83", "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.74.83.tgz", @@ -377,14 +526,6 @@ "node": ">=18" } }, - "integration-tests/environments/react-native-test-app/node_modules/@types/yargs": { - "version": "15.0.19", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.19.tgz", - "integrity": "sha512-2XUaGVmyQjgyAZldf0D0c14vvo/yv0MhQBSTJcejMMaitsn3nxCB6TmH4G0ZQf+uxROOa9mpanoSm8h6SG/1ZA==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, "integration-tests/environments/react-native-test-app/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -429,84 +570,6 @@ "node": "*" } }, - "integration-tests/environments/react-native-test-app/node_modules/pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", - "dependencies": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" - }, - "engines": { - "node": ">= 10" - } - }, - "integration-tests/environments/react-native-test-app/node_modules/react-native": { - "version": "0.74.1", - "resolved": "https://registry.npmjs.org/react-native/-/react-native-0.74.1.tgz", - "integrity": "sha512-0H2XpmghwOtfPpM2LKqHIN7gxy+7G/r1hwJHKLV6uoyXGC/gCojRtoo5NqyKrWpFC8cqyT6wTYCLuG7CxEKilg==", - "dependencies": { - "@jest/create-cache-key-function": "^29.6.3", - "@react-native-community/cli": "13.6.6", - "@react-native-community/cli-platform-android": "13.6.6", - "@react-native-community/cli-platform-ios": "13.6.6", - "@react-native/assets-registry": "0.74.83", - "@react-native/codegen": "0.74.83", - "@react-native/community-cli-plugin": "0.74.83", - "@react-native/gradle-plugin": "0.74.83", - "@react-native/js-polyfills": "0.74.83", - "@react-native/normalize-colors": "0.74.83", - "@react-native/virtualized-lists": "0.74.83", - "abort-controller": "^3.0.0", - "anser": "^1.4.9", - "ansi-regex": "^5.0.0", - "base64-js": "^1.5.1", - "chalk": "^4.0.0", - "event-target-shim": "^5.0.1", - "flow-enums-runtime": "^0.0.6", - "invariant": "^2.2.4", - "jest-environment-node": "^29.6.3", - "jsc-android": "^250231.0.0", - "memoize-one": "^5.0.0", - "metro-runtime": "^0.80.3", - "metro-source-map": "^0.80.3", - "mkdirp": "^0.5.1", - "nullthrows": "^1.1.1", - "pretty-format": "^26.5.2", - "promise": "^8.3.0", - "react-devtools-core": "^5.0.0", - "react-refresh": "^0.14.0", - "react-shallow-renderer": "^16.15.0", - "regenerator-runtime": "^0.13.2", - "scheduler": "0.24.0-canary-efb381bbf-20230505", - "stacktrace-parser": "^0.1.10", - "whatwg-fetch": "^3.0.0", - "ws": "^6.2.2", - "yargs": "^17.6.2" - }, - "bin": { - "react-native": "cli.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/react": "^18.2.6", - "react": "18.2.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "integration-tests/environments/react-native-test-app/node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" - }, "integration-tests/environments/react-native-test-app/node_modules/web-streams-polyfill": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0.tgz", @@ -4745,165 +4808,20 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, - "node_modules/@react-native-community/cli": { + "node_modules/@react-native-community/cli-debugger-ui": { "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-13.6.6.tgz", - "integrity": "sha512-IqclB7VQ84ye8Fcs89HOpOscY4284VZg2pojHNl8H0Lzd4DadXJWQoxC7zWm8v2f8eyeX2kdhxp2ETD5tceIgA==", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-13.6.6.tgz", + "integrity": "sha512-Vv9u6eS4vKSDAvdhA0OiQHoA7y39fiPIgJ6biT32tN4avHDtxlc6TWZGiqv7g98SBvDWvoVAmdPLcRf3kU+c8g==", "dependencies": { - "@react-native-community/cli-clean": "13.6.6", - "@react-native-community/cli-config": "13.6.6", - "@react-native-community/cli-debugger-ui": "13.6.6", - "@react-native-community/cli-doctor": "13.6.6", - "@react-native-community/cli-hermes": "13.6.6", - "@react-native-community/cli-server-api": "13.6.6", - "@react-native-community/cli-tools": "13.6.6", - "@react-native-community/cli-types": "13.6.6", - "chalk": "^4.1.2", - "commander": "^9.4.1", - "deepmerge": "^4.3.0", - "execa": "^5.0.0", - "find-up": "^4.1.0", - "fs-extra": "^8.1.0", - "graceful-fs": "^4.1.3", - "prompts": "^2.4.2", - "semver": "^7.5.2" - }, - "bin": { - "react-native": "build/bin.js" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@react-native-community/cli-clean": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-clean/-/cli-clean-13.6.6.tgz", - "integrity": "sha512-cBwJTwl0NyeA4nyMxbhkWZhxtILYkbU3TW3k8AXLg+iGphe0zikYMGB3T+haTvTc6alTyEFwPbimk9bGIqkjAQ==", - "dependencies": { - "@react-native-community/cli-tools": "13.6.6", - "chalk": "^4.1.2", - "execa": "^5.0.0", - "fast-glob": "^3.3.2" - } - }, - "node_modules/@react-native-community/cli-config": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-config/-/cli-config-13.6.6.tgz", - "integrity": "sha512-mbG425zCKr8JZhv/j11382arezwS/70juWMsn8j2lmrGTrP1cUdW0MF15CCIFtJsqyK3Qs+FTmqttRpq81QfSg==", - "dependencies": { - "@react-native-community/cli-tools": "13.6.6", - "chalk": "^4.1.2", - "cosmiconfig": "^5.1.0", - "deepmerge": "^4.3.0", - "fast-glob": "^3.3.2", - "joi": "^17.2.1" - } - }, - "node_modules/@react-native-community/cli-debugger-ui": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-13.6.6.tgz", - "integrity": "sha512-Vv9u6eS4vKSDAvdhA0OiQHoA7y39fiPIgJ6biT32tN4avHDtxlc6TWZGiqv7g98SBvDWvoVAmdPLcRf3kU+c8g==", - "dependencies": { - "serve-static": "^1.13.1" - } - }, - "node_modules/@react-native-community/cli-doctor": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-doctor/-/cli-doctor-13.6.6.tgz", - "integrity": "sha512-TWZb5g6EmQe2Ua2TEWNmyaEayvlWH4GmdD9ZC+p8EpKFpB1NpDGMK6sXbpb42TDvwZg5s4TDRplK0PBEA/SVDg==", - "dependencies": { - "@react-native-community/cli-config": "13.6.6", - "@react-native-community/cli-platform-android": "13.6.6", - "@react-native-community/cli-platform-apple": "13.6.6", - "@react-native-community/cli-platform-ios": "13.6.6", - "@react-native-community/cli-tools": "13.6.6", - "chalk": "^4.1.2", - "command-exists": "^1.2.8", - "deepmerge": "^4.3.0", - "envinfo": "^7.10.0", - "execa": "^5.0.0", - "hermes-profile-transformer": "^0.0.6", - "node-stream-zip": "^1.9.1", - "ora": "^5.4.1", - "semver": "^7.5.2", - "strip-ansi": "^5.2.0", - "wcwidth": "^1.0.1", - "yaml": "^2.2.1" - } - }, - "node_modules/@react-native-community/cli-doctor/node_modules/@react-native-community/cli-platform-apple": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-apple/-/cli-platform-apple-13.6.6.tgz", - "integrity": "sha512-bOmSSwoqNNT3AmCRZXEMYKz1Jf1l2F86Nhs7qBcXdY/sGiJ+Flng564LOqvdAlVLTbkgz47KjNKCS2pP4Jg0Mg==", - "dependencies": { - "@react-native-community/cli-tools": "13.6.6", - "chalk": "^4.1.2", - "execa": "^5.0.0", - "fast-glob": "^3.3.2", - "fast-xml-parser": "^4.0.12", - "ora": "^5.4.1" - } - }, - "node_modules/@react-native-community/cli-doctor/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "engines": { - "node": ">=6" - } - }, - "node_modules/@react-native-community/cli-doctor/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@react-native-community/cli-doctor/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@react-native-community/cli-hermes": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-hermes/-/cli-hermes-13.6.6.tgz", - "integrity": "sha512-La5Ie+NGaRl3klei6WxKoOxmCUSGGxpOk6vU5pEGf0/O7ky+Ay0io+zXYUZqlNMi/cGpO7ZUijakBYOB/uyuFg==", - "dependencies": { - "@react-native-community/cli-platform-android": "13.6.6", - "@react-native-community/cli-tools": "13.6.6", - "chalk": "^4.1.2", - "hermes-profile-transformer": "^0.0.6" - } - }, - "node_modules/@react-native-community/cli-platform-android": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-android/-/cli-platform-android-13.6.6.tgz", - "integrity": "sha512-/tMwkBeNxh84syiSwNlYtmUz/Ppc+HfKtdopL/5RB+fd3SV1/5/NPNjMlyLNgFKnpxvKCInQ7dnl6jGHJjeHjg==", - "dependencies": { - "@react-native-community/cli-tools": "13.6.6", - "chalk": "^4.1.2", - "execa": "^5.0.0", - "fast-glob": "^3.3.2", - "fast-xml-parser": "^4.2.4", - "logkitty": "^0.7.1" - } - }, - "node_modules/@react-native-community/cli-platform-apple": { - "version": "13.6.8", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-apple/-/cli-platform-apple-13.6.8.tgz", - "integrity": "sha512-1JPohnlXPqU44zns3ALEzIbH2cKRw6JtEDJERgLuEUbs2r2NeJgqDbKyZ7fTTO8o+pegDnn6+Rr7qGVVOuUzzg==", - "dependencies": { - "@react-native-community/cli-tools": "13.6.8", + "serve-static": "^1.13.1" + } + }, + "node_modules/@react-native-community/cli-platform-apple": { + "version": "13.6.8", + "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-apple/-/cli-platform-apple-13.6.8.tgz", + "integrity": "sha512-1JPohnlXPqU44zns3ALEzIbH2cKRw6JtEDJERgLuEUbs2r2NeJgqDbKyZ7fTTO8o+pegDnn6+Rr7qGVVOuUzzg==", + "dependencies": { + "@react-native-community/cli-tools": "13.6.8", "chalk": "^4.1.2", "execa": "^5.0.0", "fast-glob": "^3.3.2", @@ -4940,27 +4858,6 @@ "node": ">=10" } }, - "node_modules/@react-native-community/cli-platform-ios": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-ios/-/cli-platform-ios-13.6.6.tgz", - "integrity": "sha512-vjDnRwhlSN5ryqKTas6/DPkxuouuyFBAqAROH4FR1cspTbn6v78JTZKDmtQy9JMMo7N5vZj1kASU5vbFep9IOQ==", - "dependencies": { - "@react-native-community/cli-platform-apple": "13.6.6" - } - }, - "node_modules/@react-native-community/cli-platform-ios/node_modules/@react-native-community/cli-platform-apple": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-platform-apple/-/cli-platform-apple-13.6.6.tgz", - "integrity": "sha512-bOmSSwoqNNT3AmCRZXEMYKz1Jf1l2F86Nhs7qBcXdY/sGiJ+Flng564LOqvdAlVLTbkgz47KjNKCS2pP4Jg0Mg==", - "dependencies": { - "@react-native-community/cli-tools": "13.6.6", - "chalk": "^4.1.2", - "execa": "^5.0.0", - "fast-glob": "^3.3.2", - "fast-xml-parser": "^4.0.12", - "ora": "^5.4.1" - } - }, "node_modules/@react-native-community/cli-server-api": { "version": "13.6.6", "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-13.6.6.tgz", @@ -5051,126 +4948,6 @@ "node": ">=10" } }, - "node_modules/@react-native-community/cli-types": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/@react-native-community/cli-types/-/cli-types-13.6.6.tgz", - "integrity": "sha512-733iaYzlmvNK7XYbnWlMjdE+2k0hlTBJW071af/xb6Bs+hbJqBP9c03FZuYH2hFFwDDntwj05bkri/P7VgSxug==", - "dependencies": { - "joi": "^17.2.1" - } - }, - "node_modules/@react-native-community/cli/node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", - "engines": { - "node": "^12.20.0 || >=14" - } - }, - "node_modules/@react-native-community/cli/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@react-native-community/cli/node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/@react-native-community/cli/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@react-native-community/cli/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@react-native-community/cli/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@react-native-community/cli/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@react-native-community/cli/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@react-native-community/cli/node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@react-native-community/cli/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/@react-native/assets-registry": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.74.83.tgz", - "integrity": "sha512-2vkLMVnp+YTZYTNSDIBZojSsjz8sl5PscP3j4GcV6idD8V978SZfwFlk8K0ti0BzRs11mzL0Pj17km597S/eTQ==", - "engines": { - "node": ">=18" - } - }, "node_modules/@react-native/babel-plugin-codegen": { "version": "0.73.2", "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.73.2.tgz", @@ -5303,176 +5080,6 @@ "node": "*" } }, - "node_modules/@react-native/community-cli-plugin": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.74.83.tgz", - "integrity": "sha512-7GAFjFOg1mFSj8bnFNQS4u8u7+QtrEeflUIDVZGEfBZQ3wMNI5ycBzbBGycsZYiq00Xvoc6eKFC7kvIaqeJpUQ==", - "dependencies": { - "@react-native-community/cli-server-api": "13.6.6", - "@react-native-community/cli-tools": "13.6.6", - "@react-native/dev-middleware": "0.74.83", - "@react-native/metro-babel-transformer": "0.74.83", - "chalk": "^4.0.0", - "execa": "^5.1.1", - "metro": "^0.80.3", - "metro-config": "^0.80.3", - "metro-core": "^0.80.3", - "node-fetch": "^2.2.0", - "querystring": "^0.2.1", - "readline": "^1.3.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/babel-plugin-codegen": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.74.83.tgz", - "integrity": "sha512-+S0st3t4Ro00bi9gjT1jnK8qTFOU+CwmziA7U9odKyWrCoRJrgmrvogq/Dr1YXlpFxexiGIupGut1VHxr+fxJA==", - "dependencies": { - "@react-native/codegen": "0.74.83" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/babel-preset": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/babel-preset/-/babel-preset-0.74.83.tgz", - "integrity": "sha512-KJuu3XyVh3qgyUer+rEqh9a/JoUxsDOzkJNfRpDyXiAyjDRoVch60X/Xa/NcEQ93iCVHAWs0yQ+XGNGIBCYE6g==", - "dependencies": { - "@babel/core": "^7.20.0", - "@babel/plugin-proposal-async-generator-functions": "^7.0.0", - "@babel/plugin-proposal-class-properties": "^7.18.0", - "@babel/plugin-proposal-export-default-from": "^7.0.0", - "@babel/plugin-proposal-logical-assignment-operators": "^7.18.0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.0", - "@babel/plugin-proposal-numeric-separator": "^7.0.0", - "@babel/plugin-proposal-object-rest-spread": "^7.20.0", - "@babel/plugin-proposal-optional-catch-binding": "^7.0.0", - "@babel/plugin-proposal-optional-chaining": "^7.20.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", - "@babel/plugin-syntax-export-default-from": "^7.0.0", - "@babel/plugin-syntax-flow": "^7.18.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0", - "@babel/plugin-syntax-optional-chaining": "^7.0.0", - "@babel/plugin-transform-arrow-functions": "^7.0.0", - "@babel/plugin-transform-async-to-generator": "^7.20.0", - "@babel/plugin-transform-block-scoping": "^7.0.0", - "@babel/plugin-transform-classes": "^7.0.0", - "@babel/plugin-transform-computed-properties": "^7.0.0", - "@babel/plugin-transform-destructuring": "^7.20.0", - "@babel/plugin-transform-flow-strip-types": "^7.20.0", - "@babel/plugin-transform-function-name": "^7.0.0", - "@babel/plugin-transform-literals": "^7.0.0", - "@babel/plugin-transform-modules-commonjs": "^7.0.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.0.0", - "@babel/plugin-transform-parameters": "^7.0.0", - "@babel/plugin-transform-private-methods": "^7.22.5", - "@babel/plugin-transform-private-property-in-object": "^7.22.11", - "@babel/plugin-transform-react-display-name": "^7.0.0", - "@babel/plugin-transform-react-jsx": "^7.0.0", - "@babel/plugin-transform-react-jsx-self": "^7.0.0", - "@babel/plugin-transform-react-jsx-source": "^7.0.0", - "@babel/plugin-transform-runtime": "^7.0.0", - "@babel/plugin-transform-shorthand-properties": "^7.0.0", - "@babel/plugin-transform-spread": "^7.0.0", - "@babel/plugin-transform-sticky-regex": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.5.0", - "@babel/plugin-transform-unicode-regex": "^7.0.0", - "@babel/template": "^7.0.0", - "@react-native/babel-plugin-codegen": "0.74.83", - "babel-plugin-transform-flow-enums": "^0.0.2", - "react-refresh": "^0.14.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@babel/core": "*" - } - }, - "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/codegen": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.74.83.tgz", - "integrity": "sha512-GgvgHS3Aa2J8/mp1uC/zU8HuTh8ZT5jz7a4mVMWPw7+rGyv70Ba8uOVBq6UH2Q08o617IATYc+0HfyzAfm4n0w==", - "dependencies": { - "@babel/parser": "^7.20.0", - "glob": "^7.1.1", - "hermes-parser": "0.19.1", - "invariant": "^2.2.4", - "jscodeshift": "^0.14.0", - "mkdirp": "^0.5.1", - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@babel/preset-env": "^7.1.6" - } - }, - "node_modules/@react-native/community-cli-plugin/node_modules/@react-native/metro-babel-transformer": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.74.83.tgz", - "integrity": "sha512-hGdx5N8diu8y+GW/ED39vTZa9Jx1di2ZZ0aapbhH4egN1agIAusj5jXTccfNBwwWF93aJ5oVbRzfteZgjbutKg==", - "dependencies": { - "@babel/core": "^7.20.0", - "@react-native/babel-preset": "0.74.83", - "hermes-parser": "0.19.1", - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@babel/core": "*" - } - }, - "node_modules/@react-native/community-cli-plugin/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@react-native/community-cli-plugin/node_modules/hermes-estree": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.19.1.tgz", - "integrity": "sha512-daLGV3Q2MKk8w4evNMKwS8zBE/rcpA800nu1Q5kM08IKijoSnPe9Uo1iIxzPKRkn95IxxsgBMPeYHt3VG4ej2g==" - }, - "node_modules/@react-native/community-cli-plugin/node_modules/hermes-parser": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.19.1.tgz", - "integrity": "sha512-Vp+bXzxYJWrpEuJ/vXxUsLnt0+y4q9zyi4zUlkLqD8FKv4LjIfOvP69R/9Lty3dCyKh0E2BU7Eypqr63/rKT/A==", - "dependencies": { - "hermes-estree": "0.19.1" - } - }, - "node_modules/@react-native/community-cli-plugin/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/@react-native/debugger-frontend": { "version": "0.74.83", "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.74.83.tgz", @@ -5481,65 +5088,6 @@ "node": ">=18" } }, - "node_modules/@react-native/dev-middleware": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.74.83.tgz", - "integrity": "sha512-UH8iriqnf7N4Hpi20D7M2FdvSANwTVStwFCSD7VMU9agJX88Yk0D1T6Meh2RMhUu4kY2bv8sTkNRm7LmxvZqgA==", - "dependencies": { - "@isaacs/ttlcache": "^1.4.1", - "@react-native/debugger-frontend": "0.74.83", - "@rnx-kit/chromium-edge-launcher": "^1.0.0", - "chrome-launcher": "^0.15.2", - "connect": "^3.6.5", - "debug": "^2.2.0", - "node-fetch": "^2.2.0", - "nullthrows": "^1.1.1", - "open": "^7.0.3", - "selfsigned": "^2.4.1", - "serve-static": "^1.13.1", - "temp-dir": "^2.0.0", - "ws": "^6.2.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@react-native/dev-middleware/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/@react-native/dev-middleware/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/@react-native/dev-middleware/node_modules/open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", - "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@react-native/dev-middleware/node_modules/ws": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.3.tgz", - "integrity": "sha512-jmTjYU0j60B+vHey6TfR3Z7RD61z/hmxBS3VMSGIrroOWXQEneK1zNuotOUrGyBHQj0yrpsLHPWtigEFd13ndA==", - "dependencies": { - "async-limiter": "~1.0.0" - } - }, "node_modules/@react-native/eslint-config": { "version": "0.74.83", "resolved": "https://registry.npmjs.org/@react-native/eslint-config/-/eslint-config-0.74.83.tgz", @@ -5812,14 +5360,6 @@ "node": ">=18" } }, - "node_modules/@react-native/gradle-plugin": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.74.83.tgz", - "integrity": "sha512-Pw2BWVyOHoBuJVKxGVYF6/GSZRf6+v1Ygc+ULGz5t20N8qzRWPa2fRZWqoxsN7TkNLPsECYY8gooOl7okOcPAQ==", - "engines": { - "node": ">=18" - } - }, "node_modules/@react-native/js-polyfills": { "version": "0.73.1", "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.73.1.tgz", @@ -5868,38 +5408,11 @@ "node": ">=18" } }, - "node_modules/@react-native/normalize-colors": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.74.83.tgz", - "integrity": "sha512-jhCY95gRDE44qYawWVvhTjTplW1g+JtKTKM3f8xYT1dJtJ8QWv+gqEtKcfmOHfDkSDaMKG0AGBaDTSK8GXLH8Q==" - }, "node_modules/@react-native/typescript-config": { "version": "0.74.83", "resolved": "https://registry.npmjs.org/@react-native/typescript-config/-/typescript-config-0.74.83.tgz", "integrity": "sha512-UTcZZYkSD+vv2O67bL/wu0GCGJP3BCbIxXd9ZewNkJmiWl5BbfoNl23+EjmDwM2V66gu24VB/RsSMn0TdmFs8Q==" }, - "node_modules/@react-native/virtualized-lists": { - "version": "0.74.83", - "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.74.83.tgz", - "integrity": "sha512-rmaLeE34rj7py4FxTod7iMTC7BAsm+HrGA8WxYmEJeyTV7WSaxAkosKoYBz8038mOiwnG9VwA/7FrB6bEQvn1A==", - "dependencies": { - "invariant": "^2.2.4", - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@types/react": "^18.2.6", - "react": "*", - "react-native": "*" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/@realm/app-importer": { "resolved": "packages/realm-app-importer", "link": true @@ -22129,7 +21642,7 @@ "peerDependencies": { "@callstack/react-native-visionos": "0.73 - 0.74", "@expo/config-plugins": ">=5.0", - "react": "17.0.1 - 18.2", + "react": "17.0.1 - 18.3", "react-native": "0.66 - 0.74 || >=0.75.0-0 <0.75.0", "react-native-macos": "^0.0.0-0 || 0.66 || 0.68 || 0.71 - 0.73", "react-native-windows": "^0.0.0-0 || 0.66 - 0.74" diff --git a/packages/realm/RealmJS.podspec b/packages/realm/RealmJS.podspec index 2dd2580243..10f9e58b9f 100644 --- a/packages/realm/RealmJS.podspec +++ b/packages/realm/RealmJS.podspec @@ -40,10 +40,19 @@ Pod::Spec.new do |s| # @see https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#platform-ios s.source = { :http => 'https://github.com/realm/realm-js/blob/main/CONTRIBUTING.md#how-to-debug-react-native-podspec' } + s.source_files = 'binding/jsi/*.cpp', - 'binding/apple/*.mm' + 'binding/apple/*.mm', + # Headers + 'binding/*.h', + 'binding/*.hpp', + 'binding/apple/*.h', + 'bindgen/src/*.h', + 'binding/jsi/*.h', + 'bindgen/vendor/realm-core/bindgen/src/*.h' s.public_header_files = 'binding/apple/*.h' + s.resource_bundles = { 'RealmJS' => ['PrivacyInfo.xcprivacy'] } s.frameworks = uses_frameworks ? ['React'] : [] diff --git a/packages/realm/bindgen/src/realm_js_jsi_helpers.h b/packages/realm/bindgen/src/realm_js_jsi_helpers.h index 21ebd14849..a107bdf55c 100644 --- a/packages/realm/bindgen/src/realm_js_jsi_helpers.h +++ b/packages/realm/bindgen/src/realm_js_jsi_helpers.h @@ -4,16 +4,15 @@ #include #include -namespace realm::js { -extern std::function flush_ui_queue; -} +#include + namespace realm::js::JSI { namespace { struct FlushMicrotaskQueueGuard { ~FlushMicrotaskQueueGuard() { - flush_ui_queue(); + realm::js::flush_ui_workaround::flush_ui_queue(); } }; diff --git a/packages/realm/bindgen/src/templates/jsi.ts b/packages/realm/bindgen/src/templates/jsi.ts index 529ce50a19..c0f462ff18 100644 --- a/packages/realm/bindgen/src/templates/jsi.ts +++ b/packages/realm/bindgen/src/templates/jsi.ts @@ -1095,10 +1095,6 @@ export function generate({ rawSpec, spec, file: makeFile }: TemplateContext): vo #include #include - namespace realm::js { - std::function flush_ui_queue; - } - // Using all-caps JSI to avoid risk of conflicts with jsi namespace from fb. namespace realm::js::JSI { namespace { @@ -1121,9 +1117,8 @@ export function generate({ rawSpec, spec, file: makeFile }: TemplateContext): vo // Blow away the addon state. RealmAddon::self.reset(); } - void realm_jsi_init(jsi::Runtime& rt, jsi::Object& exports, std::function flush_ui_queue) { + void realm_jsi_init(jsi::Runtime& rt, jsi::Object& exports) { realm_jsi_invalidate_caches(); - js::flush_ui_queue = flush_ui_queue; RealmAddon::self = std::make_unique(rt, exports); } void realm_jsi_close_sync_sessions() { diff --git a/packages/realm/bindgen/src/templates/react-native-wrapper.ts b/packages/realm/bindgen/src/templates/react-native-wrapper.ts index 60cdf41d42..977195b2dd 100644 --- a/packages/realm/bindgen/src/templates/react-native-wrapper.ts +++ b/packages/realm/bindgen/src/templates/react-native-wrapper.ts @@ -26,20 +26,29 @@ export function generate(context: TemplateContext): void { out("// This file is generated: Update the spec instead of editing this file directly"); out(` - /*global global*/ - import { Platform, NativeModules } from "react-native"; - if (Platform.OS === "android") { - // Getting the native module on Android will inject the Realm global - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const RealmNativeModule = NativeModules.Realm; - } - // TODO: Remove the need to store Realm as a global - // @see https://github.com/realm/realm-js/issues/2126 - const nativeModule = global.__RealmFuncs; - if(!nativeModule) { - throw new Error("Could not find the Realm binary. Please consult our troubleshooting guide: https://www.mongodb.com/docs/realm-sdks/js/latest/#md:troubleshooting-missing-binary"); + /* global global */ + + import { NativeModules } from "react-native"; + const RealmNativeModule = NativeModules.Realm; + + /** + * Injects, reads, deletes and returns the native module via a global property. + */ + function getNativeModule() { + RealmNativeModule.injectModuleIntoJSGlobal(); + // Read the global into the local scope + const { __injectedRealmBinding } = global; + // Delete the global again + delete global.__injectedRealmBinding; + if(typeof __injectedRealmBinding === "object") { + return __injectedRealmBinding; + } else { + throw new Error("Could not find the Realm binary. Please consult our troubleshooting guide: https://www.mongodb.com/docs/realm-sdks/js/latest/#md:troubleshooting-missing-binary"); + } } + const nativeModule = getNativeModule(); + export const WeakRef = global.WeakRef ?? class WeakRef { constructor(obj) { this.native = nativeModule.createWeakRef(obj) } deref() { return nativeModule.lockWeakRef(this.native) } diff --git a/packages/realm/binding/android/CMakeLists.txt b/packages/realm/binding/android/CMakeLists.txt index 6b2f59faf3..c64f2660f6 100644 --- a/packages/realm/binding/android/CMakeLists.txt +++ b/packages/realm/binding/android/CMakeLists.txt @@ -13,6 +13,7 @@ endif() add_library(realm-js-android-binding SHARED ../jsi/jsi_init.cpp + ../jsi/flush_ui_queue_workaround.cpp src/main/cpp/platform.cpp src/main/cpp/jni_utils.cpp src/main/cpp/io_realm_react_RealmReactModule.cpp @@ -32,6 +33,7 @@ target_link_options(realm-js-android-binding PUBLIC -fvisibility=hidden) target_include_directories(realm-js-android-binding PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/.." + "${CMAKE_CURRENT_SOURCE_DIR}/../../binding/jsi" "${CMAKE_CURRENT_SOURCE_DIR}/../../bindgen/src" "${CMAKE_CURRENT_SOURCE_DIR}/../../bindgen/vendor/realm-core/bindgen/src" diff --git a/packages/realm/binding/android/build.gradle b/packages/realm/binding/android/build.gradle index ab7a14a288..f26be70c57 100644 --- a/packages/realm/binding/android/build.gradle +++ b/packages/realm/binding/android/build.gradle @@ -71,6 +71,12 @@ android { packagingOptions { doNotStrip "**/librealm.so" } + // TODO: Remove the comments and test this + // externalNativeBuild { + // cmake { + // arguments "-DDEBUG=true" + // } + // } } release { externalNativeBuild { diff --git a/packages/realm/binding/android/src/main/cpp/io_realm_react_RealmReactModule.cpp b/packages/realm/binding/android/src/main/cpp/io_realm_react_RealmReactModule.cpp index c84683e728..71a3b31aab 100644 --- a/packages/realm/binding/android/src/main/cpp/io_realm_react_RealmReactModule.cpp +++ b/packages/realm/binding/android/src/main/cpp/io_realm_react_RealmReactModule.cpp @@ -23,13 +23,11 @@ #include #include -#include "jsi/jsi_init.h" -#include "jsi/jsi_externs.hpp" +#include "jsi_init.h" +#include "flush_ui_queue_workaround.h" #include "platform.hpp" #include "jni_utils.hpp" -#include "io_realm_react_RealmReactModule.h" - namespace jsi = facebook::jsi; using namespace realm::jni_util; @@ -39,9 +37,6 @@ jclass ssl_helper_class; namespace realm { // set the AssetManager used to access bundled files within the APK void set_asset_manager(AAssetManager* assetManager); -// Keep track of whether we are already waiting for the React Native UI queue -// to be flushed asynchronously -bool waiting_for_ui_flush = false; } // namespace realm @@ -74,50 +69,47 @@ JNIEXPORT void JNI_OnUnload(JavaVM* vm, void*) } } -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_setDefaultRealmFileDirectory(JNIEnv* env, jobject, - jstring fileDir, - jobject javaAssetManager) +extern "C" JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_injectModuleIntoJSGlobal(JNIEnv* env, + jobject thiz, + jlong runtime_pointer) { - __android_log_print(ANDROID_LOG_VERBOSE, "JSRealm", "setDefaultRealmFileDirectory"); + + __android_log_print(ANDROID_LOG_VERBOSE, "Realm", "install"); + auto runtime = reinterpret_cast(runtime_pointer); + if (runtime) { + __android_log_print(ANDROID_LOG_VERBOSE, "Realm", "Building an exports object"); + auto exports = jsi::Object(*runtime); + __android_log_print(ANDROID_LOG_VERBOSE, "Realm", "Initializing ..."); + realm_jsi_init(*runtime, exports); + // Store this as a global for JavaScript to read + runtime->global().setProperty(*runtime, "__injectedRealmBinding", exports); + } +} + +extern "C" JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_setDefaultRealmFileDirectoryImpl( + JNIEnv* env, jobject thiz, jstring file_dir, jobject asset_manager) +{ + + __android_log_print(ANDROID_LOG_VERBOSE, "Realm", "setDefaultRealmFileDirectory"); // Get the assetManager in case we want to copy files from the APK (assets) - AAssetManager* assetManager = AAssetManager_fromJava(env, javaAssetManager); + AAssetManager* assetManager = AAssetManager_fromJava(env, asset_manager); if (assetManager == NULL) { - __android_log_print(ANDROID_LOG_ERROR, "JSRealm", "Error loading the AssetManager"); + __android_log_print(ANDROID_LOG_ERROR, "Realm", "Error loading the AssetManager"); } realm::set_asset_manager(assetManager); // Setting the internal storage path for the application - const char* strFileDir = env->GetStringUTFChars(fileDir, NULL); - realm::JsPlatformHelpers::set_default_realm_file_directory(strFileDir); - env->ReleaseStringUTFChars(fileDir, strFileDir); + const char* file_dir_utf = env->GetStringUTFChars(file_dir, NULL); + realm::JsPlatformHelpers::set_default_realm_file_directory(file_dir_utf); + env->ReleaseStringUTFChars(file_dir, file_dir_utf); - __android_log_print(ANDROID_LOG_DEBUG, "JSRealm", "Absolute path: %s", + __android_log_print(ANDROID_LOG_DEBUG, "Realm", "Absolute path: %s", realm::JsPlatformHelpers::default_realm_file_directory().c_str()); } -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_install(JNIEnv*, jobject, jlong runtimePointer) -{ - __android_log_print(ANDROID_LOG_VERBOSE, "JSRealm", "install"); - auto runtime = reinterpret_cast(runtimePointer); - if (runtime) { - __android_log_print(ANDROID_LOG_VERBOSE, "JSRealm", "Building an exports object"); - auto exports = jsi::Object(*runtime); - __android_log_print(ANDROID_LOG_VERBOSE, "JSRealm", "Initializing ..."); - realm_jsi_init(*runtime, exports, [] {}); - } -} - -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_invalidateCaches(JNIEnv*, jobject) -{ - __android_log_print(ANDROID_LOG_VERBOSE, "JSRealm", "invalidateCaches"); - realm_jsi_invalidate_caches(); -} - -// Setup the flush_ui_queue function we use to flush the React Native UI queue whenever we call from C++ to JS. -// See RealmReact.mm's setBridge method for details, this is the equivalent for Android. -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_setupFlushUiQueue(JNIEnv* env, jobject, - jobject callInvokerHolderJavaObj) +extern "C" JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_injectCallInvoker(JNIEnv* env, jobject thiz, + jobject call_invoker) { // React Native uses the fbjni library for handling JNI, which has the concept of "hybrid objects", // which are Java objects containing a pointer to a C++ object. The CallInvokerHolder, which has the @@ -126,9 +118,9 @@ JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_setupFlushUiQueue(JN // object `callInvokerHolderJavaObj` manually, based on reverse engineering the fbjni code. // 1. Get the Java object referred to by the mHybridData field of the Java holder object - auto callInvokerHolderClass = env->GetObjectClass(callInvokerHolderJavaObj); + auto callInvokerHolderClass = env->FindClass("com/facebook/react/turbomodule/core/CallInvokerHolderImpl"); auto hybridDataField = env->GetFieldID(callInvokerHolderClass, "mHybridData", "Lcom/facebook/jni/HybridData;"); - auto hybridDataObj = env->GetObjectField(callInvokerHolderJavaObj, hybridDataField); + auto hybridDataObj = env->GetObjectField(call_invoker, hybridDataField); // 2. Get the destructor Java object referred to by the mDestructor field from the myHybridData Java object auto hybridDataClass = env->FindClass("com/facebook/jni/HybridData"); @@ -144,12 +136,19 @@ JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_setupFlushUiQueue(JN // 4. Cast the mNativePointer back to its C++ type auto nativePointer = reinterpret_cast(nativePointerValue); - realm::js::flush_ui_queue = [&, nativePointer]() { - if (!realm::waiting_for_ui_flush) { - realm::waiting_for_ui_flush = true; - nativePointer->getCallInvoker()->invokeAsync([]() { - realm::waiting_for_ui_flush = false; - }); - } - }; + // 5. Inject the JS call invoker for the workaround to use + realm::js::flush_ui_workaround::inject_js_call_invoker(nativePointer->getCallInvoker()); } + +extern "C" JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_invalidateCaches(JNIEnv* env, jobject thiz) +{ + // Disable the flush ui workaround + realm::js::flush_ui_workaround::reset_js_call_invoker(); + __android_log_print(ANDROID_LOG_VERBOSE, "Realm", "Invalidating caches"); +#if DEBUG + // Immediately close any open sync sessions to prevent race condition with new + // JS thread when hot reloading + realm_jsi_close_sync_sessions(); +#endif + realm_jsi_invalidate_caches(); +} \ No newline at end of file diff --git a/packages/realm/binding/android/src/main/cpp/io_realm_react_RealmReactModule.h b/packages/realm/binding/android/src/main/cpp/io_realm_react_RealmReactModule.h deleted file mode 100644 index 1ada06d7be..0000000000 --- a/packages/realm/binding/android/src/main/cpp/io_realm_react_RealmReactModule.h +++ /dev/null @@ -1,45 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class io_realm_react_RealmReactModule */ - -#ifndef _Included_io_realm_react_RealmReactModule -#define _Included_io_realm_react_RealmReactModule -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: io_realm_react_RealmReactModule - * Method: setDefaultRealmFileDirectory - * Signature: (Ljava/lang/String;Landroid/content/res/AssetManager;)V - */ -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_setDefaultRealmFileDirectory(JNIEnv*, jobject, jstring, - jobject); - -/* - * Class: io_realm_react_RealmReactModule - * Method: install - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_install(JNIEnv*, jobject, jlong); - -/* - * Class: io_realm_react_RealmReactModule - * Method: invalidateCaches - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_invalidateCaches(JNIEnv*, jobject); - -/* - * Class: io_realm_react_RealmReactModule - * Method: setupFlushUiQueue - * Signature: (Lcom/facebook/react/turbomodule/core/CallInvokerHolderImpl;)V - */ -// JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_setupFlushUiQueue -// (JNIEnv *, jobject, jobject); - -JNIEXPORT void JNICALL Java_io_realm_react_RealmReactModule_setupFlushUiQueue(JNIEnv*, jobject, jobject); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/packages/realm/binding/android/src/main/cpp/jni_utils.cpp b/packages/realm/binding/android/src/main/cpp/jni_utils.cpp index 58b667ac8d..a5b51e4d83 100644 --- a/packages/realm/binding/android/src/main/cpp/jni_utils.cpp +++ b/packages/realm/binding/android/src/main/cpp/jni_utils.cpp @@ -37,7 +37,7 @@ JNIEnv* JniUtils::get_env(bool attach_if_needed) JNIEnv* env; if (s_instance->m_vm->GetEnv(reinterpret_cast(&env), s_instance->m_vm_version) != JNI_OK) { if (attach_if_needed) { - jint ret = s_instance->m_vm->AttachCurrentThread(&env, nullptr); + s_instance->m_vm->AttachCurrentThread(&env, nullptr); } } diff --git a/packages/realm/binding/android/src/main/java/io/realm/react/RealmReactModule.java b/packages/realm/binding/android/src/main/java/io/realm/react/RealmReactModule.java index eda164794b..3f122083d6 100644 --- a/packages/realm/binding/android/src/main/java/io/realm/react/RealmReactModule.java +++ b/packages/realm/binding/android/src/main/java/io/realm/react/RealmReactModule.java @@ -16,110 +16,98 @@ package io.realm.react; +import androidx.annotation.NonNull; + import android.content.res.AssetManager; -import android.os.Build; -import android.os.Handler; -import android.os.HandlerThread; -import android.util.Log; import com.facebook.react.bridge.JavaScriptContextHolder; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; +import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags; import com.facebook.react.module.annotations.ReactModule; -import com.facebook.react.turbomodule.core.CallInvokerHolderImpl; +import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder; import com.facebook.soloader.SoLoader; import java.io.IOException; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Locale; +import java.util.Objects; @ReactModule(name = RealmReactModule.NAME) class RealmReactModule extends ReactContextBaseJavaModule { public static final String NAME = "Realm"; - private static boolean sentAnalytics = false; - // used to create a native AssetManager in C++ in order to load file from APK - // Note: We keep a VM reference to the assetManager to prevent its being - // garbage collected while the native object is in use. - //http://developer.android.com/ndk/reference/group___asset.html#gadfd6537af41577735bcaee52120127f4 + public RealmReactModule(ReactApplicationContext reactContext) { + super(reactContext); + } + + @Override + @NonNull + public String getName() { + return NAME; + } + + /** + * Used to create a native AssetManager in C++ in order to load file from APK + * Note: We keep a VM reference to the assetManager to prevent its being garbage collected while the native object is in use. + * See: http://developer.android.com/ndk/reference/group___asset.html#gadfd6537af41577735bcaee52120127f4 + */ @SuppressWarnings("FieldCanBeLocal") - private final AssetManager assetManager; + private AssetManager assetManager; - static { - try { - SoLoader.loadLibrary("realm"); - } catch (UnsatisfiedLinkError err) { - if (err.getMessage().contains("library \"libjsi.so\" not found")) { - throw new LinkageError("This version of Realm JS needs at least React Native version 0.66.0", err); - } - throw err; - } + @Override + public void invalidate() { + invalidateCaches(); } - public RealmReactModule(ReactApplicationContext reactContext) { - super(reactContext); + @ReactMethod(isBlockingSynchronousMethod = true) + public boolean injectModuleIntoJSGlobal() { + // Calling loadLibrary multiple times will be ignored + // We do it here instead of statically to allow the app load faster if Realm isn't accessed. + // Effectively emulating the behaviour of TurboModules. + SoLoader.loadLibrary("realm"); - assetManager = reactContext.getResources().getAssets(); + ReactApplicationContext reactContext = getReactApplicationContext(); - String fileDir; + // Tell the native module where to store database files and from where to load bundled database files + assetManager = reactContext.getResources().getAssets(); try { - fileDir = reactContext.getFilesDir().getCanonicalPath(); + setDefaultRealmFileDirectoryImpl(reactContext.getFilesDir().getCanonicalPath(), assetManager); } catch (IOException e) { throw new IllegalStateException(e); } - setDefaultRealmFileDirectory(fileDir, assetManager); - - // Get the javascript runtime and install our native module with it - - // TODO: Update this to use reactContext.getRuntimeExecutor() instead (since this is calling a deprecated method underneath) - // Using the RuntimeExecutor however, requires that we link our native module against fbjni. + CallInvokerHolder jsCallInvokerHolder = reactContext.getCatalystInstance().getJSCallInvokerHolder(); + injectCallInvoker(jsCallInvokerHolder); + // Get the javascript runtime and inject our native module with it JavaScriptContextHolder jsContext = reactContext.getJavaScriptContextHolder(); - synchronized(jsContext) { - install(jsContext.get()); + synchronized(Objects.requireNonNull(jsContext)) { + injectModuleIntoJSGlobal(jsContext.get()); } - } - - @Override - public void initialize() { - // Pass the React Native jsCallInvokerHolder over to C++, so that we can access the invokeAsync - // method which we use to flush the React Native UI queue whenever we call from C++ to JS. - // See RealmReact.mm's setBridge method for details, this is the equivalent for Android. - CallInvokerHolderImpl jsCallInvokerHolder = (CallInvokerHolderImpl) getReactApplicationContext().getCatalystInstance().getJSCallInvokerHolder(); - setupFlushUiQueue(jsCallInvokerHolder); - } - - @Override - public void invalidate() { - invalidateCaches(); - } - @Override - public String getName() { - return NAME; + return true; } - @Override - public Map getConstants() { - return Collections.emptyMap(); - } - - // fileDir: path of the internal storage of the application - private native void setDefaultRealmFileDirectory(String fileDir, AssetManager assets); - - private native void install(long runtimePointer); + /** + * @param fileDir Path of the internal storage of the application + * @param assetManager Manager used when restoring database files from the application assets + */ + private native void setDefaultRealmFileDirectoryImpl(String fileDir, AssetManager assetManager); + + /** + * Injects the native module into the JS global + * NOTE: We're using a global instead of returning a JSI object, to workaround limitations + * in the expressiveness of the React Native Codegen and to retain support for the "old architecture". + * @param runtimePointer The memory address of the JSI Runtime object. + */ + private native void injectModuleIntoJSGlobal(long runtimePointer); + + /** + * Passes the React Native jsCallInvokerHolder over to C++ so we can setup our UI queue flushing. + * This is needed as a workaround for https://github.com/facebook/react-native/issues/33006 + * where we call the invokeAsync method to flush the React Native UI queue whenever we call from C++ to JS. + */ + private native void injectCallInvoker(CallInvokerHolder callInvoker); private native void invalidateCaches(); - // Passes the React Native jsCallInvokerHolder over to C++ so we can setup our UI queue flushing - private native void setupFlushUiQueue(CallInvokerHolderImpl callInvoker); } diff --git a/packages/realm/binding/android/src/main/java/io/realm/react/RealmReactPackage.java b/packages/realm/binding/android/src/main/java/io/realm/react/RealmReactPackage.java index 37556913a4..5e696b33ef 100644 --- a/packages/realm/binding/android/src/main/java/io/realm/react/RealmReactPackage.java +++ b/packages/realm/binding/android/src/main/java/io/realm/react/RealmReactPackage.java @@ -16,51 +16,27 @@ package io.realm.react; -import android.util.Log; +import androidx.annotation.NonNull; import com.facebook.react.ReactPackage; -import com.facebook.react.TurboReactPackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.module.annotations.ReactModule; -import com.facebook.react.module.model.ReactModuleInfo; -import com.facebook.react.module.model.ReactModuleInfoProvider; -import com.facebook.react.turbomodule.core.interfaces.TurboModule; - -import java.util.HashMap; -import java.util.Map; - -public class RealmReactPackage extends TurboReactPackage implements ReactPackage { - @Override - public NativeModule getModule(String name, final ReactApplicationContext reactContext) { - if (name.equals(RealmReactModule.NAME)) { - return new RealmReactModule(reactContext); - } else { - return null; - } - } - - @Override - public ReactModuleInfoProvider getReactModuleInfoProvider() { - final Map reactModuleInfoMap = new HashMap<>(); - ReactModule reactModule = RealmReactModule.class.getAnnotation(ReactModule.class); - - reactModuleInfoMap.put( - reactModule.name(), - new ReactModuleInfo( - reactModule.name(), - RealmReactModule.class.getName(), - false, - reactModule.needsEagerInit(), - reactModule.hasConstants(), - reactModule.isCxxModule(), - TurboModule.class.isAssignableFrom(RealmReactModule.class))); - - return new ReactModuleInfoProvider() { - @Override - public Map getReactModuleInfos() { - return reactModuleInfoMap; - } - }; - } +import com.facebook.react.uimanager.ViewManager; + +import java.util.Collections; +import java.util.List; + +public class RealmReactPackage implements ReactPackage { + + @NonNull + @Override + public List createNativeModules(@NonNull ReactApplicationContext reactContext) { + return Collections.singletonList(new RealmReactModule(reactContext)); + } + + @NonNull + @Override + public List createViewManagers(@NonNull ReactApplicationContext reactApplicationContext) { + return Collections.emptyList(); + } } diff --git a/packages/realm/binding/apple/RealmReact.mm b/packages/realm/binding/apple/RealmReact.mm deleted file mode 100644 index 40e05dff2d..0000000000 --- a/packages/realm/binding/apple/RealmReact.mm +++ /dev/null @@ -1,158 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// Copyright 2016 Realm Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////// - -#import "RealmReact.h" - -#import -#import -#import -#import - -#import -#import -#import -#import -#import - -#import "jsi/jsi_init.h" - -// the part of the RCTCxxBridge private class we care about -@interface RCTBridge (Realm_RCTCxxBridge) -- (void *)runtime; -// Expose the CallInvoker so that we can call `invokeAsync` -- (std::shared_ptr)jsCallInvoker; -@end - -@interface RealmReact () -@end - -@implementation RealmReact { - // Keep track of whether we are already waiting for the React Native UI queue - // to be flushed asynchronously - bool waitingForUiFlush; -} - -@synthesize bridge = _bridge; - -RCT_EXPORT_MODULE(Realm) - -+ (BOOL)requiresMainQueueSetup { - return YES; -} - -+ (void)initialize { - if (self != [RealmReact class]) { - return; - } -} - -- (instancetype)init { - self = [super init]; - if (self) { - waitingForUiFlush = false; - } - return self; -} - -- (dispatch_queue_t)methodQueue { - return dispatch_get_main_queue(); -} - -- (NSDictionary *)constantsToExport { - return @{}; -} - -- (void)invalidate { -#if DEBUG - // Immediately close any open sync sessions to prevent race condition with new - // JS thread when hot reloading - realm_jsi_close_sync_sessions(); -#endif - - realm_jsi_invalidate_caches(); -} - -- (void)dealloc { - [self performSelectorOnMainThread:@selector(invalidate) - withObject:nil - waitUntilDone:YES]; -} - -- (void)setBridge:(RCTBridge *)bridge { - _bridge = bridge; - - if (objc_lookUpClass("RCTWebSocketExecutor") && - [bridge executorClass] == objc_lookUpClass("RCTWebSocketExecutor")) { - // Skip native initialization when in legacy Chrome debugging mode -#if !DEBUG - @throw [NSException - exceptionWithName:@"Invalid Executor" - reason:@"Chrome debug mode not supported in Release builds" - userInfo:nil]; -#endif - } else if ([bridge isKindOfClass:objc_lookUpClass("RCTCxxBridge")] || - [NSStringFromClass([bridge class]) isEqual:@"RCTCxxBridge"]) { - __weak __typeof__(self) weakSelf = self; - __weak __typeof__(bridge) weakBridge = bridge; - - [bridge - dispatchBlock:^{ - __typeof__(self) self = weakSelf; - __typeof__(bridge) bridge = weakBridge; - if (!self || !bridge) { - return; - } - - // Make sure the previous JS thread is completely finished before - // continuing. - static __weak NSThread *s_currentJSThread; - while (s_currentJSThread && !s_currentJSThread.finished) { - [NSThread sleepForTimeInterval:0.1]; - } - s_currentJSThread = [NSThread currentThread]; - - auto &rt = *static_cast(bridge.runtime); - auto exports = jsi::Object(rt); - realm_jsi_init(rt, exports, ^{ - // Calling jsCallInvokver->invokeAsync tells React Native to execute the lambda passed - // in on the JS thread, and then flush the internal "microtask queue", which has the - // effect of flushing any pending UI updates. - // - // We call this after we have called into JS from C++, in order to ensure that the RN - // UI updates in response to any changes from Realm. We need to do this as we bypass - // the usual RN bridge mechanism for communicating between C++ and JS, so without doing - // this RN has no way to know that a change has occurred which might require an update - // (see #4389, facebook/react-native#33006). - // - // Calls are debounced using the waitingForUiFlush flag, so if an async flush is already - // pending when another JS to C++ call happens, we don't call invokeAsync again. This works - // because the work is performed before the microtask queue is flushed - see sequence - // diagram at https://bit.ly/3kexhHm. It might be possible to further optimize this, - // e.g. only flush the queue a maximum of once per frame, but this seems reasonable. - if (!self->waitingForUiFlush) { - self->waitingForUiFlush = true; - [bridge jsCallInvoker]->invokeAsync( - [&]() { self->waitingForUiFlush = false; }); - } - }); - } - queue:RCTJSThread]; - } -} - -@end diff --git a/packages/realm/binding/apple/RealmReact.h b/packages/realm/binding/apple/RealmReactModule.h similarity index 85% rename from packages/realm/binding/apple/RealmReact.h rename to packages/realm/binding/apple/RealmReactModule.h index 02d08fcbd0..fe67f33b30 100644 --- a/packages/realm/binding/apple/RealmReact.h +++ b/packages/realm/binding/apple/RealmReactModule.h @@ -17,12 +17,14 @@ //////////////////////////////////////////////////////////////////////////// #import +#import +#import #ifdef __cplusplus extern "C" { #endif -@interface RealmReact : NSObject +@interface RealmReactModule : NSObject @end #ifdef __cplusplus diff --git a/packages/realm/binding/apple/RealmReactModule.mm b/packages/realm/binding/apple/RealmReactModule.mm new file mode 100644 index 0000000000..b68ecb1fa2 --- /dev/null +++ b/packages/realm/binding/apple/RealmReactModule.mm @@ -0,0 +1,92 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +#import "RealmReactModule.h" + +#import +#import +#import +#import +#import + +#import +#import +#import +#import +#import + +#import "jsi/jsi_init.h" +#import "flush_ui_queue_workaround.h" + +// the part of the RCTCxxBridge private class we care about +@interface RCTBridge (Realm_RCTCxxBridge) +- (void *)runtime; +- (std::shared_ptr)jsCallInvoker; +@end + +@implementation RealmReactModule + +@synthesize bridge = _bridge; + +RCT_EXPORT_MODULE(Realm) + ++ (BOOL)requiresMainQueueSetup { + return YES; +} + +- (dispatch_queue_t)methodQueue { + return dispatch_get_main_queue(); +} + +- (void)invalidate { + realm::js::flush_ui_workaround::reset_js_call_invoker(); +#if DEBUG + // Immediately close any open sync sessions to prevent race condition with new + // JS thread when hot reloading + realm_jsi_close_sync_sessions(); +#endif + + realm_jsi_invalidate_caches(); +} + +- (void)dealloc { + [self performSelectorOnMainThread:@selector(invalidate) + withObject:nil + waitUntilDone:YES]; +} + +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(injectModuleIntoJSGlobal) { + RCTBridge* bridge = [RCTBridge currentBridge]; + auto &rt = *static_cast(bridge.runtime); + + // Since https://github.com/facebook/react-native/pull/43396 this should only be needed when bridgeless is not enabled. + // but unfortunately, that doesn't seem to be the case. + // See https://github.com/facebook/react-native/pull/43396#issuecomment-2178586017 for context + // If it was, we could use the enablement of "microtasks" to avoid the overhead of calling the invokeAsync on every call from C++ into JS. + // if (!facebook::react::ReactNativeFeatureFlags::enableMicrotasks()) { + realm::js::flush_ui_workaround::inject_js_call_invoker([bridge jsCallInvoker]); + + auto exports = jsi::Object(rt); + realm_jsi_init(rt, exports); + // Exposing this via a global for the JS wrapper to read + rt.global().setProperty(rt, "__injectedRealmBinding", exports); + + return @true; +} + +@end diff --git a/packages/realm/binding/jsi/flush_ui_queue_workaround.cpp b/packages/realm/binding/jsi/flush_ui_queue_workaround.cpp new file mode 100644 index 0000000000..4ff1261f7c --- /dev/null +++ b/packages/realm/binding/jsi/flush_ui_queue_workaround.cpp @@ -0,0 +1,62 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2024 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +#include "flush_ui_queue_workaround.h" + +#include + +namespace realm::js::flush_ui_workaround { +// Calls are debounced using the waiting_for_ui_flush bool, so if an async flush is already +// pending when another JS to C++ call happens, we don't call invokeAsync again. This works +// because the work is performed before the microtask queue is flushed - see sequence +// diagram at https://bit.ly/3kexhHm. It might be possible to further optimize this, +// e.g. only flush the queue a maximum of once per frame, but this seems reasonable. +bool waiting_for_ui_flush = false; +std::shared_ptr js_invoker_{}; + +void inject_js_call_invoker(std::shared_ptr js_invoker) +{ + js_invoker_ = js_invoker; +} + +void reset_js_call_invoker() +{ + // TODO: Consider taking an invoker as an argument and only resetting if it matches js_invoker_ + // This would ensure the pointer isn't resetting from a subsequent assignment from the constructor + js_invoker_.reset(); +} + +void flush_ui_queue() +{ + if (js_invoker_ && !waiting_for_ui_flush) { + waiting_for_ui_flush = true; + // Calling invokeAsync tells React Native to execute the lambda passed + // in on the JS thread, and then flush the internal "microtask queue", which has the + // effect of flushing any pending UI updates. + // + // We call this after we have called into JS from C++, in order to ensure that the RN + // UI updates in response to any changes from Realm. We need to do this as we bypass + // the usual RN bridge mechanism for communicating between C++ and JS, so without doing + // this RN has no way to know that a change has occurred which might require an update + // (see #4389, facebook/react-native#33006). + js_invoker_->invokeAsync([&] { + waiting_for_ui_flush = false; + }); + } +} +} // namespace realm::js::flush_ui_workaround diff --git a/packages/realm/binding/jsi/flush_ui_queue_workaround.h b/packages/realm/binding/jsi/flush_ui_queue_workaround.h new file mode 100644 index 0000000000..5889a58b44 --- /dev/null +++ b/packages/realm/binding/jsi/flush_ui_queue_workaround.h @@ -0,0 +1,27 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2024 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include + +namespace realm::js::flush_ui_workaround { +void inject_js_call_invoker(std::shared_ptr js_invoker); +void reset_js_call_invoker(); +void flush_ui_queue(); +} // namespace realm::js::flush_ui_workaround diff --git a/packages/realm/binding/jsi/jsi_init.h b/packages/realm/binding/jsi/jsi_init.h index 65dd7dcad3..cd6d782e7f 100644 --- a/packages/realm/binding/jsi/jsi_init.h +++ b/packages/realm/binding/jsi/jsi_init.h @@ -26,7 +26,7 @@ extern "C" { #endif namespace jsi = facebook::jsi; -void realm_jsi_init(jsi::Runtime& rt, jsi::Object& exports, std::function flush_ui_queue); +void realm_jsi_init(jsi::Runtime& rt, jsi::Object& exports); void realm_jsi_invalidate_caches(); void realm_jsi_close_sync_sessions();