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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"**/lib/**/*.js": true,
"**/node_modules": false
},
"editor.formatOnSave": true,
"editor.formatOnSave": false,
"eslint.format.enable": true,
"eslint.packageManager": "yarn",
"eslint.enable": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Use TurboModules for networking in MSRN (#11867)",
"packageName": "react-native-windows",
"email": "julio.rocha@microsoft.com",
"dependentChangeType": "patch"
}
4 changes: 2 additions & 2 deletions packages/playground/windows/playground-win32-packaged.sln
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ Global
..\..\..\vnext\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Debug|ARM = Debug|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
Release|ARM = Release|ARM
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8B88FFAE-4DBC-49A2-AFA5-D2477D4AD189}.Debug|ARM.ActiveCfg = Debug|Win32
Expand Down
4 changes: 2 additions & 2 deletions packages/playground/windows/playground-win32.sln
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ Global
..\..\..\vnext\Shared\Shared.vcxitems*{f7d32bd0-2749-483e-9a0d-1635ef7e3136}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Debug|ARM = Debug|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
Release|ARM = Release|ARM
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8B88FFAE-4DBC-49A2-AFA5-D2477D4AD189}.Debug|ARM.ActiveCfg = Debug|Win32
Expand Down
3 changes: 3 additions & 0 deletions vnext/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@ csharp_prefer_simple_default_expression = false:none
indent_style = tab
indent_size = 4

[overrides.json]
insert_final_newline = false

[package.json]
insert_final_newline = false
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace http = boost::beast::http;

using folly::dynamic;
using Microsoft::React::Networking::IHttpResource;
using Microsoft::React::Networking::OriginPolicy;
using std::make_shared;
Expand Down Expand Up @@ -146,10 +145,10 @@ TEST_CLASS(HttpOriginPolicyIntegrationTest)
string{server1Args.Url},
0, /*requestId*/
std::move(clientArgs.RequestHeaders),
dynamic::object("string", ""), /*data*/
{ { "string", "" } }, /*data*/
"text",
false, /*useIncrementalUpdates*/
0, /*timeout*/
0, /*timeout*/
clientArgs.WithCredentials, /*withCredentials*/
[](int64_t){} /*reactCallback*/
);
Expand Down Expand Up @@ -200,10 +199,10 @@ TEST_CLASS(HttpOriginPolicyIntegrationTest)
string{serverArgs.Url},
0, /*requestId*/
std::move(clientArgs.RequestHeaders),
dynamic::object("string", ""), /*data*/
{ { "string", "" } }, /*data*/
"text",
false, /*useIncrementalUpdates*/
0, /*timeout*/
0, /*timeout*/
clientArgs.WithCredentials, /*withCredentials*/
[](int64_t) {} /*reactCallback*/
);
Expand Down Expand Up @@ -298,12 +297,12 @@ TEST_CLASS(HttpOriginPolicyIntegrationTest)
{
{"ValidHeader", "AnyValue"}
},
dynamic::object("string", ""), /*data*/
{ { "string", "" } }, /*data*/
"text",
false /*useIncrementalUpdates*/,
0 /*timeout*/,
false /*withCredentials*/,
[](int64_t) {} /*callback*/
false /*useIncrementalUpdates*/,
0 /*timeout*/,
false /*withCredentials*/,
[](int64_t) {} /*callback*/
);

getDataPromise.get_future().wait();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ TEST_MODULE_INITIALIZE(InitModule) {
using Microsoft::React::SetRuntimeOptionBool;

SetRuntimeOptionBool("WebSocket.AcceptSelfSigned", true);
SetRuntimeOptionBool("UseBeastWebSocket", false);
SetRuntimeOptionBool("Blob.EnableModule", true);

// WebSocketJSExecutor can't register native log hooks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
<Import Project="..\Microsoft.ReactNative.Cxx\Microsoft.ReactNative.Cxx.vcxitems" Label="Shared" />
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
Expand All @@ -47,22 +48,32 @@
<ItemDefinitionGroup>
<ClCompile>
<SDLCheck>true</SDLCheck>
<!-- See https://stackoverflow.com/questions/42847103/stdtr1-with-visual-studio-2017. -->
<!--
See https://stackoverflow.com/questions/42847103/stdtr1-with-visual-studio-2017.

CORE_ABI - marks ABI elements that are shared between UWP and Win32 DLLs.
-->
<PreprocessorDefinitions>
BOOST_ASIO_HAS_IOCP;
CORE_ABI;
_WIN32_WINNT=$(WinVer);
WIN32;
_WINDOWS;
FOLLY_NO_CONFIG;
NOMINMAX;
_HAS_AUTO_PTR_ETC;
RN_PLATFORM=windesktop;
RN_PLATFORM=win32;
RN_EXPORT=;
JSI_EXPORT=;
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>
$(VCInstallDir)UnitTest\include;
"$(ReactNativeWindowsDir)Microsoft.ReactNative";
"$(ReactNativeWindowsDir)\Shared\tracing";
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
<UseFullPaths>true</UseFullPaths>
</ClCompile>
<Link>
Expand Down Expand Up @@ -128,4 +139,23 @@
<Target Name="Test">
<Exec Command="$(OutDir)$(TargetFileName)" IgnoreStandardErrorWarningFormat="true" />
</Target>
<Target Name="SetCppWinRTReferences" AfterTargets="GetCppWinRTProjectWinMDReferences" BeforeTargets="CppWinRTMakeReferenceProjection" Returns="@(CppWinRTDynamicProjectWinMDReferences)">
<ItemGroup>
<!--
To increase resilience against build configuration changes, we could try to obtain the .winmd
path below from the Desktop.DLL project reference. The respective task should look similar to
'GetTargetFileName' MSBuild task in the 'GetRNDllPath' target below (and potentially share
build logic with it).
-->
<CppWinRTDynamicProjectWinMDReferences Include="$(OutputPath)..\React.Windows.Desktop\facebook.react.winmd">
<WinMDPath>$(OutputPath)..\React.Windows.Desktop\facebook.react.winmd</WinMDPath>
</CppWinRTDynamicProjectWinMDReferences>
<CppWinRTDynamicProjectWinMDReferences Include="$(OutputPath)..\React.Windows.Desktop\Microsoft.Internal.winmd">
<WinMDPath>$(OutputPath)..\React.Windows.Desktop\Microsoft.Internal.winmd</WinMDPath>
</CppWinRTDynamicProjectWinMDReferences>
<CppWinRTDynamicProjectWinMDReferences Include="$(OutputPath)..\React.Windows.Desktop\Microsoft.ReactNative.winmd">
<WinMDPath>$(OutputPath)..\React.Windows.Desktop\Microsoft.ReactNative.winmd</WinMDPath>
</CppWinRTDynamicProjectWinMDReferences>
</ItemGroup>
</Target>
</Project>
129 changes: 0 additions & 129 deletions vnext/Desktop.UnitTests/BaseWebSocketTests.cpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<IncludePath>$(ReactNativeWindowsDir)Mso;$(ReactNativeWindowsDir)Common;$(ReactNativeWindowsDir)Desktop;$(ReactNativeWindowsDir)stubs;$(ReactNativeWindowsDir)Shared;$(ReactNativeWindowsDir)include\Shared;$(MSBuildThisFileDirectory);$(IncludePath)</IncludePath>
<IncludePath>$(ReactNativeWindowsDir)Mso;$(ReactNativeWindowsDir)Common;$(ReactNativeWindowsDir)Desktop;$(ReactNativeWindowsDir)stubs;$(ReactNativeWindowsDir)Shared;$(ReactNativeWindowsDir)include\Shared;$(ReactNativeWindowsDir)Microsoft.ReactNative.Cxx;$(MSBuildThisFileDirectory);$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
Expand Down Expand Up @@ -83,9 +83,10 @@
</ItemDefinitionGroup>
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactCommunity.cpp.props" />
<ItemGroup>
<ClCompile Include="BaseWebSocketTests.cpp">
<ExcludedFromBuild Condition="'$(EnableBeast)' == 0">true</ExcludedFromBuild>
</ClCompile>
<Midl Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\IJSValueReader.idl" />
<Midl Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\IJSValueWriter.idl" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="BytecodeUnitTests.cpp" />
<ClCompile Include="EmptyUIManagerModule.cpp" />
<ClCompile Include="LayoutAnimationTests.cpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<ClCompile Include="InstanceMocks.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BaseWebSocketTests.cpp">
<Filter>Unit Tests</Filter>
</ClCompile>
<ClCompile Include="BytecodeUnitTests.cpp">
<Filter>Unit Tests</Filter>
</ClCompile>
Expand Down
2 changes: 2 additions & 0 deletions vnext/Desktop.UnitTests/RedirectHttpFilterUnitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "WinRTNetworkingMocks.h"

// Windows API
#include <Windows.h>
// Leaving a line so clang-format does not mess up include ordering
#include <WinInet.h>
#include <winrt/Windows.Web.Http.Headers.h>

Expand Down
Loading