react-native-windows 0.70.0 → 0.70.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/Network/RCTNetworking.windows.js +117 -1
- package/Microsoft.ReactNative/Pch/pch.h +0 -1
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +4 -2
- package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +1 -3
- package/PropertySheets/External/Microsoft.ReactNative.Common.props +0 -9
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.props +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.props +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.props +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.props +1 -0
- package/PropertySheets/External/Microsoft.ReactNative.WinAppSDK.CSharpApp.props +1 -0
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/PropertySheets/NuGet.CSharp.props +15 -0
- package/PropertySheets/NuGet.Cpp.props +31 -0
- package/PropertySheets/React.Cpp.props +1 -15
- package/Scripts/OfficeReact.Win32.nuspec +1 -0
- package/Shared/Modules/HttpModule.cpp +4 -2
- package/Shared/Modules/HttpModule.h +1 -1
- package/Shared/Networking/IHttpResource.h +1 -1
- package/Shared/Networking/IRedirectEventSource.h +18 -0
- package/Shared/Networking/IWinRTHttpRequestFactory.h +22 -0
- package/Shared/Networking/OriginPolicy.h +1 -1
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +47 -16
- package/Shared/Networking/OriginPolicyHttpFilter.h +16 -3
- package/Shared/Networking/RedirectHttpFilter.cpp +283 -0
- package/Shared/Networking/RedirectHttpFilter.h +97 -0
- package/Shared/Networking/WinRTHttpResource.cpp +207 -154
- package/Shared/Networking/WinRTHttpResource.h +17 -4
- package/Shared/Shared.vcxitems +4 -0
- package/Shared/Shared.vcxitems.filters +12 -0
- package/package.json +1 -1
- package/template/cpp-app/proj/MyApp.vcxproj +0 -3
- package/template/cpp-lib/proj/MyLib.vcxproj +0 -3
- package/template/cs-app/proj/MyApp.csproj +0 -3
- package/template/cs-lib/proj/MyLib.csproj +0 -3
- package/Libraries/Network/RCTNetworkingWinShared.js +0 -117
|
@@ -15,9 +15,6 @@
|
|
|
15
15
|
<ApplicationType>Windows Store</ApplicationType>
|
|
16
16
|
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
|
17
17
|
</PropertyGroup>
|
|
18
|
-
<PropertyGroup Label="NuGet">
|
|
19
|
-
<ResolveNuGetPackages>false</ResolveNuGetPackages>
|
|
20
|
-
</PropertyGroup>
|
|
21
18
|
<PropertyGroup Label="ReactNativeWindowsProps">
|
|
22
19
|
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(SolutionDir), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
|
|
23
20
|
</PropertyGroup>
|
|
@@ -25,9 +25,6 @@
|
|
|
25
25
|
<AppxGeneratePrisForPortableLibrariesEnabled>false</AppxGeneratePrisForPortableLibrariesEnabled>
|
|
26
26
|
<LangVersion>7.3</LangVersion>
|
|
27
27
|
</PropertyGroup>
|
|
28
|
-
<PropertyGroup Label="NuGet">
|
|
29
|
-
<AssetTargetFallback>$(AssetTargetFallback);native</AssetTargetFallback>
|
|
30
|
-
</PropertyGroup>
|
|
31
28
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
|
32
29
|
<DebugSymbols>true</DebugSymbols>
|
|
33
30
|
<OutputPath>bin\x86\Debug\</OutputPath>
|
|
@@ -24,9 +24,6 @@
|
|
|
24
24
|
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
|
|
25
25
|
<LangVersion>7.3</LangVersion>
|
|
26
26
|
</PropertyGroup>
|
|
27
|
-
<PropertyGroup Label="NuGet">
|
|
28
|
-
<AssetTargetFallback>$(AssetTargetFallback);native</AssetTargetFallback>
|
|
29
|
-
</PropertyGroup>
|
|
30
27
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
|
31
28
|
<DebugSymbols>true</DebugSymbols>
|
|
32
29
|
<OutputPath>bin\x86\Debug\</OutputPath>
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*
|
|
5
|
-
* @flow strict-local
|
|
6
|
-
* @format
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
'use strict';
|
|
10
|
-
|
|
11
|
-
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
|
-
import {type EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
17
|
-
|
|
18
|
-
type RCTNetworkingEventDefinitions = $ReadOnly<{
|
|
19
|
-
didSendNetworkData: [
|
|
20
|
-
[
|
|
21
|
-
number, // requestId
|
|
22
|
-
number, // progress
|
|
23
|
-
number, // total
|
|
24
|
-
],
|
|
25
|
-
],
|
|
26
|
-
didReceiveNetworkResponse: [
|
|
27
|
-
[
|
|
28
|
-
number, // requestId
|
|
29
|
-
number, // status
|
|
30
|
-
?{[string]: string}, // responseHeaders
|
|
31
|
-
?string, // responseURL
|
|
32
|
-
],
|
|
33
|
-
],
|
|
34
|
-
didReceiveNetworkData: [
|
|
35
|
-
[
|
|
36
|
-
number, // requestId
|
|
37
|
-
string, // response
|
|
38
|
-
],
|
|
39
|
-
],
|
|
40
|
-
didReceiveNetworkIncrementalData: [
|
|
41
|
-
[
|
|
42
|
-
number, // requestId
|
|
43
|
-
string, // responseText
|
|
44
|
-
number, // progress
|
|
45
|
-
number, // total
|
|
46
|
-
],
|
|
47
|
-
],
|
|
48
|
-
didReceiveNetworkDataProgress: [
|
|
49
|
-
[
|
|
50
|
-
number, // requestId
|
|
51
|
-
number, // loaded
|
|
52
|
-
number, // total
|
|
53
|
-
],
|
|
54
|
-
],
|
|
55
|
-
didCompleteNetworkResponse: [
|
|
56
|
-
[
|
|
57
|
-
number, // requestId
|
|
58
|
-
string, // error
|
|
59
|
-
boolean, // timeOutError
|
|
60
|
-
],
|
|
61
|
-
],
|
|
62
|
-
}>;
|
|
63
|
-
|
|
64
|
-
let _requestId = 1;
|
|
65
|
-
function generateRequestId(): number {
|
|
66
|
-
return _requestId++;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const RCTNetworking = {
|
|
70
|
-
addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
|
|
71
|
-
eventType: K,
|
|
72
|
-
listener: (...$ElementType<RCTNetworkingEventDefinitions, K>) => mixed,
|
|
73
|
-
context?: mixed,
|
|
74
|
-
): EventSubscription {
|
|
75
|
-
return RCTDeviceEventEmitter.addListener(eventType, listener, context);
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
sendRequest(
|
|
79
|
-
method: string,
|
|
80
|
-
trackingName: string,
|
|
81
|
-
url: string,
|
|
82
|
-
headers: {...},
|
|
83
|
-
data: RequestBody,
|
|
84
|
-
responseType: NativeResponseType,
|
|
85
|
-
incrementalUpdates: boolean,
|
|
86
|
-
timeout: number,
|
|
87
|
-
callback: (requestId: number) => void,
|
|
88
|
-
withCredentials: boolean,
|
|
89
|
-
) {
|
|
90
|
-
const requestId = generateRequestId();
|
|
91
|
-
const body = convertRequestBody(data);
|
|
92
|
-
RCTNetworkingNative.sendRequest(
|
|
93
|
-
{
|
|
94
|
-
method,
|
|
95
|
-
url,
|
|
96
|
-
requestId,
|
|
97
|
-
data: {...body, trackingName},
|
|
98
|
-
headers,
|
|
99
|
-
responseType,
|
|
100
|
-
incrementalUpdates,
|
|
101
|
-
timeout,
|
|
102
|
-
withCredentials,
|
|
103
|
-
},
|
|
104
|
-
callback,
|
|
105
|
-
);
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
abortRequest(requestId: number) {
|
|
109
|
-
RCTNetworkingNative.abortRequest(requestId);
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
clearCookies(callback: (result: boolean) => void) {
|
|
113
|
-
RCTNetworkingNative.clearCookies(callback);
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
module.exports = RCTNetworking;
|