microsoft / microsoft/react-native-windows

Commit changes when failing VS AutoLinkCheck

Open
#7,809 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Build Infrastructure Area: Developer Experience enhancement Workstream: Module Support
Dominant language
C++
Stars
17.3k
Forks
1.2k
Avg merge
1d 13h
Merged PRs (30d)
33

Description

In VS Builds we run nx react-native autolink-windows --check, which does a dry run of autolinking logic. This is done to avoid mutating build files during the actual build.

An alternate approach is to write the files, then fail the build, messaging the user that their files were updated. This still requires multiple builds, but removes a trip to the command-line for manual steps.

As a proof of concept I tried the following sequence of events:

  1. Started a build
  2. Mutated packages.config during the build
  3. Canceled the build
  4. Started a solution build

The new NuGet package was restored on the next build, meaning we should be able to fail the build a single time and have changes picked up the next.

So, we could change the current:

Warning: Auto-linking changes were necessary but '--check' was specified. Run 'npx react-native autolink-windows' to apply the changes.

to

Auto-linking updated your project. Please rebuild for changes to take effect.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the VS Builds invocation of nx react-native autolink-windows --check and the handling of its warning. Review how packages.config is mutated and restored during the next solution build. Done means the build updates the project, reports that a rebuild is required, and no longer instructs users to run the command manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native
Domain
build-system, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.