react-native-windows 0.78.4 → 0.78.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Directory.Build.props +6 -4
- package/Folly/Folly.vcxproj +46 -6
- package/Folly/Folly.vcxproj.filters +16 -4
- package/Folly/TEMP_UntilFollyUpdate/ConstexprMath.h +26 -18
- package/Folly/TEMP_UntilFollyUpdate/Conv.cpp +1205 -0
- package/Folly/TEMP_UntilFollyUpdate/chrono/Hardware.h +155 -0
- package/Folly/TEMP_UntilFollyUpdate/concurrency/CacheLocality.cpp +633 -0
- package/Folly/TEMP_UntilFollyUpdate/{dynamic-inl.h → json/dynamic-inl.h} +3 -4
- package/Folly/TEMP_UntilFollyUpdate/{json.cpp → json/json.cpp} +14 -10
- package/Folly/TEMP_UntilFollyUpdate/lang/SafeAssert.h +7 -14
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.h +6 -6
- package/Folly/ThreadNameStub.cpp +10 -0
- package/Folly/cgmanifest.json +11 -1
- package/Libraries/Components/View/View.windows.js +107 -56
- package/Libraries/Components/View/ViewAccessibility.d.ts +60 -1
- package/Libraries/Image/Image.windows.js +42 -21
- package/Libraries/Modal/Modal.d.ts +7 -0
- package/Libraries/Modal/Modal.windows.js +7 -1
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +3 -0
- package/Libraries/Text/Text.d.ts +18 -0
- package/Microsoft.ReactNative/AsynchronousEventBeat.cpp +4 -25
- package/Microsoft.ReactNative/AsynchronousEventBeat.h +0 -3
- package/Microsoft.ReactNative/Base/FollyIncludes.h +1 -0
- package/Microsoft.ReactNative/CallInvoker.cpp +42 -0
- package/Microsoft.ReactNative/CallInvoker.h +34 -0
- package/Microsoft.ReactNative/{JSDispatcherWriter.cpp → CallInvokerWriter.cpp} +35 -47
- package/Microsoft.ReactNative/CallInvokerWriter.h +74 -0
- package/Microsoft.ReactNative/CompositionComponentView.idl +0 -5
- package/Microsoft.ReactNative/CompositionSwitcher.idl +7 -0
- package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +8 -10
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +12 -2
- package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.cpp +100 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionAnnotationProvider.h +31 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +77 -11
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +43 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +7 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +86 -56
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +5 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +0 -4
- package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService.cpp +0 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +118 -63
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +133 -8
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +16 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +4 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +9 -1
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +34 -11
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +133 -135
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +9 -6
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +46 -49
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +6 -1
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +13 -8
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +146 -25
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +14 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +160 -12
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +6 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.cpp +47 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h +15 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.cpp +6 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputProps.h +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +7 -9
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +4 -1
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +5 -0
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +40 -36
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +68 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +11 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +70 -13
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +10 -2
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +5 -5
- package/Microsoft.ReactNative/Fabric/ImageRequestParams.cpp +26 -0
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +47 -8
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +10 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/CompositionAccessibilityProps.h +67 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +22 -4
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.h +15 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +20 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +5 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/MouseEvent.h +20 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +5 -8
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorParser.h +1 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +247 -45
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +15 -0
- package/Microsoft.ReactNative/Fabric/platform/react/threading/MessageQueueThreadImpl.cpp +39 -0
- package/Microsoft.ReactNative/Fabric/platform/react/threading/MessageQueueThreadImpl.h +54 -0
- package/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.cpp +126 -0
- package/Microsoft.ReactNative/Fabric/platform/react/threading/TaskDispatchThread.h +73 -0
- package/Microsoft.ReactNative/IReactContext.cpp +17 -0
- package/Microsoft.ReactNative/IReactContext.h +1 -0
- package/Microsoft.ReactNative/IReactContext.idl +18 -1
- package/Microsoft.ReactNative/IReactDispatcher.idl +1 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.cpp +12 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.h +2 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.idl +8 -0
- package/Microsoft.ReactNative/JsiApi.cpp +10 -2
- package/Microsoft.ReactNative/JsiApi.h +1 -0
- package/Microsoft.ReactNative/JsiApi.idl +1 -0
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +0 -3
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +2 -3
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +7 -12
- package/Microsoft.ReactNative/Modules/Animated/AnimationDriver.cpp +2 -1
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedModule.cpp +4 -8
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/ClipboardModule.cpp +6 -8
- package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +6 -15
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +13 -24
- package/Microsoft.ReactNative/QuirkSettings.cpp +0 -16
- package/Microsoft.ReactNative/QuirkSettings.h +0 -3
- package/Microsoft.ReactNative/ReactHost/ReactHost.cpp +11 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +78 -68
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -2
- package/Microsoft.ReactNative/ReactInstanceSettings.cpp +12 -0
- package/Microsoft.ReactNative/ReactInstanceSettings.h +2 -0
- package/Microsoft.ReactNative/ReactInstanceSettings.idl +6 -0
- package/Microsoft.ReactNative/ReactNativeIsland.idl +3 -0
- package/Microsoft.ReactNative/ReactSupport.cpp +44 -11
- package/Microsoft.ReactNative/RedBox.cpp +30 -1
- package/Microsoft.ReactNative/SchedulerSettings.cpp +4 -4
- package/Microsoft.ReactNative/SchedulerSettings.h +1 -1
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +30 -12
- package/Microsoft.ReactNative/Utils/ImageUtils.h +1 -0
- package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +37 -31
- package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.cpp +1 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/JSRuntimeApi.inc +2 -0
- package/Microsoft.ReactNative.Cxx/ApiLoaders/NodeApi_posix.cpp +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +94 -27
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +27 -6
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.cpp +45 -11
- package/Microsoft.ReactNative.Cxx/JSI/JsiApiContext.h +6 -0
- package/Microsoft.ReactNative.Cxx/JSI/decorator.h +220 -0
- package/Microsoft.ReactNative.Cxx/JSI/instrumentation.h +28 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi-inl.h +6 -0
- package/Microsoft.ReactNative.Cxx/JSI/jsi.cpp +241 -4
- package/Microsoft.ReactNative.Cxx/JSI/jsi.h +207 -19
- package/Microsoft.ReactNative.Cxx/JSValue.cpp +19 -3
- package/Microsoft.ReactNative.Cxx/JSValue.h +15 -7
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +2 -2
- package/Microsoft.ReactNative.Cxx/NativeModules.h +60 -2
- package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.cpp +1267 -614
- package/Microsoft.ReactNative.Cxx/NodeApiJsiRuntime.h +4 -2
- package/Microsoft.ReactNative.Cxx/ReactContext.h +7 -0
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.cpp +11 -13
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.h +2 -3
- package/Microsoft.ReactNative.Cxx/node-api/js_native_api.h +81 -20
- package/Microsoft.ReactNative.Cxx/node-api/js_native_api_types.h +47 -2
- package/Microsoft.ReactNative.Cxx/node-api/js_runtime_api.h +13 -0
- package/Microsoft.ReactNative.Cxx/stubs/glog/logging.h +1 -1
- package/Microsoft.ReactNative.Managed/ReactContext.cs +3 -1
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/React.Cpp.props +2 -1
- package/PropertySheets/WebView2.props +1 -1
- package/PropertySheets/WinUI.props +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jserrorhandler/JsErrorHandler.cpp +429 -0
- package/ReactCommon/cgmanifest.json +1 -1
- package/Shared/HermesRuntimeHolder.cpp +6 -0
- package/Shared/JSI/ChakraRuntime.cpp +4 -0
- package/Shared/JSI/ChakraRuntime.h +2 -0
- package/Shared/Modules/BlobModule.cpp +14 -16
- package/Shared/Modules/BlobModule.h +3 -1
- package/Shared/Networking/WinRTWebSocketResource.cpp +82 -101
- package/Shared/Networking/WinRTWebSocketResource.h +91 -7
- package/Shared/Shared.vcxitems +11 -7
- package/Shared/Shared.vcxitems.filters +6 -1
- package/Shared/TurboModuleManager.cpp +0 -15
- package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +6 -6
- package/codegen/react/components/rnwcore/AndroidSwitch.g.h +6 -6
- package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +6 -6
- package/codegen/react/components/rnwcore/InputAccessory.g.h +6 -6
- package/codegen/react/components/rnwcore/ModalHostView.g.h +11 -7
- package/codegen/react/components/rnwcore/Props.cpp +2 -1
- package/codegen/react/components/rnwcore/Props.h +1 -0
- package/codegen/react/components/rnwcore/PullToRefreshView.g.h +6 -6
- package/codegen/react/components/rnwcore/SafeAreaView.g.h +6 -6
- package/codegen/react/components/rnwcore/Switch.g.h +6 -6
- package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +6 -6
- package/index.windows.js +4 -2
- package/package.json +3 -4
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
- package/stubs/glog/logging.h +1 -1
- package/Microsoft.ReactNative/JSDispatcherWriter.h +0 -47
- package/Microsoft.ReactNative/SynchronousEventBeat.cpp +0 -51
- package/Microsoft.ReactNative/SynchronousEventBeat.h +0 -31
|
@@ -89,7 +89,6 @@ DispatchQueue GetCurrentOrSerialQueue() noexcept {
|
|
|
89
89
|
|
|
90
90
|
return queue;
|
|
91
91
|
}
|
|
92
|
-
|
|
93
92
|
} // namespace
|
|
94
93
|
|
|
95
94
|
namespace Microsoft::React::Networking {
|
|
@@ -104,7 +103,6 @@ WinRTWebSocketResource2::WinRTWebSocketResource2(
|
|
|
104
103
|
: m_socket{std::move(socket)},
|
|
105
104
|
m_writer(std::move(writer)),
|
|
106
105
|
m_readyState{ReadyState::Connecting},
|
|
107
|
-
m_connectPerformed{CreateEvent(/*attributes*/ nullptr, /*manual reset*/ true, /*state*/ false, /*name*/ nullptr)},
|
|
108
106
|
m_callingQueue{callingQueue} {
|
|
109
107
|
for (const auto &certException : certExceptions) {
|
|
110
108
|
m_socket.Control().IgnorableServerCertificateErrors().Append(certException);
|
|
@@ -221,125 +219,112 @@ void WinRTWebSocketResource2::OnClosed(IWebSocket const &sender, IWebSocketClose
|
|
|
221
219
|
|
|
222
220
|
fire_and_forget WinRTWebSocketResource2::PerformConnect(Uri &&uri) noexcept {
|
|
223
221
|
auto self = shared_from_this();
|
|
224
|
-
auto
|
|
222
|
+
auto movedUri = std::move(uri);
|
|
225
223
|
|
|
226
224
|
co_await resume_in_queue(self->m_backgroundQueue);
|
|
227
225
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
SetEvent(self->m_connectPerformed.get());
|
|
226
|
+
co_await self->m_sequencer.QueueTaskAsync(
|
|
227
|
+
[self = self->shared_from_this(), coUri = std::move(movedUri)]() -> IAsyncAction {
|
|
228
|
+
auto coSelf = self->shared_from_this();
|
|
229
|
+
|
|
230
|
+
auto async = coSelf->m_socket.ConnectAsync(coUri);
|
|
231
|
+
co_await lessthrow_await_adapter<IAsyncAction>{async};
|
|
232
|
+
|
|
233
|
+
auto result = async.ErrorCode();
|
|
234
|
+
try {
|
|
235
|
+
if (result >= 0) { // Non-failing HRESULT
|
|
236
|
+
coSelf->m_readyState = ReadyState::Open;
|
|
237
|
+
|
|
238
|
+
co_await resume_in_queue(coSelf->m_callingQueue);
|
|
239
|
+
if (coSelf->m_connectHandler) {
|
|
240
|
+
coSelf->m_connectHandler();
|
|
241
|
+
}
|
|
242
|
+
} else {
|
|
243
|
+
coSelf->Fail(std::move(result), ErrorType::Connection);
|
|
244
|
+
}
|
|
245
|
+
} catch (hresult_error const &e) {
|
|
246
|
+
coSelf->Fail(e, ErrorType::Connection);
|
|
247
|
+
} catch (std::exception const &e) {
|
|
248
|
+
coSelf->Fail(e.what(), ErrorType::Connection);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
254
251
|
}
|
|
255
252
|
|
|
256
253
|
fire_and_forget WinRTWebSocketResource2::PerformClose() noexcept {
|
|
257
254
|
auto self = shared_from_this();
|
|
258
255
|
|
|
259
|
-
co_await resume_on_signal(self->m_connectPerformed.get());
|
|
260
|
-
|
|
261
256
|
co_await resume_in_queue(self->m_backgroundQueue);
|
|
262
257
|
|
|
263
|
-
|
|
264
|
-
|
|
258
|
+
co_await self->m_sequencer.QueueTaskAsync([self = self->shared_from_this()]() -> IAsyncAction {
|
|
259
|
+
auto coSelf = self->shared_from_this();
|
|
265
260
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
261
|
+
try {
|
|
262
|
+
coSelf->m_socket.Close(static_cast<uint16_t>(coSelf->m_closeCode), winrt::to_hstring(coSelf->m_closeReason));
|
|
263
|
+
coSelf->m_readyState = ReadyState::Closing;
|
|
264
|
+
} catch (winrt::hresult_invalid_argument const &e) {
|
|
265
|
+
coSelf->Fail(e, ErrorType::Close);
|
|
266
|
+
} catch (hresult_error const &e) {
|
|
267
|
+
coSelf->Fail(e, ErrorType::Close);
|
|
268
|
+
} catch (const std::exception &e) {
|
|
269
|
+
coSelf->Fail(e.what(), ErrorType::Close);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
co_return;
|
|
273
|
+
});
|
|
276
274
|
}
|
|
277
275
|
|
|
278
|
-
fire_and_forget WinRTWebSocketResource2::
|
|
276
|
+
fire_and_forget WinRTWebSocketResource2::EnqueueWrite(string &&message, bool isBinary) noexcept {
|
|
279
277
|
auto self = shared_from_this();
|
|
280
278
|
string coMessage = std::move(message);
|
|
281
279
|
|
|
282
|
-
co_await resume_in_queue(self->m_backgroundQueue); // Ensure writes happen sequentially
|
|
283
|
-
self->m_outgoingMessages.emplace(std::move(coMessage), isBinary);
|
|
284
|
-
|
|
285
|
-
co_await resume_on_signal(self->m_connectPerformed.get());
|
|
286
|
-
|
|
287
280
|
co_await resume_in_queue(self->m_backgroundQueue);
|
|
288
281
|
|
|
289
|
-
co_await self->
|
|
290
|
-
|
|
282
|
+
co_await self->m_sequencer.QueueTaskAsync(
|
|
283
|
+
[self = self->shared_from_this(), message = std::move(coMessage), isBinary]() -> IAsyncAction {
|
|
284
|
+
auto coSelf = self->shared_from_this();
|
|
285
|
+
auto coMessage = std::move(message);
|
|
291
286
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
co_await resume_in_queue(m_backgroundQueue);
|
|
287
|
+
co_await coSelf->PerformWrite(std::move(coMessage), isBinary);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
296
290
|
|
|
291
|
+
IAsyncAction WinRTWebSocketResource2::PerformWrite(string &&message, bool isBinary) noexcept {
|
|
297
292
|
auto self = shared_from_this();
|
|
298
293
|
|
|
299
|
-
|
|
300
|
-
if (
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
size_t length = 0;
|
|
305
|
-
string messageLocal;
|
|
306
|
-
bool isBinaryLocal;
|
|
307
|
-
try {
|
|
308
|
-
std::tie(messageLocal, isBinaryLocal) = self->m_outgoingMessages.front();
|
|
309
|
-
self->m_outgoingMessages.pop();
|
|
310
|
-
if (isBinaryLocal) {
|
|
311
|
-
self->m_socket.Control().MessageType(SocketMessageType::Binary);
|
|
312
|
-
|
|
313
|
-
auto buffer = CryptographicBuffer::DecodeFromBase64String(winrt::to_hstring(messageLocal));
|
|
314
|
-
if (buffer) {
|
|
315
|
-
length = buffer.Length();
|
|
316
|
-
self->m_writer.WriteBuffer(buffer);
|
|
317
|
-
}
|
|
318
|
-
} else {
|
|
319
|
-
self->m_socket.Control().MessageType(SocketMessageType::Utf8);
|
|
294
|
+
try {
|
|
295
|
+
if (isBinary) {
|
|
296
|
+
self->m_socket.Control().MessageType(SocketMessageType::Binary);
|
|
320
297
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
CheckedReinterpretCast<const uint8_t *>(messageLocal.c_str()) + messageLocal.length());
|
|
325
|
-
self->m_writer.WriteBytes(view);
|
|
298
|
+
auto buffer = CryptographicBuffer::DecodeFromBase64String(winrt::to_hstring(message));
|
|
299
|
+
if (buffer) {
|
|
300
|
+
self->m_writer.WriteBuffer(buffer);
|
|
326
301
|
}
|
|
327
|
-
}
|
|
328
|
-
self->
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
302
|
+
} else {
|
|
303
|
+
self->m_socket.Control().MessageType(SocketMessageType::Utf8);
|
|
304
|
+
|
|
305
|
+
winrt::array_view<const uint8_t> view(
|
|
306
|
+
CheckedReinterpretCast<const uint8_t *>(message.c_str()),
|
|
307
|
+
CheckedReinterpretCast<const uint8_t *>(message.c_str()) + message.length());
|
|
308
|
+
self->m_writer.WriteBytes(view);
|
|
333
309
|
}
|
|
310
|
+
} catch (hresult_error const &e) { // TODO: Remove after fixing unit tests exceptions.
|
|
311
|
+
self->Fail(e, ErrorType::Send);
|
|
312
|
+
} catch (const std::exception &e) {
|
|
313
|
+
self->Fail(e.what(), ErrorType::Send);
|
|
314
|
+
}
|
|
334
315
|
|
|
335
|
-
|
|
336
|
-
|
|
316
|
+
co_await resume_in_queue(self->m_backgroundQueue);
|
|
317
|
+
// If an exception occurred, abort write process.
|
|
318
|
+
if (self->m_readyState != ReadyState::Open) {
|
|
319
|
+
co_return;
|
|
320
|
+
}
|
|
337
321
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
322
|
+
auto async = self->m_writer.StoreAsync();
|
|
323
|
+
co_await lessthrow_await_adapter<DataWriterStoreOperation>{async};
|
|
324
|
+
|
|
325
|
+
auto result = async.ErrorCode();
|
|
326
|
+
if (result < 0) {
|
|
327
|
+
self->Fail(std::move(result), ErrorType::Send);
|
|
343
328
|
}
|
|
344
329
|
}
|
|
345
330
|
|
|
@@ -393,11 +378,7 @@ void WinRTWebSocketResource2::Connect(string &&url, const Protocols &protocols,
|
|
|
393
378
|
m_socket.SetRequestHeader(L"Origin", std::move(origin));
|
|
394
379
|
}
|
|
395
380
|
} catch (hresult_error const &e) {
|
|
396
|
-
Fail(e, ErrorType::Connection);
|
|
397
|
-
|
|
398
|
-
SetEvent(m_connectPerformed.get());
|
|
399
|
-
|
|
400
|
-
return;
|
|
381
|
+
return Fail(e, ErrorType::Connection);
|
|
401
382
|
}
|
|
402
383
|
|
|
403
384
|
PerformConnect(std::move(uri));
|
|
@@ -406,11 +387,11 @@ void WinRTWebSocketResource2::Connect(string &&url, const Protocols &protocols,
|
|
|
406
387
|
void WinRTWebSocketResource2::Ping() noexcept {}
|
|
407
388
|
|
|
408
389
|
void WinRTWebSocketResource2::Send(string &&message) noexcept {
|
|
409
|
-
|
|
390
|
+
EnqueueWrite(std::move(message), false);
|
|
410
391
|
}
|
|
411
392
|
|
|
412
393
|
void WinRTWebSocketResource2::SendBinary(string &&base64String) noexcept {
|
|
413
|
-
|
|
394
|
+
EnqueueWrite(std::move(base64String), true);
|
|
414
395
|
}
|
|
415
396
|
|
|
416
397
|
void WinRTWebSocketResource2::Close(CloseCode code, const string &reason) noexcept {
|
|
@@ -18,17 +18,101 @@ namespace Microsoft::React::Networking {
|
|
|
18
18
|
|
|
19
19
|
class WinRTWebSocketResource2 : public IWebSocketResource,
|
|
20
20
|
public std::enable_shared_from_this<WinRTWebSocketResource2> {
|
|
21
|
-
winrt::Windows::Networking::Sockets::IMessageWebSocket m_socket;
|
|
22
|
-
|
|
23
21
|
///
|
|
24
|
-
//
|
|
22
|
+
// See https://devblogs.microsoft.com/oldnewthing/20250328-00/?p=111016
|
|
25
23
|
///
|
|
26
|
-
|
|
24
|
+
struct TaskSequencer {
|
|
25
|
+
TaskSequencer() = default;
|
|
26
|
+
TaskSequencer(const TaskSequencer &) = delete;
|
|
27
|
+
void operator=(const TaskSequencer &) = delete;
|
|
28
|
+
|
|
29
|
+
private:
|
|
30
|
+
using CoroHandle = std::experimental::coroutine_handle<>;
|
|
31
|
+
|
|
32
|
+
struct Suspender {
|
|
33
|
+
CoroHandle m_handle;
|
|
34
|
+
|
|
35
|
+
bool await_ready() const noexcept {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
void await_suspend(CoroHandle h) noexcept {
|
|
40
|
+
m_handle = h;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
void await_resume() const noexcept {}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
static void *Completed() {
|
|
47
|
+
return reinterpret_cast<void *>(1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
struct ChainedTask {
|
|
51
|
+
private:
|
|
52
|
+
std::atomic<void *> m_next;
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
ChainedTask(void *state = nullptr) : m_next(state) {}
|
|
56
|
+
|
|
57
|
+
void ContinueWith(CoroHandle h) {
|
|
58
|
+
if (m_next.exchange(h.address(), std::memory_order_acquire) != nullptr) {
|
|
59
|
+
h();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
void Complete() {
|
|
64
|
+
auto resumeAddress = m_next.exchange(Completed());
|
|
65
|
+
if (resumeAddress) {
|
|
66
|
+
CoroHandle::from_address(resumeAddress).resume();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
27
70
|
|
|
71
|
+
struct Completer {
|
|
72
|
+
std::shared_ptr<ChainedTask> m_chain;
|
|
73
|
+
|
|
74
|
+
~Completer() {
|
|
75
|
+
m_chain->Complete();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
winrt::slim_mutex m_mutex;
|
|
80
|
+
std::shared_ptr<ChainedTask> m_latest = std::make_shared<ChainedTask>(Completed());
|
|
81
|
+
|
|
82
|
+
public:
|
|
83
|
+
template <typename Maker>
|
|
84
|
+
auto QueueTaskAsync(Maker &&maker) -> decltype(maker()) {
|
|
85
|
+
auto node = std::make_shared<ChainedTask>();
|
|
86
|
+
Suspender suspend;
|
|
87
|
+
|
|
88
|
+
using Async = decltype(maker());
|
|
89
|
+
auto task = [&node, &suspend, &maker]() -> Async {
|
|
90
|
+
Completer completer{node};
|
|
91
|
+
auto localMaker = std::forward<Maker>(maker);
|
|
92
|
+
auto context = winrt::apartment_context();
|
|
93
|
+
|
|
94
|
+
co_await suspend;
|
|
95
|
+
co_await context;
|
|
96
|
+
|
|
97
|
+
co_return co_await localMaker();
|
|
98
|
+
}();
|
|
99
|
+
|
|
100
|
+
{
|
|
101
|
+
winrt::slim_lock_guard guard(m_mutex);
|
|
102
|
+
m_latest.swap(node);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
node->ContinueWith(suspend.m_handle);
|
|
106
|
+
|
|
107
|
+
return task;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
winrt::Windows::Networking::Sockets::IMessageWebSocket m_socket;
|
|
28
112
|
ReadyState m_readyState;
|
|
113
|
+
TaskSequencer m_sequencer;
|
|
29
114
|
Mso::DispatchQueue m_callingQueue;
|
|
30
115
|
Mso::DispatchQueue m_backgroundQueue;
|
|
31
|
-
std::queue<std::pair<std::string, bool>> m_outgoingMessages;
|
|
32
116
|
CloseCode m_closeCode{CloseCode::Normal};
|
|
33
117
|
std::string m_closeReason;
|
|
34
118
|
|
|
@@ -52,9 +136,9 @@ class WinRTWebSocketResource2 : public IWebSocketResource,
|
|
|
52
136
|
winrt::Windows::Networking::Sockets::IWebSocketClosedEventArgs const &args);
|
|
53
137
|
|
|
54
138
|
winrt::fire_and_forget PerformConnect(winrt::Windows::Foundation::Uri &&uri) noexcept;
|
|
55
|
-
winrt::fire_and_forget
|
|
139
|
+
winrt::fire_and_forget EnqueueWrite(std::string &&message, bool isBinary) noexcept;
|
|
140
|
+
winrt::Windows::Foundation::IAsyncAction PerformWrite(std::string &&message, bool isBinary) noexcept;
|
|
56
141
|
winrt::fire_and_forget PerformClose() noexcept;
|
|
57
|
-
winrt::Windows::Foundation::IAsyncAction SendPendingMessages() noexcept;
|
|
58
142
|
|
|
59
143
|
WinRTWebSocketResource2(
|
|
60
144
|
winrt::Windows::Networking::Sockets::IMessageWebSocket &&socket,
|
package/Shared/Shared.vcxitems
CHANGED
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
36
36
|
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\Composition.Input.idl</DependentUpon>
|
|
37
37
|
</ClCompile>
|
|
38
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionAnnotationProvider.cpp">
|
|
39
|
+
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
40
|
+
</ClCompile>
|
|
38
41
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionContextHelper.cpp">
|
|
39
42
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
40
43
|
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\CompositionContext.idl</DependentUpon>
|
|
@@ -222,11 +225,11 @@
|
|
|
222
225
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\WindowsImageManager.cpp">
|
|
223
226
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
224
227
|
</ClCompile>
|
|
225
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\
|
|
226
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\AsynchronousEventBeat.cpp">
|
|
228
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\ImageRequestParams.cpp">
|
|
227
229
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
228
230
|
</ClCompile>
|
|
229
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\
|
|
231
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\SchedulerSettings.cpp"/>
|
|
232
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\AsynchronousEventBeat.cpp">
|
|
230
233
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
231
234
|
</ClCompile>
|
|
232
235
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\ReactNativeWin32App.cpp">
|
|
@@ -339,6 +342,7 @@
|
|
|
339
342
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\JsiApi.h">
|
|
340
343
|
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\JsiApi.idl</DependentUpon>
|
|
341
344
|
</ClInclude>
|
|
345
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\CallInvoker.cpp"/>
|
|
342
346
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\SchedulerSettings.h" />
|
|
343
347
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\ReactNativeWin32App.h">
|
|
344
348
|
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
|
|
@@ -398,7 +402,7 @@
|
|
|
398
402
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IReactDispatcher.cpp">
|
|
399
403
|
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IReactDispatcher.idl</DependentUpon>
|
|
400
404
|
</ClCompile>
|
|
401
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\
|
|
405
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\CallInvokerWriter.cpp">
|
|
402
406
|
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IJSValueWriter.idl</DependentUpon>
|
|
403
407
|
</ClCompile>
|
|
404
408
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Timer.cpp">
|
|
@@ -555,8 +559,7 @@
|
|
|
555
559
|
</ItemGroup>
|
|
556
560
|
<ItemGroup Condition="'$(UseFabric)' == 'true'">
|
|
557
561
|
<CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\defaults\DefaultTurboModules.cpp" />
|
|
558
|
-
|
|
559
|
-
<!-- <CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\microtasks\NativeMicrotasks.cpp" /> -->
|
|
562
|
+
<CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\microtasks\NativeMicrotasks.cpp" />
|
|
560
563
|
<CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\featureflags\NativeReactNativeFeatureFlags.cpp" />
|
|
561
564
|
<CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\dom\NativeDOM.cpp" DisableSpecificWarnings="4715;%(DisableSpecificWarnings)" />
|
|
562
565
|
<CLCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\idlecallbacks\NativeIdleCallbacks.cpp" />
|
|
@@ -648,7 +651,6 @@
|
|
|
648
651
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\observers\events\EventPerformanceLogger.cpp" />
|
|
649
652
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\scheduler\Scheduler.cpp" />
|
|
650
653
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\scheduler\SurfaceHandler.cpp" />
|
|
651
|
-
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\scheduler\SurfaceManager.cpp" />
|
|
652
654
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\telemetry\SurfaceTelemetry.cpp" />
|
|
653
655
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\telemetry\TransactionTelemetry.cpp" />
|
|
654
656
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\textlayoutmanager\TextMeasureCache.cpp" />
|
|
@@ -671,6 +673,8 @@
|
|
|
671
673
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jserrorhandler\JsErrorHandler.cpp" />
|
|
672
674
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jserrorhandler\StackTraceParser.cpp" />
|
|
673
675
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\componentregistry\native\NativeComponentRegistryBinding.cpp" />
|
|
676
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\platform\react\threading\MessageQueueThreadImpl.cpp" />
|
|
677
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\platform\react\threading\TaskDispatchThread.cpp" />
|
|
674
678
|
</ItemGroup>
|
|
675
679
|
<ItemGroup>
|
|
676
680
|
<Midl Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\HttpSettings.idl" />
|
|
@@ -215,6 +215,9 @@
|
|
|
215
215
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextRangeProvider.cpp">
|
|
216
216
|
<Filter>Source Files\Fabric\Composition</Filter>
|
|
217
217
|
</ClCompile>
|
|
218
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionAnnotationProvider.cpp">
|
|
219
|
+
<Filter>Source Files\Fabric\Composition</Filter>
|
|
220
|
+
</ClCompile>
|
|
218
221
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\ReactNativeIsland.cpp">
|
|
219
222
|
<Filter>Source Files\Fabric\Composition</Filter>
|
|
220
223
|
</ClCompile>
|
|
@@ -283,7 +286,6 @@
|
|
|
283
286
|
<Filter>Source Files\Modules</Filter>
|
|
284
287
|
</ClCompile>
|
|
285
288
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\AsynchronousEventBeat.cpp" />
|
|
286
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\SynchronousEventBeat.cpp" />
|
|
287
289
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\RuntimeScheduler.cpp" />
|
|
288
290
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\RuntimeScheduler_Legacy.cpp" />
|
|
289
291
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\RuntimeScheduler_Modern.cpp" />
|
|
@@ -338,6 +340,9 @@
|
|
|
338
340
|
<ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\tracing\PerformanceTracer.cpp" />
|
|
339
341
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextProvider.cpp" />
|
|
340
342
|
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionTextRangeProvider.cpp" />
|
|
343
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\Composition\CompositionAnnotationProvider.cpp" />
|
|
344
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\ImageRequestParams.cpp" />
|
|
345
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\CallInvoker.cpp" />
|
|
341
346
|
</ItemGroup>
|
|
342
347
|
<ItemGroup>
|
|
343
348
|
<Filter Include="Source Files">
|
|
@@ -11,21 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
namespace facebook::react {
|
|
13
13
|
|
|
14
|
-
#ifdef USE_FABRIC
|
|
15
|
-
|
|
16
|
-
NativeMicrotasks::NativeMicrotasks(std::shared_ptr<CallInvoker> jsInvoker)
|
|
17
|
-
: NativeMicrotasksCxxSpec(std::move(jsInvoker)) {}
|
|
18
|
-
|
|
19
|
-
void NativeMicrotasks::queueMicrotask(jsi::Runtime &runtime, jsi::Function callback) {
|
|
20
|
-
assert(false);
|
|
21
|
-
// Currently using a version of hermes/jsi without queueMicrotask
|
|
22
|
-
// When we update JSI we can remove all the Microtask code from here, and just rely on the implementation of
|
|
23
|
-
// the NativeMicrotasks TurboModule from the core NativeMicrotasks.cpp file
|
|
24
|
-
// runtime.queueMicrotask(callback);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
#endif
|
|
28
|
-
|
|
29
14
|
TurboModuleManager::TurboModuleManager(
|
|
30
15
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry,
|
|
31
16
|
std::shared_ptr<CallInvoker> callInvoker)
|
|
@@ -153,7 +153,7 @@ void RegisterActivityIndicatorViewNativeComponent(
|
|
|
153
153
|
userData->UpdateEventEmitter(std::make_shared<ActivityIndicatorViewEventEmitter>(eventEmitter));
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
if
|
|
156
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseActivityIndicatorView<TUserData>::FinalizeUpdate) {
|
|
157
157
|
builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
158
158
|
winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept {
|
|
159
159
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -161,7 +161,7 @@ void RegisterActivityIndicatorViewNativeComponent(
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
if
|
|
164
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseActivityIndicatorView<TUserData>::UpdateState) {
|
|
165
165
|
builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
166
166
|
const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
|
|
167
167
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -169,7 +169,7 @@ void RegisterActivityIndicatorViewNativeComponent(
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
if
|
|
172
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseActivityIndicatorView<TUserData>::MountChildComponentView) {
|
|
173
173
|
builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
174
174
|
const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept {
|
|
175
175
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -177,7 +177,7 @@ void RegisterActivityIndicatorViewNativeComponent(
|
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
if
|
|
180
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseActivityIndicatorView<TUserData>::UnmountChildComponentView) {
|
|
181
181
|
builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
182
182
|
const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept {
|
|
183
183
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -187,13 +187,13 @@ void RegisterActivityIndicatorViewNativeComponent(
|
|
|
187
187
|
|
|
188
188
|
compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
189
189
|
auto userData = winrt::make_self<TUserData>();
|
|
190
|
-
if
|
|
190
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseActivityIndicatorView<TUserData>::Initialize) {
|
|
191
191
|
userData->Initialize(view);
|
|
192
192
|
}
|
|
193
193
|
view.UserData(*userData);
|
|
194
194
|
});
|
|
195
195
|
|
|
196
|
-
if
|
|
196
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseActivityIndicatorView<TUserData>::CreateVisual) {
|
|
197
197
|
compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
198
198
|
auto userData = view.UserData().as<TUserData>();
|
|
199
199
|
return userData->CreateVisual(view);
|
|
@@ -230,7 +230,7 @@ void RegisterAndroidDrawerLayoutNativeComponent(
|
|
|
230
230
|
userData->UpdateEventEmitter(std::make_shared<AndroidDrawerLayoutEventEmitter>(eventEmitter));
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
if
|
|
233
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseAndroidDrawerLayout<TUserData>::FinalizeUpdate) {
|
|
234
234
|
builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
235
235
|
winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept {
|
|
236
236
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -238,7 +238,7 @@ void RegisterAndroidDrawerLayoutNativeComponent(
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
if
|
|
241
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseAndroidDrawerLayout<TUserData>::UpdateState) {
|
|
242
242
|
builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
243
243
|
const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
|
|
244
244
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -252,7 +252,7 @@ void RegisterAndroidDrawerLayoutNativeComponent(
|
|
|
252
252
|
userData->HandleCommand(view, args);
|
|
253
253
|
});
|
|
254
254
|
|
|
255
|
-
if
|
|
255
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseAndroidDrawerLayout<TUserData>::MountChildComponentView) {
|
|
256
256
|
builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
257
257
|
const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept {
|
|
258
258
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -260,7 +260,7 @@ void RegisterAndroidDrawerLayoutNativeComponent(
|
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
if
|
|
263
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseAndroidDrawerLayout<TUserData>::UnmountChildComponentView) {
|
|
264
264
|
builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
265
265
|
const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept {
|
|
266
266
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -270,13 +270,13 @@ void RegisterAndroidDrawerLayoutNativeComponent(
|
|
|
270
270
|
|
|
271
271
|
compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
272
272
|
auto userData = winrt::make_self<TUserData>();
|
|
273
|
-
if
|
|
273
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseAndroidDrawerLayout<TUserData>::Initialize) {
|
|
274
274
|
userData->Initialize(view);
|
|
275
275
|
}
|
|
276
276
|
view.UserData(*userData);
|
|
277
277
|
});
|
|
278
278
|
|
|
279
|
-
if
|
|
279
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseAndroidDrawerLayout<TUserData>::CreateVisual) {
|
|
280
280
|
compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
281
281
|
auto userData = view.UserData().as<TUserData>();
|
|
282
282
|
return userData->CreateVisual(view);
|
|
@@ -141,7 +141,7 @@ void RegisterAndroidHorizontalScrollContentViewNativeComponent(
|
|
|
141
141
|
userData->UpdateEventEmitter(std::make_shared<AndroidHorizontalScrollContentViewEventEmitter>(eventEmitter));
|
|
142
142
|
});
|
|
143
143
|
|
|
144
|
-
if
|
|
144
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseAndroidHorizontalScrollContentView<TUserData>::FinalizeUpdate) {
|
|
145
145
|
builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
146
146
|
winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept {
|
|
147
147
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -149,7 +149,7 @@ void RegisterAndroidHorizontalScrollContentViewNativeComponent(
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
if
|
|
152
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseAndroidHorizontalScrollContentView<TUserData>::UpdateState) {
|
|
153
153
|
builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
154
154
|
const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
|
|
155
155
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -157,7 +157,7 @@ void RegisterAndroidHorizontalScrollContentViewNativeComponent(
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
if
|
|
160
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseAndroidHorizontalScrollContentView<TUserData>::MountChildComponentView) {
|
|
161
161
|
builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
162
162
|
const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept {
|
|
163
163
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -165,7 +165,7 @@ void RegisterAndroidHorizontalScrollContentViewNativeComponent(
|
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
if
|
|
168
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseAndroidHorizontalScrollContentView<TUserData>::UnmountChildComponentView) {
|
|
169
169
|
builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
|
|
170
170
|
const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept {
|
|
171
171
|
auto userData = view.UserData().as<TUserData>();
|
|
@@ -175,13 +175,13 @@ void RegisterAndroidHorizontalScrollContentViewNativeComponent(
|
|
|
175
175
|
|
|
176
176
|
compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
177
177
|
auto userData = winrt::make_self<TUserData>();
|
|
178
|
-
if
|
|
178
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseAndroidHorizontalScrollContentView<TUserData>::Initialize) {
|
|
179
179
|
userData->Initialize(view);
|
|
180
180
|
}
|
|
181
181
|
view.UserData(*userData);
|
|
182
182
|
});
|
|
183
183
|
|
|
184
|
-
if
|
|
184
|
+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseAndroidHorizontalScrollContentView<TUserData>::CreateVisual) {
|
|
185
185
|
compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
|
|
186
186
|
auto userData = view.UserData().as<TUserData>();
|
|
187
187
|
return userData->CreateVisual(view);
|