diff --git a/change/react-native-windows-a8df45ea-26f4-44f5-9b82-712c9aad497e.json b/change/react-native-windows-a8df45ea-26f4-44f5-9b82-712c9aad497e.json new file mode 100644 index 00000000000..bdc304a634d --- /dev/null +++ b/change/react-native-windows-a8df45ea-26f4-44f5-9b82-712c9aad497e.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Enable Blob module with runtime option", + "packageName": "react-native-windows", + "email": "julio.rocha@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp b/vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp index ea1183a6a96..0813355bf0a 100644 --- a/vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp +++ b/vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp @@ -28,6 +28,7 @@ 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. SetRuntimeOptionBool("RNTester.UseWebDebugger", false); diff --git a/vnext/Shared/OInstance.cpp b/vnext/Shared/OInstance.cpp index 97694c8d330..6bae7ab25ba 100644 --- a/vnext/Shared/OInstance.cpp +++ b/vnext/Shared/OInstance.cpp @@ -614,20 +614,20 @@ std::vector> InstanceImpl::GetDefaultNativeModules []() { return std::make_unique(); }, nativeQueue)); -// TODO: Follow up - Blob module not supported in UWP. Need to define property bag lifetime and onwership. -#if (defined(_MSC_VER) && !defined(WINRT)) - modules.push_back(std::make_unique( - m_innerInstance, - Microsoft::React::GetBlobModuleName(), - [transitionalProps]() { return Microsoft::React::CreateBlobModule(transitionalProps); }, - nativeQueue)); + // #10036 - Blob module not supported in UWP. Need to define property bag lifetime and onwership. + if (Microsoft::React::GetRuntimeOptionBool("Blob.EnableModule")) { + modules.push_back(std::make_unique( + m_innerInstance, + Microsoft::React::GetBlobModuleName(), + [transitionalProps]() { return Microsoft::React::CreateBlobModule(transitionalProps); }, + nativeQueue)); - modules.push_back(std::make_unique( - m_innerInstance, - Microsoft::React::GetFileReaderModuleName(), - [transitionalProps]() { return Microsoft::React::CreateFileReaderModule(transitionalProps); }, - nativeQueue)); -#endif + modules.push_back(std::make_unique( + m_innerInstance, + Microsoft::React::GetFileReaderModuleName(), + [transitionalProps]() { return Microsoft::React::CreateFileReaderModule(transitionalProps); }, + nativeQueue)); + } return modules; }