This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
WIP: React Native Windows Support #193
Open
ryanlntn
wants to merge
7
commits into
Galooshi:master
Choose a base branch
from
ryanlntn:react-native-windows
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9b9ef08
Add initial react-native-windows runner and build script
ryanlntn 7fb6130
Setup windows HappoRunner
ryanlntn 3331cf1
Initial windows support
ryanlntn 475ed43
Update deps
ryanlntn e8b87b2
Clean up
ryanlntn e2cf7d1
Fix happo module resolution issue
ryanlntn 7ed71dd
Windows can't find appium so assume it's already started
ryanlntn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
This file was deleted.
Oops, something went wrong.
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
89 changes: 89 additions & 0 deletions
89
packages/happo-target-react-native/runner/windows/.gitignore
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,89 @@ | ||
*AppPackages* | ||
*BundleArtifacts* | ||
*ReactAssets* | ||
|
||
#OS junk files | ||
[Tt]humbs.db | ||
*.DS_Store | ||
|
||
#Visual Studio files | ||
*.[Oo]bj | ||
*.user | ||
*.aps | ||
*.pch | ||
*.vspscc | ||
*.vssscc | ||
*_i.c | ||
*_p.c | ||
*.ncb | ||
*.suo | ||
*.tlb | ||
*.tlh | ||
*.bak | ||
*.[Cc]ache | ||
*.ilk | ||
*.log | ||
*.lib | ||
*.sbr | ||
*.sdf | ||
*.opensdf | ||
*.opendb | ||
*.unsuccessfulbuild | ||
ipch/ | ||
[Oo]bj/ | ||
[Bb]in | ||
[Dd]ebug*/ | ||
[Rr]elease*/ | ||
Ankh.NoLoad | ||
|
||
# Visual C++ cache files | ||
ipch/ | ||
*.aps | ||
*.ncb | ||
*.opendb | ||
*.opensdf | ||
*.sdf | ||
*.cachefile | ||
*.VC.db | ||
*.VC.VC.opendb | ||
|
||
#MonoDevelop | ||
*.pidb | ||
*.userprefs | ||
|
||
#Tooling | ||
_ReSharper*/ | ||
*.resharper | ||
[Tt]est[Rr]esult* | ||
*.sass-cache | ||
|
||
#Project files | ||
[Bb]uild/ | ||
|
||
#Subversion files | ||
.svn | ||
|
||
# Office Temp Files | ||
~$* | ||
|
||
# vim Temp Files | ||
*~ | ||
|
||
#NuGet | ||
packages/ | ||
*.nupkg | ||
|
||
#ncrunch | ||
*ncrunch* | ||
*crunch*.local.xml | ||
|
||
# visual studio database projects | ||
*.dbmdl | ||
|
||
#Test files | ||
*.testsettings | ||
|
||
#Other files | ||
*.DotSettings | ||
.vs/ | ||
*project.lock.json |
256 changes: 256 additions & 0 deletions
256
packages/happo-target-react-native/runner/windows/HappoRunner.sln
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/happo-target-react-native/runner/windows/HappoRunner/App.xaml
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,8 @@ | ||
<Application | ||
x:Class="HappoRunner.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:HappoRunner" | ||
RequestedTheme="Light"> | ||
|
||
</Application> |
147 changes: 147 additions & 0 deletions
147
packages/happo-target-react-native/runner/windows/HappoRunner/App.xaml.cs
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,147 @@ | ||
using ReactNative; | ||
using ReactNative.Modules.Launch; | ||
using System; | ||
using Windows.ApplicationModel; | ||
using Windows.ApplicationModel.Activation; | ||
using Windows.UI.Core; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace HappoRunner | ||
{ | ||
/// <summary> | ||
/// Provides application-specific behavior to supplement the default Application class. | ||
/// </summary> | ||
sealed partial class App : Application | ||
{ | ||
private readonly ReactPage _reactPage; | ||
|
||
/// <summary> | ||
/// Initializes the singleton application object. This is the first line of authored code | ||
/// executed, and as such is the logical equivalent of main() or WinMain(). | ||
/// </summary> | ||
public App() | ||
{ | ||
this.InitializeComponent(); | ||
this.Suspending += OnSuspending; | ||
this.Resuming += OnResuming; | ||
|
||
_reactPage = new MainPage(); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when the application is launched normally by the end user. Other entry points | ||
/// will be used such as when the application is launched to open a specific file. | ||
/// </summary> | ||
/// <param name="e">Details about the launch request and process.</param> | ||
protected override void OnLaunched(LaunchActivatedEventArgs e) | ||
{ | ||
base.OnLaunched(e); | ||
OnCreate(e.Arguments); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when the application is activated. | ||
/// </summary> | ||
/// <param name="args">The activated event arguments.</param> | ||
protected override void OnActivated(IActivatedEventArgs args) | ||
{ | ||
base.OnActivated(args); | ||
|
||
switch (args.Kind) | ||
{ | ||
case ActivationKind.Protocol: | ||
case ActivationKind.ProtocolForResults: | ||
var protocolArgs = (IProtocolActivatedEventArgs)args; | ||
LauncherModule.SetActivatedUrl(protocolArgs.Uri.AbsoluteUri); | ||
break; | ||
} | ||
|
||
if (args.PreviousExecutionState != ApplicationExecutionState.Running && | ||
args.PreviousExecutionState != ApplicationExecutionState.Suspended) | ||
{ | ||
OnCreate(null); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Called whenever the app is opened to initia | ||
/// </summary> | ||
/// <param name="arguments"></param> | ||
private void OnCreate(string arguments) | ||
{ | ||
_reactPage.OnResume(Exit); | ||
|
||
#if DEBUG | ||
if (System.Diagnostics.Debugger.IsAttached) | ||
{ | ||
this.DebugSettings.EnableFrameRateCounter = true; | ||
} | ||
|
||
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = | ||
AppViewBackButtonVisibility.Visible; | ||
#endif | ||
|
||
Frame rootFrame = Window.Current.Content as Frame; | ||
|
||
// Do not repeat app initialization when the Window already has content, | ||
// just ensure that the window is active | ||
if (rootFrame == null) | ||
{ | ||
_reactPage.OnCreate(arguments); | ||
|
||
// Create a Frame to act as the navigation context and navigate to the first page | ||
rootFrame = new Frame(); | ||
|
||
rootFrame.NavigationFailed += OnNavigationFailed; | ||
|
||
// Place the frame in the current Window | ||
Window.Current.Content = rootFrame; | ||
} | ||
|
||
if (rootFrame.Content == null) | ||
{ | ||
// When the navigation stack isn't restored navigate to the first page, | ||
// configuring the new page by passing required information as a navigation | ||
// parameter | ||
rootFrame.Content = _reactPage; | ||
} | ||
|
||
// Ensure the current window is active | ||
Window.Current.Activate(); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when Navigation to a certain page fails | ||
/// </summary> | ||
/// <param name="sender">The Frame which failed navigation</param> | ||
/// <param name="e">Details about the navigation failure</param> | ||
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e) | ||
{ | ||
throw new Exception("Failed to load Page " + e.SourcePageType.FullName); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when application execution is being suspended. Application state is saved | ||
/// without knowing whether the application will be terminated or resumed with the contents | ||
/// of memory still intact. | ||
/// </summary> | ||
/// <param name="sender">The source of the suspend request.</param> | ||
/// <param name="e">Details about the suspend request.</param> | ||
private void OnSuspending(object sender, SuspendingEventArgs e) | ||
{ | ||
_reactPage.OnSuspend(); | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when application execution is being resumed. | ||
/// </summary> | ||
/// <param name="sender">The source of the resume request.</param> | ||
/// <param name="e">Details about the resume request.</param> | ||
private void OnResuming(object sender, object e) | ||
{ | ||
_reactPage.OnResume(Exit); | ||
} | ||
} | ||
} |
Binary file added
BIN
+1.4 KB
...get-react-native/runner/windows/HappoRunner/Assets/LockScreenLogo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.52 KB
...arget-react-native/runner/windows/HappoRunner/Assets/SplashScreen.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.87 KB
...-react-native/runner/windows/HappoRunner/Assets/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.61 KB
...et-react-native/runner/windows/HappoRunner/Assets/Square44x44Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.23 KB
...r/windows/HappoRunner/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.42 KB
packages/happo-target-react-native/runner/windows/HappoRunner/Assets/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.13 KB
...et-react-native/runner/windows/HappoRunner/Assets/Wide310x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!