Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
31bed1c
Refactor ViewManagers to detect unimplemented properties (#4575)
asklar Apr 13, 2020
6258922
applying package updates ***NO_CI***
rnbot Apr 13, 2020
0bbf423
Fix fast refresh in playground app (#4580)
acoates-ms Apr 13, 2020
ab65bd9
Remove Folly Unzipping ContinueOnError (#4581)
NickGerleman Apr 13, 2020
c92a5a8
applying package updates ***NO_CI***
rnbot Apr 13, 2020
c143c56
Add missing headers to Microsoft.ReactNative project (#4583)
kmelmon Apr 14, 2020
d37555d
applying package updates ***NO_CI***
rnbot Apr 14, 2020
ce6a537
Update e2e-testing.md
asklar Apr 14, 2020
ae37f8e
Upgrade to 0.62 (#4587)
NickGerleman Apr 14, 2020
746fd97
applying package updates ***NO_CI***
rnbot Apr 14, 2020
356cc27
Bump beachball from 1.28.1 to 1.28.2 (#4600)
dependabot-preview[bot] Apr 14, 2020
e731d76
Elevate if necessary to install e2etest app certificate (#4584)
asklar Apr 14, 2020
d2d6bff
applying package updates ***NO_CI***
rnbot Apr 14, 2020
7c66e60
Consistency [with upstream] in instructions (#4601)
alloy Apr 14, 2020
218e5c4
applying package updates ***NO_CI***
rnbot Apr 14, 2020
5ec607d
Password box bug (#4607)
kmelmon Apr 15, 2020
48eaa21
applying package updates ***NO_CI***
rnbot Apr 15, 2020
63aeb0f
Rename DeveloperSettings.SourceBundlePath -> SourceBundleName (#4608)
statm Apr 15, 2020
3c6253c
applying package updates ***NO_CI***
rnbot Apr 15, 2020
053a7ca
Updates to main README (#4422)
kikisaints Apr 15, 2020
d53d06a
This is an alternate metro bundler fix for multiple out of tree platf…
acoates-ms Apr 15, 2020
eb3ce3a
applying package updates ***NO_CI***
rnbot Apr 15, 2020
e0adf5e
Fix PickerWindows (and DatePickerExample Page) (#4613)
NickGerleman Apr 15, 2020
d7a1b10
applying package updates ***NO_CI***
rnbot Apr 15, 2020
83f6067
Use more of the CLI rather than custom build steps to validate new pr…
acoates-ms Apr 16, 2020
9407dea
Bump io-ts from 2.1.3 to 2.2.0 (#4620)
dependabot-preview[bot] Apr 16, 2020
d1a4b6e
Bump beachball from 1.28.2 to 1.29.1 (#4621)
dependabot-preview[bot] Apr 16, 2020
4c320cf
Fix E2E Tests, add CI break on test failure, improve TreeDumpLibrary …
asklar Apr 16, 2020
9718f84
Implement accessibilityState (#4617)
kmelmon Apr 16, 2020
2a2d613
applying package updates ***NO_CI***
rnbot Apr 17, 2020
f3d983e
Remove AccessibilityStates (#4625)
kmelmon Apr 17, 2020
609c18c
Implement Shared StatusBarManagerModule and Do Module Cleanup (#4609)
NickGerleman Apr 17, 2020
d04b28b
Remove Clang Format Pre-Commit Hook (#4610)
NickGerleman Apr 17, 2020
317d9fc
Implement AppearanceModule (#4622)
NickGerleman Apr 17, 2020
c1a2140
Allow enabling direct debugging through the CLI. (#4531)
nasadigital Apr 17, 2020
b16fac7
Bump @react-native-community/eslint-config from 1.0.0 to 1.1.0 (#4627)
dependabot-preview[bot] Apr 17, 2020
a67124c
Fix issue with yoga in X64 Release builds (#4628)
acoates-ms Apr 17, 2020
7834106
Add support for React Native BackHandler API on Windows (#4623)
DrewHiggins Apr 17, 2020
18d54be
applying package updates ***NO_CI***
rnbot Apr 18, 2020
52bf969
Fix include paths (#4634)
kmelmon Apr 18, 2020
6dae6e7
applying package updates ***NO_CI***
rnbot Apr 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions .ado/Get-ShellScaling.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Add-Type @'
using System;
using System.Runtime.InteropServices;
using System.Drawing;

public class DPI {
[DllImport("gdi32.dll")]
static extern int GetDeviceCaps(IntPtr hdc, int nIndex);

public enum DeviceCap {
VERTRES = 10,
DESKTOPVERTRES = 117
}

public static float scaling() {
Graphics g = Graphics.FromHwnd(IntPtr.Zero);
IntPtr desktop = g.GetHdc();
int LogicalScreenHeight = GetDeviceCaps(desktop, (int)DeviceCap.VERTRES);
int PhysicalScreenHeight = GetDeviceCaps(desktop, (int)DeviceCap.DESKTOPVERTRES);

return (float)PhysicalScreenHeight / (float)LogicalScreenHeight;
}
}
'@ -ReferencedAssemblies 'System.Drawing.dll'

[Math]::round([DPI]::scaling(), 2) * 100
11 changes: 11 additions & 0 deletions .ado/SetupLocalDumps.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
setlocal
set CRASHDUMPS_FOLDER=%BUILD_ARTIFACTSTAGINGDIRECTORY%\ReactUWPTestAppTreeDump\CrashDumps
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /s
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\ReactUWPTestApp.exe" /v DumpFolder /t REG_SZ /d %CRASHDUMPS_FOLDER%
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\ReactUWPTestApp.exe" /v DumpType /t REG_DWORD /d 2
if not exist %CRASHDUMPS_FOLDER% (
md %CRASHDUMPS_FOLDER%
) else (
del %CRASHDUMPS_FOLDER%\* /s /q
)
endlocal
8 changes: 7 additions & 1 deletion .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ variables:
- template: variables/msbuild.yml
- template: variables/vs2019.yml

schedules:
- cron: "0 0 * * *"
displayName: Nightly publish build
branches:
include:
- master

trigger:
batch: true
branches:
include:
- master
- "*-stable"

pr: none
Expand Down
36 changes: 34 additions & 2 deletions .ado/templates/e2e-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:

- template: prepare-env.yml

- task: CmdLine@2
displayName: Set LocalDumps
inputs:
script: $(Build.SourcesDirectory)\.ado\SetupLocalDumps.cmd
workingDirectory: $(Build.SourcesDirectory)

- task: NuGetCommand@2
displayName: NuGet restore - ReactUWPTestApp
inputs:
Expand All @@ -34,7 +40,7 @@ jobs:
- task: CmdLine@2
displayName: run-windows
inputs:
script: react-native run-windows --no-packager --arch ${{ parameters.BuildPlatform }} --release --logging --msbuildprops BaseIntDir=$(BaseIntDir)
script: yarn windows --no-packager --arch ${{ parameters.BuildPlatform }} --release --logging --msbuildprops BaseIntDir=$(BaseIntDir)
workingDirectory: packages/E2ETest

- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -74,6 +80,11 @@ jobs:
targetType: 'inline'
script: 'if ((Get-Process React*) -eq $Null) { echo "TestApp is not running"; exit 1}'

- task: CmdLine@2
displayName: mkdir errorShots
inputs:
script: mkdir $(Build.SourcesDirectory)\packages\E2ETest\errorShots

- task: CmdLine@2
displayName: run e2etest
inputs:
Expand All @@ -87,7 +98,28 @@ jobs:
targetFolder: $(Build.StagingDirectory)/ReactUWPTestAppTreeDump
contents: TreeDump\**
condition: succeededOrFailed()


- task: CopyFiles@2
displayName: Copy tree dump screenshots
inputs:
sourceFolder: $(Build.SourcesDirectory)\packages\E2ETest\errorShots
targetFolder: $(Build.StagingDirectory)/ReactUWPTestAppTreeDump
condition: succeededOrFailed()

- task: PowerShell@2
displayName: "MSInfo32"
inputs:
targetType: "inline"
script: "Start-Process msinfo32 -ArgumentList '/report $(Build.StagingDirectory)\\ReactUWPTestAppTreeDump\\msinfo32.txt' -Wait"
condition: failed()

- task: PowerShell@2
displayName: "Get-ShellScaling"
inputs:
targetType: "inline"
script: ". $(Build.SourcesDirectory)\\.ado\\Get-ShellScaling.ps1 > $(Build.StagingDirectory)\\ReactUWPTestAppTreeDump\\scaleFactor.txt"
condition: failed()

- task: PublishBuildArtifacts@1
displayName: "Publish Artifact:ReactUWPTestAppTreeDump"
inputs:
Expand Down
64 changes: 31 additions & 33 deletions .ado/templates/react-native-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ steps:
inputs:
artifactName: TestMSRNNuget.${{ parameters.platform }}.${{ parameters.configuration }}
downloadPath: $(System.DefaultWorkingDirectory)
condition: eq('true', ${{ parameters.experimentalNugetDependency }})
condition: and(succeeded(), eq('true', ${{ parameters.experimentalNugetDependency }}))

- task: CmdLine@2
displayName: Init new project
Expand All @@ -84,14 +84,20 @@ steps:
inputs:
targetType: inline
script: |
Install-Package Microsoft.ReactNative -Source $(System.DefaultWorkingDirectory)/TestMSRNNuget.${{ parameters.platform }}.${{ parameters.configuration }} -Destination $(Agent.BuildDirectory)\testcli\windows\packages
condition: eq('true', ${{ parameters.experimentalNugetDependency }})

- task: NuGetCommand@2
displayName: NuGet restore testcli
inputs:
command: restore
restoreSolution: $(Agent.BuildDirectory)\testcli\windows\testcli.sln
Install-Package Microsoft.ReactNative -Source $(System.DefaultWorkingDirectory)/TestMSRNNuget.${{ parameters.platform }}.${{ parameters.configuration }} -Destination $(Agent.BuildDirectory)\testcli\localNugets
$xml = [xml](gc $(Agent.BuildDirectory)\testcli\windows\Nuget.Config)
$newSource = $xml.CreateElement("add");
$keyAttr = $xml.CreateAttribute("key");
$keyAttr.Value ="PrPublish";
$valueAttr = $xml.CreateAttribute("value");
$valueAttr.Value ="$(Agent.BuildDirectory)\testcli\localNugets";
$newSource.Attributes.Append($keyAttr);
$newSource.Attributes.Append($valueAttr);
$packageSources = $xml.ChildNodes.Item(1).packageSources;
$packageSources.InsertBefore($newSource, $packageSources.FirstChild);
$xml.save("$(Agent.BuildDirectory)\testcli\windows\Nuget.Config");

condition: and(succeeded(), eq('true', ${{ parameters.experimentalNugetDependency }}))

- template: install-SDK.yml
parameters:
Expand All @@ -114,34 +120,26 @@ steps:
-Cleanup:$true
condition: and(succeeded(), ${{ parameters.installVsComponents }})

- task: VSBuild@1
displayName: VSBuild - testcli
# Work around issue of parameters not getting expanded in conditions properly
- powershell: |
Write-Host "##vso[task.setvariable variable=localConfig]${{ parameters.configuration}}"

- task: CmdLine@2
displayName: Build project (Release)
inputs:
solution: $(Agent.BuildDirectory)\testcli\windows\testcli.sln
vsVersion: $(MSBuildVersion) # Optional. Options: latest, 16.0, 15.0, 14.0, 12.0, 4.0
msbuildArchitecture: $(MSBuildArchitecture) # Optional. Options: x86, x64
platform: ${{ parameters.platform }} # Optional
configuration: ${{ parameters.configuration }} # Optional
clean: false # Optional
maximumCpuCount: false # Optional
restoreNugetPackages: false # Optional
createLogFile: true
logFileVerbosity: detailed
msbuildArgs:
/p:PreferredToolArchitecture=$(MSBuildPreferredToolArchitecture)
/p:PlatformToolset=$(MSBuildPlatformToolset)
/p:AppxGeneratePrisForPortableLibrariesEnabled=false

- task: PublishBuildArtifacts@1
condition: succeededOrFailed()
timeoutInMinutes: 10
script: npx --no-install react-native run-windows --arch ${{ parameters.platform }} --no-launch --no-deploy --logging --release
workingDirectory: $(Agent.BuildDirectory)\testcli
condition: and(succeeded(), eq('Release', variables['localConfig']))

- task: CmdLine@2
displayName: Build project (Debug)
inputs:
pathtoPublish: $(Agent.BuildDirectory)/testcli/windows/testcli.sln.log
artifactName: Detailed Logs for testcli.sln ${{ parameters.platform }} ${{ parameters.configuration }} ${{ parameters.experimentalNugetDependency }}
publishLocation: 'Container'
script: npx --no-install react-native run-windows --arch ${{ parameters.platform }} --no-launch --no-deploy --logging
workingDirectory: $(Agent.BuildDirectory)\testcli
condition: and(succeeded(), eq('Debug', variables['localConfig']))

- task: CmdLine@2
displayName: Create bundle testcli
inputs:
script: react-native bundle --entry-file index.js platform windows --bundle-output test.bundle
script: npx --no-install react-native bundle --entry-file index.js --platform windows --bundle-output test.bundle
workingDirectory: $(Agent.BuildDirectory)\testcli
8 changes: 4 additions & 4 deletions .ado/windows-vs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variables:
- template: variables/msbuild.yml
- template: variables/vs2019.yml
- name: reactNativeVersion
value: 0.61.5
value: 0.62.2

jobs:
- job: Setup
Expand Down Expand Up @@ -259,21 +259,21 @@ jobs:
- task: CmdLine@2
displayName: run-windows (Debug)
inputs:
script: react-native run-windows --no-packager --no-launch --no-deploy --arch $(BuildPlatform) --logging --msbuildprops BaseIntDir=$(BaseIntDir)
script: yarn windows --no-packager --no-launch --no-deploy --arch $(BuildPlatform) --logging --msbuildprops BaseIntDir=$(BaseIntDir)
workingDirectory: packages/microsoft-reactnative-sampleapps
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Debug'))

- task: CmdLine@2
displayName: run-windows (Release)
inputs:
script: react-native run-windows --no-packager --no-launch --no-deploy --arch $(BuildPlatform) --logging --release --msbuildprops BaseIntDir=$(BaseIntDir)
script: yarn windows --no-packager --no-launch --no-deploy --arch $(BuildPlatform) --logging --release --msbuildprops BaseIntDir=$(BaseIntDir)
workingDirectory: packages/microsoft-reactnative-sampleapps
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'Release'))

- task: CmdLine@2
displayName: Create SampleApp bundle
inputs:
script: node node_modules/react-native/local-cli/cli.js bundle --entry-file index.windows.js --bundle-output SampleApp.bundle
script: yarn bundle-cpp
workingDirectory: packages\microsoft-reactnative-sampleapps
condition: succeeded()

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,5 @@ bld/
# OpenCover
*_coverage.xml

tsdoc-metadata.json
tsdoc-metadata.json
*.dmp
76 changes: 22 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center"> React Native for Windows </h1>
<h1 align="center"> React Native for Windows </h1>

<p align="center">
Build native Windows apps with React.
Expand All @@ -18,84 +18,52 @@

![Hero Image with Logo](./.github/hero2.png)

[React Native](https://reactnative.dev) enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and [React](https://reactjs.org/). The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.
> See the official [React Native website](https://reactnative.dev/) for an introduction to React Native.

[React Native](https://reactnative.dev) is a framework developed by Facebook that enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and [React](https://reactjs.org/). The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere.

This repository adds support for the [Windows 10 SDK](https://developer.microsoft.com/en-us/windows/downloads), which allows you to build apps for [all devices supported by Windows 10](https://developer.microsoft.com/en-us/windows/get-started-windows-10) including PCs, tablets, 2-in-1s, Xbox, Mixed reality devices etc.

## Status and roadmap

We are in the process of re-implementing react-native-windows in C++, for better performance, and to better align with the shared C++ react-native core as it evolves. Please see the [Roadmap 2019](https://microsoft.github.io/react-native-windows/blog/2019/07/22/roadmap) blog for details on this effort and investment roadmap for the upcoming months.

Please see the [July 2019 Updates Blog](https://microsoft.github.io/react-native-windows/blog/2019/07/21/updates) for all the latest updates!

## Quick Links

- [Getting Started](#getting-started)
- [Getting Help](#getting-help)
- [Documentation](#documentation)
- [Examples](#examples)
- [Extending React Native](#extending-react-native)
- [Opening Issues](#opening-issues)
- [Contributing](#contributing)
- [License](#license)
- [Code of Conduct](#code-of-conduct)

## Introduction

See the official [React Native website](https://reactnative.dev/) for an introduction to React Native.
[Check out our blog](https://microsoft.github.io/react-native-windows/blog/) If you'd like to stay up to date on the status of React Native for Windows and check out current and past roadmaps, We will post all new releases, updates and general news about the project there.

## System Requirements

- You can run React Native Windows UWP apps only on Windows 10 devices
- React Native Windows currently supports Windows 10 SDK >= [15063](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive). See [Windows 10 Compatibility](https://microsoft.github.io/react-native-windows/docs/win10-compat) for version support details.
- Download [Visual Studio 2017 Community or Greater](https://www.visualstudio.com/downloads/). (Visual Studio 2015 support has been deprecated.)
- You will need to start Visual Studio after it is installed to do some final setup before it can be used to build or run your React Native Windows application
You can run React Native Windows UWP apps only on Windows 10 devices.

*Note*: Development on React Native Windows itself currently requires Visual Studio 2017 or higher. It is not currently supported with VS Code, but work is ongoing as tracked [here](https://github.com/microsoft/vscode-react-native/issues/1007).

## Getting Started

Want to develop a React Native Windows app? Head over to our [Getting Started Guide](https://microsoft.github.io/react-native-windows/docs/getting-started).

## Getting Help

- Chat with us on [Reactiflux](https://discord.gg/0ZcbPKXt5bWJVmUY) in #react-native
- If it turns out that you may have found a bug, please [open an issue](#opening-issues)
For a full and detailed list of the system requirements and how to set up your development platform, see our [System Requirements](https://microsoft.github.io/react-native-windows/docs/rnw-dependencies) documentation on our website.

## Documentation
[React Native already has great documentation](https://reactnative.dev/docs/getting-started.html) and we're working to ensure the React Native Windows is part of that documentation story.

[React Native already has great documentation](https://reactnative.dev/docs/getting-started.html), and we're working to ensure the React Native Windows is part of that documentation story. Check out the [React documentation](https://reactjs.org/docs/getting-started.html) for further details about the React API in general.
[React Native for Windows](https://microsoft.github.io/react-native-windows/) has it's own separate documentation site where Windows and Mac specific information, like API docs and blog updates live.

For information on parity status with Android and iOS, including details on implemented and missing components and modules, along with related issues for missing features from partial implementations, go [here](https://microsoft.github.io/react-native-windows/docs/parity-status).
## Get Started
See the [Getting Started Guide](https://microsoft.github.io/react-native-windows/docs/getting-started) on our React Native for Windows website.

## Extending React Native
## Need Help?

- Looking for a component? [JS.coach](https://js.coach/react-native)
- Fellow developers write and publish React Native modules to npm and open source them on GitHub.
- Third party modules may be missing Windows support, so reach out to the project owners directly.
- Making modules helps grow the React Native ecosystem and community. We recommend writing modules for your use cases and sharing them on npm.
- You should almost never need to modify or fork React Native Windows itself (the ReactNative and ReactNative.Shared project/sources) to create custom controls. The extension points should already exist to do just about anything!
- Read the guides on [Native Modules for Windows](https://microsoft.github.io/react-native-windows/docs/native-modules).
Come join us and chat on the [Reactiflux](https://discord.gg/0ZcbPKXt5bWJVmUY) Discord server under in **#react-native**

## Opening Issues
If it turns out that you may have found a bug, we would like to hear about it!

If you encounter a bug with the React Native Windows plugin, we would like to hear about it. Search the [existing issues](https://github.com/microsoft/react-native-windows/issues) and try to make sure your problem doesn’t already exist before opening a new issue. It’s helpful if you include the version of Windows, React Native, React Native Windows plugin, and device family (i.e., mobile, desktop, Xbox, etc.) you’re using. Please include a stack trace and reduced repro case when appropriate, too.
### Logging Issues
Search the [existing issues](https://github.com/microsoft/react-native-windows/issues) and try to make sure your problem doesn’t already exist before opening a new issue. If your issue doesn't exist yet, try to make sure you provide as much information as possible to us so we can help you sooner. It’s helpful if you include information like:

Please use the [appropriate template](https://github.com/microsoft/react-native-windows/issues/new/choose) to file your issues.
- The version of Windows, React Native, React Native Windows plugin, and device family (i.e., mobile, desktop, Xbox, etc.) where you ran into the issue.
- A stack trace and reduced repro case when possible.
- Ensure the [appropriate template](https://github.com/microsoft/react-native-windows/issues/new/choose) is used when filing your issue(s).

The GitHub issues are intended for bug reports and feature requests. For help and questions with using the React Native Windows plugin please make use of the resources listed in the [Getting Help](#getting-help) section.
The GitHub issues are intended for bug reports and feature requests. For help and questions with using the React Native Windows plugin please make use of the resources listed our main README's the [Getting Help](https://github.com/microsoft/react-native-windows#getting-help) section.

## Contributing

Make sure to install the [system requirements](#system-requirements). If you just want to get started with developing your own app, read [Getting Started with App Development](#getting-started). You only need to interact with `npm` to use for your app development.

For more information about contributing PRs, see [Contribution Guidelines for react-native-windows](docs/contributing.md)
See [Contributing guidelines](./docs/contributing.md) for how to setup your fork of the repo and start a PR to contribute to React Native for Windows.

[Good First Task](https://github.com/microsoft/react-native-windows/labels/Good%20First%20Task) and [help wanted](https://github.com/microsoft/react-native-windows/labels/help%20wanted) are great starting points for PRs.

### Examples

- Using the CLI in the [Getting Started](#getting-started) sections will set you up with a sample React-Native-Windows app that you can begin editing.
- Using the CLI in the [Getting Started](https://microsoft.github.io/react-native-windows/docs/getting-started) guide will set you up with a sample React Native for Windows app that you can begin editing right away.
- If you're looking for sample code, just browse the RNTester folder in the GitHub web UI

## License
Expand Down
Loading