microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.35k stars 1.14k forks source link

Replace dependency script with WinGet Desired State Configuration #12553

Open chrisglein opened 10 months ago

chrisglein commented 10 months ago

Summary

We have automated (via script) and manual steps to install dependencies here.

That script is challenging to maintain, and is located here.

WinGet configure has some capability to standardize this kind of thing: https://learn.microsoft.com/en-us/windows/package-manager/configuration/

Motivation

We don't want to maintain this script. And WinGet likely will need changes to support our complexity and the earlier we engage the more time there is to make fixes.

Open Questions

Our dependency script is complicated as these things go. WinGet might not be ready to replace something of this complexity. But we can start investigating it as a replacement, even if partial.

The normal recommendation for this would be to use the Sandbox to set up the configuration. Because installing Visual Studio is a requirement, the Sandbox would run out of disk space. So we'd need to build the configuration from a base Windows VM instead.

joshuayoes commented 10 months ago

I have started a declaration file at this repository https://github.com/joshuayoes/ReactNativeWindowsSandbox

It is currently a work in progress, but so far many of the dependencies are working.

joshuayoes commented 10 months ago

I've pushed some updates to https://github.com/joshuayoes/ReactNativeWindowsSandbox, it now passes the validation phase of rnw-dependencies.ps1.

Would ya'll be able to verify it works on your end, then we can work on adding a section to the docs?

frankcalise commented 10 months ago

I've pushed some updates to https://github.com/joshuayoes/ReactNativeWindowsSandbox, it now passes the validation phase of rnw-dependencies.ps1.

Would ya'll be able to verify it works on your end, then we can work on adding a section to the docs?

Can confirm these instructions work as long as the RN init commands are the following:

npx react-native init <projectName>
cd <projectName>
npx react-native-windows-init --overwrite
npx react-native run-windows

Note I dropped @nightly here because currently nightly is 0.74.x and Windows is at 0.73.x so it didn't like the react-native-windows-init after a nightly base.