react-native-windows 0.81.38 → 0.81.40
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/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +6 -4
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +6 -4
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +17 -15
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +0 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +60 -5
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +3 -0
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +2 -2
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/React.Cpp.props +0 -1
- package/Shared/Networking/WinRTWebSocketResource.h +1 -5
- package/Shared/OInstance.cpp +13 -8
- package/external/folly/folly.vcxitems +10 -0
- package/package.json +4 -4
|
@@ -1816,7 +1816,7 @@ struct CompActivityVisual : winrt::implements<
|
|
|
1816
1816
|
auto innerBrush = TTypeRedirects::CompositionContextHelper::InnerBrush(brush);
|
|
1817
1817
|
if (brush) {
|
|
1818
1818
|
_themeProperties.InsertVector4(
|
|
1819
|
-
L"Foreground", ColorAsVector4(innerBrush.as<TTypeRedirects::CompositionColorBrush>().Color()));
|
|
1819
|
+
L"Foreground", ColorAsVector4(innerBrush.template as<TTypeRedirects::CompositionColorBrush>().Color()));
|
|
1820
1820
|
} else {
|
|
1821
1821
|
_themeProperties.InsertVector4(L"Foreground", ColorAsVector4({0, 0, 0, 0}));
|
|
1822
1822
|
}
|
|
@@ -367,7 +367,8 @@ void ComponentView::FinalizeUpdates(winrt::Microsoft::ReactNative::ComponentView
|
|
|
367
367
|
void ComponentView::onLostFocus(
|
|
368
368
|
const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept {
|
|
369
369
|
if (args.OriginalSource() == Tag()) {
|
|
370
|
-
m_eventEmitter
|
|
370
|
+
if (m_eventEmitter)
|
|
371
|
+
m_eventEmitter->onBlur();
|
|
371
372
|
|
|
372
373
|
if (m_componentHostingFocusVisual) {
|
|
373
374
|
auto s = get_strong();
|
|
@@ -415,7 +416,8 @@ winrt::com_ptr<ComponentView> ComponentView::focusVisualRoot(const facebook::rea
|
|
|
415
416
|
void ComponentView::onGotFocus(
|
|
416
417
|
const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept {
|
|
417
418
|
if (args.OriginalSource() == Tag()) {
|
|
418
|
-
m_eventEmitter
|
|
419
|
+
if (m_eventEmitter)
|
|
420
|
+
m_eventEmitter->onFocus();
|
|
419
421
|
if (viewProps()->enableFocusRing &&
|
|
420
422
|
rootComponentView()->focusState() == winrt::Microsoft::ReactNative::FocusState::Keyboard) {
|
|
421
423
|
facebook::react::Rect focusRect = m_layoutMetrics.frame;
|
|
@@ -1376,7 +1378,7 @@ void ViewComponentView::OnKeyDown(
|
|
|
1376
1378
|
((args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::RightWindows) &
|
|
1377
1379
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down);
|
|
1378
1380
|
|
|
1379
|
-
if (args.OriginalSource() == Tag() && !args.Handled()) {
|
|
1381
|
+
if (m_eventEmitter && args.OriginalSource() == Tag() && !args.Handled()) {
|
|
1380
1382
|
facebook::react::KeyEvent event;
|
|
1381
1383
|
event.shiftKey = fShift;
|
|
1382
1384
|
event.ctrlKey = fCtrl;
|
|
@@ -1423,7 +1425,7 @@ void ViewComponentView::OnKeyUp(
|
|
|
1423
1425
|
((args.KeyboardSource().GetKeyState(winrt::Windows::System::VirtualKey::RightWindows) &
|
|
1424
1426
|
winrt::Microsoft::UI::Input::VirtualKeyStates::Down) == winrt::Microsoft::UI::Input::VirtualKeyStates::Down);
|
|
1425
1427
|
|
|
1426
|
-
if (args.OriginalSource() == Tag()) {
|
|
1428
|
+
if (m_eventEmitter && args.OriginalSource() == Tag()) {
|
|
1427
1429
|
facebook::react::KeyEvent event;
|
|
1428
1430
|
event.shiftKey = fShift;
|
|
1429
1431
|
event.ctrlKey = fCtrl;
|
package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp
CHANGED
|
@@ -77,10 +77,12 @@ struct ModalHostView : public winrt::implements<ModalHostView, winrt::Windows::F
|
|
|
77
77
|
const winrt::Microsoft::ReactNative::Composition::PortalComponentView &portalComponentView) noexcept {
|
|
78
78
|
m_reactContext = portalComponentView.ReactContext();
|
|
79
79
|
|
|
80
|
-
portalComponentView.Mounted(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
portalComponentView.Mounted([](const auto & /*sender*/, const auto &view) {
|
|
81
|
+
view.UserData().template as<ModalHostView>()->OnMounted(view);
|
|
82
|
+
});
|
|
83
|
+
portalComponentView.Unmounted([](const auto & /*sender*/, const auto &view) {
|
|
84
|
+
view.UserData().template as<ModalHostView>()->OnUnmounted(view);
|
|
85
|
+
});
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
void UpdateProps(
|
|
@@ -354,7 +354,8 @@ void ParagraphComponentView::updateVisualBrush() noexcept {
|
|
|
354
354
|
DWRITE_TEXT_METRICS metrics;
|
|
355
355
|
winrt::check_hresult(m_textLayout->GetMetrics(&metrics));
|
|
356
356
|
|
|
357
|
-
if (metrics.width == 0 || metrics.height == 0
|
|
357
|
+
if (metrics.width == 0 || metrics.height == 0 || m_layoutMetrics.frame.size.width == 0 ||
|
|
358
|
+
m_layoutMetrics.frame.size.height == 0) {
|
|
358
359
|
m_drawingSurface = nullptr;
|
|
359
360
|
return;
|
|
360
361
|
}
|
package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp
CHANGED
|
@@ -85,7 +85,7 @@ static PCreateTextServices g_pfnCreateTextServices;
|
|
|
85
85
|
HRESULT HrEnsureRichEd20Loaded() noexcept {
|
|
86
86
|
HRESULT hr = S_OK;
|
|
87
87
|
std::call_once(g_richEditLoadedFlag, [&hr]() {
|
|
88
|
-
g_hInstRichEdit =
|
|
88
|
+
g_hInstRichEdit = LoadLibraryExW(L"Msftedit.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
|
89
89
|
if (!g_hInstRichEdit) {
|
|
90
90
|
hr = E_FAIL;
|
|
91
91
|
return;
|
|
@@ -1146,21 +1146,23 @@ void WindowsTextInputComponentView::OnCharacterReceived(
|
|
|
1146
1146
|
return;
|
|
1147
1147
|
}
|
|
1148
1148
|
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1149
|
+
if (m_eventEmitter) {
|
|
1150
|
+
// convert keyCode to std::string
|
|
1151
|
+
wchar_t key[2] = L" ";
|
|
1152
|
+
key[0] = static_cast<wchar_t>(args.KeyCode());
|
|
1153
|
+
std::string keyString = ::Microsoft::Common::Unicode::Utf16ToUtf8(key, 1);
|
|
1154
|
+
// Call onKeyPress event
|
|
1155
|
+
auto emitter = std::static_pointer_cast<const facebook::react::WindowsTextInputEventEmitter>(m_eventEmitter);
|
|
1156
|
+
facebook::react::WindowsTextInputEventEmitter::OnKeyPress onKeyPressArgs;
|
|
1157
|
+
if (keyString.compare("\r") == 0) {
|
|
1158
|
+
onKeyPressArgs.key = "Enter";
|
|
1159
|
+
} else if (keyString.compare("\b") == 0) {
|
|
1160
|
+
onKeyPressArgs.key = "Backspace";
|
|
1161
|
+
} else {
|
|
1162
|
+
onKeyPressArgs.key = keyString;
|
|
1163
|
+
}
|
|
1164
|
+
emitter->onKeyPress(onKeyPressArgs);
|
|
1162
1165
|
}
|
|
1163
|
-
emitter->onKeyPress(onKeyPressArgs);
|
|
1164
1166
|
|
|
1165
1167
|
WPARAM wParam = static_cast<WPARAM>(args.KeyCode());
|
|
1166
1168
|
|
|
@@ -97,7 +97,6 @@
|
|
|
97
97
|
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
|
|
98
98
|
<WarningLevel>Level4</WarningLevel>
|
|
99
99
|
<AdditionalOptions>%(AdditionalOptions) /bigobj /ZH:SHA_256</AdditionalOptions>
|
|
100
|
-
<AdditionalOptions Condition="'$(PlatformToolsetVersion)' != '' And $(PlatformToolsetVersion)<145">%(AdditionalOptions) /await</AdditionalOptions>
|
|
101
100
|
<AdditionalIncludeDirectories>
|
|
102
101
|
$(ExternalDir)fmt\include;
|
|
103
102
|
$(ReactNativeWindowsDir)Microsoft.ReactNative;
|
|
@@ -149,6 +149,35 @@ struct LoadedCallbackGuard {
|
|
|
149
149
|
Mso::CntPtr<ReactInstanceWin> m_reactInstance;
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
+
//=============================================================================================
|
|
153
|
+
// InitTaskGuard fails the load if an initialization task is destroyed without running.
|
|
154
|
+
// It reports the failure in the native queue. ReactHost's load action stays pending until then,
|
|
155
|
+
// so ReactHost cannot be released while the instance reports the error to it.
|
|
156
|
+
//=============================================================================================
|
|
157
|
+
|
|
158
|
+
struct InitTaskGuard {
|
|
159
|
+
InitTaskGuard(ReactInstanceWin &reactInstance) noexcept : m_reactInstance{&reactInstance} {}
|
|
160
|
+
|
|
161
|
+
InitTaskGuard(const InitTaskGuard &other) = delete;
|
|
162
|
+
InitTaskGuard &operator=(const InitTaskGuard &other) = delete;
|
|
163
|
+
|
|
164
|
+
void Dismiss() noexcept {
|
|
165
|
+
m_reactInstance = nullptr;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
~InitTaskGuard() noexcept {
|
|
169
|
+
if (auto reactInstance = std::move(m_reactInstance)) {
|
|
170
|
+
Mso::DispatchQueue queue = reactInstance->Queue();
|
|
171
|
+
queue.InvokeElsePost([instance = std::move(reactInstance)]() noexcept {
|
|
172
|
+
instance->OnReactInstanceLoaded(Mso::CancellationErrorProvider().MakeErrorCode(true));
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
private:
|
|
178
|
+
Mso::CntPtr<ReactInstanceWin> m_reactInstance;
|
|
179
|
+
};
|
|
180
|
+
|
|
152
181
|
struct BridgeUIBatchInstanceCallback final : public facebook::react::InstanceCallback {
|
|
153
182
|
BridgeUIBatchInstanceCallback(Mso::WeakPtr<ReactInstanceWin> wkInstance) : m_wkInstance(wkInstance) {}
|
|
154
183
|
virtual ~BridgeUIBatchInstanceCallback() = default;
|
|
@@ -624,13 +653,21 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
|
|
|
624
653
|
winrt::Microsoft::ReactNative::Composition::implementation::UriImageManager::Install(
|
|
625
654
|
ReactPropertyBag(m_reactContext->Properties()), m_options.UriImageManager);
|
|
626
655
|
|
|
627
|
-
|
|
656
|
+
// The app's UI queue, or the native queue, can destroy an initialization task without running it.
|
|
657
|
+
// Office, for example, cancels its UI queue when it starts to shut down. The load would then never
|
|
658
|
+
// complete, and ReactHost would never unload the instance, so the host could never close.
|
|
659
|
+
// The guard fails the load in that case. The native task dismisses it; the tasks that load the
|
|
660
|
+
// bundle carry their own guards.
|
|
661
|
+
auto loadGuard = std::make_shared<InitTaskGuard>(*this);
|
|
662
|
+
m_uiQueue->Post([this, weakThis = Mso::WeakPtr{this}, loadGuard]() noexcept {
|
|
628
663
|
// Objects that must be created on the UI thread
|
|
629
664
|
if (auto strongThis = weakThis.GetStrongPtr()) {
|
|
630
665
|
InitUIDependentCalls();
|
|
631
666
|
|
|
632
|
-
strongThis->Queue().Post([this, weakThis]() noexcept {
|
|
667
|
+
strongThis->Queue().Post([this, weakThis, loadGuard]() noexcept {
|
|
668
|
+
loadGuard->Dismiss();
|
|
633
669
|
if (auto strongThis = weakThis.GetStrongPtr()) {
|
|
670
|
+
m_isNativeInitStarted = true;
|
|
634
671
|
auto devSettings = strongThis->CreateDevSettings();
|
|
635
672
|
|
|
636
673
|
try {
|
|
@@ -797,12 +834,16 @@ void ReactInstanceWin::InitializeWithBridge() noexcept {
|
|
|
797
834
|
ReactPropertyBag(m_reactContext->Properties()), m_options.UriImageManager);
|
|
798
835
|
#endif
|
|
799
836
|
|
|
800
|
-
|
|
837
|
+
// See InitializeBridgeless for why the initialization tasks carry an InitTaskGuard.
|
|
838
|
+
auto loadGuard = std::make_shared<InitTaskGuard>(*this);
|
|
839
|
+
m_uiQueue->Post([this, weakThis = Mso::WeakPtr{this}, loadGuard]() noexcept {
|
|
801
840
|
// Objects that must be created on the UI thread
|
|
802
841
|
if (auto strongThis = weakThis.GetStrongPtr()) {
|
|
803
842
|
InitUIDependentCalls();
|
|
804
|
-
strongThis->Queue().Post([this, weakThis]() noexcept {
|
|
843
|
+
strongThis->Queue().Post([this, weakThis, loadGuard]() noexcept {
|
|
844
|
+
loadGuard->Dismiss();
|
|
805
845
|
if (auto strongThis = weakThis.GetStrongPtr()) {
|
|
846
|
+
m_isNativeInitStarted = true;
|
|
806
847
|
auto devSettings = strongThis->CreateDevSettings();
|
|
807
848
|
|
|
808
849
|
auto getBoolProperty = [properties = ReactPropertyBag{m_options.Properties}](
|
|
@@ -1075,7 +1116,9 @@ Mso::Future<void> ReactInstanceWin::Destroy() noexcept {
|
|
|
1075
1116
|
AbandonJSCallQueue();
|
|
1076
1117
|
|
|
1077
1118
|
// Make sure that the instance is not destroyed yet
|
|
1119
|
+
bool completesOnJSQueue = false;
|
|
1078
1120
|
if (auto instance = m_instance.Exchange(nullptr)) {
|
|
1121
|
+
completesOnJSQueue = true;
|
|
1079
1122
|
{
|
|
1080
1123
|
// Release the JSI runtime
|
|
1081
1124
|
std::scoped_lock lock{m_mutex};
|
|
@@ -1084,13 +1127,19 @@ Mso::Future<void> ReactInstanceWin::Destroy() noexcept {
|
|
|
1084
1127
|
}
|
|
1085
1128
|
// Release the message queues before the ui manager and instance.
|
|
1086
1129
|
m_nativeMessageThread.Exchange(nullptr);
|
|
1087
|
-
m_jsMessageThread.Exchange(nullptr);
|
|
1130
|
+
auto jsMessageThread = m_jsMessageThread.Exchange(nullptr);
|
|
1131
|
+
if (!m_isNativeInitStarted && jsMessageThread) {
|
|
1132
|
+
// A queue dropped the initialization task, so the bridge was never created. Destroying the bridge is
|
|
1133
|
+
// what quits the JS queue and completes m_whenDestroyed, so quit the queue here instead.
|
|
1134
|
+
jsMessageThread->quitSynchronous();
|
|
1135
|
+
}
|
|
1088
1136
|
m_instanceWrapper.Exchange(nullptr);
|
|
1089
1137
|
m_jsDispatchQueue.Exchange(nullptr);
|
|
1090
1138
|
}
|
|
1091
1139
|
|
|
1092
1140
|
#ifdef USE_FABRIC
|
|
1093
1141
|
if (m_bridgelessReactInstance) {
|
|
1142
|
+
completesOnJSQueue = true;
|
|
1094
1143
|
if (auto jsMessageThread = m_jsMessageThread.Exchange(nullptr)) {
|
|
1095
1144
|
jsMessageThread->runOnQueueSync([&]() noexcept {
|
|
1096
1145
|
// Unregister from inspector BEFORE shutting down JS thread
|
|
@@ -1119,6 +1168,12 @@ Mso::Future<void> ReactInstanceWin::Destroy() noexcept {
|
|
|
1119
1168
|
}
|
|
1120
1169
|
#endif
|
|
1121
1170
|
|
|
1171
|
+
if (!completesOnJSQueue) {
|
|
1172
|
+
// Initialization never created the instance that runs on the JS queue, for example because a queue
|
|
1173
|
+
// dropped its initialization task. No JS queue work item will complete m_whenDestroyed.
|
|
1174
|
+
m_whenDestroyed.TrySetValue();
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1122
1177
|
return m_whenDestroyedResult;
|
|
1123
1178
|
}
|
|
1124
1179
|
|
|
@@ -149,6 +149,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
|
|
|
149
149
|
void OnDebuggerAttach() noexcept;
|
|
150
150
|
|
|
151
151
|
friend struct LoadedCallbackGuard;
|
|
152
|
+
friend struct InitTaskGuard;
|
|
152
153
|
void OnReactInstanceLoaded(const Mso::ErrorCode &errorCode) noexcept;
|
|
153
154
|
|
|
154
155
|
void DrainJSCallQueue() noexcept;
|
|
@@ -182,6 +183,8 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
|
|
|
182
183
|
std::atomic<bool> m_isLoaded{false};
|
|
183
184
|
std::atomic<bool> m_isDestroyed{false};
|
|
184
185
|
std::atomic<bool> m_isRekaInitialized{false};
|
|
186
|
+
// Set on the native queue when the initialization task that runs there starts.
|
|
187
|
+
std::atomic<bool> m_isNativeInitStarted{false};
|
|
185
188
|
|
|
186
189
|
private: // fields controlled by mutex
|
|
187
190
|
mutable std::mutex m_mutex;
|
|
@@ -201,14 +201,14 @@ class ViewShadowNode : public ShadowNodeBase {
|
|
|
201
201
|
auto contentControl = winrt::make<winrt::Microsoft::ReactNative::implementation::ViewControl>();
|
|
202
202
|
|
|
203
203
|
m_contentControlGotFocusRevoker = contentControl.GotFocus(winrt::auto_revoke, [=](auto &&, auto &&args) {
|
|
204
|
-
if (args.OriginalSource().try_as<xaml::UIElement>() == contentControl.as<xaml::UIElement>()) {
|
|
204
|
+
if (args.OriginalSource().template try_as<xaml::UIElement>() == contentControl.as<xaml::UIElement>()) {
|
|
205
205
|
auto tag = m_tag;
|
|
206
206
|
DispatchEvent("topFocus", std::move(folly::dynamic::object("target", tag)));
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
m_contentControlLostFocusRevoker = contentControl.LostFocus(winrt::auto_revoke, [=](auto &&, auto &&args) {
|
|
211
|
-
if (args.OriginalSource().try_as<xaml::UIElement>() == contentControl.as<xaml::UIElement>()) {
|
|
211
|
+
if (args.OriginalSource().template try_as<xaml::UIElement>() == contentControl.as<xaml::UIElement>()) {
|
|
212
212
|
auto tag = m_tag;
|
|
213
213
|
DispatchEvent("topBlur", std::move(folly::dynamic::object("target", tag)));
|
|
214
214
|
}
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.81.
|
|
13
|
+
<ReactNativeWindowsVersion>0.81.40</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>81</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>40</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>be0af08d662d3d6a0583d77541b6abab8233aeca</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<EnableDevServerHBCBundles Condition="'$(EnableDevServerHBCBundles)' == ''">false</EnableDevServerHBCBundles>
|
|
18
18
|
|
|
19
19
|
<UseV8 Condition="'$(UseV8)' == ''">false</UseV8>
|
|
20
|
-
<V8Version Condition="'$(V8Version)' == ''">0.
|
|
20
|
+
<V8Version Condition="'$(V8Version)' == ''">0.79.5</V8Version>
|
|
21
21
|
<V8PackageName>ReactNative.V8Jsi.Windows</V8PackageName>
|
|
22
22
|
<V8PackageName Condition="'$(V8AppPlatform)' != 'win32'">$(V8PackageName).UWP</V8PackageName>
|
|
23
23
|
<V8Package>$(NuGetPackageRoot)\$(V8PackageName).$(V8Version)</V8Package>
|
|
@@ -139,7 +139,6 @@
|
|
|
139
139
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
|
140
140
|
<ShowIncludes Condition="'$(ShowIncludes)'=='true'">true</ShowIncludes>
|
|
141
141
|
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
|
|
142
|
-
<AdditionalOptions Condition="'$(PlatformToolsetVersion)' != '' And $(PlatformToolsetVersion)<145">%(AdditionalOptions) /await</AdditionalOptions>
|
|
143
142
|
<ControlFlowGuard>Guard</ControlFlowGuard>
|
|
144
143
|
<SpectreMitigation>Spectre</SpectreMitigation>
|
|
145
144
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#include "IWebSocketResource.h"
|
|
11
11
|
|
|
12
12
|
// Standard Library
|
|
13
|
+
#include <coroutine>
|
|
13
14
|
#include <future>
|
|
14
15
|
#include <mutex>
|
|
15
16
|
#include <queue>
|
|
@@ -27,12 +28,7 @@ class WinRTWebSocketResource2 : public IWebSocketResource,
|
|
|
27
28
|
void operator=(const TaskSequencer &) = delete;
|
|
28
29
|
|
|
29
30
|
private:
|
|
30
|
-
// `experimental` is deprecated starting Visual Studio 2026
|
|
31
|
-
#if _MSC_VER >= 1951
|
|
32
31
|
using CoroHandle = std::coroutine_handle<>;
|
|
33
|
-
#else
|
|
34
|
-
using CoroHandle = std::experimental::coroutine_handle<>;
|
|
35
|
-
#endif
|
|
36
32
|
struct Suspender {
|
|
37
33
|
CoroHandle m_handle;
|
|
38
34
|
|
package/Shared/OInstance.cpp
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#include <folly/json.h>
|
|
15
15
|
#include <jsi/jsi.h>
|
|
16
16
|
#include <jsireact/JSIExecutor.h>
|
|
17
|
+
#include <cstring>
|
|
17
18
|
#include <filesystem>
|
|
18
19
|
#include "OInstance.h"
|
|
19
20
|
#include "Unicode.h"
|
|
@@ -77,15 +78,13 @@ namespace Microsoft::ReactNative {
|
|
|
77
78
|
bool isHBCBundle(const std::string &bundle) {
|
|
78
79
|
static uint32_t constexpr HBCBundleMagicNumber = 0xffe7c3c3;
|
|
79
80
|
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
auto header = reinterpret_cast<const facebook::react::BundleHeader *>(&bundle[0]);
|
|
84
|
-
if (HBCBundleMagicNumber == header->magic32.value) {
|
|
85
|
-
return true;
|
|
86
|
-
} else {
|
|
81
|
+
// Only the leading magic number is needed; copy just those bytes rather than the whole (potentially huge) bundle.
|
|
82
|
+
uint32_t magic = 0;
|
|
83
|
+
if (bundle.size() < sizeof(magic)) {
|
|
87
84
|
return false;
|
|
88
85
|
}
|
|
86
|
+
std::memcpy(&magic, bundle.data(), sizeof(magic));
|
|
87
|
+
return magic == HBCBundleMagicNumber;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
void LoadRemoteUrlScript(
|
|
@@ -136,7 +135,13 @@ void LoadRemoteUrlScript(
|
|
|
136
135
|
// This code is based on the HBC Bundle integration on Android
|
|
137
136
|
// Ref:
|
|
138
137
|
// https://github.com/facebook/react-native/blob/24d91268b64c7abbd4b26547ffcc663dc90ec5e7/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp#L231
|
|
139
|
-
|
|
138
|
+
// Bytecode bundles are only requested from the dev server when USE_HERMES and ENABLE_DEVSERVER_HBCBUNDLES are
|
|
139
|
+
// defined.
|
|
140
|
+
bool isBytecodeBundle = false;
|
|
141
|
+
#if defined(USE_HERMES) && defined(ENABLE_DEVSERVER_HBCBUNDLES)
|
|
142
|
+
isBytecodeBundle = isHBCBundle(jsBundleString);
|
|
143
|
+
#endif
|
|
144
|
+
if (isBytecodeBundle) {
|
|
140
145
|
auto script = std::make_unique<facebook::react::JSBigStdString>(jsBundleString, false);
|
|
141
146
|
const char *buffer = script->c_str();
|
|
142
147
|
uint32_t bufferLength = (uint32_t)script->size();
|
|
@@ -153,6 +153,16 @@
|
|
|
153
153
|
<AdditionalIncludeDirectories>$(ReactNativeWindowsDir)Folly;$(ReactNativeWindowsDir)stubs;$(ExternalDir)folly;$(ExternalDir)fast-float\include;$(ExternalDir)fmt\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
154
154
|
</ClCompile>
|
|
155
155
|
</ItemGroup>
|
|
156
|
+
<!-- Work around MSVC v145 ARM64 optimizer C1001 in AtForkListSingleton::init.
|
|
157
|
+
Disable PCH use so its Release optimization settings cannot override /Od.
|
|
158
|
+
Keep the forced pch.h include as an ordinary header. Remove when the compiler is fixed. -->
|
|
159
|
+
<ItemGroup>
|
|
160
|
+
<ClCompile Update="$(ExternalDir)folly\folly\system\AtFork.cpp" Condition="'$(Platform)' == 'ARM64' And '$(PlatformToolsetVersion)' != '' And $(PlatformToolsetVersion)>=145">
|
|
161
|
+
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
162
|
+
<Optimization>Disabled</Optimization>
|
|
163
|
+
<WholeProgramOptimization>false</WholeProgramOptimization>
|
|
164
|
+
</ClCompile>
|
|
165
|
+
</ItemGroup>
|
|
156
166
|
<!-- SysMman.cpp is Desktop-only and must not use folly's UWP pch; re-assert no-PCH after
|
|
157
167
|
the blanket Update above, which would otherwise force pch.h onto it. -->
|
|
158
168
|
<ItemGroup>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.40",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "17.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "17.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "17.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.81.
|
|
29
|
+
"@react-native-windows/cli": "0.81.12",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
31
|
"@react-native/assets-registry": "0.81.6",
|
|
32
32
|
"@react-native/codegen": "0.81.6",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"yargs": "^17.6.2"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@react-native-windows/codegen": "0.81.
|
|
71
|
+
"@react-native-windows/codegen": "0.81.8",
|
|
72
72
|
"@react-native/metro-config": "0.81.6",
|
|
73
73
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
74
74
|
"@rnw-scripts/eslint-config": "1.2.38",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"prettier": "2.8.8",
|
|
86
86
|
"react": "19.1.4",
|
|
87
87
|
"react-native": "0.81.6",
|
|
88
|
-
"react-native-platform-override": "0.81.
|
|
88
|
+
"react-native-platform-override": "0.81.4",
|
|
89
89
|
"react-refresh": "^0.14.0",
|
|
90
90
|
"typescript": "5.0.4"
|
|
91
91
|
},
|