This PR backports #14071 to 0.74.
## Description
Fix CI to correctly enable/disable hermes.
### Type of Change
_Erase all that don't apply._
- Bug fix (non-breaking change which fixes an issue)
### Why
Accurate testing.
### What
Fixed the task that set the UseHermes experimental prop.
## Screenshots
N/A
## Testing
Verified UseHermes set to true now.
## Changelog
Should this change be included in the release notes: _no_
This PR backports #14084 to 0.74.
## Description
This PR upgrades the minimum version of `Microsoft.NETCore.UniversalWindowsPlatform` to 6.2.14 for UWP C# projects.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
This is long over-due as the latest (and probably last) version of this package hasn't changed in over two years. There's no reason for us to build against an older version. Just as importantly, this brings in a newer version of the .NetNative toolchain, which seems to resolve issues around C# builds hanging at the .NetNative step.
Resolves#14055Resolves#9194Resolves#4869
### What
Updated the minimum version of `Microsoft.NETCore.UniversalWindowsPlatform` to 6.2.14 for UWP C# projects. Added new entries to the props that enable C++ apps to consume C# modules to see the latest versions of .NetNative.
## Screenshots
N/A
## Testing
Verified E2Etests build and run.
## Changelog
Should this change be included in the release notes: _yes_
Update to Microsoft.NETCore.UniversalWindowsPlatform 6.2.14
* [Fabric] Introducing autocapitalize prop in TextInput - Take 2 (#13343)
* New implementation of autocapitalize!
* Change files
* Fixed bug for sentences scenario
* Just keep characters mode for now
* Revert "Just keep characters mode for now"
This reverts commit 60ca1cebbc.
* Re-apply changes minus packages.json.lock
* The original js file was deleted, re-applying changes
* Fixed snapshot and lint errors
* Fix override mismatch, added comments
* Remove stale test check
* Minor changes
* Update obsolete snapshot
* Cleanup ReactNativeAppBuilder and ReactNativeWin32App (#13983)
This PR simplifies and scopes down the API for `ReactNativeAppBuilder` and `ReactNativeWin32App`.
- Bug fix (non-breaking change which fixes an issue)
`ReactNativeAppBuilder`'s API surface made it too easy to call incorrectly and not realize it.
Resolves#13946
There are a variety of changes to the API surface:
* `ReactInstanceSettingsBuilder` deleted: not only are there are simply too many APIs that would need to be exposed to be useful, the very act of creating and replacing the app's `ReactNativeHost`'s `ReactInstanceSettings` with a new one is what caused the bug in #13946 in the first place
* `ReactNativeAppBuilder` now only exposes APIs to specify the intial, non-ReactNative, WinAppSDK types, (i.e. `DispatcherQueueController`, `Compositor`, and `AppWindow`), objects the app developer may already have created for their existing app, and otherwise is only responsible for building a `ReactNativeWin32App` with those types properly pre-made
* `ReactNativeWin32App::Start()` is now more responsible for the stitching together all of the relevant types to make a working Win32 fabric app
* All WinRT APIs without an immediate use-case have been commented out until we are sure they are necessary and that it is safe to expose them
* The template has been updated to follow the pattern of:
* Use `ReactNativeAppBuilder` to get a `ReactNativeWin32` app with the base WinAppSDK types ready
* Get and modify the types as necessary from the created app object (like the `ReactInstanceSettings` and the `AppWindow`)
* Call `app.Start()`
N/A
Verified new apps and example apps in libraryes build and run properly.
Should this change be included in the release notes: _yes_
Cleanup ReactNativeAppBuilder and ReactNativeWin32App
* Update Guardrails on Provider Instantiation (#13961)
* Update Provider Guardrails
* Change files
* Format
* Update Snapshots
* Add very basic box-shadow support (#14028)
* Add very basic box-shadow support
* Change files
* Focus should notify island host when tab loop wraps to give host oportunity to take focus (#14026)
* Focus should notify island host when tab loop wraps to give host oportunity to take focus
* Change files
* Default scroll to bring a component into view should have padding around the viewport (#14018)
* Default scroll to bring a component into view should have padding around the viewport
* Change files
* Update focus visuals to use cornerRadius and inner/outer strokes (#14008)
* Update focus visuals to use cornerRadius and inner/outer strokes.
* Change files
* Format
* lint fix
* Scale focus border for scaleFactor
* [Fabric] Get Modal to host RN components in new hwnd (#13500)
* save state
* add example
* build but blank page still :(
* clean up comments
* visuals show up in new hwnd!
* clean up code
* better naming and unfork Modal examples
* testing save state
* Make the RN island a Modal member var
* Failed attempt at skipping root view in CEH, leaving it for learning purposes
* you can click on UI!
* clean up code
* Change files
* save state
* remove hardcoded rootTag
* add width/height to example
* add test
* revert simple.tsx
* remove test
* update snapshot
* feedback part 1: make Modal a RootComponentView
* feedback part2: simplify MountChildren
* fix deleting modal
* feedback round2
* remove comment
* remove imports
* feedback part 3
* fix overrides
* add simple layout - still has issues with padding/flex
* feedback part4
* lint
* update overrides
* Change files
* feedback
---------
Co-authored-by: Daniel Ayala <14967941+danielayala94@users.noreply.github.com>
* Support accessibilityState 'checked' (#13962)
* Implement accessibilityState checked
* Change files
* Add Testing
* Format and Update Snapshots
* Adjust Guardrails
* Merge
* Format
* Format
* Lint
* Change files
* Fix Merge Error
* Fix issue with prop cloning with custom native props (#14061)
* Fix issue with prop cloning with custom native props
* format
* prettier
* Change files
---------
Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com>
* change files
* Build fixes
* fix
* fix
* snapshot
---------
Co-authored-by: Daniel Ayala <14967941+danielayala94@users.noreply.github.com>
Co-authored-by: Jon Thysell <jthysell@microsoft.com>
Co-authored-by: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com>
Co-authored-by: Tatiana Kapos <tatianakapos@microsoft.com>
Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com>
## Description
Updates our macOS testing in CI to the macos-latest VM image.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
To unblock CI.
### What
See above.
## Screenshots
N/A
## Testing
Verified tests pass.
## Changelog
Should this change be included in the release notes: _no_
## Description
This PR cherry-picks the following certificate-related commits to unblock CI in 0.74:
3a5ca66aab3534af4fdf5fad854368
---------
Co-authored-by: Danny van Velzen 🁴 <dannyvv@microsoft.com>
## Description
This PR temporarily disables NuGet code-signing during publish and also forces all new projects to include our public ADO feed which will contain unsigned packages.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
See #14030 for why this is necessary.
### What
See above.
## Screenshots
N/A
## Testing
N/A
## Changelog
Should this change be included in the release notes: _yes_
[0.74] Temporarily disable code-signing of NuGet packages
* Introduce ReactNativeAppBuilder (#13368)
* Introduce ReactNativeAppBuilder.idl
* yarn format fix
* Change files
* Address feedback
* Add a fabric check for ReactNativeAppBuilder
* yarn format
* Update SampleAppFabric to use ReactNativeAppBuilder (#13382)
* Update SampleAppFabric to use ReactNativeAppBuilder
* Yarn format fix
* Address feedback to keep BUNDLE and DEBUG
* Yarn format
* Change files
* Setup the DebugBundlePath when loading from metro
* Update reactnativeappbuilder (#13467)
* Build reactnativeappbuilder
* Setup reactnativewin32 app
* Fix dispatcherqueue issue
* Change files
* Cleanup
* Address feedback
* Address feedback2
* Fix pipeline error
* Fix pipeline errors
* Address feedback
* Implement the SampleTurboModule module (#13541)
This PR provides a proper implementation of the `SampleTurboModule` module and removes the proxy code in `TurboModuleManager` which instead substituted the old `SampleTurboCxxModule` module.
- New feature (non-breaking change which adds functionality)
The APIs of `SampleTurboModule` are starting to deviate from the older `SampleTurboCxxModule`, specifically the addition of new `EventEmitter` members. So it's time we had a "real" implementation of `SampleTurboModule`.
Closes#13531
See above.
N/A
Verified tests still pass and the new module is being called.
Should this change be included in the release notes: _yes_
Implement the SampleTurboModule module
* [Fabric] Fix crash when running inspect (#13592)
* [Fabric] Fix crash when running inspect
* Change files
* fix
* [Fabric] Enable ScrollView touch scrolling (#13664)
* [Fabric] Enable ScrolView touch scrolling
* Change files
* format
* typo
* [Fabric] Add Support for accessibilityActions and onAccessibilityAction (#13674)
* Add Implementation for accessibilityActions
* Add activate action
* Format
* Change files
* [Fabric] LogBox should destroy its window on instance shutdown (#13675)
* [Fabric] LogBox should destroy its window on instance shutdown
* Change files
* format
* [Fabric] Add FocusNavigationDirection and allow overriding of default command handling (#13857)
* [Fabric] Add FocusNavigationDirection and allow overriding of default command handling
* Change files
* revert packages.lock
* [Fabric] LayoutDirection and FontSizeMultiplier support (#13866)
* [Fabric] LayoutDirection and FontSizeMultiplier support
* Change files
* Missed a few places not setting LayoutDirection
* fix crash on logbox
* Fix textinput caret
* fix
* RichEdit has to be told its multiline before we can set a multiline string
* Use a legacy native module binding that always returns null in bridgeless mode (#13905)
* Use a legacy native module binding that always returns null in bridgeless mode
* Change files
* format
* SampleTurboModule only works as a turbomodule, so do not install it when using web debugger (#13911)
* SampleTurboModule only works as a turbomodule, so do not install it when using web debugger
* Change files
* fix
* merge conflicts
* format
* fix
* lint fix
* fix
* fix
* update snapshots
---------
Co-authored-by: Sharath Manchala <10109130+sharath2727@users.noreply.github.com>
Co-authored-by: Jon Thysell <jthysell@microsoft.com>
Co-authored-by: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com>
Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com>
## Description
Fixing error blocking PRs due to surprise ADO policy change:
```
Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backtick (`). More information is available here: https://aka.ms/ado/75787
```
### Type of Change
_Erase all that don't apply._
- Bug fix (non-breaking change which fixes an issue)
### Why
Unblock pipelines.
### What
Fixed argument escaping.
## Screenshots
N/A
## Testing
N/A
## Changelog
Should this change be included in the release notes: _no_
## Description
Bumps the version of `serve-static` and `send` to address CVE-2024-43799 and CVE-2024-43800.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
Resolve Component Governance security alerts.
### What
Bumped yarn.lock versions
## Screenshots
N/A
## Testing
N/A
## Changelog
Should this change be included in the release notes: _no_
This PR backports #13338 to 0.74.
## Description
This PR updates the `cpp-app` and `cpp-lib` new architecture templates to build against the pre-built `Microsoft.ReactNative` NuGet packages by default.
### Type of Change
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- This change requires a documentation update
### Why
Building the `Microsoft.ReactNative` native code is very resource-intensive. Pre-building that code makes for much faster builds and greatly improved developer experience. This experience has been experimental and poorly support for Paper for some time now - for the new architecture projects we want using NuGets to be the primary experience from day one.
Resolves#12639
### What
The `cpp-app` and `cpp-lib` new architecture templates now set up projects to consume the ("-Fabric" versions) of the pre-built `Microsoft.ReactNative` NuGet packages by default.
The CI and PR builds have also been updated to make sure nugets for x64, x86, arm64 are built first and then consumed by the new project tests.
To support working on RNW itself, the new projects made using "devMode" (i.e. by yarn linking with your local RNW repo) will still build against the source of that local RNW repo rather than the nugets.
This PR also fixes the `--singleproc` flag for `run-windows`. Previously it didn't do anything on machines with high RAM, but now if you specify the flag it forces single processor builds as expected.
## Screenshots
Building x64 Release Paper (build RNW from source): ![image](https://github.com/user-attachments/assets/d7a529b9-d313-4227-b236-f4781aa25855)
Building x64 Release Fabric (use RNW Nugets):
![image](https://github.com/user-attachments/assets/bdb81df2-e111-4d61-a20a-302b3b6b1ecf)
## Testing
Verified new projects build and run using the pre-built nugets.
## Changelog
Should this change be included in the release notes: _yes_
[0.74] Switch New Architecture templates to use prebuilt NuGets
Backport of PR #13573 to 0.74.
* [Fabric] Fixes a crash that happens on release builds
* Change files
Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
Backport PR #13566 to 0.74.
## Description
This PR moves all of the logic concerning validating and cleaning project names when creating new projects (via the `init-windows` CLI command or the soon to be deprecated `react-native-windows-init` command) into one shared location with unit tests. It also updates the cleaning logic to handle package scopes (i.e. `@org/package`) and better apply cleaning to packages with hyphens (i.e. `my-package`).
Going forward, when creating (new or old arch) projects with `init-windows`, the flow will still to adhere the following rules:
1. Verify that a string specified with `--name` or `--namespace` is valid, or else error out.
2. If an item isn't specified, do our best to determine the value from `package.json`, etc., and clean that value if necessary.
When using `react-native-windows-init`, (which still only lets you specify the `--namespace`, and always figures out name from `package.json`, etc.), the flow will be mostly the same as before, where both name and namespace will be cleaned automatically if invalid, rather than erroring out. (However the consolidated cleaning logic should mean an improvement when using tools other than the RN CLI for creating your initial RN project).
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
The rules for what constitutes a "valid" name for a RN project has changed over the years with each of the different tools that are used to create RN projects. This PR is an attempt to both broaden the number of supported new project tools while also ensuring RNW still produces usable native code.
Closes#13558Closes#13426
### What
Moved all name(space) logic into a new `nameHelpers` module, exposed them to existing callers, and created unit tests.
## Screenshots
N/A
## Testing
Add new tests for nameHelpers.
## Changelog
Should this change be included in the release notes: _yes_
[0.74] Improve new project name(space) validation and cleaning
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
This PR backports #13362 to 0.74.
## Description
The `init-windows` CLI command can be used to create apps with the old arch templates, but "devMode" (i.e. using your local, linked RNW repo instead of the package from NPM) didn't work.
This PR fixes that functionality so `init-windows` can become the new method.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
We want `init-windows` to be the default method for creating new RNW projects, but it still needs to support the old templates for now, and this was the last "missing" feature.
### What
Switched the old templates to using the same `metro.config.js` file that the new templates use (with devMode template variable) and also piping through the correct value for that variable.
## Screenshots
N/A
## Testing
Verified I could create a new (old) app locally with linked RNW and it recognized and implemented devMode correctly, so that the app could launch.
## Changelog
Should this change be included in the release notes: yes
[0.74] Enabled detecting devMode with `react-native init-window`s and the old/* templates
* Use Turbo Modules for Desktop instead of CxxModules (#13265)
* fix
* format
* fabric should always set useTurboModulesOnly
---------
Co-authored-by: Vladimir Morozov <vmorozov@microsoft.com>
This PR backports #13455 to 0.74.
## Description
This PR bumps the minimum version of VS that RNW expects to 17.11.0.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
To make sure users don't use the regressed builds of VS 2022.
Resolves#13339Resolves#13374
### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.
## Screenshots
N/A
## Testing
`run-windows` now works with 17.11.0.
## Changelog
Should this change be included in the release notes: _yes_
Require Visual Studio 2022 >= v17.11.0
* Port Desktop DLL to ARM64EC (#13320)
* Upgrade WinSDK version for C/C++ projects
* Do not build Integration Test projects for ARM64EC
* Make V8Platform x64 for ARM64EC
* Override HermesPlatform for ARM64EC
* Override WinAppSDK platforms for ARM64EC
* Exclude OpenSSL on Desktop DLL for ARM64EC
* Override WinAppSDK _MrtCoreRuntimeIdentifier
* Add explicit LIB dependencies for ARM64EC
* Skip React.Windows.IntegrationTests on ARM64EC
* Remove OpenSSL from Desktop LIB and DLL
* /t:Vars - Log SolutionName
* Update Desktop NUSPEC to use ARM64EC (#13335)
* Add ARM64EC strip slices