react-native-windows 0.82.3 → 0.83.0-preview.0

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.
Files changed (224) hide show
  1. package/.flowconfig +2 -7
  2. package/Libraries/Animated/components/AnimatedFlatList.js +5 -3
  3. package/Libraries/Animated/components/AnimatedImage.js +4 -3
  4. package/Libraries/Animated/components/AnimatedSectionList.js +2 -2
  5. package/Libraries/Animated/components/AnimatedText.js +7 -3
  6. package/Libraries/Animated/components/AnimatedView.js +3 -2
  7. package/Libraries/Animated/createAnimatedComponent.js +24 -12
  8. package/Libraries/Animated/nodes/AnimatedColor.js +26 -10
  9. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +43 -15
  10. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +43 -15
  11. package/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +2 -2
  12. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +2 -2
  13. package/Libraries/Components/Glyph/Glyph.js +4 -1
  14. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +2 -2
  15. package/Libraries/Components/RefreshControl/RefreshControl.d.ts +3 -3
  16. package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +2 -2
  17. package/Libraries/Components/ScrollView/ScrollView.js +1 -0
  18. package/Libraries/Components/ScrollView/ScrollView.windows.js +1 -0
  19. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -6
  20. package/Libraries/Components/Switch/Switch.d.ts +2 -2
  21. package/Libraries/Components/Switch/Switch.windows.js +1 -1
  22. package/Libraries/Components/TextInput/TextInput.d.ts +2 -5
  23. package/Libraries/Components/TextInput/TextInput.js +6 -0
  24. package/Libraries/Components/TextInput/TextInput.windows.js +6 -0
  25. package/Libraries/Components/Touchable/TouchableBounce.js +7 -7
  26. package/Libraries/Components/Touchable/TouchableBounce.windows.js +7 -7
  27. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +1 -1
  28. package/Libraries/Components/View/ReactNativeStyleAttributes.js +19 -1
  29. package/Libraries/Components/View/View.d.ts +2 -2
  30. package/Libraries/Components/View/View.windows.js +0 -1
  31. package/Libraries/Components/View/ViewNativeComponent.js +13 -1
  32. package/Libraries/Core/ReactNativeVersion.js +3 -3
  33. package/Libraries/Core/setUpPerformance.js +2 -0
  34. package/Libraries/Debugging/DebuggingOverlay.js +14 -14
  35. package/Libraries/Debugging/DebuggingOverlayRegistry.js +8 -2
  36. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -2
  37. package/Libraries/Image/Image.d.ts +3 -3
  38. package/Libraries/Image/ImageInjection.js +3 -6
  39. package/Libraries/Image/ImageTypes.flow.js +3 -7
  40. package/Libraries/Lists/FlatList.js +8 -8
  41. package/Libraries/Lists/SectionList.d.ts +5 -1
  42. package/Libraries/Lists/ViewabilityHelper.js +1 -1
  43. package/Libraries/Lists/VirtualizedList.js +1 -0
  44. package/Libraries/LogBox/UI/AnsiHighlight.js +4 -1
  45. package/Libraries/NativeComponent/BaseViewConfig.android.js +11 -2
  46. package/Libraries/NativeComponent/NativeComponentRegistry.d.ts +98 -0
  47. package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -0
  48. package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +3 -1
  49. package/Libraries/NativeComponent/ViewConfigIgnore.windows.js +45 -0
  50. package/Libraries/Network/RCTNetworking.android.js +3 -1
  51. package/Libraries/Network/RCTNetworking.ios.js +3 -0
  52. package/Libraries/Network/RCTNetworking.windows.js +3 -0
  53. package/Libraries/Network/XMLHttpRequest.js +1 -41
  54. package/Libraries/Pressability/usePressability.js +14 -3
  55. package/Libraries/ReactNative/PaperUIManager.windows.js +3 -3
  56. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +20 -82
  57. package/Libraries/ReactNative/getNativeComponentAttributes.js +12 -0
  58. package/Libraries/Renderer/implementations/ReactFabric-dev.js +6759 -4478
  59. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3169 -3119
  60. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4732 -3535
  61. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +6646 -4070
  62. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3136 -2825
  63. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4761 -3312
  64. package/Libraries/Renderer/shims/ReactNative.js +3 -1
  65. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  66. package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +2 -1
  67. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
  68. package/Libraries/StyleSheet/StyleSheetTypes.js +44 -0
  69. package/Libraries/StyleSheet/processBackgroundPosition.js +284 -0
  70. package/Libraries/StyleSheet/processBackgroundRepeat.js +105 -0
  71. package/Libraries/StyleSheet/processBackgroundSize.js +104 -0
  72. package/Libraries/Text/Text.d.ts +2 -2
  73. package/Libraries/Text/TextNativeComponent.js +10 -0
  74. package/Libraries/TurboModule/TurboModuleRegistry.js +3 -9
  75. package/Libraries/Utilities/DevLoadingView.js +14 -6
  76. package/Libraries/Utilities/HMRClient.js +13 -5
  77. package/Microsoft.ReactNative/CompositionComponentView.idl +2 -0
  78. package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -0
  79. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +1 -1
  80. package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
  81. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +2 -52
  82. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +10 -40
  83. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +3 -80
  84. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +45 -12
  85. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +8 -0
  86. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +61 -74
  87. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +4 -0
  88. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +1 -0
  89. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +4 -3
  90. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +2 -1
  91. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.cpp +245 -0
  92. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.h +80 -0
  93. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +20 -36
  94. package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +5 -0
  95. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +1 -0
  96. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
  97. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +20 -94
  98. package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -3
  99. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +0 -41
  100. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +0 -11
  101. package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -3
  102. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +31 -101
  103. package/Microsoft.ReactNative/ReactNativeWin32App.h +2 -13
  104. package/Microsoft.ReactNative/ReactNativeWindow.idl +44 -0
  105. package/Microsoft.ReactNative.Cxx/AutoDraw.h +9 -1
  106. package/Microsoft.ReactNative.Cxx/ReactCommon/CallInvoker.h +13 -16
  107. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +24 -36
  108. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.h +5 -8
  109. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/AString.h +8 -6
  110. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Array.h +32 -49
  111. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +27 -76
  112. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +4 -2
  113. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/CallbackWrapper.h +19 -18
  114. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +25 -48
  115. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Convert.h +38 -31
  116. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Error.h +11 -6
  117. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/EventEmitter.h +47 -45
  118. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Function.h +69 -89
  119. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/HighResTimeStamp.h +8 -8
  120. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.h +6 -6
  121. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +16 -8
  122. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Object.h +17 -24
  123. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Promise.h +17 -17
  124. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Value.h +20 -29
  125. package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/react_native_assert.h +2 -7
  126. package/Microsoft.ReactNative.Cxx/ReactCommon/react/timing/primitives.h +127 -115
  127. package/PropertySheets/Generated/PackageVersion.g.props +5 -5
  128. package/PropertySheets/Warnings.props +2 -1
  129. package/ReactCommon/ReactCommon.vcxproj +11 -2
  130. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +2 -2
  131. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +4 -2
  132. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +4 -2
  133. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +4 -2
  134. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/MethodCall.cpp +4 -2
  135. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ModuleRegistry.cpp +5 -3
  136. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -4
  137. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/RAMBundleRegistry.cpp +6 -4
  138. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +2 -0
  139. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +25 -35
  140. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +86 -67
  141. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +15 -8
  142. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSINativeModules.cpp +4 -2
  143. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +84 -68
  144. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +31 -35
  145. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +4 -5
  146. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp +2 -1
  147. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +24 -36
  148. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +28 -66
  149. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/webperformance/NativePerformance.cpp +5 -0
  150. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -3
  151. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +8 -4
  152. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +19 -16
  153. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +8 -9
  154. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +25 -95
  155. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +85 -42
  156. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +2 -0
  157. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +2 -0
  158. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +25 -31
  159. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +19 -5
  160. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +16 -1
  161. package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +1 -15
  162. package/Scripts/creaternwapp.cmd +1 -1
  163. package/Scripts/perf/compare-results.js +357 -0
  164. package/Scripts/perf/create-perf-test.js +343 -0
  165. package/Scripts/perf/post-pr-comment.js +210 -0
  166. package/Shared/Hermes/HermesRuntimeTargetDelegate.cpp +8 -0
  167. package/Shared/Hermes/HermesRuntimeTargetDelegate.h +3 -0
  168. package/Shared/Shared.vcxitems +15 -3
  169. package/Shared/Shared.vcxitems.filters +11 -3
  170. package/codegen/NativeIntersectionObserverSpec.g.h +2 -0
  171. package/codegen/NativeNetworkingIOSSpec.g.h +2 -0
  172. package/codegen/NativePerformanceSpec.g.h +6 -0
  173. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +229 -139
  174. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +2 -1
  175. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +42 -25
  176. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +2 -1
  177. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +2 -1
  178. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +11 -6
  179. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +11 -6
  180. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +1 -0
  181. package/codegen/react/components/rnwcore/InputAccessory.g.h +2 -1
  182. package/codegen/react/components/rnwcore/ModalHostView.g.h +40 -23
  183. package/codegen/react/components/rnwcore/Props.cpp +6 -1
  184. package/codegen/react/components/rnwcore/Props.h +1 -0
  185. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +11 -6
  186. package/codegen/react/components/rnwcore/SafeAreaView.g.h +1 -0
  187. package/codegen/react/components/rnwcore/Switch.g.h +11 -6
  188. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +2 -1
  189. package/codegen/react/components/rnwcore/VirtualView.g.h +41 -8
  190. package/codegen/react/components/rnwcore/VirtualViewExperimental.g.h +45 -8
  191. package/codegen/rnwcoreJSI.h +3973 -6059
  192. package/index.js +6 -0
  193. package/index.windows.js +6 -0
  194. package/jest/mockComponent.js +6 -6
  195. package/jest/setup.js +15 -10
  196. package/package.json +27 -27
  197. package/src/private/components/virtualview/VirtualView.js +22 -27
  198. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +6 -0
  199. package/src/private/featureflags/ReactNativeFeatureFlags.js +100 -19
  200. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +18 -3
  201. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
  202. package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -1
  203. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -0
  204. package/src/private/webapis/dom/nodes/ReactNativeElement.js +12 -2
  205. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +76 -15
  206. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +1 -0
  207. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  208. package/src/private/webapis/performance/ResourceTiming.js +31 -4
  209. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +4 -1
  210. package/src/private/webapis/performance/specs/NativePerformance.js +3 -0
  211. package/stubs/double-conversion/double-conversion.h +5 -0
  212. package/templates/cpp-app/template.config.js +1 -1
  213. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
  214. package/templates/cpp-lib/template.config.js +1 -1
  215. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
  216. package/types/index.d.ts +1 -0
  217. package/types/public/ReactNativeTypes.d.ts +115 -2
  218. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +0 -152
  219. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/BaseViewProps.cpp +0 -628
  220. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +0 -1574
  221. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +0 -528
  222. package/Scripts/OpenSSL.nuspec +0 -39
  223. package/Scripts/OpenSSL.targets +0 -36
  224. package/codegen/rnwcoreJSI-generated.cpp +0 -3470
@@ -1,528 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #include "ShadowNode.h"
9
- #include "DynamicPropsUtilities.h"
10
- #include "ShadowNodeFragment.h"
11
-
12
- #include <react/debug/react_native_assert.h>
13
- #include <react/featureflags/ReactNativeFeatureFlags.h>
14
- #include <react/renderer/core/ComponentDescriptor.h>
15
- #include <react/renderer/core/ShadowNodeFragment.h>
16
- #include <react/renderer/debug/DebugStringConvertible.h>
17
- #include <react/renderer/debug/debugStringConvertibleUtils.h>
18
-
19
- #include <utility>
20
-
21
- namespace facebook::react {
22
-
23
- /*
24
- * Runtime shadow node reference updates should only run from one thread at all
25
- * times to avoid having more than one shadow tree updating the current fiber
26
- * tree simultaneously. This thread_local flag allows enabling the updates for
27
- * choses threads.
28
- */
29
- thread_local bool useRuntimeShadowNodeReferenceUpdateOnThread{false}; // NOLINT
30
-
31
- /* static */ void ShadowNode::setUseRuntimeShadowNodeReferenceUpdateOnThread(
32
- bool isEnabled) {
33
- useRuntimeShadowNodeReferenceUpdateOnThread = isEnabled;
34
- }
35
-
36
- ShadowNode::SharedListOfShared ShadowNode::emptySharedShadowNodeSharedList() {
37
- static const auto emptySharedShadowNodeSharedList =
38
- std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>();
39
- return emptySharedShadowNodeSharedList;
40
- }
41
-
42
- /*
43
- * On iOS, this method returns `props` if provided, `sourceShadowNode`'s props
44
- * otherwise. On Android, we forward props in case `sourceShadowNode` hasn't
45
- * been mounted. `Props::rawProps` are merged from `props` to a copy of
46
- * `sourceShadowNode.props_` and returned. This is necessary to enable
47
- * Background Executor and should be removed once reimplementation of JNI layer
48
- * is finished.
49
- */
50
- Props::Shared ShadowNode::propsForClonedShadowNode(
51
- const ShadowNode& sourceShadowNode,
52
- const Props::Shared& props) {
53
- #ifdef RN_SERIALIZABLE_STATE
54
- bool hasBeenMounted = sourceShadowNode.hasBeenMounted_;
55
- bool sourceNodeHasRawProps = !sourceShadowNode.getProps()->rawProps.empty();
56
- if (!hasBeenMounted && sourceNodeHasRawProps && props) {
57
- auto& castedProps = const_cast<Props&>(*props);
58
- castedProps.rawProps = mergeDynamicProps(
59
- sourceShadowNode.getProps()->rawProps,
60
- props->rawProps,
61
- NullValueStrategy::Override);
62
- return props;
63
- }
64
- #endif
65
- return props ? props : sourceShadowNode.getProps();
66
- }
67
-
68
- bool ShadowNode::sameFamily(const ShadowNode& first, const ShadowNode& second) {
69
- return first.family_ == second.family_;
70
- }
71
-
72
- #pragma mark - Constructors
73
-
74
- ShadowNode::ShadowNode(
75
- const ShadowNodeFragment& fragment,
76
- ShadowNodeFamily::Shared family,
77
- ShadowNodeTraits traits)
78
- :
79
- #if RN_DEBUG_STRING_CONVERTIBLE
80
- revision_(1),
81
- #endif
82
- props_(fragment.props),
83
- children_(
84
- fragment.children ? fragment.children
85
- : emptySharedShadowNodeSharedList()),
86
- state_(fragment.state),
87
- orderIndex_(0),
88
- family_(std::move(family)),
89
- traits_(traits) {
90
- react_native_assert(props_);
91
- react_native_assert(children_);
92
-
93
- traits_.set(ShadowNodeTraits::Trait::ChildrenAreShared);
94
-
95
- for (const auto& child : *children_) {
96
- child->family_->setParent(family_);
97
- }
98
-
99
- updateTraitsIfNeccessary();
100
-
101
- // The first node of the family gets its state committed automatically.
102
- family_->setMostRecentState(state_);
103
- }
104
-
105
- ShadowNode::ShadowNode(
106
- const ShadowNode& sourceShadowNode,
107
- const ShadowNodeFragment& fragment)
108
- :
109
- #if RN_DEBUG_STRING_CONVERTIBLE
110
- revision_(sourceShadowNode.revision_ + 1),
111
- #endif
112
- props_(propsForClonedShadowNode(sourceShadowNode, fragment.props)),
113
- children_(
114
- fragment.children ? fragment.children : sourceShadowNode.children_),
115
- state_(
116
- fragment.state ? fragment.state
117
- : (ReactNativeFeatureFlags::useShadowNodeStateOnClone()
118
- ? sourceShadowNode.state_
119
- : sourceShadowNode.getMostRecentState())),
120
- orderIndex_(sourceShadowNode.orderIndex_),
121
- family_(sourceShadowNode.family_),
122
- traits_(sourceShadowNode.traits_) {
123
-
124
- react_native_assert(props_);
125
- react_native_assert(children_);
126
-
127
- // State could have been progressed above by checking
128
- // `sourceShadowNode.getMostRecentState()`.
129
- traits_.set(ShadowNodeTraits::Trait::ChildrenAreShared);
130
-
131
- if (fragment.children) {
132
- for (const auto& child : *children_) {
133
- child->family_->setParent(family_);
134
- }
135
- updateTraitsIfNeccessary();
136
- }
137
- }
138
-
139
- std::shared_ptr<ShadowNode> ShadowNode::clone(
140
- const ShadowNodeFragment& fragment) const {
141
- const auto& family = *family_;
142
- const auto& componentDescriptor = family.componentDescriptor_;
143
- if (family.nativeProps_DEPRECATED != nullptr) {
144
- auto propsParserContext = PropsParserContext{family_->getSurfaceId(), {}};
145
- if (fragment.props == ShadowNodeFragment::propsPlaceholder()) {
146
- // Clone existing `props_` with `family.nativeProps_DEPRECATED` to apply
147
- // previously set props via `setNativeProps` API.
148
- auto props = componentDescriptor.cloneProps(
149
- propsParserContext, props_, RawProps(*family.nativeProps_DEPRECATED));
150
- auto clonedNode = componentDescriptor.cloneShadowNode(
151
- *this,
152
- {.props = props,
153
- .children = fragment.children,
154
- .state = fragment.state});
155
- return clonedNode;
156
- } else {
157
- // TODO: We might need to merge fragment.priops with
158
- // `family.nativeProps_DEPRECATED`.
159
- return componentDescriptor.cloneShadowNode(*this, fragment);
160
- }
161
- } else {
162
- return componentDescriptor.cloneShadowNode(*this, fragment);
163
- }
164
- }
165
-
166
- std::shared_ptr<const ContextContainer> ShadowNode::getContextContainer() const {
167
- return family_->componentDescriptor_.getContextContainer();
168
- }
169
-
170
- #pragma mark - Getters
171
-
172
- ComponentName ShadowNode::getComponentName() const {
173
- return family_->getComponentName();
174
- }
175
-
176
- ComponentHandle ShadowNode::getComponentHandle() const {
177
- return family_->getComponentHandle();
178
- }
179
-
180
- const std::vector<std::shared_ptr<const ShadowNode>>& ShadowNode::getChildren()
181
- const {
182
- return *children_;
183
- }
184
-
185
- ShadowNodeTraits ShadowNode::getTraits() const {
186
- return traits_;
187
- }
188
-
189
- const Props::Shared& ShadowNode::getProps() const {
190
- return props_;
191
- }
192
-
193
- const SharedEventEmitter& ShadowNode::getEventEmitter() const {
194
- return family_->eventEmitter_;
195
- }
196
-
197
- jsi::Value ShadowNode::getInstanceHandle(jsi::Runtime& runtime) const {
198
- return family_->getInstanceHandle(runtime);
199
- }
200
-
201
- Tag ShadowNode::getTag() const {
202
- return family_->tag_;
203
- }
204
-
205
- SurfaceId ShadowNode::getSurfaceId() const {
206
- return family_->surfaceId_;
207
- }
208
-
209
- const ComponentDescriptor& ShadowNode::getComponentDescriptor() const {
210
- return family_->componentDescriptor_;
211
- }
212
-
213
- const State::Shared& ShadowNode::getState() const {
214
- return state_;
215
- }
216
-
217
- State::Shared ShadowNode::getMostRecentState() const {
218
- return family_->getMostRecentState();
219
- }
220
-
221
- int ShadowNode::getOrderIndex() const {
222
- return orderIndex_;
223
- }
224
-
225
- void ShadowNode::sealRecursive() const {
226
- if (getSealed()) {
227
- return;
228
- }
229
-
230
- seal();
231
-
232
- props_->seal();
233
-
234
- for (const auto& child : *children_) {
235
- child->sealRecursive();
236
- }
237
- }
238
-
239
- #pragma mark - Mutating Methods
240
-
241
- void ShadowNode::appendChild(const std::shared_ptr<const ShadowNode>& child) {
242
- ensureUnsealed();
243
-
244
- cloneChildrenIfShared();
245
- auto& children =
246
- const_cast<std::vector<std::shared_ptr<const ShadowNode>>&>(*children_);
247
- children.push_back(child);
248
-
249
- child->family_->setParent(family_);
250
- updateTraitsIfNeccessary();
251
- }
252
-
253
- void ShadowNode::replaceChild(
254
- const ShadowNode& oldChild,
255
- const std::shared_ptr<const ShadowNode>& newChild,
256
- size_t suggestedIndex) {
257
- ensureUnsealed();
258
-
259
- cloneChildrenIfShared();
260
- newChild->family_->setParent(family_);
261
-
262
- auto& children =
263
- const_cast<std::vector<std::shared_ptr<const ShadowNode>>&>(*children_);
264
- auto size = children.size();
265
-
266
- if (suggestedIndex != std::numeric_limits<size_t>::max() &&
267
- suggestedIndex < size) {
268
- // If provided `suggestedIndex` is accurate,
269
- // replacing in place using the index.
270
- if (children.at(suggestedIndex).get() == &oldChild) {
271
- children[suggestedIndex] = newChild;
272
- return;
273
- }
274
- }
275
-
276
- for (size_t index = 0; index < size; index++) {
277
- if (children.at(index).get() == &oldChild) {
278
- children[index] = newChild;
279
- return;
280
- }
281
- }
282
-
283
- react_native_assert(false && "Child to replace was not found.");
284
- updateTraitsIfNeccessary();
285
- }
286
-
287
- void ShadowNode::cloneChildrenIfShared() {
288
- if (!traits_.check(ShadowNodeTraits::Trait::ChildrenAreShared)) {
289
- return;
290
- }
291
-
292
- traits_.unset(ShadowNodeTraits::Trait::ChildrenAreShared);
293
- children_ = std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>(
294
- *children_);
295
- }
296
-
297
- void ShadowNode::updateTraitsIfNeccessary() {
298
- if (ReactNativeFeatureFlags::enableViewCulling()) {
299
- if (traits_.check(ShadowNodeTraits::Trait::Unstable_uncullableView)) {
300
- return;
301
- }
302
-
303
- for (const auto& child : *children_) {
304
- if (child->getTraits().check(
305
- ShadowNodeTraits::Trait::Unstable_uncullableView) ||
306
- child->getTraits().check(
307
- ShadowNodeTraits::Trait::Unstable_uncullableTrace)) {
308
- traits_.set(ShadowNodeTraits::Trait::Unstable_uncullableTrace);
309
- return;
310
- }
311
- }
312
- traits_.unset(ShadowNodeTraits::Trait::Unstable_uncullableTrace);
313
- }
314
- }
315
-
316
- void ShadowNode::setMounted(bool mounted) const {
317
- if (mounted) {
318
- family_->setMostRecentState(getState());
319
- family_->setMounted();
320
- hasBeenMounted_ = mounted;
321
- }
322
-
323
- family_->eventEmitter_->setEnabled(mounted);
324
- }
325
-
326
- bool ShadowNode::getHasBeenPromoted() const {
327
- return hasBeenMounted_.load();
328
- }
329
-
330
- void ShadowNode::setRuntimeShadowNodeReference(
331
- const std::shared_ptr<ShadowNodeWrapper>& runtimeShadowNodeReference)
332
- const {
333
- runtimeShadowNodeReference_ = runtimeShadowNodeReference;
334
- }
335
-
336
- void ShadowNode::updateRuntimeShadowNodeReference(
337
- const std::shared_ptr<const ShadowNode>& destinationShadowNode) const {
338
- if (auto reference = runtimeShadowNodeReference_.lock()) {
339
- reference->shadowNode = destinationShadowNode;
340
- }
341
- }
342
-
343
- void ShadowNode::transferRuntimeShadowNodeReference(
344
- const std::shared_ptr<const ShadowNode>& destinationShadowNode) const {
345
- destinationShadowNode->runtimeShadowNodeReference_ =
346
- runtimeShadowNodeReference_;
347
-
348
- if (!ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit()) {
349
- updateRuntimeShadowNodeReference(destinationShadowNode);
350
- }
351
- }
352
-
353
- void ShadowNode::transferRuntimeShadowNodeReference(
354
- const std::shared_ptr<const ShadowNode>& destinationShadowNode,
355
- const ShadowNodeFragment& fragment) const {
356
- if ((ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit() ||
357
- useRuntimeShadowNodeReferenceUpdateOnThread) &&
358
- fragment.runtimeShadowNodeReference) {
359
- transferRuntimeShadowNodeReference(destinationShadowNode);
360
- }
361
- }
362
-
363
- const ShadowNodeFamily& ShadowNode::getFamily() const {
364
- return *family_;
365
- }
366
-
367
- ShadowNodeFamily::Shared ShadowNode::getFamilyShared() const {
368
- return family_;
369
- }
370
-
371
- std::shared_ptr<ShadowNode> ShadowNode::cloneTree(
372
- const ShadowNodeFamily& shadowNodeFamily,
373
- const std::function<std::shared_ptr<ShadowNode>(
374
- const ShadowNode& oldShadowNode)>& callback) const {
375
- auto ancestors = shadowNodeFamily.getAncestors(*this);
376
-
377
- if (ancestors.empty()) {
378
- return std::shared_ptr<ShadowNode>{nullptr};
379
- }
380
-
381
- auto& parent = ancestors.back();
382
- auto& oldShadowNode = parent.first.get().getChildren().at(parent.second);
383
-
384
- auto newShadowNode = callback(*oldShadowNode);
385
-
386
- react_native_assert(
387
- newShadowNode &&
388
- "`callback` returned `nullptr` which is not allowed value.");
389
-
390
- auto childNode = newShadowNode;
391
-
392
- for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) {
393
- auto& parentNode = it->first.get();
394
- auto childIndex = it->second;
395
-
396
- auto children = parentNode.getChildren();
397
- react_native_assert(
398
- ShadowNode::sameFamily(*children.at(childIndex), *childNode));
399
- children[childIndex] = childNode;
400
-
401
- childNode = parentNode.clone(
402
- {.children =
403
- std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>(
404
- children)});
405
- }
406
-
407
- return std::const_pointer_cast<ShadowNode>(childNode);
408
- }
409
-
410
- namespace {
411
-
412
- std::shared_ptr<ShadowNode> cloneMultipleRecursive(
413
- const ShadowNode& shadowNode,
414
- const std::unordered_set<const ShadowNodeFamily*>& familiesToUpdate,
415
- const std::unordered_map<const ShadowNodeFamily*, int>& childrenCount,
416
- const std::function<std::shared_ptr<
417
- ShadowNode>(const ShadowNode&, const ShadowNodeFragment&)>& callback) {
418
- const auto* family = &shadowNode.getFamily();
419
- auto& children = shadowNode.getChildren();
420
- std::shared_ptr<std::vector<std::shared_ptr<const ShadowNode>>> newChildren;
421
- auto count = childrenCount.at(family);
422
-
423
- // [Windows Remove when issue #15292 is resolved (the fix goes upstream and comes back)
424
- for (size_t i = 0; count > 0 && i < children.size(); i++) {
425
- // Windows]
426
- const auto childFamily = &children[i]->getFamily();
427
- if (childrenCount.contains(childFamily)) {
428
- count--;
429
- if (!newChildren) {
430
- newChildren =
431
- std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>(
432
- children);
433
- }
434
- (*newChildren)[i] = cloneMultipleRecursive(
435
- *children[i], familiesToUpdate, childrenCount, callback);
436
- }
437
- }
438
-
439
- ShadowNodeFragment fragment{.children = newChildren};
440
- if (familiesToUpdate.contains(family)) {
441
- return callback(shadowNode, fragment);
442
- }
443
- return shadowNode.clone(fragment);
444
- }
445
-
446
- } // namespace
447
-
448
- std::shared_ptr<ShadowNode> ShadowNode::cloneMultiple(
449
- const std::unordered_set<const ShadowNodeFamily*>& familiesToUpdate,
450
- const std::function<std::shared_ptr<ShadowNode>(
451
- const ShadowNode& oldShadowNode,
452
- const ShadowNodeFragment& fragment)>& callback) const {
453
- std::unordered_map<const ShadowNodeFamily*, int> childrenCount;
454
-
455
- for (const auto& family : familiesToUpdate) {
456
- if (childrenCount.contains(family)) {
457
- continue;
458
- }
459
-
460
- childrenCount[family] = 0;
461
-
462
- auto ancestor = family->parent_.lock();
463
- while ((ancestor != nullptr) && ancestor != family_) {
464
- auto ancestorIt = childrenCount.find(ancestor.get());
465
- if (ancestorIt != childrenCount.end()) {
466
- ancestorIt->second++;
467
- break;
468
- }
469
- childrenCount[ancestor.get()] = 1;
470
-
471
- ancestor = ancestor->parent_.lock();
472
- }
473
-
474
- if (ancestor == family_) {
475
- childrenCount[ancestor.get()]++;
476
- }
477
- }
478
-
479
- if (childrenCount.empty()) {
480
- return nullptr;
481
- }
482
-
483
- return cloneMultipleRecursive(
484
- *this, familiesToUpdate, childrenCount, callback);
485
- }
486
-
487
- #pragma mark - DebugStringConvertible
488
-
489
- #if RN_DEBUG_STRING_CONVERTIBLE
490
- std::string ShadowNode::getDebugName() const {
491
- return getComponentName();
492
- }
493
-
494
- std::string ShadowNode::getDebugValue() const {
495
- return "r" + std::to_string(revision_) + "/sr" +
496
- std::to_string(state_ ? state_->getRevision() : 0) +
497
- (getSealed() ? "/sealed" : "") +
498
- (getProps()->nativeId.empty() ? "" : "/id=" + getProps()->nativeId);
499
- }
500
-
501
- SharedDebugStringConvertibleList ShadowNode::getDebugChildren() const {
502
- auto debugChildren = SharedDebugStringConvertibleList{};
503
-
504
- for (const auto& child : *children_) {
505
- auto debugChild =
506
- std::dynamic_pointer_cast<const DebugStringConvertible>(child);
507
- if (debugChild) {
508
- debugChildren.push_back(debugChild);
509
- }
510
- }
511
-
512
- return debugChildren;
513
- }
514
-
515
- SharedDebugStringConvertibleList ShadowNode::getDebugProps() const {
516
- return props_->getDebugProps() +
517
- SharedDebugStringConvertibleList{
518
- debugStringConvertibleItem("tag", std::to_string(getTag()))};
519
- }
520
- #endif
521
-
522
- // Explicitly define destructors here, as they have to exist in order to act as
523
- // a "key function" for the ShadowNodeWrapper class -- this allows for RTTI to
524
- // work properly across dynamic library boundaries (i.e. dynamic_cast that is
525
- // used by getNativeState method)
526
- ShadowNodeWrapper::~ShadowNodeWrapper() = default;
527
-
528
- } // namespace facebook::react
@@ -1,39 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3
- <metadata>
4
- <id>$id$</id>
5
- <version>$version$</version>
6
- <description>OpenSSL for Windows Desktop - Static Library.</description>
7
- <authors>Microsoft</authors>
8
- <projectUrl>https://www.openssl.org</projectUrl>
9
- <requireLicenseAcceptance>false</requireLicenseAcceptance>
10
- <dependencies>
11
- <group targetFramework="Windows8-x86" />
12
- <group targetFramework="Windows8-x64" />
13
- <group targetFramework="Windows8-ARM64" />
14
- </dependencies>
15
- <repository type="git" url="$repoUrl$" branch="$repoBranch$" commit="$repoCommit$" />
16
- <license type="expression">OpenSSL</license>
17
- </metadata>
18
- <files>
19
- <file src="OpenSSL.targets" target="build\native\$id$.targets" />
20
-
21
- <file src="$vcpkgroot$\installed\x86-windows-static\include\openssl\**\*.*" target="include\x86\openssl" />
22
- <file src="$vcpkgroot$\installed\x86-windows-static\debug\lib\libeay32.lib" target="lib\win8-x86\Debug" />
23
- <file src="$vcpkgroot$\installed\x86-windows-static\debug\lib\ssleay32.lib" target="lib\win8-x86\Debug" />
24
- <file src="$vcpkgroot$\installed\x86-windows-static\lib\libeay32.lib" target="lib\win8-x86\Release" />
25
- <file src="$vcpkgroot$\installed\x86-windows-static\lib\ssleay32.lib" target="lib\win8-x86\Release" />
26
-
27
- <file src="$vcpkgroot$\installed\x64-windows-static\include\openssl\**\*.*" target="include\x64\openssl" />
28
- <file src="$vcpkgroot$\installed\x64-windows-static\debug\lib\libeay32.lib" target="lib\win8-x64\Debug" />
29
- <file src="$vcpkgroot$\installed\x64-windows-static\debug\lib\ssleay32.lib" target="lib\win8-x64\Debug" />
30
- <file src="$vcpkgroot$\installed\x64-windows-static\lib\libeay32.lib" target="lib\win8-x64\Release" />
31
- <file src="$vcpkgroot$\installed\x64-windows-static\lib\ssleay32.lib" target="lib\win8-x64\Release" />
32
-
33
- <file src="$vcpkgroot$\installed\arm64-windows-static\include\openssl\**\*.*" target="include\ARM64\openssl" />
34
- <file src="$vcpkgroot$\installed\arm64-windows-static\debug\lib\libeay32.lib" target="lib\win8-arm64\Debug" />
35
- <file src="$vcpkgroot$\installed\arm64-windows-static\debug\lib\ssleay32.lib" target="lib\win8-arm64\Debug" />
36
- <file src="$vcpkgroot$\installed\arm64-windows-static\lib\libeay32.lib" target="lib\win8-arm64\Release" />
37
- <file src="$vcpkgroot$\installed\arm64-windows-static\lib\ssleay32.lib" target="lib\win8-arm64\Release" />
38
- </files>
39
- </package>
@@ -1,36 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
3
- <ItemDefinitionGroup>
4
- <ClCompile>
5
- <AdditionalIncludeDirectories Condition="'$(Platform)' != 'Win32'">
6
- $(MSBuildThisFileDirectory)..\..\include\$(Platform);
7
- %(AdditionalIncludeDirectories)
8
- </AdditionalIncludeDirectories>
9
- <AdditionalIncludeDirectories Condition="'$(Platform)' == 'Win32'">
10
- $(MSBuildThisFileDirectory)..\..\include\x86;
11
- %(AdditionalIncludeDirectories)
12
- </AdditionalIncludeDirectories>
13
- </ClCompile>
14
- <Link>
15
- <AdditionalLibraryDirectories Condition="'$(Platform)' != 'Win32'">
16
- $(MSBuildThisFileDirectory)..\..\lib\win8-$(Platform)\$(Configuration);
17
- %(AdditionalLibraryDirectories)
18
- </AdditionalLibraryDirectories>
19
- <AdditionalLibraryDirectories Condition="'$(Platform)' == 'Win32'">
20
- $(MSBuildThisFileDirectory)..\..\lib\win8-x86\$(Configuration);
21
- %(AdditionalLibraryDirectories)
22
- </AdditionalLibraryDirectories>
23
- <!--
24
- libeay32.lib - Provided by this package
25
- ssleay32.lib - Provided by this package
26
- Crypt32.lib - Provided by Windows API
27
- -->
28
- <AdditionalDependencies>
29
- libeay32.lib;
30
- ssleay32.lib;
31
- Crypt32.lib;
32
- %(AdditionalDependencies)
33
- </AdditionalDependencies>
34
- </Link>
35
- </ItemDefinitionGroup>
36
- </Project>