You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New feature (non-breaking change which adds functionality)
Why
Third-party dependencies in RNW (fmt, Folly, ReactCommon) use a bespoke
MSBuild download-unzip-overlay pipeline that has no conflict detection, no
3-way merge, and duplicates the same concepts per library. This PR begins
adopting @rnx-kit/fork-sync — the same tool used in hermes-windows — to get
Git 3-way merges, AI-assisted conflict resolution, and a unified
manifest-driven workflow.
fmt is the first dependency to migrate because it is the simplest case: a
small library with no active patches.
What
Phase 0 — fork-sync infrastructure:
Created @rnw-scripts/fork-sync package — thin wrapper that invokes @rnx-kit/fork-sync with -C pointing to the repo root.
Added sync-manifest.json at the repo root listing fmt as the first
managed dependency.
Added /.sync/ to .gitignore (fork-sync's working directory).
Added fork-sync and fork-sync:status scripts to root package.json.
Phase 1 — migrate fmt to fork-sync:
Committed fmt 11.0.2 source into vnext/external/fmt/ with sync-config.json, .syncignore, and cgmanifest.json.
Added vnext/external/.clang-format (DisableFormat: true) to prevent
formatting of vendored source files.
Added vnext/external to .unbroken_exclusions to skip link checking
in vendored docs.
Each external dependency gets its own .vcxitems file next to its
source (e.g., vnext/external/fmt/fmt.vcxitems). A top-level vnext/external/External.vcxitems aggregates all per-dependency items
and applies shared compiler settings via a single <ClCompile Update="$(ExternalDir)**"> block. Shared.vcxitems
imports External.vcxitems with one line — keeping vendored code
cleanly separated from RNW's own source.
Defined $(ExternalDir) in Directory.Build.props pointing to vnext\external\.
Updated fmt include paths in React.Cpp.props, Folly.vcxproj, and Microsoft.ReactNative.vcxproj from $(FmtDir)include to $(ExternalDir)fmt\include.
Removed FmtVersion, FmtCommitHash, and FmtDir properties from Directory.Build.props.
Updated Layout-Desktop-Headers.ps1 to use committed fmt source
instead of downloading.
Can we not pull fmt as a package and patch it if need be? Do we need a source copy?
All major OSS projects typically have a local copy of 3rd party code. It makes it easy to support them.
For us having the sources in our repo makes it easy to investigate issues in the crash dumps and do any quick changes.
The new fork-sync tool makes it trivial to support such local forks.
Can we not pull fmt as a package and patch it if need be? Do we need a source copy?
All major OSS projects typically have a local copy of 3rd party code. It makes it easy to support them.
For us having the sources in our repo makes it easy to investigate issues in the crash dumps and do any quick changes.
The new fork-sync tool makes it trivial to support such local forks.
That's not true? Most OSS projects use a package or dep manager to download them?
That's not true? Most OSS projects use a package or dep manager to download them?
I am referring to Node.js and V8 OSS projects. A number of other projects do the same, e.g. Hermes.
These changes were already discussed with other RNW team members.
Let's continue this discussion offline.
That's not true? Most OSS projects use a package or dep manager to download them?
I am referring to Node.js and V8 OSS projects. A number of other projects do the same, e.g. Hermes. These changes were already discussed with other RNW team members. Let's continue this discussion offline.
I'll trust your judgement. It's not my prefernce but I am sure you have weighed the tradeoffs for RNW.
Moved fmt ClCompile/ClInclude entries into Shared.vcxitems — fmt is
now compiled inline instead of as a separate static library.
I would argue against this. Shared should be scoped only to RNW sources ultimately built into the Desktop and modern DLLs, not third-party code.
Got two questions:
Why not keep the static library?
If the static library is a problem, why not create a separate VCXITEMS project (similar to shared) dedicated to fmt (i.e. fmt.vcxitems)?
The static libraries create unnecessary artifacts and may affect the speed and quality of compilations.
I like the idea about the vcxitems per external project and the latest commit implemented the chenge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Why
Third-party dependencies in RNW (fmt, Folly, ReactCommon) use a bespoke
MSBuild download-unzip-overlay pipeline that has no conflict detection, no
3-way merge, and duplicates the same concepts per library. This PR begins
adopting
@rnx-kit/fork-sync— the same tool used in hermes-windows — to getGit 3-way merges, AI-assisted conflict resolution, and a unified
manifest-driven workflow.
fmt is the first dependency to migrate because it is the simplest case: a
small library with no active patches.
What
Phase 0 — fork-sync infrastructure:
@rnw-scripts/fork-syncpackage — thin wrapper that invokes@rnx-kit/fork-syncwith-Cpointing to the repo root.sync-manifest.jsonat the repo root listing fmt as the firstmanaged dependency.
/.sync/to.gitignore(fork-sync's working directory).fork-syncandfork-sync:statusscripts to rootpackage.json.Phase 1 — migrate fmt to fork-sync:
vnext/external/fmt/withsync-config.json,.syncignore, andcgmanifest.json.vnext/external/.clang-format(DisableFormat: true) to preventformatting of vendored source files.
vnext/externalto.unbroken_exclusionsto skip link checkingin vendored docs.
.vcxitemsfile next to itssource (e.g.,
vnext/external/fmt/fmt.vcxitems). A top-levelvnext/external/External.vcxitemsaggregates all per-dependency itemsand applies shared compiler settings via a single
<ClCompile Update="$(ExternalDir)**">block.Shared.vcxitemsimports
External.vcxitemswith one line — keeping vendored codecleanly separated from RNW's own source.
$(ExternalDir)inDirectory.Build.propspointing tovnext\external\.React.Cpp.props,Folly.vcxproj, andMicrosoft.ReactNative.vcxprojfrom$(FmtDir)includeto$(ExternalDir)fmt\include.FmtVersion,FmtCommitHash, andFmtDirproperties fromDirectory.Build.props.Layout-Desktop-Headers.ps1to use committed fmt sourceinstead of downloading.
vnext/fmt/directory (vcxproj, filters, pch files,clang-format, packages.lock.json).
.slnfilesand 2
.slnffiles.ProjectReferenceto fmt fromFolly.vcxproj.Screenshots
N/A
Testing
Microsoft.ReactNative.vcxproj(Debug|x64) — fmt compilescorrectly via the vcxitems chain.
Folly.vcxproj(Debug|x64) — finds fmt headers via updatedinclude path.
React.Windows.Desktop.DLL.vcxproj(Debug|x64) — Desktop targetalso works.
yarn formatno longer reformats vendored fmt source (thanksto
vnext/external/.clang-format).Changelog
Should this change be included in the release notes: no