diff --git a/change/react-native-windows-3ee0cf72-a448-421f-a738-e2aac37a7883.json b/change/react-native-windows-3ee0cf72-a448-421f-a738-e2aac37a7883.json new file mode 100644 index 00000000000..c1e69744372 --- /dev/null +++ b/change/react-native-windows-3ee0cf72-a448-421f-a738-e2aac37a7883.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Always instantiate Blob module inUWP", + "packageName": "react-native-windows", + "email": "julio.rocha@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Desktop.DLL/react-native-win32.x64.def b/vnext/Desktop.DLL/react-native-win32.x64.def index f8d5742909f..eec2862ff77 100644 --- a/vnext/Desktop.DLL/react-native-win32.x64.def +++ b/vnext/Desktop.DLL/react-native-win32.x64.def @@ -56,7 +56,6 @@ EXPORTS ?makeChakraRuntime@JSI@Microsoft@@YA?AV?$unique_ptr@VRuntime@jsi@facebook@@U?$default_delete@VRuntime@jsi@facebook@@@std@@@std@@$$QEAUChakraRuntimeArgs@12@@Z ?Make@IHttpResource@Networking@React@Microsoft@@SA?AV?$shared_ptr@UIHttpResource@Networking@React@Microsoft@@@std@@XZ ?CreateTimingModule@react@facebook@@YA?AV?$unique_ptr@VCxxModule@module@xplat@facebook@@U?$default_delete@VCxxModule@module@xplat@facebook@@@std@@@std@@AEBV?$shared_ptr@VMessageQueueThread@react@facebook@@@4@@Z -??0NetworkingModule@React@Microsoft@@QEAA@XZ ?MakeJSQueueThread@ReactNative@Microsoft@@YA?AV?$shared_ptr@VMessageQueueThread@react@facebook@@@std@@XZ ?Hash128@SpookyHashV2@hash@folly@@SAXPEBX_KPEA_K2@Z ??1Instance@react@facebook@@QEAA@XZ diff --git a/vnext/Desktop.DLL/react-native-win32.x86.def b/vnext/Desktop.DLL/react-native-win32.x86.def index d899f933715..f9b316cb1b0 100644 --- a/vnext/Desktop.DLL/react-native-win32.x86.def +++ b/vnext/Desktop.DLL/react-native-win32.x86.def @@ -52,7 +52,6 @@ EXPORTS ?makeChakraRuntime@JSI@Microsoft@@YG?AV?$unique_ptr@VRuntime@jsi@facebook@@U?$default_delete@VRuntime@jsi@facebook@@@std@@@std@@$$QAUChakraRuntimeArgs@12@@Z ?CreateTimingModule@react@facebook@@YG?AV?$unique_ptr@VCxxModule@module@xplat@facebook@@U?$default_delete@VCxxModule@module@xplat@facebook@@@std@@@std@@ABV?$shared_ptr@VMessageQueueThread@react@facebook@@@4@@Z ?Make@IHttpResource@Networking@React@Microsoft@@SG?AV?$shared_ptr@UIHttpResource@Networking@React@Microsoft@@@std@@XZ -??0NetworkingModule@React@Microsoft@@QAE@XZ ?MakeJSQueueThread@ReactNative@Microsoft@@YG?AV?$shared_ptr@VMessageQueueThread@react@facebook@@@std@@XZ ?Hash128@SpookyHashV2@hash@folly@@SGXPBXIPA_K1@Z ?assertionFailure@detail@folly@@YGXPBD00I0H@Z diff --git a/vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp b/vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp index 0813355bf0a..4ed441749b3 100644 --- a/vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp +++ b/vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp @@ -27,7 +27,6 @@ TEST_MODULE_INITIALIZE(InitModule) { SetRuntimeOptionBool("WebSocket.AcceptSelfSigned", true); SetRuntimeOptionBool("UseBeastWebSocket", false); - SetRuntimeOptionBool("Http.UseMonolithicModule", false); SetRuntimeOptionBool("Blob.EnableModule", true); // WebSocketJSExecutor can't register native log hooks. diff --git a/vnext/Microsoft.ReactNative/Base/CoreNativeModules.cpp b/vnext/Microsoft.ReactNative/Base/CoreNativeModules.cpp index c1e1d6dfa9a..bf56183b8e7 100644 --- a/vnext/Microsoft.ReactNative/Base/CoreNativeModules.cpp +++ b/vnext/Microsoft.ReactNative/Base/CoreNativeModules.cpp @@ -18,21 +18,6 @@ namespace Microsoft::ReactNative { -using winrt::Microsoft::ReactNative::ReactPropertyBag; - -namespace { - -using winrt::Microsoft::ReactNative::ReactPropertyId; - -ReactPropertyId HttpUseMonolithicModuleProperty() noexcept { - static ReactPropertyId propId{ - L"ReactNative.Http" - L"UseMonolithicModule"}; - return propId; -} - -} // namespace - std::vector GetCoreModules( const std::shared_ptr &batchingUIMessageQueue, const std::shared_ptr @@ -45,17 +30,15 @@ std::vector GetCoreModules( [props = context->Properties()]() { return Microsoft::React::CreateHttpModule(props); }, jsMessageQueue); - if (!ReactPropertyBag(context->Properties()).Get(HttpUseMonolithicModuleProperty())) { - modules.emplace_back( - Microsoft::React::GetBlobModuleName(), - [props = context->Properties()]() { return Microsoft::React::CreateBlobModule(props); }, - batchingUIMessageQueue); + modules.emplace_back( + Microsoft::React::GetBlobModuleName(), + [props = context->Properties()]() { return Microsoft::React::CreateBlobModule(props); }, + batchingUIMessageQueue); - modules.emplace_back( - Microsoft::React::GetFileReaderModuleName(), - [props = context->Properties()]() { return Microsoft::React::CreateFileReaderModule(props); }, - batchingUIMessageQueue); - } + modules.emplace_back( + Microsoft::React::GetFileReaderModuleName(), + [props = context->Properties()]() { return Microsoft::React::CreateFileReaderModule(props); }, + batchingUIMessageQueue); // AsyncStorageModule doesn't work without package identity (it indirectly depends on // Windows.Storage.StorageFile), so check for package identity before adding it. diff --git a/vnext/Shared/OInstance.cpp b/vnext/Shared/OInstance.cpp index 5a93e1bc1e8..d1bb5661a18 100644 --- a/vnext/Shared/OInstance.cpp +++ b/vnext/Shared/OInstance.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -75,11 +74,7 @@ namespace Microsoft::React { /*extern*/ std::unique_ptr CreateHttpModule( winrt::Windows::Foundation::IInspectable const &inspectableProperties) noexcept { - if (GetRuntimeOptionBool("Http.UseMonolithicModule")) { - return std::make_unique(); - } else { - return std::make_unique(inspectableProperties); - } + return std::make_unique(inspectableProperties); } } // namespace Microsoft::React @@ -643,8 +638,7 @@ std::vector> InstanceImpl::GetDefaultNativeModules // If this code is enabled, we will have unused module instances. // Also, MSRN has a different property bag mechanism incompatible with this method's transitionalProps variable. #if (defined(_MSC_VER) && !defined(WINRT)) - if (Microsoft::React::GetRuntimeOptionBool("Blob.EnableModule") && - !Microsoft::React::GetRuntimeOptionBool("Http.UseMonolithicModule")) { + if (Microsoft::React::GetRuntimeOptionBool("Blob.EnableModule")) { modules.push_back(std::make_unique( m_innerInstance, Microsoft::React::GetBlobModuleName(), diff --git a/vnext/Shared/Shared.vcxitems b/vnext/Shared/Shared.vcxitems index 8788faecf59..a7eff112749 100644 --- a/vnext/Shared/Shared.vcxitems +++ b/vnext/Shared/Shared.vcxitems @@ -50,7 +50,9 @@ - + + true +