react-native-windows 0.72.0 → 0.72.2
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/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Network/RCTNetworking.windows.js +10 -16
- package/Microsoft.ReactNative/Fabric/ImageRequest.cpp +11 -14
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +1 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -3
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +0 -7
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +11 -10
- package/Microsoft.ReactNative.Managed/packages.lock.json +2 -71
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/React.Cpp.props +2 -3
- package/Shared/BaseFileReaderResource.cpp +95 -0
- package/Shared/BaseFileReaderResource.h +41 -0
- package/Shared/CreateModules.h +27 -5
- package/Shared/IFileReaderResource.h +36 -0
- package/Shared/Modules/BlobModule.cpp +93 -297
- package/Shared/Modules/BlobModule.h +25 -87
- package/Shared/Modules/CxxModuleUtilities.cpp +32 -0
- package/Shared/Modules/CxxModuleUtilities.h +17 -0
- package/Shared/Modules/FileReaderModule.cpp +118 -51
- package/Shared/Modules/FileReaderModule.h +27 -1
- package/Shared/Modules/HttpModule.cpp +133 -9
- package/Shared/Modules/HttpModule.h +33 -0
- package/Shared/Modules/IRequestBodyHandler.h +6 -4
- package/Shared/Modules/IResponseHandler.h +3 -3
- package/Shared/Modules/IUriHandler.h +3 -3
- package/Shared/Modules/IWebSocketModuleContentHandler.h +6 -4
- package/Shared/Modules/WebSocketModule.cpp +190 -7
- package/Shared/Modules/WebSocketTurboModule.h +52 -0
- package/Shared/Networking/DefaultBlobResource.cpp +323 -0
- package/Shared/Networking/DefaultBlobResource.h +133 -0
- package/Shared/Networking/IBlobResource.h +56 -0
- package/Shared/Networking/IHttpResource.h +6 -5
- package/Shared/Networking/WinRTHttpResource.cpp +40 -32
- package/Shared/Networking/WinRTHttpResource.h +4 -3
- package/Shared/Networking/WinRTTypes.h +3 -3
- package/Shared/Shared.vcxitems +8 -1
- package/Shared/Shared.vcxitems.filters +24 -3
- package/package.json +11 -11
- package/types/experimental.d.ts +101 -0
- package/types/index.d.ts +216 -0
- package/types/modules/BatchedBridge.d.ts +32 -0
- package/types/modules/Codegen.d.ts +74 -0
- package/types/modules/Devtools.d.ts +31 -0
- package/types/modules/LaunchScreen.d.ts +18 -0
- package/types/modules/globals.d.ts +579 -0
- package/types/private/TimerMixin.d.ts +19 -0
- package/types/private/Utilities.d.ts +10 -0
- package/types/public/DeprecatedPropertiesAlias.d.ts +185 -0
- package/types/public/Insets.d.ts +15 -0
- package/types/public/ReactNativeRenderer.d.ts +144 -0
- package/types/public/ReactNativeTypes.d.ts +143 -0
- package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +0 -44
- package/Microsoft.ReactNative/Base/CoreNativeModules.h +0 -30
- /package/Shared/{Modules/IBlobPersistor.h → IBlobPersistor.h} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
3
|
-
*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
4
6
|
*
|
|
5
7
|
* @flow strict-local
|
|
6
8
|
* @format
|
|
@@ -9,11 +11,10 @@
|
|
|
9
11
|
'use strict';
|
|
10
12
|
|
|
11
13
|
import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter';
|
|
12
|
-
const RCTNetworkingNative =
|
|
13
|
-
require('../BatchedBridge/NativeModules').Networking; // [Windows]
|
|
14
|
-
import {type NativeResponseType} from './XMLHttpRequest';
|
|
15
|
-
import convertRequestBody, {type RequestBody} from './convertRequestBody';
|
|
16
14
|
import {type EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
15
|
+
import convertRequestBody, {type RequestBody} from './convertRequestBody';
|
|
16
|
+
import NativeNetworkingIOS from './NativeNetworkingIOS';
|
|
17
|
+
import {type NativeResponseType} from './XMLHttpRequest';
|
|
17
18
|
|
|
18
19
|
type RCTNetworkingEventDefinitions = $ReadOnly<{
|
|
19
20
|
didSendNetworkData: [
|
|
@@ -61,11 +62,6 @@ type RCTNetworkingEventDefinitions = $ReadOnly<{
|
|
|
61
62
|
],
|
|
62
63
|
}>;
|
|
63
64
|
|
|
64
|
-
let _requestId = 1;
|
|
65
|
-
function generateRequestId(): number {
|
|
66
|
-
return _requestId++;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
65
|
const RCTNetworking = {
|
|
70
66
|
addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
|
|
71
67
|
eventType: K,
|
|
@@ -88,13 +84,11 @@ const RCTNetworking = {
|
|
|
88
84
|
callback: (requestId: number) => void,
|
|
89
85
|
withCredentials: boolean,
|
|
90
86
|
) {
|
|
91
|
-
const requestId = generateRequestId();
|
|
92
87
|
const body = convertRequestBody(data);
|
|
93
|
-
|
|
88
|
+
NativeNetworkingIOS.sendRequest(
|
|
94
89
|
{
|
|
95
90
|
method,
|
|
96
91
|
url,
|
|
97
|
-
requestId,
|
|
98
92
|
data: {...body, trackingName},
|
|
99
93
|
headers,
|
|
100
94
|
responseType,
|
|
@@ -107,11 +101,11 @@ const RCTNetworking = {
|
|
|
107
101
|
},
|
|
108
102
|
|
|
109
103
|
abortRequest(requestId: number) {
|
|
110
|
-
|
|
104
|
+
NativeNetworkingIOS.abortRequest(requestId);
|
|
111
105
|
},
|
|
112
106
|
|
|
113
107
|
clearCookies(callback: (result: boolean) => void) {
|
|
114
|
-
|
|
108
|
+
NativeNetworkingIOS.clearCookies(callback);
|
|
115
109
|
},
|
|
116
110
|
};
|
|
117
111
|
|
|
@@ -5,22 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
#include <react/renderer/imagemanager/ImageRequest.h>
|
|
7
7
|
|
|
8
|
-
namespace facebook {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
namespace facebook::react {
|
|
9
|
+
|
|
10
|
+
ImageRequest::ImageRequest(
|
|
11
|
+
ImageSource imageSource,
|
|
12
|
+
std::shared_ptr<const ImageTelemetry> telemetry,
|
|
13
|
+
SharedFunction<> cancelationFunction)
|
|
14
|
+
: imageSource_(std::move(imageSource)),
|
|
15
|
+
telemetry_(std::move(telemetry)),
|
|
16
|
+
cancelRequest_(std::move(cancelationFunction)) {
|
|
13
17
|
coordinator_ = std::make_shared<ImageResponseObserverCoordinator>();
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
void ImageRequest::setCancelationFunction(std::function<void(void)> cancelationFunction) {
|
|
17
|
-
cancelRequest_ = cancelationFunction;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
20
|
void ImageRequest::cancel() const {
|
|
21
|
-
|
|
22
|
-
cancelRequest_();
|
|
23
|
-
}
|
|
21
|
+
cancelRequest_();
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
const ImageSource &ImageRequest::getImageSource() const {
|
|
@@ -39,5 +37,4 @@ const std::shared_ptr<const ImageResponseObserverCoordinator> &ImageRequest::get
|
|
|
39
37
|
return coordinator_;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
} // namespace react
|
|
43
|
-
} // namespace facebook
|
|
40
|
+
} // namespace facebook::react
|
|
@@ -79,7 +79,7 @@ void generateBitmap(
|
|
|
79
79
|
facebook::react::ImageRequest WindowsImageManager::requestImage(
|
|
80
80
|
const facebook::react::ImageSource &imageSource,
|
|
81
81
|
facebook::react::SurfaceId surfaceId) const {
|
|
82
|
-
auto imageRequest = facebook::react::ImageRequest(imageSource, nullptr);
|
|
82
|
+
auto imageRequest = facebook::react::ImageRequest(imageSource, nullptr, {});
|
|
83
83
|
|
|
84
84
|
auto weakObserverCoordinator = (std::weak_ptr<const facebook::react::ImageResponseObserverCoordinator>)
|
|
85
85
|
imageRequest.getSharedObserverCoordinator();
|
|
@@ -185,7 +185,6 @@
|
|
|
185
185
|
<ItemGroup>
|
|
186
186
|
<ClInclude Include="ABICxxModule.h" />
|
|
187
187
|
<ClInclude Include="ABIViewManager.h" />
|
|
188
|
-
<ClInclude Include="Base\CoreNativeModules.h" />
|
|
189
188
|
<ClInclude Include="Base\CxxReactIncludes.h" />
|
|
190
189
|
<ClInclude Include="Base\FollyIncludes.h" />
|
|
191
190
|
<ClInclude Include="CoreAppPage.h">
|
|
@@ -421,7 +420,6 @@
|
|
|
421
420
|
<ItemGroup>
|
|
422
421
|
<ClCompile Include="ABICxxModule.cpp" />
|
|
423
422
|
<ClCompile Include="ABIViewManager.cpp" />
|
|
424
|
-
<ClCompile Include="Base\CoreNativeModules.cpp" />
|
|
425
423
|
<ClCompile Include="Base\CoreUIManagers.cpp" />
|
|
426
424
|
<ClCompile Include="CoreAppPage.cpp">
|
|
427
425
|
<DependentUpon>CoreAppPage.xaml</DependentUpon>
|
|
@@ -679,4 +677,4 @@
|
|
|
679
677
|
</ClCompile>
|
|
680
678
|
</ItemGroup>
|
|
681
679
|
</Target>
|
|
682
|
-
</Project>
|
|
680
|
+
</Project>
|
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
<ClCompile Include="ReactSupport.cpp" />
|
|
16
16
|
<ClCompile Include="TestHook.cpp" />
|
|
17
17
|
<ClCompile Include="ViewManagersProvider.cpp" />
|
|
18
|
-
<ClCompile Include="Base\CoreNativeModules.cpp">
|
|
19
|
-
<Filter>Base</Filter>
|
|
20
|
-
</ClCompile>
|
|
21
18
|
<ClCompile Include="Base\CoreUIManagers.cpp">
|
|
22
19
|
<Filter>Base</Filter>
|
|
23
20
|
</ClCompile>
|
|
@@ -357,9 +354,6 @@
|
|
|
357
354
|
<ClInclude Include="RedBox.h" />
|
|
358
355
|
<ClInclude Include="TestHook.h" />
|
|
359
356
|
<ClInclude Include="ViewManagersProvider.h" />
|
|
360
|
-
<ClInclude Include="Base\CoreNativeModules.h">
|
|
361
|
-
<Filter>Base</Filter>
|
|
362
|
-
</ClInclude>
|
|
363
357
|
<ClInclude Include="Modules\AccessibilityInfoModule.h">
|
|
364
358
|
<Filter>Modules</Filter>
|
|
365
359
|
</ClInclude>
|
|
@@ -632,7 +626,6 @@
|
|
|
632
626
|
<ClInclude Include="Views\IXamlRootView.h">
|
|
633
627
|
<Filter>Views</Filter>
|
|
634
628
|
</ClInclude>
|
|
635
|
-
<ClInclude Include="JsiApi.h" />
|
|
636
629
|
<ClInclude Include="RedBoxErrorInfo.h" />
|
|
637
630
|
<ClInclude Include="RedBoxErrorFrameInfo.h" />
|
|
638
631
|
<ClInclude Include="Views\Image\Effects.h">
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
#include "MsoUtils.h"
|
|
7
7
|
|
|
8
8
|
#include <AppModelHelpers.h>
|
|
9
|
-
#include <Base/CoreNativeModules.h>
|
|
10
9
|
#include <Threading/MessageDispatchQueue.h>
|
|
11
10
|
#include <Threading/MessageQueueThreadFactory.h>
|
|
12
11
|
#include <appModel.h>
|
|
@@ -30,7 +29,6 @@
|
|
|
30
29
|
#include <QuirkSettings.h>
|
|
31
30
|
#include <Shared/DevServerHelper.h>
|
|
32
31
|
#include <Views/ViewManager.h>
|
|
33
|
-
#include <base/CoreNativeModules.h>
|
|
34
32
|
#include <dispatchQueue/dispatchQueue.h>
|
|
35
33
|
#include "DynamicWriter.h"
|
|
36
34
|
#ifndef CORE_ABI
|
|
@@ -86,6 +84,7 @@
|
|
|
86
84
|
#include <tuple>
|
|
87
85
|
#include "ChakraRuntimeHolder.h"
|
|
88
86
|
|
|
87
|
+
#include <CreateModules.h>
|
|
89
88
|
#include <Utils/Helpers.h>
|
|
90
89
|
#include "CrashManager.h"
|
|
91
90
|
#include "JsiApi.h"
|
|
@@ -392,6 +391,16 @@ void ReactInstanceWin::LoadModules(
|
|
|
392
391
|
registerTurboModule(
|
|
393
392
|
L"Timing", winrt::Microsoft::ReactNative::MakeTurboModuleProvider<::Microsoft::ReactNative::Timing>());
|
|
394
393
|
#endif
|
|
394
|
+
|
|
395
|
+
registerTurboModule(::Microsoft::React::GetBlobTurboModuleName(), ::Microsoft::React::GetBlobModuleProvider());
|
|
396
|
+
|
|
397
|
+
registerTurboModule(::Microsoft::React::GetHttpTurboModuleName(), ::Microsoft::React::GetHttpModuleProvider());
|
|
398
|
+
|
|
399
|
+
registerTurboModule(
|
|
400
|
+
::Microsoft::React::GetFileReaderTurboModuleName(), ::Microsoft::React::GetFileReaderModuleProvider());
|
|
401
|
+
|
|
402
|
+
registerTurboModule(
|
|
403
|
+
::Microsoft::React::GetWebSocketTurboModuleName(), ::Microsoft::React::GetWebSocketModuleProvider());
|
|
395
404
|
}
|
|
396
405
|
|
|
397
406
|
//! Initialize() is called from the native queue.
|
|
@@ -459,15 +468,7 @@ void ReactInstanceWin::Initialize() noexcept {
|
|
|
459
468
|
}
|
|
460
469
|
};
|
|
461
470
|
|
|
462
|
-
#ifdef CORE_ABI
|
|
463
471
|
std::vector<facebook::react::NativeModuleDescription> cxxModules;
|
|
464
|
-
#else
|
|
465
|
-
// Acquire default modules and then populate with custom modules.
|
|
466
|
-
// Note that some of these have custom thread affinity.
|
|
467
|
-
std::vector<facebook::react::NativeModuleDescription> cxxModules =
|
|
468
|
-
Microsoft::ReactNative::GetCoreModules(m_batchingUIThread, m_jsMessageThread.Load(), m_reactContext);
|
|
469
|
-
#endif
|
|
470
|
-
|
|
471
472
|
auto nmp = std::make_shared<winrt::Microsoft::ReactNative::NativeModulesProvider>();
|
|
472
473
|
|
|
473
474
|
LoadModules(nmp, m_options.TurboModuleProvider);
|
|
@@ -24,21 +24,11 @@
|
|
|
24
24
|
"Microsoft.SourceLink.Common": "1.0.0"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
"boost": {
|
|
28
|
-
"type": "Transitive",
|
|
29
|
-
"resolved": "1.76.0",
|
|
30
|
-
"contentHash": "p+w3YvNdXL8Cu9Fzrmexssu0tZbWxuf6ywsQqHjDlKFE5ojXHof1HIyMC3zDLfLnh80dIeFcEUAuR2Asg/XHRA=="
|
|
31
|
-
},
|
|
32
27
|
"Microsoft.Build.Tasks.Git": {
|
|
33
28
|
"type": "Transitive",
|
|
34
29
|
"resolved": "1.0.0",
|
|
35
30
|
"contentHash": "z2fpmmt+1Jfl+ZnBki9nSP08S1/tbEOxFdsK1rSR+LBehIJz1Xv9/6qOOoGNqlwnAGGVGis1Oj6S8Kt9COEYlQ=="
|
|
36
31
|
},
|
|
37
|
-
"Microsoft.JavaScript.Hermes": {
|
|
38
|
-
"type": "Transitive",
|
|
39
|
-
"resolved": "0.1.15",
|
|
40
|
-
"contentHash": "My/u5RvxoymtwWokoweU6iVpuP79w271UjadcmSNqnQ9ESIv00tlVP4sHnIiN3t2lJNDeciyE1EVF4swGPECKQ=="
|
|
41
|
-
},
|
|
42
32
|
"Microsoft.Net.Native.Compiler": {
|
|
43
33
|
"type": "Transitive",
|
|
44
34
|
"resolved": "2.2.7-rel-27913-00",
|
|
@@ -70,24 +60,6 @@
|
|
|
70
60
|
"resolved": "1.0.0",
|
|
71
61
|
"contentHash": "G8DuQY8/DK5NN+3jm5wcMcd9QYD90UV7MiLmdljSJixi3U/vNaeBKmmXUqI4DJCOeWizIUEh4ALhSt58mR+5eg=="
|
|
72
62
|
},
|
|
73
|
-
"Microsoft.UI.Xaml": {
|
|
74
|
-
"type": "Transitive",
|
|
75
|
-
"resolved": "2.8.0",
|
|
76
|
-
"contentHash": "vxdHxTr63s5KVtNddMFpgvjBjUH50z7seq/5jLWmmSuf8poxg+sXrywkofUdE8ZstbpO9y3FL/IXXUcPYbeesA==",
|
|
77
|
-
"dependencies": {
|
|
78
|
-
"Microsoft.Web.WebView2": "1.0.1264.42"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"Microsoft.Web.WebView2": {
|
|
82
|
-
"type": "Transitive",
|
|
83
|
-
"resolved": "1.0.1264.42",
|
|
84
|
-
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
|
|
85
|
-
},
|
|
86
|
-
"Microsoft.Windows.SDK.BuildTools": {
|
|
87
|
-
"type": "Transitive",
|
|
88
|
-
"resolved": "10.0.22000.194",
|
|
89
|
-
"contentHash": "4L0P3zqut466SIqT3VBeLTNUQTxCBDOrTRymRuROCRJKazcK7ibLz9yAO1nKWRt50ttCj39oAa2Iuz9ZTDmLlg=="
|
|
90
|
-
},
|
|
91
63
|
"NETStandard.Library": {
|
|
92
64
|
"type": "Transitive",
|
|
93
65
|
"resolved": "2.0.3",
|
|
@@ -172,7 +144,6 @@
|
|
|
172
144
|
"folly": {
|
|
173
145
|
"type": "Project",
|
|
174
146
|
"dependencies": {
|
|
175
|
-
"boost": "[1.76.0, )",
|
|
176
147
|
"fmt": "[1.0.0, )"
|
|
177
148
|
}
|
|
178
149
|
},
|
|
@@ -181,18 +152,13 @@
|
|
|
181
152
|
"dependencies": {
|
|
182
153
|
"Common": "[1.0.0, )",
|
|
183
154
|
"Folly": "[1.0.0, )",
|
|
184
|
-
"
|
|
185
|
-
"Microsoft.UI.Xaml": "[2.8.0, )",
|
|
186
|
-
"Microsoft.Windows.SDK.BuildTools": "[10.0.22000.194, )",
|
|
187
|
-
"ReactCommon": "[1.0.0, )",
|
|
188
|
-
"boost": "[1.76.0, )"
|
|
155
|
+
"ReactCommon": "[1.0.0, )"
|
|
189
156
|
}
|
|
190
157
|
},
|
|
191
158
|
"reactcommon": {
|
|
192
159
|
"type": "Project",
|
|
193
160
|
"dependencies": {
|
|
194
|
-
"Folly": "[1.0.0, )"
|
|
195
|
-
"boost": "[1.76.0, )"
|
|
161
|
+
"Folly": "[1.0.0, )"
|
|
196
162
|
}
|
|
197
163
|
}
|
|
198
164
|
},
|
|
@@ -210,11 +176,6 @@
|
|
|
210
176
|
"runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
|
|
211
177
|
}
|
|
212
178
|
},
|
|
213
|
-
"Microsoft.Web.WebView2": {
|
|
214
|
-
"type": "Transitive",
|
|
215
|
-
"resolved": "1.0.1264.42",
|
|
216
|
-
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
|
|
217
|
-
},
|
|
218
179
|
"runtime.win10-arm.Microsoft.NETCore.UniversalWindowsPlatform": {
|
|
219
180
|
"type": "Transitive",
|
|
220
181
|
"resolved": "6.2.9",
|
|
@@ -235,11 +196,6 @@
|
|
|
235
196
|
"runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
|
|
236
197
|
}
|
|
237
198
|
},
|
|
238
|
-
"Microsoft.Web.WebView2": {
|
|
239
|
-
"type": "Transitive",
|
|
240
|
-
"resolved": "1.0.1264.42",
|
|
241
|
-
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
|
|
242
|
-
},
|
|
243
199
|
"runtime.win10-arm-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
|
|
244
200
|
"type": "Transitive",
|
|
245
201
|
"resolved": "6.2.9",
|
|
@@ -260,11 +216,6 @@
|
|
|
260
216
|
"runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
|
|
261
217
|
}
|
|
262
218
|
},
|
|
263
|
-
"Microsoft.Web.WebView2": {
|
|
264
|
-
"type": "Transitive",
|
|
265
|
-
"resolved": "1.0.1264.42",
|
|
266
|
-
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
|
|
267
|
-
},
|
|
268
219
|
"runtime.win10-arm64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
|
|
269
220
|
"type": "Transitive",
|
|
270
221
|
"resolved": "6.2.9",
|
|
@@ -285,11 +236,6 @@
|
|
|
285
236
|
"runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
|
|
286
237
|
}
|
|
287
238
|
},
|
|
288
|
-
"Microsoft.Web.WebView2": {
|
|
289
|
-
"type": "Transitive",
|
|
290
|
-
"resolved": "1.0.1264.42",
|
|
291
|
-
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
|
|
292
|
-
},
|
|
293
239
|
"runtime.win10-x64.Microsoft.NETCore.UniversalWindowsPlatform": {
|
|
294
240
|
"type": "Transitive",
|
|
295
241
|
"resolved": "6.2.9",
|
|
@@ -310,11 +256,6 @@
|
|
|
310
256
|
"runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
|
|
311
257
|
}
|
|
312
258
|
},
|
|
313
|
-
"Microsoft.Web.WebView2": {
|
|
314
|
-
"type": "Transitive",
|
|
315
|
-
"resolved": "1.0.1264.42",
|
|
316
|
-
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
|
|
317
|
-
},
|
|
318
259
|
"runtime.win10-x64-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
|
|
319
260
|
"type": "Transitive",
|
|
320
261
|
"resolved": "6.2.9",
|
|
@@ -335,11 +276,6 @@
|
|
|
335
276
|
"runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
|
|
336
277
|
}
|
|
337
278
|
},
|
|
338
|
-
"Microsoft.Web.WebView2": {
|
|
339
|
-
"type": "Transitive",
|
|
340
|
-
"resolved": "1.0.1264.42",
|
|
341
|
-
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
|
|
342
|
-
},
|
|
343
279
|
"runtime.win10-x86.Microsoft.NETCore.UniversalWindowsPlatform": {
|
|
344
280
|
"type": "Transitive",
|
|
345
281
|
"resolved": "6.2.9",
|
|
@@ -360,11 +296,6 @@
|
|
|
360
296
|
"runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": "6.2.9"
|
|
361
297
|
}
|
|
362
298
|
},
|
|
363
|
-
"Microsoft.Web.WebView2": {
|
|
364
|
-
"type": "Transitive",
|
|
365
|
-
"resolved": "1.0.1264.42",
|
|
366
|
-
"contentHash": "7OBUTkzQ5VI/3gb0ufi5U4zjuCowAJwQg2li0zXXzqkM+S1kmOlivTy1R4jAW+gY5Vyg510M+qMAESCQUjrfgA=="
|
|
367
|
-
},
|
|
368
299
|
"runtime.win10-x86-aot.Microsoft.NETCore.UniversalWindowsPlatform": {
|
|
369
300
|
"type": "Transitive",
|
|
370
301
|
"resolved": "6.2.9",
|
|
@@ -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.2</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>72</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>2</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>5e9afa8863e83a46610cc49c82e80c1c02cfcf0e</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
<Import Project="$(MSBuildThisFileDirectory)NuGet.Cpp.props" />
|
|
21
21
|
|
|
22
22
|
<PropertyGroup Label="Desktop">
|
|
23
|
-
<!-- See https://
|
|
24
|
-
<WinVer>
|
|
25
|
-
<EnableBeast Condition="'$(EnableBeast)' == ''">0</EnableBeast>
|
|
23
|
+
<!-- See https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt -->
|
|
24
|
+
<WinVer Condition="'$(WinVer)' == ''">_WIN32_WINNT_WIN10</WinVer>
|
|
26
25
|
</PropertyGroup>
|
|
27
26
|
|
|
28
27
|
<PropertyGroup>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#include "BaseFileReaderResource.h"
|
|
5
|
+
|
|
6
|
+
// Boost Library
|
|
7
|
+
#include <boost/archive/iterators/base64_from_binary.hpp>
|
|
8
|
+
#include <boost/archive/iterators/ostream_iterator.hpp>
|
|
9
|
+
#include <boost/archive/iterators/transform_width.hpp>
|
|
10
|
+
|
|
11
|
+
// Windows API
|
|
12
|
+
#include <winrt/base.h>
|
|
13
|
+
|
|
14
|
+
using std::function;
|
|
15
|
+
using std::shared_ptr;
|
|
16
|
+
using std::string;
|
|
17
|
+
|
|
18
|
+
namespace Microsoft::React {
|
|
19
|
+
|
|
20
|
+
#pragma region BaseFileReaderResource
|
|
21
|
+
|
|
22
|
+
BaseFileReaderResource::BaseFileReaderResource(std::weak_ptr<IBlobPersistor> weakBlobPersistor) noexcept
|
|
23
|
+
: m_weakBlobPersistor{weakBlobPersistor} {}
|
|
24
|
+
|
|
25
|
+
#pragma region IFileReaderResource
|
|
26
|
+
|
|
27
|
+
void BaseFileReaderResource::ReadAsText(
|
|
28
|
+
string &&blobId,
|
|
29
|
+
int64_t offset,
|
|
30
|
+
int64_t size,
|
|
31
|
+
string &&encoding,
|
|
32
|
+
function<void(string &&)> &&resolver,
|
|
33
|
+
function<void(string &&)> &&rejecter) noexcept /*override*/ {
|
|
34
|
+
auto persistor = m_weakBlobPersistor.lock();
|
|
35
|
+
if (!persistor) {
|
|
36
|
+
return resolver("Could not find Blob persistor");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
winrt::array_view<uint8_t const> bytes;
|
|
40
|
+
try {
|
|
41
|
+
bytes = persistor->ResolveMessage(std::move(blobId), offset, size);
|
|
42
|
+
} catch (const std::exception &e) {
|
|
43
|
+
return rejecter(e.what());
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// #9982 - Handle non-UTF8 encodings
|
|
47
|
+
// See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/charset/Charset.html
|
|
48
|
+
auto result = string{bytes.cbegin(), bytes.cend()};
|
|
49
|
+
|
|
50
|
+
resolver(std::move(result));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
void BaseFileReaderResource::ReadAsDataUrl(
|
|
54
|
+
string &&blobId,
|
|
55
|
+
int64_t offset,
|
|
56
|
+
int64_t size,
|
|
57
|
+
string &&type,
|
|
58
|
+
function<void(string &&)> &&resolver,
|
|
59
|
+
function<void(string &&)> &&rejecter) noexcept /*override*/ {
|
|
60
|
+
auto persistor = m_weakBlobPersistor.lock();
|
|
61
|
+
if (!persistor) {
|
|
62
|
+
return rejecter("Could not find Blob persistor");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
winrt::array_view<uint8_t const> bytes;
|
|
66
|
+
try {
|
|
67
|
+
bytes = persistor->ResolveMessage(std::move(blobId), offset, size);
|
|
68
|
+
} catch (const std::exception &e) {
|
|
69
|
+
return rejecter(e.what());
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
auto result = string{"data:"};
|
|
73
|
+
result += type;
|
|
74
|
+
result += ";base64,";
|
|
75
|
+
|
|
76
|
+
// https://www.boost.org/doc/libs/1_76_0/libs/serialization/doc/dataflow.html
|
|
77
|
+
using namespace boost::archive::iterators;
|
|
78
|
+
typedef base64_from_binary<transform_width<const char *, 6, 8>> encode_base64;
|
|
79
|
+
std::ostringstream oss;
|
|
80
|
+
std::copy(encode_base64(bytes.cbegin()), encode_base64(bytes.cend()), ostream_iterator<char>(oss));
|
|
81
|
+
result += oss.str();
|
|
82
|
+
|
|
83
|
+
resolver(std::move(result));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/*static*/ shared_ptr<IFileReaderResource> IFileReaderResource::Make(
|
|
87
|
+
std::weak_ptr<IBlobPersistor> weakBlobPersistor) noexcept {
|
|
88
|
+
return std::make_shared<BaseFileReaderResource>(weakBlobPersistor);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
#pragma endregion IFileReaderResource
|
|
92
|
+
|
|
93
|
+
#pragma endregion BaseFileReaderResource
|
|
94
|
+
|
|
95
|
+
} // namespace Microsoft::React
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
#include "IFileReaderResource.h"
|
|
7
|
+
|
|
8
|
+
// Standard Library
|
|
9
|
+
#include <memory>
|
|
10
|
+
|
|
11
|
+
namespace Microsoft::React {
|
|
12
|
+
|
|
13
|
+
class BaseFileReaderResource : public IFileReaderResource, public std::enable_shared_from_this<BaseFileReaderResource> {
|
|
14
|
+
protected:
|
|
15
|
+
std::weak_ptr<IBlobPersistor> m_weakBlobPersistor;
|
|
16
|
+
|
|
17
|
+
public:
|
|
18
|
+
BaseFileReaderResource(std::weak_ptr<IBlobPersistor> weakBlobPersistor) noexcept;
|
|
19
|
+
|
|
20
|
+
#pragma region IFileReaderResource
|
|
21
|
+
|
|
22
|
+
void ReadAsText(
|
|
23
|
+
std::string &&blobId,
|
|
24
|
+
int64_t offset,
|
|
25
|
+
int64_t size,
|
|
26
|
+
std::string &&encoding,
|
|
27
|
+
std::function<void(std::string &&)> &&resolver,
|
|
28
|
+
std::function<void(std::string &&)> &&rejecter) noexcept override;
|
|
29
|
+
|
|
30
|
+
void ReadAsDataUrl(
|
|
31
|
+
std::string &&blobId,
|
|
32
|
+
int64_t offset,
|
|
33
|
+
int64_t size,
|
|
34
|
+
std::string &&type,
|
|
35
|
+
std::function<void(std::string &&)> &&resolver,
|
|
36
|
+
std::function<void(std::string &&)> &&rejecter) noexcept override;
|
|
37
|
+
|
|
38
|
+
#pragma endregion IFileReaderResource
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
} // namespace Microsoft::React
|
package/Shared/CreateModules.h
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
// React Native
|
|
7
7
|
#include <cxxreact/CxxModule.h>
|
|
8
|
-
#include <smartPtr/cntPtr.h>
|
|
9
8
|
|
|
10
9
|
// Windows API
|
|
11
10
|
#include <winrt/Windows.Foundation.h>
|
|
@@ -14,12 +13,16 @@
|
|
|
14
13
|
#include <memory>
|
|
15
14
|
|
|
16
15
|
// Forward declarations. Desktop projects can not access <React.h>
|
|
16
|
+
namespace winrt::Microsoft::ReactNative {
|
|
17
|
+
struct ReactContext;
|
|
18
|
+
struct ReactModuleProvider;
|
|
19
|
+
} // namespace winrt::Microsoft::ReactNative
|
|
20
|
+
|
|
17
21
|
namespace Mso::React {
|
|
18
22
|
struct IReactContext;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
namespace facebook {
|
|
22
|
-
namespace react {
|
|
25
|
+
namespace facebook::react {
|
|
23
26
|
|
|
24
27
|
class MessageQueueThread;
|
|
25
28
|
|
|
@@ -29,11 +32,12 @@ class MessageQueueThread;
|
|
|
29
32
|
extern std::unique_ptr<facebook::xplat::module::CxxModule> CreateTimingModule(
|
|
30
33
|
const std::shared_ptr<facebook::react::MessageQueueThread> &nativeThread) noexcept;
|
|
31
34
|
|
|
32
|
-
} // namespace react
|
|
33
|
-
} // namespace facebook
|
|
35
|
+
} // namespace facebook::react
|
|
34
36
|
|
|
35
37
|
namespace Microsoft::React {
|
|
36
38
|
|
|
39
|
+
#pragma region CxxModules
|
|
40
|
+
|
|
37
41
|
extern const char *GetHttpModuleName() noexcept;
|
|
38
42
|
extern std::unique_ptr<facebook::xplat::module::CxxModule> CreateHttpModule(
|
|
39
43
|
winrt::Windows::Foundation::IInspectable const &inspectableProperties) noexcept;
|
|
@@ -50,4 +54,22 @@ extern const char *GetFileReaderModuleName() noexcept;
|
|
|
50
54
|
extern std::unique_ptr<facebook::xplat::module::CxxModule> CreateFileReaderModule(
|
|
51
55
|
winrt::Windows::Foundation::IInspectable const &inspectableProperties) noexcept;
|
|
52
56
|
|
|
57
|
+
#pragma endregion CxxModules
|
|
58
|
+
|
|
59
|
+
#pragma region TurboModules
|
|
60
|
+
|
|
61
|
+
extern const wchar_t *GetBlobTurboModuleName() noexcept;
|
|
62
|
+
extern const winrt::Microsoft::ReactNative::ReactModuleProvider &GetBlobModuleProvider() noexcept;
|
|
63
|
+
|
|
64
|
+
extern const wchar_t *GetHttpTurboModuleName() noexcept;
|
|
65
|
+
extern const winrt::Microsoft::ReactNative::ReactModuleProvider &GetHttpModuleProvider() noexcept;
|
|
66
|
+
|
|
67
|
+
extern const wchar_t *GetFileReaderTurboModuleName() noexcept;
|
|
68
|
+
extern const winrt::Microsoft::ReactNative::ReactModuleProvider &GetFileReaderModuleProvider() noexcept;
|
|
69
|
+
|
|
70
|
+
extern const wchar_t *GetWebSocketTurboModuleName() noexcept;
|
|
71
|
+
extern const winrt::Microsoft::ReactNative::ReactModuleProvider &GetWebSocketModuleProvider() noexcept;
|
|
72
|
+
|
|
73
|
+
#pragma endregion TurboModules
|
|
74
|
+
|
|
53
75
|
} // namespace Microsoft::React
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
#include "IBlobPersistor.h"
|
|
7
|
+
|
|
8
|
+
// Standard Library
|
|
9
|
+
#include <functional>
|
|
10
|
+
#include <string>
|
|
11
|
+
|
|
12
|
+
namespace Microsoft::React {
|
|
13
|
+
|
|
14
|
+
struct IFileReaderResource {
|
|
15
|
+
virtual ~IFileReaderResource() noexcept {}
|
|
16
|
+
|
|
17
|
+
virtual void ReadAsText(
|
|
18
|
+
std::string &&blobId,
|
|
19
|
+
int64_t offset,
|
|
20
|
+
int64_t size,
|
|
21
|
+
std::string &&encoding,
|
|
22
|
+
std::function<void(std::string &&)> &&resolver,
|
|
23
|
+
std::function<void(std::string &&)> &&rejecter) noexcept = 0;
|
|
24
|
+
|
|
25
|
+
virtual void ReadAsDataUrl(
|
|
26
|
+
std::string &&blobId,
|
|
27
|
+
int64_t offset,
|
|
28
|
+
int64_t size,
|
|
29
|
+
std::string &&type,
|
|
30
|
+
std::function<void(std::string &&)> &&resolver,
|
|
31
|
+
std::function<void(std::string &&)> &&rejecter) noexcept = 0;
|
|
32
|
+
|
|
33
|
+
static std::shared_ptr<IFileReaderResource> Make(std::weak_ptr<IBlobPersistor> weakBlobPersistor) noexcept;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
} // namespace Microsoft::React
|