From 722aeffe9e5e91ee3ba83779c113e35141bf618b Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Tue, 19 May 2026 15:53:39 -0700 Subject: [PATCH 1/2] Remove JSBigStringResourceDll, and unify WebsocketResource --- vnext/Desktop/JSBigStringResourceDll.cpp | 38 ------------------- vnext/Desktop/JSBigStringResourceDll.h | 36 ------------------ vnext/Desktop/React.Windows.Desktop.vcxproj | 3 -- .../React.Windows.Desktop.vcxproj.filters | 6 --- .../Microsoft.ReactNative.vcxproj | 1 - .../Microsoft.ReactNative.vcxproj.filters | 3 -- .../Modules/CreateModules.cpp | 24 ------------ vnext/Scripts/OfficeReact.Win32.nuspec | 1 - vnext/Shared/Shared.vcxitems | 1 + .../WebSocketResourceFactory.cpp | 0 10 files changed, 1 insertion(+), 112 deletions(-) delete mode 100644 vnext/Desktop/JSBigStringResourceDll.cpp delete mode 100644 vnext/Desktop/JSBigStringResourceDll.h delete mode 100644 vnext/Microsoft.ReactNative/Modules/CreateModules.cpp rename vnext/{Desktop => Shared}/WebSocketResourceFactory.cpp (100%) diff --git a/vnext/Desktop/JSBigStringResourceDll.cpp b/vnext/Desktop/JSBigStringResourceDll.cpp deleted file mode 100644 index 5062a7ca5d5..00000000000 --- a/vnext/Desktop/JSBigStringResourceDll.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -#include "pch.h" - -#include "JSBigStringResourceDll.h" - -#include - -namespace facebook { -namespace react { - -JSBigStringResourceDll::JSBigStringResourceDll(HMODULE dll, HRSRC resource) { - HGLOBAL loadedResource{LoadResource(dll, resource)}; - if (loadedResource == nullptr) { - throw std::invalid_argument("Could not load resource"); - } - this->resource = static_cast(LockResource(loadedResource)); - if (this->resource == nullptr) { - throw std::invalid_argument("Could not lock resource"); - } - - this->resourceSize = SizeofResource(dll, resource); - if (this->resourceSize == 0) { - throw std::invalid_argument("Could not retrieve size of resource"); - } - - if (this->c_str()[this->size()] != '\0') { - throw std::invalid_argument("Resource was not null-terminated"); - } -} - -std::unique_ptr JSBigStringResourceDll::Make(HMODULE dll, HRSRC resource) { - return std::make_unique(dll, resource); -} - -} // namespace react -} // namespace facebook diff --git a/vnext/Desktop/JSBigStringResourceDll.h b/vnext/Desktop/JSBigStringResourceDll.h deleted file mode 100644 index 4edc4f5e9b7..00000000000 --- a/vnext/Desktop/JSBigStringResourceDll.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -#pragma once - -#include -#include - -namespace facebook { -namespace react { - -class JSBigStringResourceDll final : public JSBigString { - public: - static std::unique_ptr Make(HMODULE dll, HRSRC resource); - - JSBigStringResourceDll(HMODULE dll, HRSRC resource); - - virtual bool isAscii() const override { - return false; - } - - virtual const char *c_str() const override { - return resource; - } - - virtual size_t size() const override { - return resourceSize - 1; - } - - private: - char *resource; - uint32_t resourceSize; -}; - -} // namespace react -} // namespace facebook diff --git a/vnext/Desktop/React.Windows.Desktop.vcxproj b/vnext/Desktop/React.Windows.Desktop.vcxproj index 40406584365..1dddc0a9ad4 100644 --- a/vnext/Desktop/React.Windows.Desktop.vcxproj +++ b/vnext/Desktop/React.Windows.Desktop.vcxproj @@ -132,12 +132,10 @@ - Create - @@ -179,7 +177,6 @@ - diff --git a/vnext/Desktop/React.Windows.Desktop.vcxproj.filters b/vnext/Desktop/React.Windows.Desktop.vcxproj.filters index 9634940f0a1..2a6bfcc9d28 100644 --- a/vnext/Desktop/React.Windows.Desktop.vcxproj.filters +++ b/vnext/Desktop/React.Windows.Desktop.vcxproj.filters @@ -41,9 +41,6 @@ ABI - - Source Files - Generated Files @@ -66,9 +63,6 @@ - - Header Files - Header Files\Modules diff --git a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj index e767733e54e..b41c838404b 100644 --- a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +++ b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj @@ -324,7 +324,6 @@ - Create diff --git a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters index e308cba30f0..6131d7e9ba9 100644 --- a/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +++ b/vnext/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters @@ -140,9 +140,6 @@ Utils - - Modules - diff --git a/vnext/Microsoft.ReactNative/Modules/CreateModules.cpp b/vnext/Microsoft.ReactNative/Modules/CreateModules.cpp deleted file mode 100644 index 3df2f543bff..00000000000 --- a/vnext/Microsoft.ReactNative/Modules/CreateModules.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -#include -#include -#include -#include -#include - -// Windows API -#include - -using winrt::Microsoft::ReactNative::ReactPropertyBag; -using winrt::Microsoft::ReactNative::ReactPropertyId; -using winrt::Microsoft::ReactNative::implementation::QuirkSettings; - -namespace Microsoft::React::Networking { - -std::shared_ptr IWebSocketResource::Make() { - std::vector certExceptions; - return std::make_shared(std::move(certExceptions)); -} - -} // namespace Microsoft::React::Networking diff --git a/vnext/Scripts/OfficeReact.Win32.nuspec b/vnext/Scripts/OfficeReact.Win32.nuspec index 4d53f228dbf..1fff761cd76 100644 --- a/vnext/Scripts/OfficeReact.Win32.nuspec +++ b/vnext/Scripts/OfficeReact.Win32.nuspec @@ -56,7 +56,6 @@ - diff --git a/vnext/Shared/Shared.vcxitems b/vnext/Shared/Shared.vcxitems index 14afc5a6b13..e55833a5d6e 100644 --- a/vnext/Shared/Shared.vcxitems +++ b/vnext/Shared/Shared.vcxitems @@ -170,6 +170,7 @@ true + diff --git a/vnext/Desktop/WebSocketResourceFactory.cpp b/vnext/Shared/WebSocketResourceFactory.cpp similarity index 100% rename from vnext/Desktop/WebSocketResourceFactory.cpp rename to vnext/Shared/WebSocketResourceFactory.cpp From 747aace1d84f2a1a6fe3d7fb32f6ed1728241d98 Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Tue, 19 May 2026 15:57:42 -0700 Subject: [PATCH 2/2] Change files --- ...ative-windows-5af495be-fb9e-41ac-b5db-3e57961ae073.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/react-native-windows-5af495be-fb9e-41ac-b5db-3e57961ae073.json diff --git a/change/react-native-windows-5af495be-fb9e-41ac-b5db-3e57961ae073.json b/change/react-native-windows-5af495be-fb9e-41ac-b5db-3e57961ae073.json new file mode 100644 index 00000000000..48dc52d322b --- /dev/null +++ b/change/react-native-windows-5af495be-fb9e-41ac-b5db-3e57961ae073.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Remove JSBigStringResourceDll, and unify WebsocketResource", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +}