Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Enable Blob module with runtime option",
"packageName": "react-native-windows",
"email": "julio.rocha@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"NETStandard.Library": {
"type": "Transitive",
"resolved": "2.0.3",
"contentHash": "548M6mnBSJWxsIlkQHfbzoYxpiYFXZZSL00p4GHYv8PkiqFBnnT68mW5mGEsA/ch9fDO9GkPgkFQpWiXZN7mAQ==",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
Expand All @@ -104,8 +104,8 @@
},
"ReactNative.Hermes.Windows": {
"type": "Transitive",
"resolved": "0.11.0-ms.6",
"contentHash": "WAVLsSZBV4p/3hNC3W67su7xu3f/ZMSKxu0ON7g2GaKRbkJmH0Qyif1IlzcJwtvR48kuOdfgPu7Bgtz3AY+gqg=="
"resolved": "0.12.1",
"contentHash": "0yjt0Y2pNfqw7qUiV5Q3W8hZ2HuS3HiS135c/ILLXeRXLpQMmfq1NS3oBZ1oMZy94gSfgP9QZ/862T3qUTES1A=="
},
"runtime.win10-arm.Microsoft.Net.Native.Compiler": {
"type": "Transitive",
Expand Down Expand Up @@ -315,7 +315,7 @@
"Microsoft.Windows.CppWinRT": "2.0.211028.7",
"Microsoft.Windows.SDK.BuildTools": "10.0.22000.194",
"ReactCommon": "1.0.0",
"ReactNative.Hermes.Windows": "0.11.0-ms.6",
"ReactNative.Hermes.Windows": "0.12.1",
"boost": "1.76.0"
}
},
Expand Down
8 changes: 4 additions & 4 deletions vnext/Microsoft.ReactNative.Managed/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@
"NETStandard.Library": {
"type": "Transitive",
"resolved": "2.0.3",
"contentHash": "548M6mnBSJWxsIlkQHfbzoYxpiYFXZZSL00p4GHYv8PkiqFBnnT68mW5mGEsA/ch9fDO9GkPgkFQpWiXZN7mAQ==",
"contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
}
},
"ReactNative.Hermes.Windows": {
"type": "Transitive",
"resolved": "0.11.0-ms.6",
"contentHash": "WAVLsSZBV4p/3hNC3W67su7xu3f/ZMSKxu0ON7g2GaKRbkJmH0Qyif1IlzcJwtvR48kuOdfgPu7Bgtz3AY+gqg=="
"resolved": "0.12.1",
"contentHash": "0yjt0Y2pNfqw7qUiV5Q3W8hZ2HuS3HiS135c/ILLXeRXLpQMmfq1NS3oBZ1oMZy94gSfgP9QZ/862T3qUTES1A=="
},
"runtime.win10-arm.Microsoft.Net.Native.Compiler": {
"type": "Transitive",
Expand Down Expand Up @@ -182,7 +182,7 @@
"Microsoft.Windows.CppWinRT": "2.0.211028.7",
"Microsoft.Windows.SDK.BuildTools": "10.0.22000.194",
"ReactCommon": "1.0.0",
"ReactNative.Hermes.Windows": "0.11.0-ms.6",
"ReactNative.Hermes.Windows": "0.12.1",
"boost": "1.76.0"
}
},
Expand Down
2 changes: 1 addition & 1 deletion vnext/Shared/Networking/WinRTHttpResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void WinRTHttpResource::SendRequest(
bool withCredentials,
std::function<void(int64_t)> &&callback) noexcept /*override*/ {
// Enforce supported args
assert(responseType == "text" || responseType == "base64" | responseType == "blob");
assert(responseType == "text" || responseType == "base64" || responseType == "blob");

if (callback) {
callback(requestId);
Expand Down
23 changes: 13 additions & 10 deletions vnext/Shared/OInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,17 +619,20 @@ std::vector<std::unique_ptr<NativeModule>> InstanceImpl::GetDefaultNativeModules
[]() { return std::make_unique<StatusBarManagerModule>(); },
nativeQueue));

modules.push_back(std::make_unique<CxxNativeModule>(
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<CxxNativeModule>(
m_innerInstance,
Microsoft::React::GetBlobModuleName(),
[transitionalProps]() { return Microsoft::React::CreateBlobModule(transitionalProps); },
nativeQueue));

modules.push_back(std::make_unique<CxxNativeModule>(
m_innerInstance,
Microsoft::React::GetFileReaderModuleName(),
[transitionalProps]() { return Microsoft::React::CreateFileReaderModule(transitionalProps); },
nativeQueue));
modules.push_back(std::make_unique<CxxNativeModule>(
m_innerInstance,
Microsoft::React::GetFileReaderModuleName(),
[transitionalProps]() { return Microsoft::React::CreateFileReaderModule(transitionalProps); },
nativeQueue));
}

return modules;
}
Expand Down