Skip to content
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

[0.74] Update templates to calculate rnwPath for *.sln files #13613

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Aug 26, 2024

This PR backports #13572 to 0.74.

Description

Visual Studio solution files cannot use variables in paths to the various project files, and up until now the paths to RNW projects assumed a simple app repo, and were hardcoded to ..\node_modules\react-native-windows\.

This PR changes the templates for both new and old architecture projects to instead inject the calculated actual path to the RNW package.

Note: Node does not "see" symlinks, only their resolved path. So if you're getting RNW via a symlink (say through yarn link) the sln file will hardcode the resolved path at the time of creation.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Why

Some user feedback has indicated that the hardcoded paths did not work for monorepos which may have multiple packages depending on RNW.

What

See above.

Screenshots

N/A

Testing

Verified that the path is now generated.

Changelog

Should this change be included in the release notes: yes

[0.74] Update templates to calculate rnwPath for *.sln files

Microsoft Reviewers: Open in CodeFlow

This PR backports microsoft#13572 to 0.74.

## Description

Visual Studio solution files cannot use variables in paths to the various project files, and up until now the paths to RNW projects assumed a simple app repo, and were hardcoded to `..\node_modules\react-native-windows\`.

This PR changes the templates for both new and old architecture projects to instead inject the calculated actual path to the RNW package.

**Note:** Node does not "see" symlinks, only their resolved path. So if you're getting RNW via a symlink (say through yarn link) the sln file will hardcode the resolved path at the time of creation.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

### Why
Some user feedback has indicated that the hardcoded paths did not work for monorepos which may have multiple packages depending on RNW.

### What
See above.

## Screenshots
N/A

## Testing
Verified that the path is now generated.

## Changelog
Should this change be included in the release notes: _yes_

Update templates to calculate rnwPath for *.sln files
@jonthysell jonthysell requested review from a team as code owners August 26, 2024 19:56
@jonthysell jonthysell enabled auto-merge (squash) August 26, 2024 19:57
@jonthysell jonthysell merged commit 8c67f63 into microsoft:0.74-stable Aug 26, 2024
95 checks passed
@jonthysell jonthysell deleted the dynamicslns74 branch August 27, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants