react-native-windows 0.72.14 → 0.72.16
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/ReactHost/ReactInstanceWin.cpp +3 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Shared/DevSettings.h +3 -0
- package/Shared/Modules/BlobCollector.cpp +21 -0
- package/Shared/Modules/BlobCollector.h +23 -0
- package/Shared/Modules/BlobModule.cpp +19 -0
- package/Shared/OInstance.cpp +6 -2
- package/Shared/Shared.vcxitems +2 -0
- package/Shared/Shared.vcxitems.filters +8 -0
- package/package.json +1 -1
|
@@ -567,6 +567,9 @@ void ReactInstanceWin::Initialize() noexcept {
|
|
|
567
567
|
auto omitNetCxxPropName = ReactPropertyBagHelper::GetName(nullptr, L"OmitNetworkingCxxModules");
|
|
568
568
|
auto omitNetCxxPropValue = m_options.Properties.Get(omitNetCxxPropName);
|
|
569
569
|
devSettings->omitNetworkingCxxModules = winrt::unbox_value_or(omitNetCxxPropValue, false);
|
|
570
|
+
auto useWebSocketTurboModulePropName = ReactPropertyBagHelper::GetName(nullptr, L"UseWebSocketTurboModule");
|
|
571
|
+
auto useWebSocketTurboModulePropValue = m_options.Properties.Get(useWebSocketTurboModulePropName);
|
|
572
|
+
devSettings->useWebSocketTurboModule = winrt::unbox_value_or(useWebSocketTurboModulePropValue, false);
|
|
570
573
|
auto bundleRootPath = devSettings->bundleRootPath;
|
|
571
574
|
auto instanceWrapper = facebook::react::CreateReactInstance(
|
|
572
575
|
std::shared_ptr<facebook::react::Instance>(strongThis->m_instance.Load()),
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.72.
|
|
13
|
+
<ReactNativeWindowsVersion>0.72.16</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>72</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>16</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>36fc7ba40eb0f163dc83c652f808195fbc4b25c0</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
package/Shared/DevSettings.h
CHANGED
|
@@ -102,6 +102,9 @@ struct DevSettings {
|
|
|
102
102
|
|
|
103
103
|
// Transitory. Used to indicate whether or not to load networking types in the default Cxx module registry.
|
|
104
104
|
bool omitNetworkingCxxModules{false};
|
|
105
|
+
|
|
106
|
+
// OC:8368383 - Memory leak under investigation.
|
|
107
|
+
bool useWebSocketTurboModule{false};
|
|
105
108
|
};
|
|
106
109
|
|
|
107
110
|
} // namespace react
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#include "BlobCollector.h"
|
|
5
|
+
|
|
6
|
+
using std::string;
|
|
7
|
+
|
|
8
|
+
namespace Microsoft::React {
|
|
9
|
+
|
|
10
|
+
using Networking::IBlobResource;
|
|
11
|
+
|
|
12
|
+
BlobCollector::BlobCollector(string blobId, std::shared_ptr<IBlobResource> resource) noexcept
|
|
13
|
+
: m_blobId{blobId}, m_weakResource{std::weak_ptr<IBlobResource>(resource)} {}
|
|
14
|
+
|
|
15
|
+
BlobCollector::~BlobCollector() noexcept {
|
|
16
|
+
if (auto rc = m_weakResource.lock()) {
|
|
17
|
+
rc->Release(std::move(m_blobId));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
} // namespace Microsoft::React
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
#include <Networking/IBlobResource.h>
|
|
7
|
+
|
|
8
|
+
// JSI
|
|
9
|
+
#include <jsi/jsi.h>
|
|
10
|
+
|
|
11
|
+
namespace Microsoft::React {
|
|
12
|
+
|
|
13
|
+
class JSI_EXPORT BlobCollector : public facebook::jsi::HostObject {
|
|
14
|
+
std::string m_blobId;
|
|
15
|
+
std::weak_ptr<Networking::IBlobResource> m_weakResource;
|
|
16
|
+
|
|
17
|
+
public:
|
|
18
|
+
BlobCollector(std::string blobId, std::shared_ptr<Networking::IBlobResource> resource) noexcept;
|
|
19
|
+
|
|
20
|
+
~BlobCollector() noexcept;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
} // namespace Microsoft::React
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
#include "BlobModule.h"
|
|
5
5
|
|
|
6
6
|
#include <CreateModules.h>
|
|
7
|
+
#include <JSI/JsiApiContext.h>
|
|
7
8
|
#include <Modules/CxxModuleUtilities.h>
|
|
9
|
+
#include "BlobCollector.h"
|
|
8
10
|
|
|
9
11
|
// React Native
|
|
10
12
|
#include <cxxreact/JsArgumentHelpers.h>
|
|
@@ -38,6 +40,23 @@ void BlobTurboModule::Initialize(msrn::ReactContext const &reactContext) noexcep
|
|
|
38
40
|
m_resource->Callbacks().OnError = [&reactContext](string &&errorText) {
|
|
39
41
|
Modules::SendEvent(reactContext, L"blobFailed", {errorText});
|
|
40
42
|
};
|
|
43
|
+
|
|
44
|
+
namespace jsi = facebook::jsi;
|
|
45
|
+
msrn::ExecuteJsi(reactContext, [resource = m_resource](jsi::Runtime &runtime) {
|
|
46
|
+
runtime.global().setProperty(
|
|
47
|
+
runtime,
|
|
48
|
+
"__blobCollectorProvider",
|
|
49
|
+
jsi::Function::createFromHostFunction(
|
|
50
|
+
runtime,
|
|
51
|
+
jsi::PropNameID::forAscii(runtime, "__blobCollectorProvider"),
|
|
52
|
+
1,
|
|
53
|
+
[resource](jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) {
|
|
54
|
+
auto blobId = args[0].asString(rt).utf8(rt);
|
|
55
|
+
auto collector = std::make_shared<BlobCollector>(blobId, resource);
|
|
56
|
+
|
|
57
|
+
return jsi::Object::createFromHostObject(rt, collector);
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
41
60
|
}
|
|
42
61
|
|
|
43
62
|
ReactNativeSpecs::BlobModuleSpec_Constants BlobTurboModule::GetConstants() noexcept {
|
package/Shared/OInstance.cpp
CHANGED
|
@@ -556,14 +556,18 @@ std::vector<std::unique_ptr<NativeModule>> InstanceImpl::GetDefaultNativeModules
|
|
|
556
556
|
// If this code is enabled, we will have unused module instances.
|
|
557
557
|
// Also, MSRN has a different property bag mechanism incompatible with this method's transitionalProps variable.
|
|
558
558
|
#if (defined(_MSC_VER) && !defined(WINRT))
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
|
|
560
|
+
// OC:8368383 - Memory leak under investigation.
|
|
561
|
+
if (!m_devSettings->useWebSocketTurboModule) {
|
|
561
562
|
modules.push_back(std::make_unique<CxxNativeModule>(
|
|
562
563
|
m_innerInstance,
|
|
563
564
|
Microsoft::React::GetWebSocketModuleName(),
|
|
564
565
|
[transitionalProps]() { return Microsoft::React::CreateWebSocketModule(transitionalProps); },
|
|
565
566
|
nativeQueue));
|
|
567
|
+
}
|
|
566
568
|
|
|
569
|
+
// Applications using the Windows ABI feature should loade the networking TurboModule variants instead.
|
|
570
|
+
if (!m_devSettings->omitNetworkingCxxModules) {
|
|
567
571
|
// Use in case the host app provides its a non-Blob-compatilbe HTTP module.
|
|
568
572
|
if (!Microsoft::React::GetRuntimeOptionBool("Blob.DisableModule")) {
|
|
569
573
|
modules.push_back(std::make_unique<CxxNativeModule>(
|
package/Shared/Shared.vcxitems
CHANGED
|
@@ -167,6 +167,7 @@
|
|
|
167
167
|
<ClCompile Include="$(MSBuildThisFileDirectory)LayoutAnimation.cpp" />
|
|
168
168
|
<ClCompile Include="$(MSBuildThisFileDirectory)Logging.cpp" />
|
|
169
169
|
<ClCompile Include="$(MSBuildThisFileDirectory)MemoryMappedBuffer.cpp" />
|
|
170
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.cpp" />
|
|
170
171
|
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\BlobModule.cpp" />
|
|
171
172
|
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\CxxModuleUtilities.cpp" />
|
|
172
173
|
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\ExceptionsManagerModule.cpp" />
|
|
@@ -301,6 +302,7 @@
|
|
|
301
302
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\V8RuntimeHolder.h" />
|
|
302
303
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\RuntimeHolder.h" />
|
|
303
304
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\ScriptStore.h" />
|
|
305
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.h" />
|
|
304
306
|
<ClInclude Include="$(MSBuildThisFileDirectory)Modules\BlobModule.h" />
|
|
305
307
|
<ClInclude Include="$(MSBuildThisFileDirectory)Modules\CxxModuleUtilities.h" />
|
|
306
308
|
<ClInclude Include="$(MSBuildThisFileDirectory)Modules\FileReaderModule.h" />
|
|
@@ -270,6 +270,11 @@
|
|
|
270
270
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\DefaultBlobResource.cpp">
|
|
271
271
|
<Filter>Source Files\Networking</Filter>
|
|
272
272
|
</ClCompile>
|
|
273
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\platform\react\renderer\components\view\HostPlatformViewProps.cpp" />
|
|
274
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\Fabric\platform\react\renderer\components\view\HostPlatformViewEventEmitter.cpp" />
|
|
275
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.cpp">
|
|
276
|
+
<Filter>Source Files\Modules</Filter>
|
|
277
|
+
</ClCompile>
|
|
273
278
|
</ItemGroup>
|
|
274
279
|
<ItemGroup>
|
|
275
280
|
<Filter Include="Source Files">
|
|
@@ -741,6 +746,9 @@
|
|
|
741
746
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\V8RuntimeHolder.h" />
|
|
742
747
|
<ClInclude Include="$(MSBuildThisFileDirectory)SafeLoadLibrary.h" />
|
|
743
748
|
<ClInclude Include="$(MSBuildThisFileDirectory)V8JSIRuntimeHolder.h" />
|
|
749
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.h">
|
|
750
|
+
<Filter>Header Files\Modules</Filter>
|
|
751
|
+
</ClInclude>
|
|
744
752
|
</ItemGroup>
|
|
745
753
|
<ItemGroup>
|
|
746
754
|
<None Include="$(MSBuildThisFileDirectory)tracing\rnw.wprp">
|