Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update target version to 19h1 and set XamlRoot for Flyout #2456

Merged
25 commits merged into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
748aa16
Merge pull request #1 from Microsoft/master
licanhua May 6, 2019
8d5ae2d
Merge pull request #2 from microsoft/master
licanhua May 8, 2019
190e01f
Merge pull request #3 from microsoft/master
licanhua May 9, 2019
6254a72
Merge pull request #4 from microsoft/master
licanhua May 10, 2019
45963fd
Merge pull request #6 from microsoft/master
licanhua May 23, 2019
25d8bbb
Merge pull request #7 from microsoft/master
licanhua Jun 3, 2019
7f4b9b1
draft
licanhua May 10, 2019
afb6801
workaround cppwinrt error
licanhua May 10, 2019
30a3b61
popup fix
licanhua May 10, 2019
e77cfb8
rollback change to popup and update Flyout
licanhua May 14, 2019
597c5d6
update comment from popup to flyout
licanhua May 14, 2019
97cdf60
change signature and rename getShadowNodeWithXamlRoot
licanhua Jun 6, 2019
1937eca
Merge branch 'master' of https:///github.com/licanhua/react-native-wi…
licanhua Jun 9, 2019
fb9728d
Merge pull request #8 from microsoft/master
licanhua Jun 9, 2019
8853a02
Merge branch 'master' of https:///github.com/licanhua/react-native-wi…
licanhua Jun 9, 2019
ee7cf4e
draft
licanhua May 10, 2019
cf36f27
workaround cppwinrt error
licanhua May 10, 2019
1303516
popup fix
licanhua May 10, 2019
50afb93
rollback change to popup and update Flyout
licanhua May 14, 2019
6b46ca5
update comment from popup to flyout
licanhua May 14, 2019
907cb15
change signature and rename getShadowNodeWithXamlRoot
licanhua Jun 6, 2019
11805fd
install SDK
licanhua Jun 9, 2019
7a9662b
install SDK for win32
licanhua Jun 9, 2019
d0c2663
Merge branch 'user/canli/supportsIsland' of https:///github.com/lican…
licanhua Jun 9, 2019
1f67e81
install desktopcpp
licanhua Jun 9, 2019
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 vnext/Playground/Playground/Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyName>Playground</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
Expand Down
4 changes: 2 additions & 2 deletions vnext/PropertySheets/React.Cpp.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<PropertyGroup Label="Globals">
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<!-- Use RS5 SDK (10.0.17763.0) Support running on RS2+ (10.0.15063.0) -->
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<!-- Use 19H1 SDK (10.0.18362.0) Support running on RS2+ (10.0.15063.0) -->
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.15063.0</WindowsTargetPlatformMinVersion>
</PropertyGroup>

Expand Down
19 changes: 19 additions & 0 deletions vnext/ReactUWP/Modules/NativeUIManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@ void NativeUIManager::DirtyYogaNode(int64_t tag)
}
}

winrt::XamlRoot NativeUIManager::tryGetXamlRoot()
{
if (m_host)
{
for (auto const tag : m_host->GetAllRootTags())
{
if (auto shadowNode = static_cast<ShadowNodeBase*>(m_host->FindShadowNodeForTag(tag)))
{
if (auto uiElement10 = shadowNode->GetView().try_as<winrt::IUIElement10>())
{
if (auto xamlRoot = uiElement10.XamlRoot())
return xamlRoot;
}
}
}
}
return nullptr;
}

NativeUIManager::NativeUIManager()
{
#if defined(_DEBUG)
Expand Down
5 changes: 5 additions & 0 deletions vnext/ReactUWP/Modules/NativeUIManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class NativeUIManager : public facebook::react::INativeUIManager
// Other public functions
void DirtyYogaNode(int64_t tag);

// For unparented node like Flyout, XamlRoot should be set to handle XamlIsland/AppWindow scenarios.
// Since it doesn't have parent, and all nodes in the tree should have the same XamlRoot,
// this function iterates all roots and try to get a valid XamlRoot.
winrt::XamlRoot tryGetXamlRoot();

private:
void DoLayout();
void UpdateExtraLayout(int64_t tag);
Expand Down
5 changes: 3 additions & 2 deletions vnext/ReactUWP/ReactUWP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
<SDLCheck>true</SDLCheck>
<!--
REACTWINDOWS_BUILD - building with REACTWINDOWS_API as dll exports
OLD_CPPWINRT is a workaround to make target version to 19H1
-->
<PreprocessorDefinitions>REACTWINDOWS_BUILD;RN_PLATFORM=uwp;USE_EDGEMODE_JSRT;NOMINMAX;FOLLY_NO_CONFIG;RN_EXPORT=;JSI_EXPORT=;WIN32=0;WINRT=1;NOJSC;_HAS_AUTO_PTR_ETC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>OLD_CPPWINRT;REACTWINDOWS_BUILD;RN_PLATFORM=uwp;USE_EDGEMODE_JSRT;NOMINMAX;FOLLY_NO_CONFIG;RN_EXPORT=;JSI_EXPORT=;WIN32=0;WINRT=1;NOJSC;_HAS_AUTO_PTR_ETC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ReactNativeWindowsDir);$(ReactNativeWindowsDir)Pch;$(ReactNativeWindowsDir)ReactUWP\GeneratedWinmdHeader;$(ReactNativeWindowsDir)ReactWindowsCore;$(ReactNativeWindowsDir)include\ReactWindowsCore;$(ReactNativeWindowsDir)include\ReactUWP;$(YogaDir);$(ReactNativeDir)\ReactCommon;$(ReactNativeWindowsDir)include;$(ReactNativeWindowsDir)stubs;$(ReactNativeWindowsDir)Shared;$(FollyDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalOptions>/await %(AdditionalOptions)</AdditionalOptions>
Expand Down Expand Up @@ -135,7 +136,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(ApplicationTypeRevision)' == '10.0'">
<MetaDataDir Include="$(WindowsSDK_MetadataPath)\$(WindowsTargetPlatformVersion)\Windows.Foundation.FoundationContract\3.0.0.0" />
<MetaDataDir Include="$(WindowsSDK_MetadataPath)\$(WindowsTargetPlatformVersion)\Windows.Foundation.UniversalApiContract\7.0.0.0" />
<MetaDataDir Include="$(WindowsSDK_MetadataPath)\$(WindowsTargetPlatformVersion)\Windows.Foundation.UniversalApiContract\8.0.0.0" />
</ItemGroup>
<Message Text="$(MdMergeExe) -v @(MetaDataDir -> '-metadata_dir &quot;%(Identity)&quot;', ' ') -o &quot;$(MergedWinmdDirectory)&quot; -i &quot;$(UnmergedWinmdDirectory)&quot; -partial -n:-1" />
<Exec Command="$(MdMergeExe) -v @(MetaDataDir -> '-metadata_dir &quot;%(Identity)&quot;', ' ') -o &quot;$(MergedWinmdDirectory)&quot; -i &quot;$(UnmergedWinmdDirectory)&quot; -partial -n:-1" />
Expand Down
12 changes: 12 additions & 0 deletions vnext/ReactUWP/Views/FlyoutViewManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ void FlyoutShadowNode::createView()
if (!m_updating && instance != nullptr)
OnFlyoutClosed(*instance, m_tag, false);
});

// Set XamlRoot on the Flyout to handle XamlIsland/AppWindow scenarios.
if (auto flyoutBase6 = m_flyout.try_as<winrt::IFlyoutBase6>())
licanhua marked this conversation as resolved.
Show resolved Hide resolved
{
if (auto instance = wkinstance.lock())
{
if (auto xamlRoot = static_cast<NativeUIManager*>(instance->NativeUIManager())->tryGetXamlRoot())
{
flyoutBase6.XamlRoot(xamlRoot);
}
}
}
}

/*static*/ void FlyoutShadowNode::OnFlyoutClosed(IReactInstance& instance, int64_t tag, bool newValue)
Expand Down
2 changes: 1 addition & 1 deletion vnext/V8Inspector/V8Inspector.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<ProjectGuid>{F1B91D19-79E4-461B-AC8E-E3E6E747F65F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>V8Inspector</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down
3 changes: 1 addition & 2 deletions vnext/docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ This is a summary of setup steps needed to install and work with React Native fo
* Node.js development support
* SDKs, libraries, and frameworks per your versioning needs
* Windows 10 SDK (10.0.15063.0)
* Windows 10 SDK (10.0.16299.0)
* Windows 10 SDK (10.0.17763.0)
* Windows 10 SDK (10.0.18362.0)

## Dependencies
* Install the dependencies [specified by React Native](http://facebook.github.io/react-native/docs/getting-started.html#node-python2-jdk). Specifically, make sure a recent version of [Node.js](https://nodejs.org) is installed. [Chocolatey](https://chocolatey.org/) is the React Native recommended installation method. On an elevated Command Prompt, run:
Expand Down
4 changes: 2 additions & 2 deletions vnext/local-cli/generator-windows/templates/proj/MyApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<AssemblyName><%=ns%></AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down