-
-
Notifications
You must be signed in to change notification settings - Fork 841
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
Add Windows support #530
Add Windows support #530
Conversation
Add support for react-native-windows.
@zoontek you can use Windows evaluation VMs to test: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/: When setting up, make sure to up the CPU count and RAM for the VM. In the VM, run Powershell as admin, and execute:
Answer Then run Then, its just building and running the example, in another console (so it will refresh PATH variable):
The last one will take some time to build stuff. The script will try to install the app on the VM, and it can timeout. If that happens, just rerun |
Co-authored-by: Alexander Sklar <[email protected]>
@@ -59,7 +61,8 @@ | |||
}, | |||
"peerDependencies": { | |||
"react": ">=16.8.6", | |||
"react-native": ">=0.60.0" | |||
"react-native": ">=0.60.0", | |||
"react-native-windows": ">=0.62" |
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.
should this be in the module always? I forget where we landed on this @jonthysell @acoates-ms
@bzoz @zoontek you can also use Windows Sandbox instead of setting up the VM (though you'll still have to install the dev dependencies) |
@@ -0,0 +1,163 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<Import Project="$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" /> |
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.
I think this should be: $(SolutionDir)packages -> no slash after the env variable. Have you also tried consuming the module in a new app, other than the existing example in this repo? (Unless we have changed/fixed the trailing slash)
Ref:
react-native-checkbox/react-native-checkbox@e94ba09
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.
I've based that on https://github.com/react-native-community/react-native-camera/blob/master/windows/ReactNativeCameraCPP/ReactNativeCameraCPP.vcxproj, tested it and it works.
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.
Awesome! Just make sure you can consume this from a clean app before merging.
@zoontek updated, PTAL |
@bzoz Tested again, everything seems OK now. Thanks |
Summary
Add support for Windows using react-native-windows.
This PR includes the necessary Windows files and changes to the docs.
Test Plan
Unfortunately, this implementation uses APIs not available in Windows build uses by Github Action. You can run tests manually, using the example app - using Appium and jest:
Checklist
README.md
CHANGELOG.md
example/App.js
)