react-native-windows 0.82.1 → 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 (232) 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/Base/CxxReactIncludes.h +11 -0
  78. package/Microsoft.ReactNative/CompositionComponentView.idl +2 -0
  79. package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -0
  80. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +1 -1
  81. package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
  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/TextInput/WindowsTextInputComponentView.cpp +70 -49
  95. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +4 -1
  96. package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +5 -0
  97. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +7 -2
  98. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +1 -0
  99. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -1
  100. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
  101. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +20 -94
  102. package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -3
  103. package/Microsoft.ReactNative/Pch/pch.h +2 -0
  104. package/Microsoft.ReactNative/ReactHost/CrashManager.cpp +5 -0
  105. package/Microsoft.ReactNative/ReactHost/ReactNativeHeaders.h +1 -0
  106. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +0 -41
  107. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +0 -11
  108. package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -3
  109. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +31 -101
  110. package/Microsoft.ReactNative/ReactNativeWin32App.h +2 -13
  111. package/Microsoft.ReactNative/ReactNativeWindow.idl +44 -0
  112. package/Microsoft.ReactNative.Cxx/AutoDraw.h +9 -1
  113. package/Microsoft.ReactNative.Cxx/ReactCommon/CallInvoker.h +13 -16
  114. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +24 -36
  115. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.h +5 -8
  116. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/AString.h +8 -6
  117. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Array.h +32 -49
  118. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +27 -76
  119. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +4 -2
  120. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/CallbackWrapper.h +19 -18
  121. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +25 -48
  122. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Convert.h +38 -31
  123. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Error.h +11 -6
  124. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/EventEmitter.h +47 -45
  125. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Function.h +69 -89
  126. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/HighResTimeStamp.h +8 -8
  127. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.h +6 -6
  128. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +16 -8
  129. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Object.h +17 -24
  130. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Promise.h +17 -17
  131. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Value.h +20 -29
  132. package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/react_native_assert.h +2 -7
  133. package/Microsoft.ReactNative.Cxx/ReactCommon/react/timing/primitives.h +127 -115
  134. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.props +10 -0
  135. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.props +10 -0
  136. package/PropertySheets/Generated/PackageVersion.g.props +5 -5
  137. package/PropertySheets/Warnings.props +2 -1
  138. package/ReactCommon/ReactCommon.vcxproj +21 -12
  139. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +2 -2
  140. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +381 -0
  141. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +49 -0
  142. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +145 -0
  143. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/MethodCall.cpp +100 -0
  144. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ModuleRegistry.cpp +256 -0
  145. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +13 -4
  146. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/RAMBundleRegistry.cpp +93 -0
  147. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +149 -0
  148. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +25 -35
  149. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +86 -67
  150. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +629 -0
  151. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSINativeModules.cpp +123 -0
  152. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +84 -68
  153. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +31 -35
  154. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +4 -5
  155. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp +2 -1
  156. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +24 -36
  157. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +28 -66
  158. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/webperformance/NativePerformance.cpp +414 -0
  159. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -3
  160. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +8 -4
  161. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +19 -16
  162. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +8 -9
  163. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +25 -95
  164. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +85 -42
  165. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +81 -0
  166. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +140 -0
  167. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +25 -31
  168. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +746 -0
  169. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +702 -0
  170. package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +1 -15
  171. package/Scripts/creaternwapp.cmd +1 -1
  172. package/Scripts/perf/compare-results.js +357 -0
  173. package/Scripts/perf/create-perf-test.js +343 -0
  174. package/Scripts/perf/post-pr-comment.js +210 -0
  175. package/Shared/Hermes/HermesRuntimeTargetDelegate.cpp +8 -0
  176. package/Shared/Hermes/HermesRuntimeTargetDelegate.h +3 -0
  177. package/Shared/Shared.vcxitems +24 -12
  178. package/Shared/Shared.vcxitems.filters +11 -3
  179. package/codegen/NativeIntersectionObserverSpec.g.h +2 -0
  180. package/codegen/NativeNetworkingIOSSpec.g.h +2 -0
  181. package/codegen/NativePerformanceSpec.g.h +6 -0
  182. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +229 -139
  183. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +2 -1
  184. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +42 -25
  185. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +2 -1
  186. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +2 -1
  187. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +11 -6
  188. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +11 -6
  189. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +1 -0
  190. package/codegen/react/components/rnwcore/InputAccessory.g.h +2 -1
  191. package/codegen/react/components/rnwcore/ModalHostView.g.h +40 -23
  192. package/codegen/react/components/rnwcore/Props.cpp +6 -1
  193. package/codegen/react/components/rnwcore/Props.h +1 -0
  194. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +11 -6
  195. package/codegen/react/components/rnwcore/SafeAreaView.g.h +1 -0
  196. package/codegen/react/components/rnwcore/Switch.g.h +11 -6
  197. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +2 -1
  198. package/codegen/react/components/rnwcore/VirtualView.g.h +41 -8
  199. package/codegen/react/components/rnwcore/VirtualViewExperimental.g.h +45 -8
  200. package/codegen/rnwcoreJSI.h +3973 -6059
  201. package/index.js +6 -0
  202. package/index.windows.js +6 -0
  203. package/jest/mockComponent.js +6 -6
  204. package/jest/setup.js +15 -10
  205. package/package.json +27 -27
  206. package/src/private/components/virtualview/VirtualView.js +22 -27
  207. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +6 -0
  208. package/src/private/featureflags/ReactNativeFeatureFlags.js +100 -19
  209. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +18 -3
  210. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
  211. package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -1
  212. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -0
  213. package/src/private/webapis/dom/nodes/ReactNativeElement.js +12 -2
  214. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +76 -15
  215. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +1 -0
  216. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  217. package/src/private/webapis/performance/ResourceTiming.js +31 -4
  218. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +4 -1
  219. package/src/private/webapis/performance/specs/NativePerformance.js +3 -0
  220. package/stubs/double-conversion/double-conversion.h +5 -0
  221. package/templates/cpp-app/template.config.js +1 -1
  222. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +3 -1
  223. package/templates/cpp-lib/template.config.js +1 -1
  224. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
  225. package/types/index.d.ts +1 -0
  226. package/types/public/ReactNativeTypes.d.ts +115 -2
  227. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +0 -152
  228. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +0 -1574
  229. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +0 -528
  230. package/Scripts/OpenSSL.nuspec +0 -39
  231. package/Scripts/OpenSSL.targets +0 -36
  232. package/codegen/rnwcoreJSI-generated.cpp +0 -3470
@@ -0,0 +1,140 @@
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
+
9
+ #if _MSC_VER
10
+ #pragma warning(push)
11
+ #pragma warning(disable : 4996) // deprecated APIs
12
+ #endif
13
+ #include <cxxreact/JSExecutor.h>
14
+ #include <logger/react_native_log.h>
15
+ #include <react/featureflags/ReactNativeFeatureFlags.h>
16
+ #include "EventEmitter.h"
17
+ #include "EventLogger.h"
18
+ #include "EventQueue.h"
19
+ #include "ShadowNodeFamily.h"
20
+
21
+ namespace facebook::react {
22
+
23
+ EventQueueProcessor::EventQueueProcessor(
24
+ EventPipe eventPipe,
25
+ EventPipeConclusion eventPipeConclusion,
26
+ StatePipe statePipe,
27
+ std::weak_ptr<EventLogger> eventLogger)
28
+ : eventPipe_(std::move(eventPipe)),
29
+ eventPipeConclusion_(std::move(eventPipeConclusion)),
30
+ statePipe_(std::move(statePipe)),
31
+ eventLogger_(std::move(eventLogger)) {}
32
+
33
+ void EventQueueProcessor::flushEvents(
34
+ jsi::Runtime& runtime,
35
+ std::vector<RawEvent>&& events) const {
36
+ {
37
+ std::scoped_lock lock(EventEmitter::DispatchMutex());
38
+
39
+ for (const auto& event : events) {
40
+ if (event.eventTarget) {
41
+ event.eventTarget->retain(runtime);
42
+ }
43
+ }
44
+ }
45
+
46
+ for (const auto& event : events) {
47
+ auto reactPriority = ReactEventPriority::Default;
48
+
49
+ if (ReactNativeFeatureFlags::
50
+ fixMappingOfEventPrioritiesBetweenFabricAndReact()) {
51
+ reactPriority = [&]() {
52
+ switch (event.category) {
53
+ case RawEvent::Category::Discrete:
54
+ return ReactEventPriority::Discrete;
55
+ case RawEvent::Category::ContinuousStart:
56
+ hasContinuousEventStarted_ = true;
57
+ return ReactEventPriority::Discrete;
58
+ case RawEvent::Category::ContinuousEnd:
59
+ hasContinuousEventStarted_ = false;
60
+ return ReactEventPriority::Discrete;
61
+ case RawEvent::Category::Continuous:
62
+ return ReactEventPriority::Continuous;
63
+ case RawEvent::Category::Idle:
64
+ return ReactEventPriority::Idle;
65
+ case RawEvent::Category::Unspecified:
66
+ return hasContinuousEventStarted_ ? ReactEventPriority::Continuous
67
+ : ReactEventPriority::Default;
68
+ }
69
+ return ReactEventPriority::Default;
70
+ }();
71
+ } else {
72
+ if (event.category == RawEvent::Category::ContinuousEnd) {
73
+ hasContinuousEventStarted_ = false;
74
+ }
75
+
76
+ reactPriority = hasContinuousEventStarted_ ? ReactEventPriority::Default
77
+ : ReactEventPriority::Discrete;
78
+
79
+ if (event.category == RawEvent::Category::Continuous) {
80
+ reactPriority = ReactEventPriority::Default;
81
+ }
82
+
83
+ if (event.category == RawEvent::Category::Discrete) {
84
+ reactPriority = ReactEventPriority::Discrete;
85
+ }
86
+ }
87
+
88
+ auto eventLogger = eventLogger_.lock();
89
+ if (eventLogger != nullptr) {
90
+ eventLogger->onEventProcessingStart(event.loggingTag);
91
+ }
92
+
93
+ if (event.eventPayload == nullptr) {
94
+ react_native_log_error(
95
+ "EventQueueProcessor: Unexpected null event payload");
96
+ continue;
97
+ }
98
+
99
+ eventPipe_(
100
+ runtime,
101
+ event.eventTarget.get(),
102
+ event.type,
103
+ reactPriority,
104
+ *event.eventPayload);
105
+
106
+ if (eventLogger != nullptr) {
107
+ eventLogger->onEventProcessingEnd(event.loggingTag);
108
+ }
109
+
110
+ if (event.category == RawEvent::Category::ContinuousStart) {
111
+ hasContinuousEventStarted_ = true;
112
+ }
113
+ }
114
+
115
+ // We only run the "Conclusion" once per event group when batched.
116
+ eventPipeConclusion_(runtime);
117
+
118
+ // No need to lock `EventEmitter::DispatchMutex()` here.
119
+ // The mutex protects from a situation when the `instanceHandle` can be
120
+ // deallocated during accessing, but that's impossible at this point because
121
+ // we have a strong pointer to it.
122
+ for (const auto& event : events) {
123
+ if (event.eventTarget) {
124
+ event.eventTarget->release(runtime);
125
+ }
126
+ }
127
+ }
128
+
129
+ void EventQueueProcessor::flushStateUpdates(
130
+ std::vector<StateUpdate>&& states) const {
131
+ for (const auto& stateUpdate : states) {
132
+ statePipe_(stateUpdate);
133
+ }
134
+ }
135
+
136
+ } // namespace facebook::react
137
+
138
+ #if _MSC_VER
139
+ #pragma warning(pop)
140
+ #endif
@@ -27,22 +27,25 @@ class ImageSource {
27
27
  std::string uri{};
28
28
  std::string bundle{};
29
29
  Float scale{3};
30
- Size size{0};
30
+ Size size{.width = 0};
31
31
  std::string body{};
32
32
  std::string method{};
33
33
  CacheStategy cache = CacheStategy::Default;
34
34
  std::vector<std::pair<std::string, std::string>> headers{};
35
35
 
36
- bool operator==(const ImageSource& rhs) const {
36
+ bool operator==(const ImageSource &rhs) const
37
+ {
37
38
  return std::tie(this->type, this->uri) == std::tie(rhs.type, rhs.uri);
38
39
  }
39
40
 
40
- bool operator!=(const ImageSource& rhs) const {
41
+ bool operator!=(const ImageSource &rhs) const
42
+ {
41
43
  return !(*this == rhs);
42
44
  }
43
45
 
44
46
  #ifdef RN_SERIALIZABLE_STATE
45
- folly::dynamic toDynamic() const {
47
+ folly::dynamic toDynamic() const
48
+ {
46
49
  folly::dynamic imageSourceResult = folly::dynamic::object();
47
50
  switch (type) {
48
51
  case ImageSource::Type::Invalid:
@@ -84,7 +87,7 @@ class ImageSource {
84
87
  }
85
88
 
86
89
  folly::dynamic headersObject = folly::dynamic::object();
87
- for (const auto& header : headers) {
90
+ for (const auto &header : headers) {
88
91
  headersObject[header.first] = header.second;
89
92
  }
90
93
  imageSourceResult["headers"] = headersObject;
@@ -94,41 +97,30 @@ class ImageSource {
94
97
  #endif
95
98
 
96
99
  #if RN_DEBUG_STRING_CONVERTIBLE
97
- SharedDebugStringConvertibleList getDebugProps(
98
- const std::string& prefix) const {
100
+ SharedDebugStringConvertibleList getDebugProps(const std::string &prefix) const
101
+ {
99
102
  ImageSource imageSource{};
100
103
 
101
104
  SharedDebugStringConvertibleList headersList;
102
- for (const auto& header : headers) {
103
- headersList.push_back(debugStringConvertibleItem(
104
- prefix + "-header-" + header.first, header.second));
105
+ for (const auto &header : headers) {
106
+ headersList.push_back(debugStringConvertibleItem(prefix + "-header-" + header.first, header.second));
105
107
  }
106
108
 
107
109
  return headersList +
108
110
  SharedDebugStringConvertibleList{
109
- debugStringConvertibleItem(
110
- prefix + "-type", toString(type), toString(imageSource.type)),
111
+ debugStringConvertibleItem(prefix + "-type", toString(type), toString(imageSource.type)),
111
112
  debugStringConvertibleItem(prefix + "-uri", uri, imageSource.uri),
112
- debugStringConvertibleItem(
113
- prefix + "-bundle", bundle, imageSource.bundle),
114
- debugStringConvertibleItem(
115
- prefix + "-scale", scale, imageSource.scale),
116
- debugStringConvertibleItem(
117
- prefix + "-size",
118
- react::toString(size),
119
- react::toString(imageSource.size)),
120
- debugStringConvertibleItem(
121
- prefix + "-body", body, imageSource.body),
122
- debugStringConvertibleItem(
123
- prefix + "-method", method, imageSource.method),
124
- debugStringConvertibleItem(
125
- prefix + "-cache",
126
- toString(cache),
127
- toString(imageSource.cache)),
113
+ debugStringConvertibleItem(prefix + "-bundle", bundle, imageSource.bundle),
114
+ debugStringConvertibleItem(prefix + "-scale", scale, imageSource.scale),
115
+ debugStringConvertibleItem(prefix + "-size", react::toString(size), react::toString(imageSource.size)),
116
+ debugStringConvertibleItem(prefix + "-body", body, imageSource.body),
117
+ debugStringConvertibleItem(prefix + "-method", method, imageSource.method),
118
+ debugStringConvertibleItem(prefix + "-cache", toString(cache), toString(imageSource.cache)),
128
119
  };
129
120
  }
130
121
 
131
- std::string toString(const Type& typeValue) const {
122
+ std::string toString(const Type &typeValue) const
123
+ {
132
124
  switch (typeValue) {
133
125
  case ImageSource::Type::Invalid:
134
126
  return "invalid";
@@ -143,7 +135,8 @@ class ImageSource {
143
135
  }
144
136
  }
145
137
 
146
- std::string toString(const CacheStategy& cacheValue) const {
138
+ std::string toString(const CacheStategy &cacheValue) const
139
+ {
147
140
  switch (cacheValue) {
148
141
  case ImageSource::CacheStategy::Default:
149
142
  return "default";
@@ -163,7 +156,8 @@ class ImageSource {
163
156
  };
164
157
 
165
158
  #ifdef RN_SERIALIZABLE_STATE
166
- inline folly::dynamic toDynamic(const ImageSource& imageSource) {
159
+ inline folly::dynamic toDynamic(const ImageSource &imageSource)
160
+ {
167
161
  return imageSource.toDynamic();
168
162
  }
169
163
  #endif