From b2e87bf4c36fcd7b25fa2aec7e9dd6c38787545b Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 27 Jan 2026 16:53:33 +0530 Subject: [PATCH 1/4] docs: fix broken markdown links --- README.md | 2 +- docs/attack-surface-analyzer.md | 3 ++- docs/managedCodeGen.md | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fca6bff31ad..ba73b3047b8 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ React Native has [great documentation](https://reactnative.dev/docs/getting-star - Check the [samples repo](https://github.com/microsoft/react-native-windows-samples) for more standalone samples. - The [React Native Gallery](https://github.com/microsoft/react-native-gallery) app demonstrates various components in an interactive way. - Check out the [React Native Developer Blog](https://devblogs.microsoft.com/react-native/) to see examples from past conference talks, blog posts, and more. -- For more sample code browse the [RNTester folder](https://github.com/microsoft/react-native-windows/tree/main/packages/e2e-test-app-fabric/windows/RNTesterApp) in the GitHub web UI. +- For more sample code browse the [RNTester folder](https://github.com/microsoft/react-native-windows/tree/main/packages/e2e-test-app-fabric/windows/RNTesterApp-Fabric) in the GitHub web UI. ## 📢 Contributing See [Contributing guidelines](https://github.com/microsoft/react-native-windows/blob/main/CONTRIBUTING.md) for how to setup your fork of the repo and start a PR to contribute to React Native for Windows. diff --git a/docs/attack-surface-analyzer.md b/docs/attack-surface-analyzer.md index 92bd7af1727..80f72a2cfb2 100644 --- a/docs/attack-surface-analyzer.md +++ b/docs/attack-surface-analyzer.md @@ -196,7 +196,8 @@ dotnet --version - [Microsoft Attack Surface Analyzer GitHub](https://github.com/microsoft/AttackSurfaceAnalyzer) - [ASA Documentation](https://github.com/microsoft/AttackSurfaceAnalyzer/wiki) -- [SDL Requirements](https://liquid.microsoft.com/Web/Object/Read/MS.Security/Requirements/Microsoft.Security.AccessControl.10011) +- [This requirement is part of Microsoft's Secure Development Lifecycle (SDL). +See:] (https://learn.microsoft.com/en-us/windows/security/) - [ASA CLI Usage](https://github.com/microsoft/AttackSurfaceAnalyzer/wiki/Command-Line-Usage) ## Support diff --git a/docs/managedCodeGen.md b/docs/managedCodeGen.md index 2f33659fbc9..6b33516507b 100644 --- a/docs/managedCodeGen.md +++ b/docs/managedCodeGen.md @@ -27,7 +27,7 @@ When building the apps that are checked in to our repo for testing, we have to r ## Turning on/off Currently the feature is behind an MSBuild property `$(ReactNativeCodeGenEnabled)`. -The default at the moment is false, it is only turned on for a single project for now which is the [SampleLibraryCS.csproj](https://github.com/microsoft/react-native-windows/blob/main/packages/sample-apps/windows/SampleLibraryCS/SampleLibraryCS.csproj) project, to prove it is stable. We will slowly enable it for all projects in the repo and then make it the default. +The default at the moment is false, it is only turned on for a single project for now which is the [SampleAppFabric](https://github.com/microsoft/react-native-windows/tree/main/packages/sample-app-fabric/windows/SampleAppFabric) project, to prove it is stable. We will slowly enable it for all projects in the repo and then make it the default. ## MSBuild/NuGet Complications MSBuild and NuGet spent a long time fighting me in mixing a NetCoreApp3.1 executable and WinRT apps in the same solution and the same build. ProjectReferences cannot be used so I had to use the `` task directly in the targets and it was tricky making it build from both the customer apps as well as our main build solution and unittest (Microsoft.ReactNative.sln). In the end there are a few hacks in place to make this work. From 3ece11f384f05b791e950683fc7fdb22e563eb2b Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 28 Jan 2026 18:50:02 +0530 Subject: [PATCH 2/4] Address reviewer feedback --- docs/attack-surface-analyzer.md | 3 +++ docs/managedCodeGen.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/attack-surface-analyzer.md b/docs/attack-surface-analyzer.md index 80f72a2cfb2..19dcc3e69e5 100644 --- a/docs/attack-surface-analyzer.md +++ b/docs/attack-surface-analyzer.md @@ -196,8 +196,11 @@ dotnet --version - [Microsoft Attack Surface Analyzer GitHub](https://github.com/microsoft/AttackSurfaceAnalyzer) - [ASA Documentation](https://github.com/microsoft/AttackSurfaceAnalyzer/wiki) +<<<<<<< Updated upstream - [This requirement is part of Microsoft's Secure Development Lifecycle (SDL). See:] (https://learn.microsoft.com/en-us/windows/security/) +======= +>>>>>>> Stashed changes - [ASA CLI Usage](https://github.com/microsoft/AttackSurfaceAnalyzer/wiki/Command-Line-Usage) ## Support diff --git a/docs/managedCodeGen.md b/docs/managedCodeGen.md index 6b33516507b..c713b3f7704 100644 --- a/docs/managedCodeGen.md +++ b/docs/managedCodeGen.md @@ -27,7 +27,10 @@ When building the apps that are checked in to our repo for testing, we have to r ## Turning on/off Currently the feature is behind an MSBuild property `$(ReactNativeCodeGenEnabled)`. +<<<<<<< Updated upstream The default at the moment is false, it is only turned on for a single project for now which is the [SampleAppFabric](https://github.com/microsoft/react-native-windows/tree/main/packages/sample-app-fabric/windows/SampleAppFabric) project, to prove it is stable. We will slowly enable it for all projects in the repo and then make it the default. +======= +>>>>>>> Stashed changes ## MSBuild/NuGet Complications MSBuild and NuGet spent a long time fighting me in mixing a NetCoreApp3.1 executable and WinRT apps in the same solution and the same build. ProjectReferences cannot be used so I had to use the `` task directly in the targets and it was tricky making it build from both the customer apps as well as our main build solution and unittest (Microsoft.ReactNative.sln). In the end there are a few hacks in place to make this work. From a45ae5e4a96b733c2138ee58dfe6e14999c401a6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 29 Jan 2026 09:45:49 +0530 Subject: [PATCH 3/4] Remove obsolete docs and clean conflict markers --- docs/attack-surface-analyzer.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/attack-surface-analyzer.md b/docs/attack-surface-analyzer.md index 19dcc3e69e5..a677f243dcd 100644 --- a/docs/attack-surface-analyzer.md +++ b/docs/attack-surface-analyzer.md @@ -196,11 +196,6 @@ dotnet --version - [Microsoft Attack Surface Analyzer GitHub](https://github.com/microsoft/AttackSurfaceAnalyzer) - [ASA Documentation](https://github.com/microsoft/AttackSurfaceAnalyzer/wiki) -<<<<<<< Updated upstream -- [This requirement is part of Microsoft's Secure Development Lifecycle (SDL). -See:] (https://learn.microsoft.com/en-us/windows/security/) -======= ->>>>>>> Stashed changes - [ASA CLI Usage](https://github.com/microsoft/AttackSurfaceAnalyzer/wiki/Command-Line-Usage) ## Support From 35efee4cf4a67c583faf343a8601a74ec6d2fac0 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 29 Jan 2026 09:49:04 +0530 Subject: [PATCH 4/4] Delete managedCodeGen.md --- docs/managedCodeGen.md | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 docs/managedCodeGen.md diff --git a/docs/managedCodeGen.md b/docs/managedCodeGen.md deleted file mode 100644 index c713b3f7704..00000000000 --- a/docs/managedCodeGen.md +++ /dev/null @@ -1,41 +0,0 @@ -# Code generation for managed react-native modules - -This feature is applicable to C# implemented modules or `ViewManager`s. Its objective is to ensure the code needed to integrate with the `react-native` application is constructed at build time instead of at runtime. - -In earlier versions of react-native-windows managed modules registered themselves based on reflection at runtime. This method has a few disadvantages: -1) the error handling was limited and only available at runtime. -2) The cost for doing reflection was paid each and every time the app ran. -3) .NET Native - which is used by UWP apps - has somewhat restrictions on what types/APIs can be reflected upon and complex ways of working around it. -Doing it at build time should result in developers seeing all errors up front, rather than only seeing errors for the code being tested. And the runtime cost is not incurred every single time. - -## How it works -This change adds a new targets file that is imported from the [CSharpLib.targets](https://github.com/microsoft/react-native-windows/blob/main/vnext/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.targets) and [CSharpApp.targets](https://github.com/microsoft/react-native-windows/blob/main/vnext/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets). That will enable the codegen for managed projects. - -Those targets will collect all the C# source files, assembly references and defines from the app (or library) and invoke the CodeGen tool to generate a C# file. This is very similar to how the translation of Xaml to csharp code behind files works. -The generated C# file will contain a class called `ReactPackageProvider` in the default namespace of your project. The generate class implements `Microsoft.ReactNative.IReactPackageProvider`. The implementation of the generated class will: - * Register the detected ViewManagers (classes implementing `Microsoft.ReactNative.IViewManager`) - * Register the detected Modules (classes with attribute `[Microsoft.ReactNative.Managed.ReactModule]`) - * Generate and register serializers for types that need to be serialized for the registred modules. - * Generate and register custom serialization methods. - -### In source mode -The targets file hooks up an MSBuild target that will ensure the tool is compiled, deployed and runnable based on the tools sources. The codegen tool is defined in the Microsoft.ReactNative.Managed.CodeGen project. It will build and deploy the tool in the current configuraiton of your project (debug or release) but will always build and run it in platform x64. - -### In NuGet mode (Future) -The tool will be shipped as a binary and the steps won't have to build or deploy the tool. The shipped version in the NuGet package will only be release win-x64. -When building the apps that are checked in to our repo for testing, we have to remain running off the source version as MSBuild and NuGet are not flexible enough to build and consume a NuGet package in the same build. - -## Turning on/off -Currently the feature is behind an MSBuild property `$(ReactNativeCodeGenEnabled)`. -<<<<<<< Updated upstream -The default at the moment is false, it is only turned on for a single project for now which is the [SampleAppFabric](https://github.com/microsoft/react-native-windows/tree/main/packages/sample-app-fabric/windows/SampleAppFabric) project, to prove it is stable. We will slowly enable it for all projects in the repo and then make it the default. -======= ->>>>>>> Stashed changes - -## MSBuild/NuGet Complications -MSBuild and NuGet spent a long time fighting me in mixing a NetCoreApp3.1 executable and WinRT apps in the same solution and the same build. ProjectReferences cannot be used so I had to use the `` task directly in the targets and it was tricky making it build from both the customer apps as well as our main build solution and unittest (Microsoft.ReactNative.sln). In the end there are a few hacks in place to make this work. -The hookups in MSBuild do not use the latest BeforeTargets/AfterTargets feature to schedule the main work. I opted to follow the same pattern that the Xaml Codegen uses, so the React CodeGen runs after all the other codegen tools (like resgen, xamlcompile etc) to ensure people familiar with those extensions know how to work with the React Managed CodeGen. - -## Future improvements - * Add support for `Task` async methods. [#5143](https://github.com/microsoft/react-native-windows/issues/5143) - * Ship it as a NuGet package [#4546](https://github.com/microsoft/react-native-windows/issues/4546)