react-native-windows 0.83.0-preview.3 → 0.84.0-preview.10

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 (237) hide show
  1. package/.flowconfig +2 -2
  2. package/Folly/Folly.vcxproj +2 -0
  3. package/Libraries/Animated/AnimatedEvent.js +2 -2
  4. package/Libraries/Animated/animations/Animation.js +1 -3
  5. package/Libraries/Animated/createAnimatedComponent.js +8 -5
  6. package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
  7. package/Libraries/Animated/nodes/AnimatedInterpolation.js +40 -4
  8. package/Libraries/Animated/nodes/AnimatedNode.js +3 -3
  9. package/Libraries/Animated/nodes/AnimatedObject.js +16 -11
  10. package/Libraries/Animated/nodes/AnimatedProps.js +43 -12
  11. package/Libraries/Animated/nodes/AnimatedStyle.js +12 -12
  12. package/Libraries/Animated/nodes/AnimatedValue.js +6 -3
  13. package/Libraries/Animated/nodes/AnimatedValueXY.js +1 -1
  14. package/Libraries/BatchedBridge/MessageQueue.js +24 -22
  15. package/Libraries/Blob/URL.js +34 -3
  16. package/Libraries/Blob/URLSearchParams.js +1 -0
  17. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +9 -1
  18. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +6 -1
  19. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +6 -1
  20. package/Libraries/Components/Button.js +2 -5
  21. package/Libraries/Components/Button.windows.js +2 -5
  22. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
  23. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroidTypes.js +4 -4
  24. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  25. package/Libraries/Components/Pressable/Pressable.js +8 -8
  26. package/Libraries/Components/Pressable/Pressable.windows.js +14 -13
  27. package/Libraries/Components/TextInput/TextInput.flow.js +13 -13
  28. package/Libraries/Components/TextInput/TextInput.flow.windows.js +19 -18
  29. package/Libraries/Components/TextInput/TextInput.js +33 -34
  30. package/Libraries/Components/TextInput/TextInput.windows.js +40 -39
  31. package/Libraries/Components/Touchable/PooledClass.js +2 -2
  32. package/Libraries/Components/Touchable/TouchableBounce.js +3 -3
  33. package/Libraries/Components/Touchable/TouchableBounce.windows.js +3 -3
  34. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -1
  35. package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +1 -1
  36. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +9 -9
  37. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +9 -9
  38. package/Libraries/Components/View/ViewPropTypes.js +16 -6
  39. package/Libraries/Components/View/ViewPropTypes.windows.js +21 -11
  40. package/Libraries/Core/Devtools/loadBundleFromServer.js +6 -3
  41. package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +6 -3
  42. package/Libraries/Core/Devtools/symbolicateStackTrace.js +1 -1
  43. package/Libraries/Core/ExceptionsManager.js +3 -3
  44. package/Libraries/Core/RawEventEmitter.js +1 -1
  45. package/Libraries/Core/ReactFiberErrorDialog.js +1 -1
  46. package/Libraries/Core/ReactNativeVersion.js +2 -2
  47. package/Libraries/Core/setUpDeveloperTools.js +1 -1
  48. package/Libraries/Core/setUpErrorHandling.js +1 -1
  49. package/Libraries/Core/setUpReactDevTools.js +6 -23
  50. package/Libraries/EventEmitter/NativeEventEmitter.js +2 -2
  51. package/Libraries/Image/Image.android.js +2 -2
  52. package/Libraries/Image/Image.ios.js +2 -2
  53. package/Libraries/Image/Image.windows.js +2 -2
  54. package/Libraries/Image/ImageProps.js +1 -1
  55. package/Libraries/Image/ImageTypes.flow.js +2 -2
  56. package/Libraries/Interaction/InteractionManager.js +3 -3
  57. package/Libraries/Interaction/PanResponder.js +1 -1
  58. package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
  59. package/Libraries/Linking/Linking.js +1 -1
  60. package/Libraries/Lists/FlatList.js +2 -2
  61. package/Libraries/LogBox/Data/LogBoxData.js +31 -4
  62. package/Libraries/LogBox/Data/LogBoxLog.js +2 -2
  63. package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
  64. package/Libraries/LogBox/Data/parseLogBoxLog.js +5 -5
  65. package/Libraries/LogBox/LogBox.js +7 -7
  66. package/Libraries/Modal/Modal.windows.js +1 -7
  67. package/Libraries/NativeComponent/BaseViewConfig.android.js +12 -0
  68. package/Libraries/NativeComponent/StaticViewConfigValidator.js +4 -4
  69. package/Libraries/NativeComponent/ViewConfigIgnore.js +1 -1
  70. package/Libraries/NativeComponent/ViewConfigIgnore.windows.js +1 -1
  71. package/Libraries/Network/RCTNetworking.android.js +3 -3
  72. package/Libraries/Network/RCTNetworking.ios.js +2 -2
  73. package/Libraries/Network/RCTNetworking.js.flow +2 -2
  74. package/Libraries/Network/RCTNetworking.windows.js +2 -2
  75. package/Libraries/Pressability/Pressability.js +9 -9
  76. package/Libraries/Pressability/Pressability.windows.js +17 -16
  77. package/Libraries/ReactNative/AppRegistry.flow.js +1 -1
  78. package/Libraries/ReactNative/BridgelessUIManager.js +1 -1
  79. package/Libraries/ReactNative/FabricUIManager.js +1 -1
  80. package/Libraries/ReactNative/PaperUIManager.js +1 -1
  81. package/Libraries/ReactNative/PaperUIManager.windows.js +1 -1
  82. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
  83. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils.js +2 -2
  84. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactNativeAttributePayload.js +1 -1
  85. package/Libraries/ReactNative/RendererImplementation.js +1 -1
  86. package/Libraries/ReactNative/getNativeComponentAttributes.js +1 -1
  87. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -2
  88. package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -3
  89. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3 -3
  90. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3 -3
  91. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +11 -4
  92. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +11 -4
  93. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +11 -4
  94. package/Libraries/Renderer/shims/ReactFabric.js +3 -1
  95. package/Libraries/Renderer/shims/ReactFeatureFlags.js +3 -1
  96. package/Libraries/Renderer/shims/ReactNative.js +2 -2
  97. package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
  98. package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +3 -1
  99. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +3 -1
  100. package/Libraries/Renderer/shims/createReactNativeComponentClass.js +3 -1
  101. package/Libraries/Settings/Settings.ios.js +1 -1
  102. package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
  103. package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
  104. package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +4 -2
  105. package/Libraries/StyleSheet/StyleSheetExports.js +1 -1
  106. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +99 -4
  107. package/Libraries/StyleSheet/StyleSheetTypes.js +6 -8
  108. package/Libraries/StyleSheet/processFilter.js +1 -1
  109. package/Libraries/Text/Text.js +46 -6
  110. package/Libraries/Text/Text.windows.js +46 -6
  111. package/Libraries/Text/TextNativeComponent.js +1 -1
  112. package/Libraries/Text/TextProps.js +7 -7
  113. package/Libraries/Text/TextProps.windows.js +7 -7
  114. package/Libraries/Types/CodegenTypes.js +1 -1
  115. package/Libraries/Types/CoreEventTypes.js +31 -0
  116. package/Libraries/Types/CoreEventTypes.windows.js +31 -13
  117. package/Libraries/Types/ReactDevToolsTypes.js +2 -2
  118. package/Libraries/Utilities/Appearance.js +2 -2
  119. package/Libraries/Utilities/DevLoadingView.js +8 -1
  120. package/Libraries/Utilities/DevSettings.js +3 -3
  121. package/Libraries/Utilities/HMRClient.js +4 -3
  122. package/Libraries/Utilities/RCTLog.js +3 -3
  123. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  124. package/Libraries/Utilities/SceneTracker.js +1 -1
  125. package/Libraries/Utilities/codegenNativeCommands.js +1 -1
  126. package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +3 -3
  127. package/Libraries/Utilities/logError.js +1 -1
  128. package/Libraries/Utilities/stringifySafe.js +7 -7
  129. package/Libraries/Utilities/useRefEffect.js +1 -1
  130. package/Libraries/WebSocket/WebSocketInterceptor.js +3 -3
  131. package/Libraries/promiseRejectionTrackingOptions.js +8 -8
  132. package/Libraries/vendor/core/ErrorUtils.js +10 -10
  133. package/Libraries/vendor/emitter/EventEmitter.js +6 -6
  134. package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +5 -0
  135. package/Microsoft.ReactNative/Fabric/AbiViewProps.h +1 -0
  136. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +58 -20
  137. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +5 -0
  138. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +302 -67
  139. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +19 -4
  140. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +23 -12
  141. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +4 -0
  142. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +1 -0
  143. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +0 -2
  144. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +98 -44
  145. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -2
  146. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +2 -3
  147. package/Microsoft.ReactNative/Fabric/ReactTaggedView.h +2 -2
  148. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +3 -3
  149. package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.h +3 -1
  150. package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +0 -1
  151. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +2 -0
  152. package/Microsoft.ReactNative/Modules/Animated/AnimatedNode.cpp +3 -3
  153. package/Microsoft.ReactNative/Modules/Animated/AnimatedNode.h +3 -2
  154. package/Microsoft.ReactNative/Modules/Timing.h +2 -1
  155. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +6 -0
  156. package/Microsoft.ReactNative/ViewProps.idl +9 -0
  157. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +12 -2
  158. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  159. package/PropertySheets/JSEngine.props +1 -1
  160. package/ReactCommon/ReactCommon.vcxproj +7 -1
  161. package/ReactCommon/ReactCommon.vcxproj.filters +0 -3
  162. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +5 -5
  163. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +0 -1
  164. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +2 -43
  165. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +12 -2
  166. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/attributedstring/TextAttributes.cpp +291 -0
  167. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +0 -1
  168. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +1 -3
  169. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/propsConversions.h +199 -0
  170. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +6 -0
  171. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +17 -10
  172. package/Scripts/creaternwapp.cmd +8 -1
  173. package/Scripts/creaternwlib.cmd +21 -2
  174. package/Shared/DevSettings.h +0 -3
  175. package/Shared/Modules/WebSocketModule.cpp +0 -1
  176. package/Shared/Modules/WebSocketModule.h +62 -3
  177. package/Shared/OInstance.cpp +5 -0
  178. package/Shared/Shared.vcxitems +4 -6
  179. package/Shared/Shared.vcxitems.filters +218 -709
  180. package/codegen/NativeAccessibilityManagerSpec.g.h +2 -0
  181. package/codegen/NativeAnimatedModuleSpec.g.h +21 -15
  182. package/codegen/NativeDevLoadingViewSpec.g.h +3 -3
  183. package/codegen/NativeIntentAndroidSpec.g.h +16 -3
  184. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +209 -191
  185. package/codegen/react/components/rnwcore/EventEmitters.h +1 -0
  186. package/codegen/react/components/rnwcore/Props.h +14 -0
  187. package/codegen/rnwcoreJSI.h +246 -211
  188. package/index.js +3 -0
  189. package/index.windows.js +3 -0
  190. package/jest/mock.js +2 -2
  191. package/jest/mockComponent.js +1 -1
  192. package/jest/setup.js +1 -1
  193. package/package.json +22 -21
  194. package/src/private/animated/NativeAnimatedHelper.js +130 -125
  195. package/src/private/animated/NativeAnimatedValidation.js +7 -4
  196. package/src/private/animated/createAnimatedPropsHook.js +13 -5
  197. package/src/private/animated/createAnimatedPropsMemoHook.js +10 -10
  198. package/src/private/components/virtualview/VirtualView.js +16 -9
  199. package/src/private/components/virtualview/logger/VirtualViewLogger.js +21 -0
  200. package/src/private/components/virtualview/logger/VirtualViewLoggerTypes.js +24 -0
  201. package/src/private/devsupport/devmenu/elementinspector/ElementProperties.js +1 -1
  202. package/src/private/devsupport/devmenu/elementinspector/Inspector.js +6 -25
  203. package/src/private/devsupport/devmenu/elementinspector/InspectorPanel.js +1 -27
  204. package/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js +3 -2
  205. package/src/private/featureflags/ReactNativeFeatureFlags.js +63 -42
  206. package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +3 -3
  207. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +12 -9
  208. package/src/private/renderer/errorhandling/ErrorHandlers.js +7 -4
  209. package/src/private/specs_DEPRECATED/modules/NativeAccessibilityManager.js +1 -1
  210. package/src/private/specs_DEPRECATED/modules/NativeAnimatedModule.js +4 -0
  211. package/src/private/specs_DEPRECATED/modules/NativeDevLoadingView.js +1 -0
  212. package/src/private/webapis/dom/events/CustomEvent.js +3 -3
  213. package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentElementInstanceHandle.js +1 -1
  214. package/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +1 -1
  215. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +29 -29
  216. package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +1 -1
  217. package/src/private/webapis/dom/oldstylecollections/NodeList.js +2 -2
  218. package/src/private/webapis/geometry/DOMRectReadOnly.js +1 -1
  219. package/src/private/webapis/html/events/MessageEvent.js +3 -3
  220. package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +3 -3
  221. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +53 -5
  222. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +2 -2
  223. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +4 -4
  224. package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +1 -1
  225. package/src/private/webapis/mutationobserver/MutationObserver.js +1 -1
  226. package/src/private/webapis/mutationobserver/MutationRecord.js +1 -1
  227. package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -4
  228. package/src/private/webapis/performance/Performance.js +1 -1
  229. package/src/private/webapis/performance/UserTiming.js +1 -1
  230. package/src/private/webapis/performance/specs/NativePerformance.js +3 -3
  231. package/src/private/webapis/structuredClone/structuredClone.js +3 -3
  232. package/src/types/globals.d.ts +30 -1
  233. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +0 -178
  234. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +0 -183
  235. package/Shared/Modules/WebSocketTurboModule.h +0 -71
  236. package/src/private/devsupport/devmenu/elementinspector/NetworkOverlay.js +0 -628
  237. package/src/private/devsupport/devmenu/perfmonitor/PerformanceOverlay.js +0 -66
@@ -0,0 +1,199 @@
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 <optional>
11
+
12
+ #include <react/renderer/core/PropsParserContext.h>
13
+ #include <react/renderer/core/RawProps.h>
14
+ #include <react/renderer/core/RawPropsKey.h>
15
+ #include <react/renderer/core/graphicsConversions.h>
16
+
17
+ namespace facebook::react {
18
+
19
+ #ifdef RN_SERIALIZABLE_STATE
20
+
21
+ inline folly::dynamic toDynamic(const std::vector<bool> &arrayValue)
22
+ {
23
+ folly::dynamic resultArray = folly::dynamic::array();
24
+ for (auto value : arrayValue) {
25
+ resultArray.push_back(value);
26
+ }
27
+ return resultArray;
28
+ }
29
+
30
+ inline folly::dynamic toDynamic(const std::vector<std::string> &arrayValue)
31
+ {
32
+ folly::dynamic resultArray = folly::dynamic::array();
33
+ for (auto &value : arrayValue) {
34
+ resultArray.push_back(value);
35
+ }
36
+ return resultArray;
37
+ }
38
+
39
+ inline folly::dynamic toDynamic(const std::vector<int> &arrayValue)
40
+ {
41
+ folly::dynamic resultArray = folly::dynamic::array();
42
+ for (auto value : arrayValue) {
43
+ resultArray.push_back(value);
44
+ }
45
+ return resultArray;
46
+ }
47
+
48
+ inline folly::dynamic toDynamic(const std::vector<double> &arrayValue)
49
+ {
50
+ folly::dynamic resultArray = folly::dynamic::array();
51
+ for (auto value : arrayValue) {
52
+ resultArray.push_back(value);
53
+ }
54
+ return resultArray;
55
+ }
56
+
57
+ inline folly::dynamic toDynamic(const std::vector<Float> &arrayValue)
58
+ {
59
+ folly::dynamic resultArray = folly::dynamic::array();
60
+ for (auto value : arrayValue) {
61
+ resultArray.push_back(value);
62
+ }
63
+ return resultArray;
64
+ }
65
+
66
+ inline folly::dynamic toDynamic(const std::vector<folly::dynamic> &arrayValue)
67
+ {
68
+ folly::dynamic resultArray = folly::dynamic::array();
69
+ for (auto &value : arrayValue) {
70
+ resultArray.push_back(value);
71
+ }
72
+ return resultArray;
73
+ }
74
+
75
+ template <typename T>
76
+ folly::dynamic toDynamic(const std::vector<T> &arrayValue)
77
+ {
78
+ folly::dynamic resultArray = folly::dynamic::array();
79
+ for (const auto &value : arrayValue) {
80
+ resultArray.push_back(toDynamic(value));
81
+ }
82
+ return resultArray;
83
+ }
84
+
85
+ #endif
86
+
87
+ /**
88
+ * Use this only when a prop update has definitely been sent from JS;
89
+ * essentially, cases where rawValue is virtually guaranteed to not be a
90
+ * nullptr.
91
+ */
92
+ template <typename T>
93
+ void fromRawValue(const PropsParserContext &context, const RawValue &rawValue, T &result, T defaultValue)
94
+ {
95
+ if (!rawValue.hasValue()) {
96
+ result = std::move(defaultValue);
97
+ return;
98
+ }
99
+
100
+ fromRawValue(context, rawValue, result);
101
+ }
102
+
103
+ template <typename T>
104
+ void fromRawValue(const PropsParserContext &context, const RawValue &rawValue, T &result)
105
+ {
106
+ result = (T)rawValue;
107
+ }
108
+
109
+ template <typename T>
110
+ void fromRawValue(const PropsParserContext &context, const RawValue &rawValue, std::optional<T> &result)
111
+ {
112
+ T resultValue;
113
+ fromRawValue(context, rawValue, resultValue);
114
+ result = std::optional<T>{std::move(resultValue)};
115
+ }
116
+
117
+ template <typename T>
118
+ void fromRawValue(const PropsParserContext &context, const RawValue &rawValue, std::vector<T> &result)
119
+ {
120
+ if (rawValue.hasType<std::vector<RawValue>>()) {
121
+ auto items = (std::vector<RawValue>)rawValue;
122
+ auto length = items.size();
123
+ result.clear();
124
+ result.reserve(length);
125
+ for (auto &item : items) {
126
+ T itemResult;
127
+ fromRawValue(context, item, itemResult);
128
+ result.push_back(itemResult);
129
+ }
130
+ return;
131
+ }
132
+
133
+ // The case where `value` is not an array.
134
+ result.clear();
135
+ result.reserve(1);
136
+ T itemResult;
137
+ fromRawValue(context, rawValue, itemResult);
138
+ result.push_back(itemResult);
139
+ }
140
+
141
+ template <typename T>
142
+ void fromRawValue(const PropsParserContext &context, const RawValue &rawValue, std::vector<std::vector<T>> &result)
143
+ {
144
+ if (rawValue.hasType<std::vector<std::vector<RawValue>>>()) {
145
+ auto items = (std::vector<std::vector<RawValue>>)rawValue;
146
+ auto length = items.size();
147
+ result.clear();
148
+ result.reserve(length);
149
+ for (auto &item : items) {
150
+ T itemResult;
151
+ fromRawValue(context, item, itemResult);
152
+ result.push_back(itemResult);
153
+ }
154
+ return;
155
+ }
156
+
157
+ // The case where `value` is not an array.
158
+ result.clear();
159
+ result.reserve(1);
160
+ T itemResult;
161
+ fromRawValue(context, rawValue, itemResult);
162
+ result.push_back(itemResult);
163
+ }
164
+
165
+ template <typename T, typename U = T>
166
+ T convertRawProp(
167
+ const PropsParserContext &context,
168
+ const RawProps &rawProps,
169
+ const char *name,
170
+ const T &sourceValue,
171
+ const U &defaultValue,
172
+ const char *namePrefix = nullptr,
173
+ const char *nameSuffix = nullptr)
174
+ {
175
+ const auto *rawValue = rawProps.at(name, namePrefix, nameSuffix);
176
+ if (rawValue == nullptr) [[likely]] {
177
+ return sourceValue;
178
+ }
179
+
180
+ // Special case: `null` always means "the prop was removed, use default
181
+ // value".
182
+ if (!rawValue->hasValue()) [[unlikely]] {
183
+ return static_cast<T>(defaultValue); // Windows #15782
184
+ }
185
+
186
+ try {
187
+ T result;
188
+ fromRawValue(context, *rawValue, result);
189
+ return result;
190
+ } catch (const std::exception &e) {
191
+ // In case of errors, log the error and fall back to the default
192
+ RawPropsKey key{.prefix = namePrefix, .name = name, .suffix = nameSuffix};
193
+ // TODO: report this using ErrorUtils so it's more visible to the user
194
+ LOG(ERROR) << "Error while converting prop '" << static_cast<std::string>(key) << "': " << e.what();
195
+ return static_cast<T>(defaultValue);// Windows #15782
196
+ }
197
+ }
198
+
199
+ } // namespace facebook::react
@@ -210,6 +210,12 @@ void UIManager::completeSurface(
210
210
  // after we commit a specific one.
211
211
  lazyShadowTreeRevisionConsistencyManager_->updateCurrentRevision(
212
212
  surfaceId, shadowTree.getCurrentRevision().rootShadowNode);
213
+
214
+ if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
215
+ if (auto animationBackend = animationBackend_.lock()) {
216
+ animationBackend->clearRegistry(surfaceId);
217
+ }
218
+ }
213
219
  }
214
220
  });
215
221
  }
@@ -20,13 +20,13 @@
20
20
  #include <cxxreact/TraceSection.h>
21
21
  #include <glog/logging.h>
22
22
  #include <jsi/JSIDynamic.h>
23
- #include <jsi/hermes.h>
23
+ #include <jsi/hermes-interfaces.h>
24
24
  #include <jsi/instrumentation.h>
25
25
  #include <jsinspector-modern/HostTarget.h>
26
- #include <jsireact/JSIExecutor.h>
27
26
  #include <react/featureflags/ReactNativeFeatureFlags.h>
28
27
  #include <react/renderer/core/ShadowNode.h>
29
28
  #include <react/renderer/runtimescheduler/RuntimeSchedulerBinding.h>
29
+ #include <react/runtime/JSRuntimeBindings.h>
30
30
  #include <react/timing/primitives.h>
31
31
  #include <react/utils/jsi-utils.h>
32
32
  #include <iostream>
@@ -53,6 +53,12 @@ std::shared_ptr<RuntimeScheduler> createRuntimeScheduler(
53
53
  return scheduler;
54
54
  }
55
55
 
56
+ std::string getSyntheticBundlePath(uint32_t bundleId) {
57
+ std::array<char, 32> buffer{};
58
+ std::snprintf(buffer.data(), buffer.size(), "seg-%u.js", bundleId);
59
+ return buffer.data();
60
+ }
61
+
56
62
  } // namespace
57
63
 
58
64
  ReactInstance::ReactInstance(
@@ -94,7 +100,7 @@ ReactInstance::ReactInstance(
94
100
  jsErrorHandler->handleError(jsiRuntime, originalError, true);
95
101
  } catch (std::exception& ex) {
96
102
  jsi::JSError error(
97
- jsiRuntime, std::string("Non-js exception: ") + ex.what());
103
+ jsiRuntime, std::string("Non-JS exception: ") + ex.what());
98
104
  jsErrorHandler->handleError(jsiRuntime, error, true);
99
105
  }
100
106
  });
@@ -161,6 +167,11 @@ ReactInstance::ReactInstance(
161
167
  runtimeScheduler->scheduleWork(std::move(callback));
162
168
  });
163
169
  }
170
+ ReactInstance::~ReactInstance() noexcept {
171
+ if (timerManager_ != nullptr) {
172
+ timerManager_->quit();
173
+ }
174
+ }
164
175
 
165
176
  void ReactInstance::unregisterFromInspector() {
166
177
  if (inspectorTarget_ != nullptr) {
@@ -226,7 +237,7 @@ void ReactInstance::loadScript(
226
237
  const std::string& sourceURL,
227
238
  std::function<void(jsi::Runtime& runtime)>&& beforeLoad,
228
239
  std::function<void(jsi::Runtime& runtime)>&& afterLoad) {
229
- auto buffer = std::make_shared<BigStringBuffer>(std::move(script));
240
+ std::shared_ptr<const jsi::Buffer> buffer(std::move(script));
230
241
  std::string scriptName = simpleBasename(sourceURL);
231
242
 
232
243
  runtimeScheduler_->scheduleWork([this,
@@ -237,7 +248,7 @@ void ReactInstance::loadScript(
237
248
  std::weak_ptr<BufferedRuntimeExecutor>(
238
249
  bufferedRuntimeExecutor_),
239
250
  beforeLoad,
240
- afterLoad](jsi::Runtime& runtime) {
251
+ afterLoad](jsi::Runtime& runtime) mutable {
241
252
  if (beforeLoad) {
242
253
  beforeLoad(runtime);
243
254
  }
@@ -362,7 +373,6 @@ void ReactInstance::registerSegment(
362
373
  throw std::invalid_argument(
363
374
  "Empty segment registered with ID " + tag + " from " + segmentPath);
364
375
  }
365
- auto buffer = std::make_shared<BigStringBuffer>(std::move(script));
366
376
 
367
377
  bool hasLogger(ReactMarker::logTaggedMarkerBridgelessImpl != nullptr);
368
378
  if (hasLogger) {
@@ -371,11 +381,8 @@ void ReactInstance::registerSegment(
371
381
  }
372
382
  LOG(WARNING) << "Starting to evaluate segment " << segmentId
373
383
  << " in ReactInstance::registerSegment";
374
- #pragma clang diagnostic push
375
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
376
384
  runtime.evaluateJavaScript(
377
- buffer, JSExecutor::getSyntheticBundlePath(segmentId, segmentPath));
378
- #pragma clang diagnostic pop
385
+ std::move(script), getSyntheticBundlePath(segmentId));
379
386
  LOG(WARNING) << "Finished evaluating segment " << segmentId
380
387
  << " in ReactInstance::registerSegment";
381
388
  if (hasLogger) {
@@ -117,7 +117,14 @@ if not "x%RN_VERSION:nightly=%"=="x%RN_VERSION%" (
117
117
  REM Do not change, this makes sure we always get a nightly template when still consuming a nightly RN and NOT a later "stable" template that may have been released
118
118
  REM set RNCLI_TEMPLATE=--template "@react-native-community/template@^%RN_VERSION:~0,4%.0-"
119
119
  REM Windows we need to manually update this with every integration #15124
120
- set RNCLI_TEMPLATE=--template "@react-native-community/template@0.83.2"
120
+ set RNCLI_TEMPLATE=--template "@react-native-community/template@0.84.1"
121
+ )
122
+
123
+ if not "x%RN_VERSION:-rc=%"=="x%RN_VERSION%" (
124
+ @echo creaternwapp.cmd Override @react-native-community/template version for RC
125
+ REM RC versions may not have a corresponding template published to npm
126
+ REM Windows we need to manually update this with every integration #15124
127
+ set RNCLI_TEMPLATE=--template "@react-native-community/template@0.84.1"
121
128
  )
122
129
 
123
130
  @echo creaternwapp.cmd: Creating base RN app project with: npx --yes @react-native-community/cli@%RNCLI_VERSION% init %APP_NAME% --version %RN_VERSION% %RNCLI_TEMPLATE% --verbose --skip-install --install-pods false --skip-git-init true
@@ -116,8 +116,15 @@ for /f "delims=" %%a in ('npm show react@%R_VERSION% version') do @set R_VERSION
116
116
 
117
117
  @echo creaternwlib.cmd Creating RNW lib "%LIB_NAME%" with react@%R_VERSION%, react-native@%RN_VERSION%, and react-native-windows@%RNW_VERSION%
118
118
 
119
- @echo creaternwlib.cmd Creating base RN library project with: npx --yes create-react-native-library@0.48.9 --slug %LIB_NAME% --description %LIB_NAME% --author-name "React-Native-Windows Bot" --author-email 53619745+rnbot@users.noreply.github.com --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --local false --type %RN_TEMPLATE_TYPE% --react-native-version %RN_VERSION% --example vanilla %LIB_NAME%
120
- call npx --yes create-react-native-library@0.48.9 --slug %LIB_NAME% --description %LIB_NAME% --author-name "React-Native-Windows Bot" --author-email 53619745+rnbot@users.noreply.github.com --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --local false --type %RN_TEMPLATE_TYPE% --react-native-version %RN_VERSION% --example vanilla %LIB_NAME%
119
+ set CRNL_RN_VERSION_ARG=--react-native-version %RN_VERSION%
120
+ if not "x%RN_VERSION:-rc=%"=="x%RN_VERSION%" (
121
+ @echo creaternwlib.cmd Override --react-native-version for RC build, will fix up versions later
122
+ REM RC versions may not have a corresponding template published to npm, omit --react-native-version
123
+ set CRNL_RN_VERSION_ARG=
124
+ )
125
+
126
+ @echo creaternwlib.cmd Creating base RN library project with: npx --yes create-react-native-library@0.48.9 --slug %LIB_NAME% --description %LIB_NAME% --author-name "React-Native-Windows Bot" --author-email 53619745+rnbot@users.noreply.github.com --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --local false --type %RN_TEMPLATE_TYPE% %CRNL_RN_VERSION_ARG% --example vanilla %LIB_NAME%
127
+ call npx --yes create-react-native-library@0.48.9 --slug %LIB_NAME% --description %LIB_NAME% --author-name "React-Native-Windows Bot" --author-email 53619745+rnbot@users.noreply.github.com --author-url http://example.com --repo-url http://example.com --languages kotlin-objc --local false --type %RN_TEMPLATE_TYPE% %CRNL_RN_VERSION_ARG% --example vanilla %LIB_NAME%
121
128
 
122
129
  if %ERRORLEVEL% neq 0 (
123
130
  @echo creaternwlib.cmd: Unable to create base RN library project
@@ -138,6 +145,18 @@ if not "x%RN_VERSION:nightly=%"=="x%RN_VERSION%" (
138
145
  popd
139
146
  )
140
147
 
148
+ if not "x%RN_VERSION:-rc=%"=="x%RN_VERSION%" (
149
+ @echo creaternwlib.cmd Fixing react-native RC version
150
+ pwsh.exe -Command "(gc package.json) -replace '""react-native"": ""[^\*]*""', '""react-native"": ""%RN_VERSION%""' | Out-File -encoding utf8NoBOM package.json"
151
+ pwsh.exe -Command "(gc package.json) -replace '""@react-native/(.+-(config|preset))"": "".*""', '""@react-native/$1"": ""%RN_VERSION%""' | Out-File -encoding utf8NoBOM package.json"
152
+ pwsh.exe -Command "(gc package.json) -replace '""@react-native-community/cli((-platform-)?(ios|android))?"": "".*""', '""@react-native-community/cli$1"": ""%RNCLI_VERSION%""' | Out-File -encoding utf8NoBOM package.json"
153
+ pushd example
154
+ pwsh.exe -Command "(gc package.json) -replace '""react-native"": ""[^\*]*""', '""react-native"": ""%RN_VERSION%""' | Out-File -encoding utf8NoBOM package.json"
155
+ pwsh.exe -Command "(gc package.json) -replace '""@react-native/(.+-(config|preset))"": "".*""', '""@react-native/$1"": ""%RN_VERSION%""' | Out-File -encoding utf8NoBOM package.json"
156
+ pwsh.exe -Command "(gc package.json) -replace '""@react-native-community/cli((-platform-)?(ios|android))?"": "".*""', '""@react-native-community/cli$1"": ""%RNCLI_VERSION%""' | Out-File -encoding utf8NoBOM package.json"
157
+ popd
158
+ )
159
+
141
160
  @echo creaternwlib.cmd: Calling yarn install
142
161
  call yarn install
143
162
 
@@ -86,9 +86,6 @@ struct DevSettings {
86
86
 
87
87
  bool enableDefaultCrashHandler{false};
88
88
 
89
- // OC:8368383 - Memory leak under investigation.
90
- bool useWebSocketTurboModule{false};
91
-
92
89
  // Enable concurrent mode by installing runtimeScheduler
93
90
  bool useRuntimeScheduler{false};
94
91
 
@@ -4,7 +4,6 @@
4
4
  #include "pch.h"
5
5
 
6
6
  #include <Modules/WebSocketModule.h>
7
- #include <Modules/WebSocketTurboModule.h>
8
7
 
9
8
  #include <CreateModules.h>
10
9
  #include <Modules/CxxModuleUtilities.h>
@@ -3,10 +3,69 @@
3
3
 
4
4
  #pragma once
5
5
 
6
+ #include <codegen/NativeWebSocketModuleSpec.g.h>
6
7
  #include <Modules/IWebSocketModuleProxy.h>
8
+ #include <NativeModules.h>
7
9
  #include <Networking/IWebSocketResource.h>
8
10
 
9
- // Windows API
10
- #include <winrt/Windows.Foundation.h>
11
+ namespace Microsoft::React {
11
12
 
12
- namespace Microsoft::React {} // namespace Microsoft::React
13
+ class WebSocketTurboModuleProxy final : public IWebSocketModuleProxy {
14
+ std::unordered_map<double, std::shared_ptr<Networking::IWebSocketResource>> &m_resourceMap;
15
+
16
+ public:
17
+ WebSocketTurboModuleProxy(
18
+ std::unordered_map<double, std::shared_ptr<Networking::IWebSocketResource>> &resourceMap) noexcept;
19
+
20
+ #pragma region IWebSocketModuleProxy
21
+
22
+ void SendBinary(std::string &&base64String, int64_t id) noexcept override;
23
+
24
+ #pragma endregion
25
+ };
26
+
27
+ REACT_MODULE(WebSocketTurboModule, L"WebSocketModule")
28
+ struct WebSocketTurboModule {
29
+ using ModuleSpec = ReactNativeSpecs::WebSocketModuleSpec;
30
+
31
+ REACT_INIT(Initialize)
32
+ void Initialize(winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept;
33
+
34
+ REACT_METHOD(Connect, L"connect")
35
+ void Connect(
36
+ std::string &&url,
37
+ std::optional<std::vector<std::string>> protocols,
38
+ ReactNativeSpecs::WebSocketModuleSpec_connect_options &&options,
39
+ double socketID) noexcept;
40
+
41
+ REACT_METHOD(Close, L"close")
42
+ void Close(double code, std::string &&reason, double socketID) noexcept;
43
+
44
+ REACT_METHOD(Send, L"send")
45
+ void Send(std::string &&message, double forSocketID) noexcept;
46
+
47
+ REACT_METHOD(SendBinary, L"sendBinary")
48
+ void SendBinary(std::string &&base64String, double forSocketID) noexcept;
49
+
50
+ REACT_METHOD(Ping, L"ping")
51
+ void Ping(double socketID) noexcept;
52
+
53
+ REACT_METHOD(AddListener, L"addListener")
54
+ void AddListener(std::string &&eventName) noexcept;
55
+
56
+ REACT_METHOD(RemoveListeners, L"removeListeners")
57
+ void RemoveListeners(double count) noexcept;
58
+
59
+ private:
60
+ std::shared_ptr<Networking::IWebSocketResource> CreateResource(int64_t id, std::string &&url) noexcept;
61
+
62
+ winrt::Microsoft::ReactNative::ReactContext m_context;
63
+ std::unordered_map<double, std::shared_ptr<Networking::IWebSocketResource>> m_resourceMap;
64
+
65
+ /// <summary>
66
+ /// Exposes a subset of the module's methods.
67
+ /// </summary>
68
+ std::shared_ptr<IWebSocketModuleProxy> m_proxy;
69
+ };
70
+
71
+ } // namespace Microsoft::React
@@ -19,6 +19,11 @@
19
19
  #include <Utils/LocalBundleReader.h>
20
20
  #endif
21
21
 
22
+ #if _MSC_VER
23
+ #pragma warning(push)
24
+ #pragma warning(disable : 4996) // deprecated APIs
25
+ #endif
26
+
22
27
  #include <CppRuntimeOptions.h>
23
28
  #include <CreateModules.h>
24
29
  #include <DevSettings.h>
@@ -325,7 +325,6 @@
325
325
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\IWebSocketModuleContentHandler.h" />
326
326
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\IWebSocketModuleProxy.h" />
327
327
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\HttpModule.h" />
328
- <ClInclude Include="$(MSBuildThisFileDirectory)Modules\WebSocketTurboModule.h" />
329
328
  <ClInclude Include="$(MSBuildThisFileDirectory)Networking\DefaultBlobResource.h" />
330
329
  <ClInclude Include="$(MSBuildThisFileDirectory)Networking\IBlobResource.h" />
331
330
  <ClInclude Include="$(MSBuildThisFileDirectory)Networking\IHttpResource.h" />
@@ -434,7 +433,6 @@
434
433
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\TraceEventSerializer.cpp" />
435
434
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\ConsoleTimeStamp.cpp" />
436
435
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\HostTargetTraceRecording.cpp " />
437
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\TraceRecordingStateSerializer.cpp" />
438
436
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\HostTargetTracing.cpp" />
439
437
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\utils\jsi-utils.cpp" />
440
438
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\reactperflogger\reactperflogger\ReactPerfettoLogger.cpp" />
@@ -447,15 +445,15 @@
447
445
  </ItemGroup>
448
446
  <ItemGroup Condition="'$(UseFabric)' == 'true'">
449
447
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\defaults\DefaultTurboModules.cpp" />
448
+ <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\intersectionobserver\NativeIntersectionObserver.cpp" />
449
+ <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\observers\intersection\IntersectionObserver.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
450
+ <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\observers\intersection\IntersectionObserverManager.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
451
+ <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\observers\intersection\IntersectionObserverState.cpp" DisableSpecificWarnings="4996;%(DisableSpecificWarnings)" />
450
452
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\microtasks\NativeMicrotasks.cpp" />
451
453
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\featureflags\NativeReactNativeFeatureFlags.cpp" />
452
454
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\dom\NativeDOM.cpp" DisableSpecificWarnings="4715;%(DisableSpecificWarnings)" />
453
455
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\idlecallbacks\NativeIdleCallbacks.cpp" />
454
- <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\intersectionobserver\NativeIntersectionObserver.cpp" />
455
456
  <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\webperformance\NativePerformance.cpp" />
456
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\observers\intersection\IntersectionObserver.cpp" />
457
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\observers\intersection\IntersectionObserverManager.cpp" />
458
- <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\observers\intersection\IntersectionObserverState.cpp" />
459
457
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\attributedstring\AttributedString.cpp" />
460
458
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\attributedstring\AttributedStringBox.cpp" DisableSpecificWarnings="4715;%(DisableSpecificWarnings)" />
461
459
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\components\view\BaseViewProps.cpp" DisableSpecificWarnings="4459;4715;%(DisableSpecificWarnings)" />