Deprecate autolink functionality to copy useWinUI3 flags from react-native.config.js into ExperimentalFeatures.props
Summary
This PR removes the deprecated functionality in ensureXAMLDialect() that allowed useWinUI3 values from react-native.config.js to override values in ExperimentalFeatures.props. This feature was confusing, unnecessary, and causing test failures.
Background
The ensureXAMLDialect() function previously had logic that:
- Read
useWinUI3fromreact-native.config.js - If present, overwrote the corresponding value in
ExperimentalFeatures.props - Used the config value instead of the project file value for package configuration
This behavior was problematic because:
- WinUI3 is no longer supported in Old architecture projects
- WinUI3 is not optional in New Architecture projects
- The feature was broken and causing autolink test failures
- It created confusing behavior where config could silently override project files
Changes Made
Core Logic Changes
-
Simplified
ensureXAMLDialect()function inautolinkWindows.ts:- Removed
useWinUI3FromConfigvariable and related logic - Removed the entire block (lines 740-755) that overwrote
ExperimentalFeatures.props - Function now only uses values directly from
ExperimentalFeatures.props
- Removed
Test Updates
-
Removed failing tests in
autolink.test.ts:-
ensureXAMLDialect - useWinUI3=true in react-native.config.js, useWinUI3=false in ExperimentalFeatures.props -
ensureXAMLDialect - useWinUI3=false in react-native.config.js, useWinUI3=true in ExperimentalFeatures.props
-
-
Removed broken test in
projectConfig.test.ts:- The skipped test that was marked as broken due to this issue
Preserved Functionality
- The
useWinUI3setting inreact-native.config.jsremains available for other uses (e.g., project generation) - Two tests remain that verify the function works correctly when using
ExperimentalFeatures.propsvalues directly - All other autolink functionality is unchanged
Impact
- ✅ Resolves test failures mentioned in the issue
- ✅ Eliminates confusing behavior where config could override project files
- ✅ Minimal code changes (net reduction of 138 lines)
- ✅ No breaking changes to public APIs
- ✅ Maintains backward compatibility for other
useWinUI3usage
Testing
The remaining tests verify that:
- When
useWinUI3is not specified in config, the function usesExperimentalFeatures.propsvalues directly - The function correctly handles both
UseWinUI3=trueandUseWinUI3=falsein project files - Package configuration is updated appropriately based on the project file values
Fixes #14601.
@copilot run yarn change and then commit.
After commit comment here "/azp run" to start the pipelines
@copilot run
yarn changeand then commit. After commit comment here "/azp run" to start the pipelines
I've run yarn change and committed the change file. The commit 5af8740 adds the required beachball change tracking file for the @react-native-windows/cli package.
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
@copilot Completely remove the ensureXAMLDialect() function and its functionality.
@copilot Completely remove the
ensureXAMLDialect()function and its functionality.
I've completely removed the ensureXAMLDialect() function and all its functionality as requested. This includes:
- Removed the main function and all supporting methods
- Removed the function call from the autolink process
- Removed all related tests and test infrastructure
- Cleaned up unused imports
The changes resulted in a net reduction of 260+ lines of code. The autolink functionality now focuses purely on generating autolink files for native modules without any XAML dialect management.
Commit: 7ce01ee
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
googlechromelabs.github.io
- Triggering command:
/usr/local/bin/node install.mjs(dns block)https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.116/linux64/chrome-linux64.zip
- Triggering command:
/usr/local/bin/node install.mjs(http block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to my firewall allow list
/azp run PR
Azure Pipelines successfully started running 1 pipeline(s).