react-native 0.86.0 → 0.86.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +1 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +1 -1
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -1
- package/Libraries/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Components/Button.js +2 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -1
- package/Libraries/Components/TextInput/TextInput.flow.js +1 -1
- package/Libraries/Components/Touchable/Touchable.d.ts +1 -1
- package/Libraries/Components/View/ViewAccessibility.d.ts +1 -1
- package/Libraries/Components/View/ViewAccessibility.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +1 -1
- package/Libraries/Core/setUpNavigator.js +1 -1
- package/Libraries/EventEmitter/RCTNativeAppEventEmitter.d.ts +1 -1
- package/Libraries/FBLazyVector/FBLazyVector.podspec +1 -1
- package/Libraries/Image/ImageSource.d.ts +1 -1
- package/Libraries/Image/RCTImageLoader.mm +1 -1
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/Interaction/PanResponder.js +1 -1
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +1 -1
- package/Libraries/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/Renderer/README.md +2 -2
- package/Libraries/Required/RCTRequired.podspec +1 -1
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Text/React-RCTText.podspec +1 -1
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Utilities/PolyfillFunctions.js +1 -1
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/README.md +6 -6
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -1
- package/React/React-RCTFBReactNativeSpec.podspec +1 -1
- package/React/React-RCTFabric.podspec +1 -1
- package/React/Runtime/React-RCTRuntime.podspec +1 -1
- package/React/Views/ScrollView/RCTScrollView.m +1 -1
- package/React-Core.podspec +1 -1
- package/React.podspec +1 -1
- package/ReactAndroid/build.gradle.kts +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/publish.gradle +5 -5
- package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +5 -4
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt +49 -12
- package/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.kt +8 -4
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollViewManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextSelectionWatcher.kt +1 -1
- package/ReactApple/Libraries/RCTFoundation/RCTDeprecation/RCTDeprecation.podspec +1 -1
- package/ReactApple/RCTSwiftUI/RCTSwiftUI.podspec +1 -1
- package/ReactApple/RCTSwiftUIWrapper/RCTSwiftUIWrapper.podspec +1 -1
- package/ReactCommon/React-Fabric.podspec +1 -1
- package/ReactCommon/React-FabricComponents.podspec +1 -1
- package/ReactCommon/React-FabricImage.podspec +1 -1
- package/ReactCommon/React-Mapbuffer.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +1 -1
- package/ReactCommon/callinvoker/React-callinvoker.podspec +1 -1
- package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/hermes/React-hermes.podspec +1 -1
- package/ReactCommon/hermes/executor/React-jsitracing.podspec +1 -1
- package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +1 -1
- package/ReactCommon/jsi/React-jsi.podspec +1 -1
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +1 -1
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -1
- package/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +1 -1
- package/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +1 -1
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -1
- package/ReactCommon/jsitooling/React-jsitooling.podspec +1 -1
- package/ReactCommon/logger/React-logger.podspec +1 -1
- package/ReactCommon/oscompat/React-oscompat.podspec +1 -1
- package/ReactCommon/react/debug/React-debug.podspec +1 -1
- package/ReactCommon/react/debug/redbox/JscSafeUrl.h +1 -1
- package/ReactCommon/react/featureflags/React-featureflags.podspec +1 -1
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +1 -1
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/dom/NativeDOM.cpp +10 -4
- package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/intersectionobserver/React-intersectionobservernativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -1
- package/ReactCommon/react/nativemodule/viewtransition/React-viewtransitionnativemodule.podspec +1 -1
- package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec +1 -1
- package/ReactCommon/react/networking/React-networking.podspec +1 -1
- package/ReactCommon/react/performance/cdpmetrics/React-performancecdpmetrics.podspec +1 -1
- package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +1 -1
- package/ReactCommon/react/renderer/animated/internal/primitives.h +1 -1
- package/ReactCommon/react/renderer/consistency/React-rendererconsistency.podspec +1 -1
- package/ReactCommon/react/renderer/core/EventEmitter.cpp +20 -4
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +27 -19
- package/ReactCommon/react/renderer/core/ShadowNodeFamily.h +2 -0
- package/ReactCommon/react/renderer/css/React-renderercss.podspec +1 -1
- package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +1 -1
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -1
- package/ReactCommon/react/renderer/mounting/internal/CullingContext.cpp +1 -1
- package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm +1 -1
- package/ReactCommon/react/renderer/uimanager/UIManager.cpp +58 -53
- package/ReactCommon/react/renderer/uimanager/tests/FabricUIManagerTest.cpp +144 -3
- package/ReactCommon/react/runtime/React-RuntimeCore.podspec +1 -1
- package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +1 -1
- package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +1 -1
- package/ReactCommon/react/timing/React-timing.podspec +1 -1
- package/ReactCommon/react/utils/React-utils.podspec +1 -1
- package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -1
- package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +1 -1
- package/ReactCommon/yoga/Yoga.podspec +2 -2
- package/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp +2 -1
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +11 -7
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.h +1 -1
- package/package.json +12 -12
- package/scripts/cocoapods/spm.rb +1 -1
- package/scripts/cocoapods/utils.rb +2 -2
- package/scripts/codegen/templates/ReactAppDependencyProvider.podspec.template +1 -1
- package/scripts/codegen/templates/ReactCodegen.podspec.template +1 -1
- package/scripts/ios-configure-glog.sh +1 -1
- package/sdks/.hermesv1version +1 -1
- package/sdks/hermes-engine/hermes-engine.podspec +7 -2
- package/sdks/hermes-engine/version.properties +1 -1
- package/src/private/types/HostInstance.js +1 -1
- package/src/types/globals.d.ts +2 -2
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/ReactNativeDependencies.podspec +1 -1
- package/third-party-podspecs/glog.podspec +1 -1
- package/types/public/ReactNativeTypes.d.ts +2 -2
- package/types_generated/Libraries/Animated/components/AnimatedScrollView.d.ts +2 -2
- package/types_generated/Libraries/Components/Button.d.ts +3 -3
- package/types_generated/Libraries/Components/TextInput/TextInput.flow.d.ts +2 -2
- package/types_generated/Libraries/Components/View/ViewAccessibility.d.ts +4 -4
- package/types_generated/Libraries/Interaction/PanResponder.d.ts +2 -2
- package/types_generated/src/private/types/HostInstance.d.ts +2 -2
|
@@ -198,10 +198,6 @@ jsi::Value NativeDOM::getParentNode(
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
auto shadowNode = getShadowNode(rt, nativeNodeReference);
|
|
201
|
-
if (isRootShadowNode(*shadowNode)) {
|
|
202
|
-
// The parent of the root node is the document.
|
|
203
|
-
return jsi::Value{shadowNode->getSurfaceId()};
|
|
204
|
-
}
|
|
205
201
|
|
|
206
202
|
auto currentRevision =
|
|
207
203
|
getCurrentShadowTreeRevision(rt, shadowNode->getSurfaceId());
|
|
@@ -209,6 +205,16 @@ jsi::Value NativeDOM::getParentNode(
|
|
|
209
205
|
return jsi::Value::undefined();
|
|
210
206
|
}
|
|
211
207
|
|
|
208
|
+
// The parent of the surface's root node is the document. Only the actual
|
|
209
|
+
// root node qualifies: nested nodes that carry the `RootNodeKind` trait
|
|
210
|
+
// (e.g. <Modal>, portals/overlays) still have a real parent in the shadow
|
|
211
|
+
// tree and must report it. Otherwise capture/bubble event propagation is
|
|
212
|
+
// silently severed at that boundary (a listener on an ancestor rendered
|
|
213
|
+
// above the modal would never receive descendant focus/blur, etc.).
|
|
214
|
+
if (ShadowNode::sameFamily(*currentRevision, *shadowNode)) {
|
|
215
|
+
return jsi::Value{shadowNode->getSurfaceId()};
|
|
216
|
+
}
|
|
217
|
+
|
|
212
218
|
auto parentShadowNode = dom::getParentNode(currentRevision, *shadowNode);
|
|
213
219
|
if (parentShadowNode == nullptr) {
|
|
214
220
|
return jsi::Value::undefined();
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec
CHANGED
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we're presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec
CHANGED
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we're presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
package/ReactCommon/react/nativemodule/viewtransition/React-viewtransitionnativemodule.podspec
CHANGED
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we're presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
package/ReactCommon/react/nativemodule/webperformance/React-webperformancenativemodule.podspec
CHANGED
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
namespace facebook::react::animated {
|
|
12
12
|
// Indicates that the animated node identifier is not defined.
|
|
13
13
|
// It is safe to use 0 because JavaScript starts assigning identifiers from 1.
|
|
14
|
-
// https://github.com/
|
|
14
|
+
// https://github.com/react/react-native/blob/main/packages/react-native/src/private/animated/NativeAnimatedHelper.js#L35
|
|
15
15
|
constexpr static Tag undefinedAnimatedNodeIdentifier = 0;
|
|
16
16
|
} // namespace facebook::react::animated
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -134,11 +134,19 @@ void EventEmitter::dispatchEvent(
|
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
SharedEventTarget eventTarget;
|
|
138
|
+
std::weak_ptr<const ShadowNodeFamily> shadowNodeFamily;
|
|
139
|
+
{
|
|
140
|
+
std::scoped_lock lock(DispatchMutex());
|
|
141
|
+
eventTarget = eventTarget_;
|
|
142
|
+
shadowNodeFamily = shadowNodeFamily_;
|
|
143
|
+
}
|
|
144
|
+
|
|
137
145
|
eventDispatcher->dispatchEvent(RawEvent(
|
|
138
146
|
normalizeEventType(std::move(type)),
|
|
139
147
|
std::move(payload),
|
|
140
|
-
|
|
141
|
-
|
|
148
|
+
std::move(eventTarget),
|
|
149
|
+
std::move(shadowNodeFamily),
|
|
142
150
|
category,
|
|
143
151
|
false,
|
|
144
152
|
eventTimestamp));
|
|
@@ -180,11 +188,19 @@ void EventEmitter::dispatchUniqueEvent(
|
|
|
180
188
|
return;
|
|
181
189
|
}
|
|
182
190
|
|
|
191
|
+
SharedEventTarget eventTarget;
|
|
192
|
+
std::weak_ptr<const ShadowNodeFamily> shadowNodeFamily;
|
|
193
|
+
{
|
|
194
|
+
std::scoped_lock lock(DispatchMutex());
|
|
195
|
+
eventTarget = eventTarget_;
|
|
196
|
+
shadowNodeFamily = shadowNodeFamily_;
|
|
197
|
+
}
|
|
198
|
+
|
|
183
199
|
eventDispatcher->dispatchUniqueEvent(RawEvent(
|
|
184
200
|
normalizeEventType(std::move(type)),
|
|
185
201
|
std::move(payload),
|
|
186
|
-
|
|
187
|
-
|
|
202
|
+
std::move(eventTarget),
|
|
203
|
+
std::move(shadowNodeFamily),
|
|
188
204
|
RawEvent::Category::Continuous,
|
|
189
205
|
true,
|
|
190
206
|
eventTimestamp));
|
|
@@ -137,27 +137,35 @@ std::shared_ptr<ShadowNode> ShadowNode::clone(
|
|
|
137
137
|
const ShadowNodeFragment& fragment) const {
|
|
138
138
|
const auto& family = *family_;
|
|
139
139
|
const auto& componentDescriptor = family.componentDescriptor_;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.state = fragment.state});
|
|
152
|
-
return clonedNode;
|
|
153
|
-
} else {
|
|
154
|
-
// TODO: We might need to merge fragment.props with
|
|
155
|
-
// `family.nativeProps_DEPRECATED`.
|
|
156
|
-
return componentDescriptor.cloneShadowNode(*this, fragment);
|
|
140
|
+
|
|
141
|
+
std::optional<RawProps> propsOverride;
|
|
142
|
+
{
|
|
143
|
+
std::lock_guard<std::mutex> lock(family.nativePropsMutex);
|
|
144
|
+
if (family.nativeProps_DEPRECATED != nullptr) {
|
|
145
|
+
if (fragment.props == ShadowNodeFragment::propsPlaceholder()) {
|
|
146
|
+
propsOverride.emplace(*family.nativeProps_DEPRECATED);
|
|
147
|
+
} else {
|
|
148
|
+
// TODO: We might need to merge fragment.props with
|
|
149
|
+
// `family.nativeProps_DEPRECATED`.
|
|
150
|
+
}
|
|
157
151
|
}
|
|
158
|
-
} else {
|
|
159
|
-
return componentDescriptor.cloneShadowNode(*this, fragment);
|
|
160
152
|
}
|
|
153
|
+
|
|
154
|
+
if (propsOverride) {
|
|
155
|
+
// Clone existing `props_` with `family.nativeProps_DEPRECATED` to
|
|
156
|
+
// apply previously set props via `setNativeProps` API. The parsed
|
|
157
|
+
// result escapes the lock so the rest of the clone work runs
|
|
158
|
+
// unblocked.
|
|
159
|
+
auto propsParserContext = PropsParserContext{family_->getSurfaceId(), {}};
|
|
160
|
+
return componentDescriptor.cloneShadowNode(
|
|
161
|
+
*this,
|
|
162
|
+
{.props = componentDescriptor.cloneProps(
|
|
163
|
+
propsParserContext, props_, std::move(*propsOverride)),
|
|
164
|
+
.children = fragment.children,
|
|
165
|
+
.state = fragment.state});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return componentDescriptor.cloneShadowNode(*this, fragment);
|
|
161
169
|
}
|
|
162
170
|
|
|
163
171
|
std::shared_ptr<const ContextContainer> ShadowNode::getContextContainer()
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <memory>
|
|
11
|
+
#include <mutex>
|
|
11
12
|
#include <shared_mutex>
|
|
12
13
|
|
|
13
14
|
#include <react/renderer/core/EventEmitter.h>
|
|
@@ -114,6 +115,7 @@ class ShadowNodeFamily final : public jsi::NativeState {
|
|
|
114
115
|
* architecture and will be removed in the future.
|
|
115
116
|
*/
|
|
116
117
|
mutable std::unique_ptr<folly::dynamic> nativeProps_DEPRECATED;
|
|
118
|
+
mutable std::mutex nativePropsMutex;
|
|
117
119
|
|
|
118
120
|
/**
|
|
119
121
|
* @return tag for the ShadowNodeFamily.
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -52,7 +52,7 @@ CullingContext CullingContext::adjustCullingContextIfNeeded(
|
|
|
52
52
|
// In RTL, content offset is flipped horizontally.
|
|
53
53
|
// We need to flip the culling context frame to match.
|
|
54
54
|
// See:
|
|
55
|
-
// https://github.com/
|
|
55
|
+
// https://github.com/react/react-native/blob/c2f39cfdd87c32b9a59efe8a788b8a03f02b0ea0/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm#L579
|
|
56
56
|
auto stateData = scrollViewShadowNode->getStateData();
|
|
57
57
|
cullingContext.frame.origin.x =
|
|
58
58
|
stateData.contentBoundingRect.size.width -
|
|
@@ -8,7 +8,7 @@ require "json"
|
|
|
8
8
|
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
9
|
version = package['version']
|
|
10
10
|
|
|
11
|
-
source = { :git => 'https://github.com/
|
|
11
|
+
source = { :git => 'https://github.com/react/react-native.git' }
|
|
12
12
|
if version == '1000.0.0'
|
|
13
13
|
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
14
14
|
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
@@ -361,7 +361,7 @@ UIFont *RCTFontWithFontProperties(RCTFontProperties fontProperties)
|
|
|
361
361
|
font = [UIFont fontWithName:fontProperties.family size:effectiveFontSize];
|
|
362
362
|
if (font != nullptr) {
|
|
363
363
|
fontNames = [UIFont fontNamesForFamilyName:font.familyName];
|
|
364
|
-
fontWeight = (fontWeight != 0.0)
|
|
364
|
+
fontWeight = (fontWeight != 0.0) ? fontWeight : RCTGetFontWeight(font);
|
|
365
365
|
} else {
|
|
366
366
|
// Failback to system font.
|
|
367
367
|
font = RCTDefaultFontWithFontProperties(fontProperties);
|
|
@@ -118,49 +118,51 @@ std::shared_ptr<ShadowNode> UIManager::cloneNode(
|
|
|
118
118
|
|
|
119
119
|
auto& componentDescriptor = shadowNode.getComponentDescriptor();
|
|
120
120
|
auto& family = shadowNode.getFamily();
|
|
121
|
-
auto props = ShadowNodeFragment::propsPlaceholder();
|
|
122
121
|
|
|
122
|
+
auto props = ShadowNodeFragment::propsPlaceholder();
|
|
123
123
|
if (!rawProps.isEmpty()) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
} else {
|
|
161
|
-
props = componentDescriptor.cloneProps(
|
|
162
|
-
propsParserContext, shadowNode.getProps(), std::move(rawProps));
|
|
124
|
+
std::optional<folly::dynamic> finalProps;
|
|
125
|
+
{
|
|
126
|
+
std::lock_guard<std::mutex> lock(family.nativePropsMutex);
|
|
127
|
+
if (family.nativeProps_DEPRECATED != nullptr) {
|
|
128
|
+
// 1. update the nativeProps_DEPRECATED props.
|
|
129
|
+
//
|
|
130
|
+
// In this step, we want the most recent value for the props
|
|
131
|
+
// managed by setNativeProps.
|
|
132
|
+
// Values in `rawProps` patch (take precedence over)
|
|
133
|
+
// `nativeProps_DEPRECATED`. For example, if both
|
|
134
|
+
// `nativeProps_DEPRECATED` and `rawProps` contain key 'A'.
|
|
135
|
+
// Value from `rawProps` overrides what was previously in
|
|
136
|
+
// `nativeProps_DEPRECATED`. Notice that the `nativeProps_DEPRECATED`
|
|
137
|
+
// patch will not get more props from `rawProps`: if the key is not
|
|
138
|
+
// present in `nativeProps_DEPRECATED`, it will not be added.
|
|
139
|
+
//
|
|
140
|
+
// The result of this operation is the new `nativeProps_DEPRECATED`.
|
|
141
|
+
family.nativeProps_DEPRECATED =
|
|
142
|
+
std::make_unique<folly::dynamic>(mergeDynamicProps(
|
|
143
|
+
*family.nativeProps_DEPRECATED, // source
|
|
144
|
+
(folly::dynamic)rawProps, // patch
|
|
145
|
+
NullValueStrategy::Ignore));
|
|
146
|
+
|
|
147
|
+
// 2. Compute the final set of props.
|
|
148
|
+
//
|
|
149
|
+
// This step takes the new props handled by `setNativeProps` and
|
|
150
|
+
// merges them in the `rawProps` managed by React.
|
|
151
|
+
// The new props handled by `nativeProps` now takes precedence
|
|
152
|
+
// on the props handled by React, as we want to make sure that
|
|
153
|
+
// all the props are applied to the component.
|
|
154
|
+
// We use these finalProps as source of truth for the component.
|
|
155
|
+
finalProps = mergeDynamicProps(
|
|
156
|
+
(folly::dynamic)rawProps, // source
|
|
157
|
+
*family.nativeProps_DEPRECATED, // patch
|
|
158
|
+
NullValueStrategy::Override);
|
|
159
|
+
}
|
|
163
160
|
}
|
|
161
|
+
|
|
162
|
+
props = componentDescriptor.cloneProps(
|
|
163
|
+
propsParserContext,
|
|
164
|
+
shadowNode.getProps(),
|
|
165
|
+
finalProps ? RawProps(std::move(*finalProps)) : std::move(rawProps));
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
auto clonedShadowNode = componentDescriptor.cloneShadowNode(
|
|
@@ -439,19 +441,22 @@ void UIManager::setNativeProps_DEPRECATED(
|
|
|
439
441
|
const std::shared_ptr<const ShadowNode>& shadowNode,
|
|
440
442
|
RawProps rawProps) const {
|
|
441
443
|
auto& family = shadowNode->getFamily();
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
444
|
+
{
|
|
445
|
+
std::lock_guard<std::mutex> lock(family.nativePropsMutex);
|
|
446
|
+
if (family.nativeProps_DEPRECATED) {
|
|
447
|
+
// Values in `rawProps` patch (take precedence over)
|
|
448
|
+
// `nativeProps_DEPRECATED`. For example, if both
|
|
449
|
+
// `nativeProps_DEPRECATED` and `rawProps` contain key 'A'. Value from
|
|
450
|
+
// `rawProps` overrides what was previously in `nativeProps_DEPRECATED`.
|
|
451
|
+
family.nativeProps_DEPRECATED =
|
|
452
|
+
std::make_unique<folly::dynamic>(mergeDynamicProps(
|
|
453
|
+
*family.nativeProps_DEPRECATED,
|
|
454
|
+
(folly::dynamic)rawProps,
|
|
455
|
+
NullValueStrategy::Override));
|
|
456
|
+
} else {
|
|
457
|
+
family.nativeProps_DEPRECATED =
|
|
458
|
+
std::make_unique<folly::dynamic>((folly::dynamic)rawProps);
|
|
459
|
+
}
|
|
455
460
|
}
|
|
456
461
|
|
|
457
462
|
shadowTreeRegistry_.visit(
|