react-native-windows 0.77.0 → 0.78.0-preview.2

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 (234) hide show
  1. package/.flowconfig +1 -1
  2. package/Chakra/ChakraTracing.cpp +1 -1
  3. package/Libraries/Animated/animations/Animation.js +22 -1
  4. package/Libraries/Animated/animations/DecayAnimation.js +1 -0
  5. package/Libraries/Animated/animations/SpringAnimation.js +1 -0
  6. package/Libraries/Animated/animations/TimingAnimation.js +1 -0
  7. package/Libraries/Animated/nodes/AnimatedAddition.js +9 -2
  8. package/Libraries/Animated/nodes/AnimatedColor.js +4 -1
  9. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +10 -2
  10. package/Libraries/Animated/nodes/AnimatedDivision.js +9 -2
  11. package/Libraries/Animated/nodes/AnimatedInterpolation.js +5 -1
  12. package/Libraries/Animated/nodes/AnimatedModulo.js +5 -2
  13. package/Libraries/Animated/nodes/AnimatedMultiplication.js +9 -2
  14. package/Libraries/Animated/nodes/AnimatedNode.js +25 -46
  15. package/Libraries/Animated/nodes/AnimatedObject.js +9 -2
  16. package/Libraries/Animated/nodes/AnimatedProps.js +5 -1
  17. package/Libraries/Animated/nodes/AnimatedStyle.js +5 -1
  18. package/Libraries/Animated/nodes/AnimatedSubtraction.js +9 -2
  19. package/Libraries/Animated/nodes/AnimatedTracking.js +5 -1
  20. package/Libraries/Animated/nodes/AnimatedTransform.js +5 -1
  21. package/Libraries/Animated/nodes/AnimatedValue.js +49 -4
  22. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
  23. package/Libraries/Animated/useAnimatedProps.js +0 -43
  24. package/Libraries/Components/Button.windows.js +3 -0
  25. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +1 -1
  26. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
  27. package/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +21 -0
  28. package/Libraries/Components/LayoutConformance/LayoutConformance.js +59 -0
  29. package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +29 -0
  30. package/Libraries/Components/Pressable/Pressable.windows.js +3 -0
  31. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  32. package/Libraries/Components/TextInput/TextInput.d.ts +5 -0
  33. package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
  34. package/Libraries/Components/TextInput/TextInput.js +6 -0
  35. package/Libraries/Components/TextInput/TextInput.windows.js +9 -0
  36. package/Libraries/Components/Touchable/TouchableBounce.windows.js +2 -0
  37. package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -0
  38. package/Libraries/Components/Touchable/TouchableOpacity.windows.js +2 -0
  39. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -0
  40. package/Libraries/Components/View/View.windows.js +3 -0
  41. package/Libraries/Components/View/ViewAccessibility.d.ts +7 -2
  42. package/Libraries/Components/View/ViewAccessibility.windows.js +1 -0
  43. package/Libraries/Components/View/ViewPropTypes.d.ts +0 -7
  44. package/Libraries/Components/View/ViewPropTypes.js +0 -9
  45. package/Libraries/Components/View/ViewPropTypes.windows.js +1 -9
  46. package/Libraries/Core/ReactNativeVersion.js +2 -2
  47. package/Libraries/Core/setUpBatchedBridge.js +1 -16
  48. package/Libraries/EventEmitter/RCTEventEmitter.js +2 -6
  49. package/Libraries/Image/AssetSourceResolver.js +11 -0
  50. package/Libraries/Image/AssetSourceResolver.windows.js +11 -0
  51. package/Libraries/Image/Image.windows.js +2 -0
  52. package/Libraries/Inspector/BorderBox.js +26 -14
  53. package/Libraries/Inspector/BoxInspector.js +60 -42
  54. package/Libraries/Inspector/ElementBox.js +55 -48
  55. package/Libraries/Inspector/StyleInspector.js +36 -30
  56. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
  57. package/Libraries/Lists/FlatList.d.ts +1 -1
  58. package/Libraries/Modal/Modal.js +2 -0
  59. package/Libraries/Modal/Modal.windows.js +2 -0
  60. package/Libraries/NativeComponent/BaseViewConfig.android.js +0 -2
  61. package/Libraries/NativeComponent/BaseViewConfig.ios.js +0 -2
  62. package/Libraries/NativeComponent/BaseViewConfig.windows.js +0 -2
  63. package/Libraries/Network/RCTNetworking.android.js +24 -16
  64. package/Libraries/Network/RCTNetworking.ios.js +1 -46
  65. package/Libraries/Network/RCTNetworking.windows.js +1 -46
  66. package/Libraries/Network/RCTNetworkingEventDefinitions.flow.js +57 -0
  67. package/Libraries/ReactNative/UIManagerProperties.js +3 -1
  68. package/Libraries/Renderer/implementations/ReactFabric-dev.js +15828 -26461
  69. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3907 -2560
  70. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4399 -2878
  71. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16102 -26908
  72. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +4034 -2695
  73. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4535 -3045
  74. package/Libraries/Renderer/shims/ReactNativeTypes.js +5 -6
  75. package/Libraries/StyleSheet/processTransform.js +6 -0
  76. package/Libraries/Text/Text.d.ts +6 -1
  77. package/Libraries/Text/Text.windows.js +4 -0
  78. package/Libraries/Text/TextProps.js +2 -2
  79. package/Libraries/Text/TextProps.windows.js +3 -2
  80. package/Libraries/Utilities/BackHandler.android.js +5 -4
  81. package/Libraries/Utilities/BackHandler.ios.js +4 -5
  82. package/Libraries/Utilities/BackHandler.windows.js +5 -4
  83. package/Microsoft.ReactNative/CompositionComponentView.idl +13 -1
  84. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +0 -1
  85. package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +0 -5
  86. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +92 -17
  87. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +9 -0
  88. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +13 -33
  89. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -3
  90. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +43 -5
  91. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +2 -1
  92. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +12 -10
  93. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +11 -9
  94. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +1 -1
  95. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +191 -329
  96. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +3 -61
  97. package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.cpp +66 -0
  98. package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.h +52 -0
  99. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +21 -0
  100. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +7 -4
  101. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +79 -19
  102. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +12 -6
  103. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +71 -17
  104. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +16 -0
  105. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +5 -10
  106. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +4 -4
  107. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +138 -110
  108. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +27 -27
  109. package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +1 -1
  110. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +38 -33
  111. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +0 -2
  112. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +5 -16
  113. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +0 -3
  114. package/Microsoft.ReactNative/Fabric/ImageManager.cpp +9 -0
  115. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +0 -2
  116. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +1 -1
  117. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +5 -0
  118. package/Microsoft.ReactNative/IReactContext.cpp +2 -2
  119. package/Microsoft.ReactNative/IReactContext.h +1 -1
  120. package/Microsoft.ReactNative/IReactContext.idl +2 -2
  121. package/Microsoft.ReactNative/IReactPackageBuilder.idl +3 -3
  122. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +97 -87
  123. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +4 -0
  124. package/Microsoft.ReactNative/Modules/AlertModule.cpp +9 -4
  125. package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.cpp +1 -1
  126. package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +32 -35
  127. package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.h +7 -4
  128. package/Microsoft.ReactNative/Modules/AppStateModule.cpp +1 -1
  129. package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.cpp +2 -2
  130. package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +2 -2
  131. package/Microsoft.ReactNative/Modules/DeviceInfoModule.cpp +3 -3
  132. package/Microsoft.ReactNative/Modules/I18nManagerModule.cpp +1 -1
  133. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +7 -5
  134. package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -1
  135. package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +10 -10
  136. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +24 -24
  137. package/Microsoft.ReactNative/Modules/Timing.cpp +2 -2
  138. package/Microsoft.ReactNative/ReactHost/IReactInstance.h +5 -0
  139. package/Microsoft.ReactNative/ReactHost/React.h +0 -3
  140. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +39 -16
  141. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +4 -2
  142. package/Microsoft.ReactNative/ReactNativeHost.cpp +9 -4
  143. package/Microsoft.ReactNative/ReactNativeIsland.idl +5 -1
  144. package/Microsoft.ReactNative/ReactPackageBuilder.cpp +3 -3
  145. package/Microsoft.ReactNative/ReactPackageBuilder.h +4 -4
  146. package/Microsoft.ReactNative/Utils/Helpers.cpp +0 -2
  147. package/Microsoft.ReactNative/Views/DebuggingOverlayViewManager.cpp +0 -1
  148. package/Microsoft.ReactNative/Views/DevMenu.cpp +6 -6
  149. package/Microsoft.ReactNative/Views/DevMenu.h +1 -1
  150. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +2 -2
  151. package/Microsoft.ReactNative/Views/ViewPanel.cpp +1 -1
  152. package/Microsoft.ReactNative/Views/ViewViewManager.cpp +2 -2
  153. package/Microsoft.ReactNative/XamlUIService.cpp +13 -7
  154. package/Microsoft.ReactNative/XamlUIService.h +4 -1
  155. package/Microsoft.ReactNative/XamlUIService.idl +2 -0
  156. package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +6 -2
  157. package/Microsoft.ReactNative.Cxx/ReactContext.h +1 -1
  158. package/Microsoft.ReactNative.Cxx/XamlUtils.h +12 -0
  159. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  160. package/PropertySheets/React.Cpp.props +3 -0
  161. package/PropertySheets/WebView2.props +1 -1
  162. package/PropertySheets/WinUI.props +5 -4
  163. package/ReactCommon/ReactCommon.vcxproj +5 -1
  164. package/ReactCommon/ReactCommon.vcxproj.filters +1 -1
  165. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +3 -3
  166. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +3 -3
  167. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +91 -0
  168. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +1 -12
  169. package/{Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h → ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/textinput/TextInputState.h} +37 -35
  170. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -0
  171. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
  172. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/ImageRequestParams.h +30 -0
  173. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +4 -3
  174. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/primitives.h +179 -0
  175. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +43 -57
  176. package/Shared/HermesRuntimeHolder.cpp +2 -2
  177. package/Shared/Shared.vcxitems +8 -14
  178. package/Shared/Shared.vcxitems.filters +4 -16
  179. package/Shared/Threading/BatchingQueueThread.cpp +3 -3
  180. package/codegen/NativeCPUTimeSpec.g.h +41 -0
  181. package/codegen/NativeFantomSpec.g.h +78 -0
  182. package/codegen/NativePerformanceSpec.g.h +31 -43
  183. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +84 -84
  184. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +212 -0
  185. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +295 -0
  186. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +200 -0
  187. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +224 -0
  188. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +250 -0
  189. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +267 -0
  190. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +234 -0
  191. package/codegen/react/components/rnwcore/InputAccessory.g.h +200 -0
  192. package/codegen/react/components/rnwcore/ModalHostView.g.h +283 -0
  193. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +246 -0
  194. package/codegen/react/components/rnwcore/SafeAreaView.g.h +197 -0
  195. package/codegen/react/components/rnwcore/Switch.g.h +263 -0
  196. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +200 -0
  197. package/codegen/rnwcoreJSI-generated.cpp +90 -57
  198. package/codegen/rnwcoreJSI.h +241 -104
  199. package/index.js +5 -0
  200. package/index.windows.js +5 -0
  201. package/just-task.js +1 -1
  202. package/package.json +25 -26
  203. package/src/private/animated/NativeAnimatedValidation.js +1 -1
  204. package/src/private/featureflags/ReactNativeFeatureFlags.js +33 -27
  205. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -5
  206. package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -55
  207. package/src/private/specs/modules/{NativeJSCSamplingProfiler.js → NativeCPUTime.js} +7 -2
  208. package/src/private/specs/modules/NativeFantom.js +37 -0
  209. package/src/private/utilities/ensureInstance.js +21 -0
  210. package/src/private/webapis/dom/nodes/ReactNativeElement.js +49 -6
  211. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +17 -9
  212. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +11 -11
  213. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +1 -1
  214. package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -1
  215. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  216. package/src/private/webapis/performance/Performance.js +0 -12
  217. package/src/private/webapis/performance/specs/NativePerformance.js +0 -11
  218. package/types/index.d.ts +1 -0
  219. package/Libraries/HeapCapture/HeapCapture.js +0 -29
  220. package/Libraries/HeapCapture/NativeJSCHeapCapture.js +0 -13
  221. package/Libraries/Performance/NativeJSCSamplingProfiler.js +0 -13
  222. package/Libraries/Performance/SamplingProfiler.js +0 -39
  223. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +0 -334
  224. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentDescriptor.h +0 -39
  225. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.cpp +0 -18
  226. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.h +0 -39
  227. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -34
  228. package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.cpp +0 -53
  229. package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.h +0 -26
  230. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +0 -363
  231. package/codegen/NativeJSCSamplingProfilerSpec.g.h +0 -35
  232. package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +0 -413
  233. package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +0 -181
  234. package/src/private/webapis/mutationobserver/specs/__mocks__/NativeMutationObserver.js +0 -327
@@ -73,6 +73,9 @@
73
73
  -->
74
74
  <PreprocessorDefinitions>_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
75
75
  </ClCompile>
76
+ <Midl>
77
+ <PreprocessorDefinitions Condition="'$(UseFabric)' == 'true'">USE_FABRIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78
+ </Midl>
76
79
  </ItemDefinitionGroup>
77
80
 
78
81
  <PropertyGroup>
@@ -2,6 +2,6 @@
2
2
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
  <PropertyGroup Label="WebView2 versioning">
4
4
  <!-- WinAppSDK 1.6+ has a dependency on Microsoft.Web.WebView2, there are a few places we need to pull in this package explicitly. -->
5
- <WebView2PackageVersion>1.0.2651.64</WebView2PackageVersion>
5
+ <WebView2PackageVersion>1.0.2792.45</WebView2PackageVersion>
6
6
  </PropertyGroup>
7
7
  </Project>
@@ -4,15 +4,16 @@
4
4
 
5
5
  <!--
6
6
  Internal versions are located at: https://microsoft.visualstudio.com/DefaultCollection/ProjectReunion/_artifacts/feed/Project.Reunion.nuget.internal/NuGet/Microsoft.WindowsAppSDK/versions
7
- For local testing of internal versions, modify the WinUI3Version, and comment out the addition nuget source in NuGet.Config
7
+ For local testing of internal versions, modify WinUI3ExperimentalVersion, and comment out the addition nuget source in NuGet.Config
8
8
  -->
9
- <!-- This value is also used by the CLI, see /packages/@react-native-windows/generate-windows -->
10
- <WinUI3Version Condition="'$(WinUI3Version)'=='' AND '$(UseExperimentalWinUI3)'=='true'">1.6.240701003-experimental2</WinUI3Version>
9
+ <WinUI3ExperimentalVersion Condition="'$(WinUI3ExperimentalVersion)'==''">1.7.250109001-experimental2</WinUI3ExperimentalVersion>
10
+ <!-- This value is also used by the CLI, see /packages/@react-native-windows/cli/.../autolinkWindows.ts -->
11
+ <WinUI3Version Condition="'$(WinUI3Version)'=='' AND '$(UseExperimentalWinUI3)'=='true'">$(WinUI3ExperimentalVersion)</WinUI3Version>
11
12
  <WinUI3Version Condition="'$(WinUI3Version)'==''">1.6.240923002</WinUI3Version>
12
13
  </PropertyGroup>
13
14
 
14
15
  <PropertyGroup Label="WinUI2x versioning">
15
- <!--This value is also used by the CLI, see /packages/@react-native-windows/generate-windows -->
16
+ <!--This value is also used by the CLI, see /packages/@react-native-windows/cli/.../autolinkWindows.ts -->
16
17
  <WinUI2xVersion Condition="'$(WinUI2xVersion)'==''">2.8.0</WinUI2xVersion>
17
18
  </PropertyGroup>
18
19
 
@@ -114,7 +114,7 @@
114
114
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\NativeToJsBridge.h" />
115
115
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\ReactMarker.h" />
116
116
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\RecoverableError.h" />
117
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\SystraceSection.h" />
117
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\TraceSection.h" />
118
118
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.h" />
119
119
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.h" />
120
120
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\InspectorInterfaces.h" />
@@ -140,6 +140,7 @@
140
140
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.cpp" />
141
141
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.cpp" />
142
142
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\InspectorInterfaces.cpp" />
143
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\InspectorFlags.cpp" />
143
144
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\logger\react_native_log.cpp" />
144
145
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\fusebox\FuseboxTracer.cpp" />
145
146
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\reactperflogger\BridgeNativeModulePerfLogger.cpp" />
@@ -192,6 +193,9 @@
192
193
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\RuntimeScheduler_Modern.h" />
193
194
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\core\PropsParserContext.h" />
194
195
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\components\textinput\basePrimitives.h" />
196
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\components\textinput\TextInputState.h" />
197
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\components\textlayoutmanager\TextLayoutManager.h" />
198
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\imagemanager\platform\cxx\react\renderer\imagemanager\ImageRequestParams.h" />
195
199
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\bridging\LongLivedObject.cpp" />
196
200
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboCxxModule.cpp" />
197
201
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModule.cpp" />
@@ -267,7 +267,7 @@
267
267
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\RecoverableError.h">
268
268
  <Filter>cxxreact</Filter>
269
269
  </ClInclude>
270
- <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\SystraceSection.h">
270
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\cxxreact\TraceSection.h">
271
271
  <Filter>cxxreact</Filter>
272
272
  </ClInclude>
273
273
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSIExecutor.h">
@@ -11,9 +11,9 @@
11
11
 
12
12
  #include <folly/Conv.h>
13
13
  #include <jsinspector-modern/ReactCdp.h>
14
- #include <jsinspector-modern/ConsoleMessage.h>
14
+ #include <react/timing/primitives.h>
15
15
 
16
- #include <reactperflogger/ReactPerfLogger.h>
16
+ #include <chrono>
17
17
 
18
18
  namespace facebook::react {
19
19
 
@@ -27,7 +27,7 @@ std::string JSExecutor::getSyntheticBundlePath(
27
27
  }
28
28
 
29
29
  double JSExecutor::performanceNow() {
30
- return ReactPerfLogger::performanceNow();
30
+ return chronoToDOMHighResTimeStamp(std::chrono::steady_clock::now());
31
31
  }
32
32
 
33
33
  void JSExecutor::addConsoleMessage(jsi::Runtime& runtime, jsinspector_modern::ConsoleMessage message){
@@ -21,7 +21,7 @@
21
21
  #include "ModuleRegistry.h"
22
22
  #include "MoveWrapper.h"
23
23
  #include "RAMBundleRegistry.h"
24
- #include "SystraceSection.h"
24
+ #include "TraceSection.h"
25
25
 
26
26
  #include <memory>
27
27
 
@@ -194,7 +194,7 @@ void NativeToJsBridge::callFunction(
194
194
  #ifdef WITH_FBSYSTRACE
195
195
  FbSystraceAsyncFlow::end(
196
196
  TRACE_TAG_REACT_CXX_BRIDGE, "JSCall", systraceCookie);
197
- SystraceSection s(
197
+ TraceSection s(
198
198
  "NativeToJsBridge::callFunction", "module", module, "method", method);
199
199
  #else
200
200
  (void)(systraceCookie);
@@ -229,7 +229,7 @@ void NativeToJsBridge::invokeCallback(
229
229
  #ifdef WITH_FBSYSTRACE
230
230
  FbSystraceAsyncFlow::end(
231
231
  TRACE_TAG_REACT_CXX_BRIDGE, "<callback>", systraceCookie);
232
- SystraceSection s("NativeToJsBridge::invokeCallback");
232
+ TraceSection s("NativeToJsBridge::invokeCallback");
233
233
  #else
234
234
  (void)(systraceCookie);
235
235
  #endif
@@ -1611,6 +1611,97 @@ TEST_P(JSITest, UTF16Test) {
1611
1611
  }
1612
1612
  Windows] */
1613
1613
 
1614
+ /*
1615
+ [Windows
1616
+ TEST_P(JSITest, GetStringDataTest) {
1617
+ // This Runtime Decorator is used to test the default getStringData
1618
+ // implementation for VMs that do not provide their own implementation
1619
+ class RD : public RuntimeDecorator<Runtime, Runtime> {
1620
+ public:
1621
+ RD(Runtime& rt) : RuntimeDecorator(rt) {}
1622
+
1623
+ void getStringData(
1624
+ const String& str,
1625
+ void* ctx,
1626
+ void (*cb)(void* ctx, bool ascii, const void* data, size_t num))
1627
+ override {
1628
+ Runtime::getStringData(str, ctx, cb);
1629
+ }
1630
+ };
1631
+
1632
+ RD rd = RD(rt);
1633
+ String str = String::createFromUtf8(rd, "hello👋");
1634
+
1635
+ std::u16string buf;
1636
+ auto cb = [&buf](bool ascii, const void* data, size_t num) {
1637
+ assert(!ascii && "Default implementation is always utf16");
1638
+ buf.append((const char16_t*)data, num);
1639
+ };
1640
+
1641
+ str.getStringData(rd, cb);
1642
+ EXPECT_EQ(buf, str.utf16(rd));
1643
+ }
1644
+
1645
+ TEST_P(JSITest, ObjectSetPrototype) {
1646
+ // This Runtime Decorator is used to test the default implementation of
1647
+ // Object.setPrototypeOf
1648
+ class RD : public RuntimeDecorator<Runtime, Runtime> {
1649
+ public:
1650
+ explicit RD(Runtime& rt) : RuntimeDecorator(rt) {}
1651
+
1652
+ void setPrototypeOf(const Object& object, const Value& prototype) override {
1653
+ return Runtime::setPrototypeOf(object, prototype);
1654
+ }
1655
+
1656
+ Value getPrototypeOf(const Object& object) override {
1657
+ return Runtime::getPrototypeOf(object);
1658
+ }
1659
+ };
1660
+
1661
+ RD rd = RD(rt);
1662
+ Object child(rd);
1663
+
1664
+ // Tests null value as prototype
1665
+ child.setPrototype(rd, Value::null());
1666
+ EXPECT_TRUE(child.getPrototype(rd).isNull());
1667
+
1668
+ Object prototypeObj(rd);
1669
+ prototypeObj.setProperty(rd, "someProperty", 123);
1670
+ Value prototype(rd, prototypeObj);
1671
+
1672
+ child.setPrototype(rd, prototype);
1673
+ EXPECT_EQ(child.getProperty(rd, "someProperty").getNumber(), 123);
1674
+
1675
+ auto getPrototypeRes = child.getPrototype(rd).asObject(rd);
1676
+ EXPECT_EQ(getPrototypeRes.getProperty(rd, "someProperty").getNumber(), 123);
1677
+ }
1678
+
1679
+ TEST_P(JSITest, ObjectCreateWithPrototype) {
1680
+ // This Runtime Decorator is used to test the default implementation of
1681
+ // Object.create(prototype)
1682
+ class RD : public RuntimeDecorator<Runtime, Runtime> {
1683
+ public:
1684
+ RD(Runtime& rt) : RuntimeDecorator(rt) {}
1685
+
1686
+ Object createObjectWithPrototype(const Value& prototype) override {
1687
+ return Runtime::createObjectWithPrototype(prototype);
1688
+ }
1689
+ };
1690
+
1691
+ RD rd = RD(rt);
1692
+ Object prototypeObj(rd);
1693
+ prototypeObj.setProperty(rd, "someProperty", 123);
1694
+ Value prototype(rd, prototypeObj);
1695
+
1696
+ Object child = Object::create(rd, prototype);
1697
+ EXPECT_EQ(child.getProperty(rd, "someProperty").getNumber(), 123);
1698
+
1699
+ // Tests null value as prototype
1700
+ child = Object::create(rd, Value::null());
1701
+ EXPECT_TRUE(child.getPrototype(rd).isNull());
1702
+ }
1703
+ Windows] */
1704
+
1614
1705
  INSTANTIATE_TEST_CASE_P(
1615
1706
  Runtimes,
1616
1707
  JSITest,
@@ -9,7 +9,6 @@
9
9
 
10
10
  #include "componentNameByReactViewName.h"
11
11
 
12
- #include <react/config/ReactNativeConfig.h>
13
12
  #include <react/debug/react_native_assert.h>
14
13
  #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
15
14
  #include <react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerAutomaticComponentDescriptor.h>
@@ -85,17 +84,7 @@ const ComponentDescriptor& ComponentDescriptorRegistry::at(
85
84
 
86
85
  if (it == _registryByName.end()) {
87
86
  // [Windows ##14204
88
- auto reactNativeConfig_ =
89
- contextContainer_->at<std::shared_ptr<const ReactNativeConfig>>(
90
- "ReactNativeConfig");
91
- if (reactNativeConfig_->getBool(
92
- "react_fabric:enabled_automatic_interop_android")) {
93
- auto componentDescriptor = std::make_shared<
94
- const UnstableLegacyViewManagerAutomaticComponentDescriptor>(
95
- parameters_, unifiedComponentName);
96
- registerComponentDescriptor(componentDescriptor);
97
- return *_registryByName.find(unifiedComponentName)->second;
98
- } else if (_fallbackComponentDescriptor == nullptr) {
87
+ if (_fallbackComponentDescriptor == nullptr) {
99
88
  throw std::invalid_argument(
100
89
  ("Unable to find componentDescriptor for " + unifiedComponentName)
101
90
  .c_str());
@@ -1,35 +1,48 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
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
+ */
3
7
 
4
8
  #pragma once
5
9
 
6
- #include <folly/dynamic.h>
7
- #include <react/renderer/attributedstring/AttributedString.h>
10
+ #include <react/renderer/attributedstring/AttributedStringBox.h>
8
11
  #include <react/renderer/attributedstring/ParagraphAttributes.h>
9
- #include <react/renderer/mapbuffer/MapBuffer.h>
10
- #include <react/renderer/mapbuffer/MapBufferBuilder.h>
11
12
  #include <react/renderer/textlayoutmanager/TextLayoutManager.h>
12
13
 
14
+ #ifdef ANDROID
15
+ #include <folly/dynamic.h>
16
+ #include <react/renderer/mapbuffer/MapBuffer.h>
17
+ #endif
18
+
13
19
  namespace facebook::react {
14
20
 
15
21
  /*
16
- * State for <WindowsTextInput> component.
22
+ * State for <TextInput> component.
17
23
  */
18
- class WindowsTextInputState final {
24
+ class TextInputState final {
19
25
  public:
20
- int64_t mostRecentEventCount{0};
26
+ TextInputState() = default;
21
27
 
22
- /**
23
- * Stores an opaque cache ID used on the Java side to refer to a specific
24
- * AttributedString for measurement purposes only.
25
- */
26
- int64_t cachedAttributedStringId{0};
28
+ TextInputState(
29
+ AttributedStringBox attributedStringBox,
30
+ AttributedString reactTreeAttributedString,
31
+ ParagraphAttributes paragraphAttributes,
32
+ int64_t mostRecentEventCount);
33
+
34
+ #ifdef ANDROID
35
+ TextInputState(
36
+ const TextInputState& previousState,
37
+ const folly::dynamic& data);
38
+ folly::dynamic getDynamic() const;
39
+ MapBuffer getMapBuffer() const;
40
+ #endif
27
41
 
28
42
  /*
29
- * All content of <TextInput> component represented as an `AttributedString`.
30
- * Only set if changed from the React tree's perspective.
43
+ * All content of <TextInput> component.
31
44
  */
32
- AttributedString attributedString{};
45
+ AttributedStringBox attributedStringBox;
33
46
 
34
47
  /*
35
48
  * All content of <TextInput> component represented as an `AttributedString`.
@@ -44,28 +57,17 @@ class WindowsTextInputState final {
44
57
  * Represents all visual attributes of a paragraph of text represented as
45
58
  * a ParagraphAttributes.
46
59
  */
47
- ParagraphAttributes paragraphAttributes{};
60
+ ParagraphAttributes paragraphAttributes;
61
+
62
+ int64_t mostRecentEventCount{0};
63
+
48
64
 
49
65
  /**
50
- * Communicates Android theme padding back to the ShadowNode / Component
51
- * Descriptor for layout.
66
+ * Stores an opaque cache ID used on the Java side to refer to a specific
67
+ * AttributedString for measurement purposes only.
52
68
  */
53
- double defaultThemePaddingStart{NAN};
54
- double defaultThemePaddingEnd{NAN};
55
- double defaultThemePaddingTop{NAN};
56
- double defaultThemePaddingBottom{NAN};
57
-
58
- WindowsTextInputState(
59
- int64_t mostRecentEventCount,
60
- AttributedString attributedString,
61
- AttributedString reactTreeAttributedString,
62
- ParagraphAttributes paragraphAttributes,
63
- double defaultThemePaddingStart,
64
- double defaultThemePaddingEnd,
65
- double defaultThemePaddingTop,
66
- double defaultThemePaddingBottom);
69
+ int64_t cachedAttributedStringId{0};
67
70
 
68
- WindowsTextInputState() = default;
69
71
  };
70
72
 
71
73
  } // namespace facebook::react
@@ -70,6 +70,7 @@ struct AccessibilityState {
70
70
  std::optional<bool> selected{std::nullopt}; // [Windows] - Do not remove; required for Windows ISelectionItemProvider Implementation
71
71
  bool busy{false};
72
72
  std::optional<bool> expanded{std::nullopt};
73
+ std::optional<bool> readOnly{std::nullopt}; // [Windows] - Do not remove; required for Windows IRangeValueProvider and IValueProvider Implementation
73
74
  std::optional<bool> multiselectable{std::nullopt}; // [Windows] - Do not remove; required for Windows ISelectionProvider Implementation
74
75
  std::optional<bool> required{std::nullopt}; // [Windows] - Do not remove; required for Windows ISelectionProvider Implementation
75
76
  enum { Unchecked, Checked, Mixed, None } checked{None};
@@ -171,6 +171,10 @@ inline void fromRawValue(
171
171
  fromRawValue(context, expanded->second, result.expanded);
172
172
  }
173
173
  // [Windows] - DO NOT REMOVE - required for Windows ISelectionProvider Implementation
174
+ auto readOnly = map.find("readOnly");
175
+ if (readOnly != map.end()) {
176
+ fromRawValue(context, readOnly->second, result.readOnly);
177
+ }
174
178
  auto multiselectable = map.find("multiselectable");
175
179
  if (multiselectable != map.end()) {
176
180
  fromRawValue(context, multiselectable->second, result.multiselectable);
@@ -0,0 +1,30 @@
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
+ #pragma once
9
+
10
+ #include <react/renderer/graphics/Float.h>
11
+
12
+ namespace facebook::react {
13
+
14
+ class ImageRequestParams {
15
+ public:
16
+ ImageRequestParams() = default;
17
+ explicit ImageRequestParams(Float blurRadius) : blurRadius(blurRadius) {}
18
+
19
+ Float blurRadius{};
20
+
21
+ bool operator==(const ImageRequestParams& rhs) const {
22
+ return this->blurRadius == rhs.blurRadius;
23
+ }
24
+
25
+ bool operator!=(const ImageRequestParams& rhs) const {
26
+ return !(*this == rhs);
27
+ }
28
+ };
29
+
30
+ } // namespace facebook::react
@@ -31,10 +31,9 @@ static inline SchedulerPriority fromRawValue(double value) {
31
31
  return SchedulerPriority::LowPriority;
32
32
  case 5:
33
33
  return SchedulerPriority::IdlePriority;
34
- default:
35
- react_native_assert(false && "Unsupported SchedulerPriority value");
36
- return SchedulerPriority::NormalPriority;
37
34
  }
35
+ react_native_assert(false && "Unsupported SchedulerPriority value");
36
+ return SchedulerPriority::NormalPriority;
38
37
  }
39
38
 
40
39
  static inline std::chrono::milliseconds timeoutForSchedulerPriority(
@@ -54,6 +53,8 @@ static inline std::chrono::milliseconds timeoutForSchedulerPriority(
54
53
  react_native_assert(false && "Unsupported SchedulerPriority value");
55
54
  return std::chrono::seconds(5);
56
55
  }
56
+ react_native_assert(false && "Unsupported SchedulerPriority value");
57
+ return std::chrono::seconds(5);
57
58
  }
58
59
 
59
60
  } // namespace facebook::react
@@ -0,0 +1,179 @@
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
+ #pragma once
9
+
10
+ #include <folly/dynamic.h>
11
+ #include <jsi/JSIDynamic.h>
12
+ #include <jsi/jsi.h>
13
+ #include <react/debug/react_native_assert.h>
14
+ #include <react/renderer/core/ShadowNode.h>
15
+
16
+ namespace facebook::react {
17
+
18
+ using BackgroundExecutor =
19
+ std::function<void(std::function<void()>&& callback)>;
20
+
21
+ struct ShadowNodeListWrapper : public jsi::NativeState {
22
+ ShadowNodeListWrapper(ShadowNode::UnsharedListOfShared shadowNodeList)
23
+ : shadowNodeList(std::move(shadowNodeList)) {}
24
+
25
+ // The below method needs to be implemented out-of-line in order for the class
26
+ // to have at least one "key function" (see
27
+ // https://itanium-cxx-abi.github.io/cxx-abi/abi.html#vague-vtable)
28
+ ~ShadowNodeListWrapper() override;
29
+
30
+ ShadowNode::UnsharedListOfShared shadowNodeList;
31
+ };
32
+
33
+ inline static ShadowNode::Shared shadowNodeFromValue(
34
+ jsi::Runtime& runtime,
35
+ const jsi::Value& value) {
36
+ if (value.isNull()) {
37
+ return nullptr;
38
+ }
39
+
40
+ return value.getObject(runtime)
41
+ .getNativeState<ShadowNodeWrapper>(runtime)
42
+ ->shadowNode;
43
+ }
44
+
45
+ inline static jsi::Value valueFromShadowNode(
46
+ jsi::Runtime& runtime,
47
+ ShadowNode::Shared shadowNode,
48
+ bool assignRuntimeShadowNodeReference = false) {
49
+ // Wrap the shadow node so that we can update JS references from native
50
+ auto wrappedShadowNode =
51
+ std::make_shared<ShadowNodeWrapper>(std::move(shadowNode));
52
+
53
+ if (assignRuntimeShadowNodeReference) {
54
+ wrappedShadowNode->shadowNode->setRuntimeShadowNodeReference(
55
+ wrappedShadowNode);
56
+ }
57
+
58
+ jsi::Object obj(runtime);
59
+ obj.setNativeState(runtime, std::move(wrappedShadowNode));
60
+ return obj;
61
+ }
62
+
63
+ // TODO: once we no longer need to mutate the return value (appendChildToSet)
64
+ // make this a SharedListOfShared
65
+ inline static ShadowNode::UnsharedListOfShared shadowNodeListFromValue(
66
+ jsi::Runtime& runtime,
67
+ const jsi::Value& value) {
68
+ // TODO: cleanup when passChildrenWhenCloningPersistedNodes is rolled out
69
+ jsi::Object object = value.asObject(runtime);
70
+ if (object.isArray(runtime)) {
71
+ auto jsArray = std::move(object).asArray(runtime);
72
+ size_t jsArrayLen = jsArray.length(runtime);
73
+ if (jsArrayLen > 0) {
74
+ auto shadowNodeArray = std::make_shared<ShadowNode::ListOfShared>();
75
+ shadowNodeArray->reserve(jsArrayLen);
76
+
77
+ for (size_t i = 0; i < jsArrayLen; i++) {
78
+ shadowNodeArray->push_back(
79
+ shadowNodeFromValue(runtime, jsArray.getValueAtIndex(runtime, i)));
80
+ }
81
+ return shadowNodeArray;
82
+ } else {
83
+ // TODO: return ShadowNode::emptySharedShadowNodeSharedList()
84
+ return std::make_shared<ShadowNode::ListOfShared>(
85
+ ShadowNode::ListOfShared({}));
86
+ ;
87
+ }
88
+ } else {
89
+ return object.getNativeState<ShadowNodeListWrapper>(runtime)
90
+ ->shadowNodeList;
91
+ }
92
+ }
93
+
94
+ inline static jsi::Value valueFromShadowNodeList(
95
+ jsi::Runtime& runtime,
96
+ ShadowNode::UnsharedListOfShared shadowNodeList) {
97
+ auto wrapper =
98
+ std::make_shared<ShadowNodeListWrapper>(std::move(shadowNodeList));
99
+ // Use the wrapper for NativeState too, otherwise we can't implement
100
+ // the marker interface. Could be simplified to a simple struct wrapper.
101
+ jsi::Object obj(runtime);
102
+ obj.setNativeState(runtime, std::move(wrapper));
103
+ return obj;
104
+ }
105
+
106
+ inline static ShadowNode::UnsharedListOfShared shadowNodeListFromWeakList(
107
+ const ShadowNode::UnsharedListOfWeak& weakShadowNodeList) {
108
+ auto result = std::make_shared<ShadowNode::ListOfShared>();
109
+ for (const auto& weakShadowNode : *weakShadowNodeList) {
110
+ auto sharedShadowNode = weakShadowNode.lock();
111
+ if (!sharedShadowNode) {
112
+ return nullptr;
113
+ }
114
+ result->push_back(sharedShadowNode);
115
+ }
116
+ return result;
117
+ }
118
+
119
+ inline static ShadowNode::UnsharedListOfWeak weakShadowNodeListFromValue(
120
+ jsi::Runtime& runtime,
121
+ const jsi::Value& value) {
122
+ auto shadowNodeList = shadowNodeListFromValue(runtime, value);
123
+ auto weakShadowNodeList = std::make_shared<ShadowNode::ListOfWeak>();
124
+ for (const auto& shadowNode : *shadowNodeList) {
125
+ weakShadowNodeList->push_back(shadowNode);
126
+ }
127
+ return weakShadowNodeList;
128
+ }
129
+
130
+ inline static Tag tagFromValue(const jsi::Value& value) {
131
+ return (Tag)value.getNumber();
132
+ }
133
+
134
+ inline static InstanceHandle::Shared instanceHandleFromValue(
135
+ jsi::Runtime& runtime,
136
+ const jsi::Value& instanceHandleValue,
137
+ const jsi::Value& tagValue) {
138
+ react_native_assert(!instanceHandleValue.isNull());
139
+ if (instanceHandleValue.isNull()) {
140
+ return nullptr;
141
+ }
142
+ return std::make_shared<InstanceHandle>(
143
+ runtime, instanceHandleValue, tagFromValue(tagValue));
144
+ }
145
+
146
+ inline static SurfaceId surfaceIdFromValue(
147
+ jsi::Runtime& runtime,
148
+ const jsi::Value& value) {
149
+ return (SurfaceId)value.getNumber();
150
+ }
151
+
152
+ inline static int displayModeToInt(const DisplayMode value) {
153
+ // the result of this method should be in sync with
154
+ // Libraries/ReactNative/DisplayMode.js
155
+ switch (value) {
156
+ case DisplayMode::Visible:
157
+ return 1;
158
+ case DisplayMode::Suspended:
159
+ return 2;
160
+ case DisplayMode::Hidden:
161
+ return 3;
162
+ default:
163
+ return -1;
164
+ }
165
+ }
166
+
167
+ inline static std::string stringFromValue(
168
+ jsi::Runtime& runtime,
169
+ const jsi::Value& value) {
170
+ return value.getString(runtime).utf8(runtime);
171
+ }
172
+
173
+ inline static folly::dynamic commandArgsFromValue(
174
+ jsi::Runtime& runtime,
175
+ const jsi::Value& value) {
176
+ return jsi::dynamicFromValue(runtime, value);
177
+ }
178
+ } // namespace facebook::react
179
+