*Description*
This PR updates RNW to build with (and require) Visual Studio 2022. This includes upgrading the `Microsoft.ReactNative.Managed.CodeGen` project to .NET 6.0
This PR does not change the minimum / target Windows SDK versions for RNW or RNW apps.
This PR does not change the language versions of C++ (17) and C# (8.0) used.
*Type of Change*
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update
*Why*
Visual Studio 2022 is the currently supported version of Visual Studio and what is available to download without an MSDN subscription to access older versions. As Visual Studio 2019 support is reduced/deprecated, we need to migrate.
Closes#8750Closes#9499Closes#10130
*What*
What's changed:
* All VS project files have been updated to require a minimum of VS 2022 (aka version 17.0).
* NuGet-based dependencies that are tied to VS version have been upgraded.
* The `Microsoft.ReactNative.Managed.CodeGen` project has been updated to .NET 6.0
* The snapshots for the codegen tests have been updated to pass
* The E2E Test app has been updated to the latest version of `react-native-xaml` (needed to fix build issues)
* Snapshots for E2E tests have been updated to pass
*Testing*
Builds and tests All tests
* Remove unused bot work
This removes the previous start of RNW bot work, targetting Azure Functions as a client for GitHub webhooks. GitHub Actions workflows can be triggered in response to many GH webhooks, with orchestration taken care of.
* Change files
* Add `e2etest:debug`
Adds "break on start` to UI automation infrastructure.
Validated locally that the test is paused with the native app open before hitting enter, and that the test resumes after.
* Change files
* lockfile
* Update packages/@react-native-windows/automation/README.md
* ReactUwpTestApp -> RNTesterApp
The name ReactUwpTestApp is an artifact of when `ReactUwp` still existed, and having a specific test bundle. Now the app is just a frame to load RNTester, plus side native test code that will soon be extracted.
This PR renames ReactUwpTestApp to a more accurate RNTesterApp. It also removes some stale scripts that have been unused for more than a year.
* Change files
* @react-native-windows/automation
This combines and documents some packages to allow external applications to leverage the work we did to allow UI testing. The various READMEs in this PR lay out what the user-flow and architecture looks like, but there is still some work around extracting IPC/tree dumping to be externally usable.
* Change files
* declare missing dependency
* Defer browser usage until after client require
* Workaround transform bug
* Add AutomationClient and AutomationElement Facade
WebDriverIO exposes a whole webdriver client, with loads of functionality that doesn't work or make sense on a desktop app. This facade exposes the bits that are supported by WinAppDriver, in an easier API. It also lets us potentially decouple from WebDriverIO if we want to move to a differnt WebDriver client.
Currently being done in the test app, but will be extracted to a separate package after to allow use in apps outside the repo.
* update docs
* Keep dumpVisualTree outside of AutomationClient for now
* fix lint
* raw example
* Hermes Inspector Integration redesign
* Improving the change file text
* Resolving review comments
* Reverting the unintentional change to enable hermes by default and some formatting fixes
* Fixing x86 builds by ensuring the right calling convention prefix with inspector APIs
* Fixing issues in instance reload
* Fixing last incomplete commit by uploading JSEngine.props
* yarn format
* Some cleanups
* yarn format
* Adding markdown documentation
* Reporting bundle download status to package and resolving review feedbacks
* Fixing build
* XAML Jest Snapshots
This PR removes the tree-dump control, allowing the dumping of arbitrary visual content from the test runner. This is done by doing RPC from the test runner to test app. This RPC channel can be easily extended in the future to allow running more arbitrary native commands from test runner.
Diffing is now handled by the industry standard Jest snapshots, instead of custom logic in TreeDumpControl to handle assertions. We replicate tree dump comparison logic of removing collapsed subtrees and dumps themselves omit scrollbars. Previous tree-dump comparison has some epsilon value for FP comparison that we do not replicate (apart from what Jest already does). Current dump values are all integral anyway, so this is not yet needed.
Dump failures are shown inline in the test runner and in CI.
* yaml fix
* fixes
* yaml fixes
* Remove unneeded yaml
* Measurement rounding
* fix
* Remove MSInfo32 Task
* Remove ShellScaling
* Increase fuziness
* Stuff
* Forgot the updated snapshots...
* Real fuzzy comparison
* Last round hopefully
* Experiment
* Back to rounding
* yarn
* Avoid RenderSize for now
* Rename E2ETest/e2etest to e2e-test-app
This is part of a series of PRs cleaning up naming in the `packages directory for consistency`. Certain conventions have grown over time, but not all packages follow them. This should create clarity on informal convnetions on where packages go and how to name them.
The changes across PRs
- `react-native-win32` and `react-native-win32-tester` to `@office-iss`
- `react-native-windows-codegen` to `@react-native-windows/codegen`
- `microsoft-reactnative-sampleapps to sample-apps`
- `E2ETest` to `e2e-test-app`
- `IntegrationTest` to `integration-test-app`
* Fix typo
* fix typos
* Rename microsoft-reactnative-sampleapps to sample-apps
This is part of a series of PRs cleaning up naming in the `packages directory for consistency`. Certain conventions have grown over time, but not all packages follow them. This should create clarity on informal convnetions on where packages go and how to name them.
The changes across PRs
- `react-native-win32` and `react-native-win32-tester` to `@office-iss`
- `react-native-windows-codegen` to `@react-native-windows/codegen`
- `microsoft-reactnative-sampleapps to sample-apps`
- `E2ETest` to `e2e-test-app`
- `IntegrationTest` to `integration-test-app`
* revert local state
* Reenable Appx signing
* trailing whitespace
* revert accidental deletion
* Change E2ETest WebDriverIO Runner To Jest
* Fixes
- Consistent Heders
- Default rootDir
- Better filename sanitization
- Fix Lint
* Change files
* Update docs
* Remove another chunk of outdated info
* Move to devDep
* Small cleanup
* Have docs go to directory instead of README
* Rewrite E2ETest Specs (Removes Python Dependency)
Checkin blocked on #6942
We move from @wdio/sync to the default async test runner, removing the python dependency.
The new webdriverio plugin for WinAppDriver supports implicit timeout, letting us dramatically simplify by relying on builtin wdio primitives.
We also remove the run_wdio script which has been a source of some errors, and whose functionality we do not currently rely on. Confirmed that the wdio runner reported error codes without it.
testID consts are pulled out of the centralized location to instead be per-testpage.
Validated changes locally. Validated that we seen a non-zero exit code on test failure.
* Change files
* Doc fixes
* wdio config fixes
* spacing
* Wait until displayed
* Remove stale line
* Only register ts-node once
* Need in worker process
* more verbose logging
* Try increasing connection retry count
* Converting the tracing mechanism to use TraceLog instead of manifest based events
* Powershell scripts to manage tracing session
* Change files
* Fixing broken changes file
* Adding documentation and formatting the source
* remove appium
* update lint
* fix wdio build error
* fix the import error
* remove fake appium package
* implict timeout
* correct config to ms:experimental-webdriver
* remove implicit timeout, and fix some error on pipeline
* update doc and comment
* resolve merge conflicts on yarn.lock and move savescreenshot to jasmineopts
* Update code to new packages for isUtf8 and yargs
* Change files
* update doc and resolve lint isutf8 error
* remove appium
* update lint
* fix wdio build error
* fix the import error
* remove fake appium package
* implict timeout
* correct config to ms:experimental-webdriver
* remove implicit timeout, and fix some error on pipeline
* update doc and comment
* resolve merge conflicts on yarn.lock and move savescreenshot to jasmineopts
* Update code to new packages for isUtf8 and yargs
* Change files
* update doc and resolve lint isutf8 error
* resolve yarn.lock conflict with master
* Add Pyton to handle installing new npm dependency for appium
* yarn update
* Update UnitTests
* Change files
* install python for gyp
* Fix typo in path for sourcedirectoyr on python install step
* Update to import to const for isutf8 due to babel limmitations
* Fix diff file due to updated diffing algorythm
* Fix JS Check unittest
* Remove color from Lage build, it conflicts with updating execa or yargs-parser. And it wasn't needed anyways
* Update Yarn lock
* restore color args
* Lage doesn't work with fetch depth of 1
* Remove fetch depth because lage is missing files otherwise
* resolve conflict with master
* resolve yarn build error because of isUtf8
* async io test case
* Revert "async io test case"
This reverts commit e0920d5b3f.
* resolve conflicts on webdriver
* update test
* rollback change on sanitize test
* remove const comment
* try use the python in microsoft hosted agent
* Update docs/e2e-testing.md
Co-authored-by: Alexander Sklar <asklar@microsoft.com>
* Update docs/e2e-testing.md
Co-authored-by: Alexander Sklar <asklar@microsoft.com>
* fix break on yaml file
* update usepython
* revert the python change
Co-authored-by: Danny van Velzen <dannyvv@microsoft.com>
Co-authored-by: Alexander Sklar <asklar@microsoft.com>
* introduce break
* write to docs folder
* Change files
* The package can only access file types that it has declared in the manifest
* schema
* yml update
* upload all of documents
* refresh certificate and PFN
* remove thumbprint
* restore tsx
* delete changefiles
When entering the 'building-rnw.md' page, Monorepo is mentioned as a
type of RNW. The issue is that when clicking on the "this page" link,
404 is returned instead of redirecting to the monorepo.md page.
The root cause of that issue is the capital letter originally used in
the link code, while the page itself has a name as: "monorepo.md".
This commit provides the fix for that by changing the letter to the
correct one, so there's no confusion for newcommers.
* Lerna to Lage
This gives us incremental and scoped JS builds, with more intelligent parallelism. I haven't configured fine-grained caching for the more esoteric projects, but as is, 12/17 projects will cache outputs. The incremental build of the repo takes ~15s on my machine.
* Remove now unneeded eslintignore
* Avoid dist
* buildci color
* Tester build caching
* Cache NuGet
* Remove more unused build artifacts
* Remove clean script
* Lint ts
* Clean Whitespace
* More whitespace
* Remove buildci to allow JSChecks build caching for lint
* Change files
* Parallel lint
* Verbose lint so we can see warnings
* Integrate Additional RNTester Refactoring (9/2 Nightly RN Build)
Commits: 5bc67b658...f0e80ae22
The most interesting bits here are addiontal RNTester changes, such as the removal of the back button. This forces some more E2ETest updates that were merged in a previous PR.
Nested Images inside of Text are rendered on start now, which is problematic for NetUI. ACoates forked the component for XAML RNTester, and this change forks for NetUI as well, which intention to upstream tracked by #6341. We similarly need to re-patch out AsyncStorage usage on NetUI after the code changed for it.
The fbjs dependency was removed, whichgets closer to letting us remove a node-fetch resolution (though the CLI pulls in an older Metro package which doesn't let us). Android added some extra Platform constants around manufacturer/Brand (likely related to the Xiamoi crash workaround), which we don't implement here, since we only really care about the union of Android + iOS, along with anything we think would be useful specifically for Windows.
* Work around RNW display: none issue
* Change files
* Keep Templates in react-native-windows Package
Fixes#5884
Testing new app creation with `react-native-windows-init` can be done using `--useDevMode` and `yarn link`, or can be done by pointing `react-native-windows-init` to a fille-path. The former works by symlinking to the monorepo, and the latter copies the single package.
The latter workflow will not pick up changes to packages outside of react-native-windows. This includes template files that were moved outside the package.
This change moves template files back into react-native-windows to ease that workflow, but keeps the CLI as a separate package to avoid previous issues of intermingled dependencies, duplicated build logic, etc. We keep the templates in a top-level `template` directory, similar to what is done by react-native core. https://github.com/facebook/react-native/tree/master/template
This change complicates logic a bit to resolve tempate location, since we can't create a cyclical peer dependency on react-native-windows. We instead need to resolve the location of react-native-windows dynamically. We do that by searching from the project directory.
WIll validate by init tests in CI. Not sure if there is a current way to validate autolinking.
* Change files
* Remove unused import
* We can't resolve package directories directly
* Update docs
* Add verification to ensure nuget and npm version match.
This will add a targets file: Microsoft.ReactNative.VersionCheck.targets
to all nuget packages. When evaluated in msbuild it will perform a check
to see if the specified version of the react-native-windows package matches
the current nuget package.
It is challenging with a mix of `PackageReference` and `packages.json` (UWP doesn't support the former yet)
to consistenly figure out the version number from within the nuget package itself.
It would involve walking the parent folder looking for nuspec or npkg files and reverse engineering
the version number from the nupkg filename. In the nuspec case (PackageReference) it is simple as you just need to
parse the nusepc file. In the UWP case, it is complicated since there is no nuspec file by default, on a nupkg file.
The issue with that is that the filename is <id>.<version> and the dot separator is valid in both the id and the version
so there is no clear way to know which is which. The only approach would have
been to extract the zip file (with nuget semantics, it's not a straight unzip as filenames are url-encoded in the zip) and
then parse the nuspect inside...
To simplify this change takes a short-cut of baking the nuget version into the targets file during the build.
* Change files
* Update docs/testing-nuget-packages.md
* Remove acceptsKeyboardFocus (for real this time)
We've backported changes to 0.63 to fix bugs with focusable, and to yellowbox if acceptsKeyboardFocus is used on View or touchables. This formalizes the removal, turning the yellowbox into a redbox, removing VM support, and removing typings. Note that typings for react-native-win32 were already removed in 0.63, so there isn't the work to do there.
Because we removed forking from Touchables we will no longer see warnings if acceptsKeyboardFocus is still used on them, but that scenario should be rarer and we will have yellowboxed for it already in 0.63.
Tested we redbox if we try to use the prop
* Change files
* Put flow supression on the right line
* Fix bugs from acceptsKeyboardFocus to focusable deprecation
#5047 deprecated acceptsKeyboardFocus in favor of focusable, with the intent to remove focusable in 0.64. There's a bug here (`focusable=false` on Touchables is broken), and we want to make the deprecation clearer, since many folks will be using the prop without typings.
There are some other bits polished, like removing an erroneous acceptsKeyboardFocus in a ViewConfig relied on by RCTText, and removing react-native-win32 typings from ViewWin32 since its deprecation cycle looks a bit different, and it helps us fully remove the property in 0.64.
A runtime warning is added on property usage to discourage use, to help catch cases where folks aren't relying on typings for compile-time errors. This is done by intercepting properties to RCTView, which will also catch property usage on Touchables, TouchableWin32, and other composed views.
To avoid bleadthrough to RN 0.65 in Office, we remove typings from ViewWin32 now to encourage transition.
Validated we see the warning when a prop is present, and that touchables are focusable by default, Touchables will use acceptsKeyboardFocus instead of focusable when present. Plan is to backport this to 0.63 and remove props from master shortly after.
* Change files
* yarn api
* Remove another acceptsKeyboardFocus
* Force E2ETest to show colors
* Avoid duplicate NuGet Restore
* Remove forking disabling focusable, but keep forking adding testID