forked from microsoft/react-native-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated bundle command * Added RNW VNext page, issue microsoft#2376
- Loading branch information
1 parent
c02a622
commit ec9c25b
Showing
6 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Don't commit bundles | ||
*ReactAssets* | ||
*Bundle* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Page | ||
x:Class="PerfCompare.ReactNativeVNextPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:PerfCompare" | ||
xmlns:rn="using:react.uwp" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
Loaded="Page_Loaded"> | ||
|
||
<Grid> | ||
<rn:ReactControl x:Name="RootElement" /> | ||
</Grid> | ||
|
||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
using react.uwp; | ||
|
||
namespace PerfCompare | ||
{ | ||
public sealed partial class ReactNativeVNextPage : Page | ||
{ | ||
private IInstance _instance; | ||
|
||
const string JSFILENAME = "index.uwp"; | ||
const string JSCOMPONENTNAME = "PerfCompareRN"; | ||
|
||
public ReactNativeVNextPage() | ||
{ | ||
this.InitializeComponent(); | ||
LoadReact(); | ||
} | ||
|
||
private void LoadReact() | ||
{ | ||
_instance = Instance.Create(JSFILENAME); | ||
|
||
_instance.Start(new InstanceSettings() | ||
{ | ||
UseWebDebugger = false, | ||
UseLiveReload = false, | ||
}); | ||
|
||
RootElement.Instance = _instance; | ||
RootElement.InitialProps = "{}"; | ||
RootElement.JsComponentName = JSCOMPONENTNAME; | ||
|
||
RootElement.StartRender(); | ||
} | ||
|
||
private async void Page_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
await Dispatcher.RunIdleAsync((args) => | ||
{ | ||
App.PerfStats.Stop(); | ||
App.ShowStats(); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters