react-native-windows 0.71.42 → 0.71.43

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.
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.71.42</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.71.43</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>71</ReactNativeWindowsMinor>
16
- <ReactNativeWindowsPatch>42</ReactNativeWindowsPatch>
16
+ <ReactNativeWindowsPatch>43</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>d755604625a3cf4b704edb607e823f0f7367ebb5</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>ce7c2173ac7e384b20fc619e653484e621d742e5</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -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 {
@@ -45,6 +45,7 @@
45
45
  <ClCompile Include="$(MSBuildThisFileDirectory)Modules\AsyncStorageModuleWin32.cpp">
46
46
  <ExcludedFromBuild Condition="'$(ApplicationType)' == ''">true</ExcludedFromBuild>
47
47
  </ClCompile>
48
+ <ClCompile Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.cpp" />
48
49
  <ClCompile Include="$(MSBuildThisFileDirectory)Modules\BlobModule.cpp" />
49
50
  <ClCompile Include="$(MSBuildThisFileDirectory)Modules\CxxModuleUtilities.cpp" />
50
51
  <ClCompile Include="$(MSBuildThisFileDirectory)Modules\ExceptionsManagerModule.cpp" />
@@ -99,6 +100,7 @@
99
100
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\V8RuntimeHolder.h" />
100
101
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\RuntimeHolder.h" />
101
102
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\ScriptStore.h" />
103
+ <ClInclude Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.h" />
102
104
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\BlobModule.h" />
103
105
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\CxxModuleUtilities.h" />
104
106
  <ClInclude Include="$(MSBuildThisFileDirectory)Modules\FileReaderModule.h" />
@@ -158,6 +158,9 @@
158
158
  <ClCompile Include="$(MSBuildThisFileDirectory)JSI\V8RuntimeHolder.cpp" />
159
159
  <ClCompile Include="$(MSBuildThisFileDirectory)SafeLoadLibrary.cpp" />
160
160
  <ClCompile Include="$(MSBuildThisFileDirectory)V8JSIRuntimeHolder.cpp" />
161
+ <ClCompile Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.cpp">
162
+ <Filter>Source Files\Modules</Filter>
163
+ </ClCompile>
161
164
  </ItemGroup>
162
165
  <ItemGroup>
163
166
  <Filter Include="Source Files">
@@ -487,6 +490,9 @@
487
490
  <ClInclude Include="$(MSBuildThisFileDirectory)JSI\V8RuntimeHolder.h" />
488
491
  <ClInclude Include="$(MSBuildThisFileDirectory)SafeLoadLibrary.h" />
489
492
  <ClInclude Include="$(MSBuildThisFileDirectory)V8JSIRuntimeHolder.h" />
493
+ <ClInclude Include="$(MSBuildThisFileDirectory)Modules\BlobCollector.h">
494
+ <Filter>Header Files\Modules</Filter>
495
+ </ClInclude>
490
496
  </ItemGroup>
491
497
  <ItemGroup>
492
498
  <None Include="$(MSBuildThisFileDirectory)tracing\rnw.wprp">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.71.42",
3
+ "version": "0.71.43",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",