react-native-windows 0.80.0-preview.1 → 0.80.0-preview.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/Directory.Build.props +6 -0
  2. package/Folly/TEMP_UntilFollyUpdate/json/json.cpp +1 -1
  3. package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -8
  4. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +73 -27
  5. package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +21 -156
  6. package/Microsoft.ReactNative/Fabric/Composition/CompositionTextRangeProvider.cpp +30 -9
  7. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +24 -0
  8. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +22 -0
  9. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +3 -0
  10. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +30 -65
  11. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +4 -6
  12. package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +11 -0
  13. package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.cpp +37 -5
  14. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +33 -15
  15. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +225 -0
  16. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +23 -0
  17. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +5 -3
  18. package/Microsoft.ReactNative/Fabric/ImageManager.cpp +1 -1
  19. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +64 -0
  20. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.h +11 -0
  21. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +2 -2
  22. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.h +1 -1
  23. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +29 -0
  24. package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +49 -0
  25. package/Microsoft.ReactNative/Utils/ThemeUtils.h +31 -0
  26. package/Microsoft.ReactNative.Managed.CodeGen/Microsoft.ReactNative.Managed.CodeGen.csproj +1 -1
  27. package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Debug.pubxml +1 -1
  28. package/Microsoft.ReactNative.Managed.CodeGen/Properties/PublishProfiles/DeployAsTool-Release.pubxml +1 -1
  29. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  30. package/PropertySheets/JSEngine.props +1 -1
  31. package/PropertySheets/Warnings.props +45 -0
  32. package/README.md +4 -0
  33. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +1 -1
  34. package/Scripts/rnw-dependencies.ps1 +18 -5
  35. package/package.json +2 -2
  36. package/templates/cpp-app/template.config.js +2 -1
  37. package/templates/cpp-lib/example/metro.config.js +1 -1
  38. package/templates/old/generateWrapper.js +1 -1
  39. package/templates/old/uwp-cpp-app/template.config.js +1 -1
@@ -9,7 +9,7 @@
9
9
  namespace facebook {
10
10
  namespace react {
11
11
 
12
- ImageManager::ImageManager(ContextContainer::Shared const &contextContainer) {
12
+ ImageManager::ImageManager(std::shared_ptr<const ContextContainer> const &contextContainer) {
13
13
  auto reactContext = *contextContainer->find<winrt::Microsoft::ReactNative::ReactContext>("MSRN.ReactContext");
14
14
  self_ = new Microsoft::ReactNative::WindowsImageManager(reactContext);
15
15
  }
@@ -3,11 +3,14 @@
3
3
 
4
4
  #include "PlatformColorUtils.h"
5
5
  #include <UI.Xaml.Media.h>
6
+ #include <Utils/ThemeUtils.h>
6
7
  #include <Utils/ValueUtils.h>
7
8
  #ifndef CORE_ABI
8
9
  #include <XamlUtils.h>
9
10
  #endif // CORE_ABI
11
+ #include <react/renderer/graphics/Color.h>
10
12
  #include <winrt/Windows.UI.ViewManagement.h>
13
+ #include "HostPlatformColor.h"
11
14
 
12
15
  namespace facebook::react {
13
16
 
@@ -142,4 +145,65 @@ winrt::Windows::UI::Color ResolvePlatformColor(const std::vector<std::string> &s
142
145
  return {};
143
146
  }
144
147
 
148
+ SharedColor GetTextInputPlaceholderColor(bool isFocused, const winrt::Windows::UI::Color &backgroundColor) {
149
+ // In high contrast mode, always use system GrayText for accessibility
150
+ auto accessibilitySettings{winrt::Windows::UI::ViewManagement::AccessibilitySettings()};
151
+ if (accessibilitySettings.HighContrast()) {
152
+ auto uiSettings{winrt::Windows::UI::ViewManagement::UISettings()};
153
+ auto grayText = uiSettings.UIElementColor(winrt::Windows::UI::ViewManagement::UIElementType::GrayText);
154
+ return hostPlatformColorFromRGBA(grayText.R, grayText.G, grayText.B, grayText.A);
155
+ }
156
+
157
+ // When no background color provided (transparent), use Windows system default
158
+ if (backgroundColor.A == 0) {
159
+ // Use system WindowText for default placeholder - matches RN Core behavior
160
+ auto uiSettings{winrt::Windows::UI::ViewManagement::UISettings()};
161
+ auto windowText = uiSettings.UIElementColor(winrt::Windows::UI::ViewManagement::UIElementType::WindowText);
162
+ // Make placeholder text lighter (60% opacity)
163
+ return hostPlatformColorFromRGBA(
164
+ windowText.R, windowText.G, windowText.B, static_cast<uint8_t>(windowText.A * 0.6f));
165
+ }
166
+
167
+ // Use ITU-R BT.601 luminance calculation to determine background brightness
168
+ bool isLightBackground = Microsoft::ReactNative::IsColorLight(backgroundColor);
169
+
170
+ // Use Windows 11 design system semantic colors for optimal contrast and consistency
171
+ // Light backgrounds: TextFillColorPrimary (darker) for focus, TextFillColorSecondary for unfocused
172
+ // Dark backgrounds: TextFillColorPrimary (lighter) for focus, TextFillColorSecondary for unfocused
173
+ if (isLightBackground) {
174
+ if (isFocused) {
175
+ auto color = ResolvePlatformColor({"TextFillColorPrimary"});
176
+ return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
177
+ } else {
178
+ auto color = ResolvePlatformColor({"TextFillColorSecondary"});
179
+ return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
180
+ }
181
+ } else {
182
+ if (isFocused) {
183
+ auto color = ResolvePlatformColor({"TextFillColorPrimary"});
184
+ return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
185
+ } else {
186
+ auto color = ResolvePlatformColor({"TextFillColorSecondary"});
187
+ return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
188
+ }
189
+ }
190
+ }
191
+
192
+ SharedColor GetDefaultTextColor() {
193
+ // In high contrast mode, always use system WindowText for accessibility
194
+ auto accessibilitySettings{winrt::Windows::UI::ViewManagement::AccessibilitySettings()};
195
+ if (accessibilitySettings.HighContrast()) {
196
+ auto uiSettings{winrt::Windows::UI::ViewManagement::UISettings()};
197
+ auto windowText = uiSettings.UIElementColor(winrt::Windows::UI::ViewManagement::UIElementType::WindowText);
198
+ return hostPlatformColorFromRGBA(windowText.R, windowText.G, windowText.B, windowText.A);
199
+ }
200
+
201
+ // Use Windows 11 design system semantic color TextFillColorPrimary
202
+ // This automatically adapts to light/dark mode themes:
203
+ // - Light mode: rgba(0, 0, 0, 0.894) - nearly black for good contrast
204
+ // - Dark mode: rgba(255, 255, 255, 1.0) - white for readability
205
+ auto color = ResolvePlatformColor({"TextFillColorPrimary"});
206
+ return hostPlatformColorFromRGBA(color.R, color.G, color.B, color.A);
207
+ }
208
+
145
209
  } // namespace facebook::react
@@ -5,8 +5,19 @@
5
5
 
6
6
  #include <winrt/Windows.UI.h>
7
7
 
8
+ // Forward declaration to avoid circular dependencies
9
+ namespace facebook::react {
10
+ class SharedColor;
11
+ }
12
+
8
13
  namespace facebook::react {
9
14
 
10
15
  winrt::Windows::UI::Color ResolvePlatformColor(const std::vector<std::string> &semanticItems);
11
16
 
17
+ // Get appropriate placeholder text color for TextInput based on focus state and background
18
+ SharedColor GetTextInputPlaceholderColor(bool isFocused, const winrt::Windows::UI::Color &backgroundColor = {});
19
+
20
+ // Get default text foreground color for Text component (theme-aware)
21
+ SharedColor GetDefaultTextColor();
22
+
12
23
  } // namespace facebook::react
@@ -66,10 +66,10 @@ class AttachmentInlineObject : public winrt::implements<AttachmentInlineObject,
66
66
  float m_height;
67
67
  };
68
68
 
69
- TextLayoutManager::TextLayoutManager(const ContextContainer::Shared &contextContainer)
69
+ TextLayoutManager::TextLayoutManager(const std::shared_ptr<const ContextContainer> &contextContainer)
70
70
  : contextContainer_(contextContainer), textMeasureCache_(kSimpleThreadSafeCacheSizeCap) {}
71
71
 
72
- WindowsTextLayoutManager::WindowsTextLayoutManager(const ContextContainer::Shared &contextContainer)
72
+ WindowsTextLayoutManager::WindowsTextLayoutManager(const std::shared_ptr<const ContextContainer> &contextContainer)
73
73
  : TextLayoutManager(contextContainer) {}
74
74
 
75
75
  void WindowsTextLayoutManager::GetTextLayout(
@@ -20,7 +20,7 @@ namespace facebook::react {
20
20
 
21
21
  class WindowsTextLayoutManager : public TextLayoutManager {
22
22
  public:
23
- WindowsTextLayoutManager(const ContextContainer::Shared &contextContainer);
23
+ WindowsTextLayoutManager(const std::shared_ptr<const ContextContainer> &contextContainer);
24
24
  virtual ~WindowsTextLayoutManager() = default;
25
25
 
26
26
  /*
@@ -7,6 +7,8 @@
7
7
  #include <UI.Xaml.Automation.Peers.h>
8
8
  #include <UI.Xaml.Controls.h>
9
9
  #include <XamlUtils.h>
10
+ #else
11
+ #include <Fabric/Composition/ReactNativeIsland.h>
10
12
  #endif
11
13
  #include <uiautomationcore.h>
12
14
  #include <uiautomationcoreapi.h>
@@ -79,6 +81,33 @@ void AccessibilityInfo::announceForAccessibility(std::wstring announcement) noex
79
81
  xaml::Automation::Peers::AutomationNotificationProcessing::ImportantMostRecent,
80
82
  hstr,
81
83
  hstr);
84
+ #else
85
+ if (auto weakIslandWrapper = context.Properties().Get(
86
+ winrt::Microsoft::ReactNative::implementation::ReactNativeIsland::LastFocusedReactNativeIslandProperty())) {
87
+ if (auto weakIsland = weakIslandWrapper.Value()) {
88
+ if (auto reactNativeIsland = weakIsland.get()) {
89
+ if (auto uiaprovider = reactNativeIsland->GetUiaProvider()) {
90
+ if (auto rawProvider = uiaprovider.try_as<IRawElementProviderSimple>()) {
91
+ // Convert announcement to BSTR for UIA
92
+ winrt::hstring hstrAnnouncement{announcement};
93
+ auto bstrAnnouncement = SysAllocString(hstrAnnouncement.c_str());
94
+ if (bstrAnnouncement) {
95
+ // Raise the UIA notification event
96
+ HRESULT hr = UiaRaiseNotificationEvent(
97
+ rawProvider.get(),
98
+ NotificationKind_Other,
99
+ NotificationProcessing_ImportantMostRecent,
100
+ bstrAnnouncement,
101
+ bstrAnnouncement);
102
+ // Clean up BSTRs
103
+ SysFreeString(bstrAnnouncement);
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+
82
111
  #endif
83
112
  });
84
113
  }
@@ -4,6 +4,10 @@
4
4
  #include "pch.h"
5
5
  #include <Utils/ThemeUtils.h>
6
6
 
7
+ #ifdef USE_FABRIC
8
+ #include <react/renderer/graphics/Color.h>
9
+ #include <react/renderer/graphics/HostPlatformColor.h>
10
+ #endif
7
11
  #include <winuser.h>
8
12
 
9
13
  namespace Microsoft::ReactNative {
@@ -30,4 +34,49 @@ bool IsInHighContrastWin32() noexcept {
30
34
  return false;
31
35
  }
32
36
 
37
+ int CalculateColorBrightness(const winrt::Windows::UI::Color &color) noexcept {
38
+ return CalculateColorBrightness(color.R, color.G, color.B);
39
+ }
40
+
41
+ int CalculateColorBrightness(int r, int g, int b) noexcept {
42
+ return (r * kColorBrightnessRedWeight + g * kColorBrightnessGreenWeight + b * kColorBrightnessBlueWeight) /
43
+ kColorBrightnessDivisor;
44
+ }
45
+
46
+ #ifdef USE_FABRIC
47
+ bool isColorMeaningful(const facebook::react::SharedColor &color) noexcept {
48
+ return facebook::react::isColorMeaningful(color);
49
+ }
50
+
51
+ facebook::react::SharedColor GetCaretColor(
52
+ const facebook::react::SharedColor &cursorColor,
53
+ const facebook::react::SharedColor &foregroundColor,
54
+ const facebook::react::SharedColor &backgroundColor) noexcept {
55
+ const auto defaultCaretColor =
56
+ facebook::react::hostPlatformColorFromRGBA(0, 0, 0, 0xFF); // Default caret color is black
57
+
58
+ if (cursorColor) {
59
+ return cursorColor;
60
+ } else if (foregroundColor) {
61
+ // Extra Caution if Background color is present
62
+ auto fgWindows = (*foregroundColor).AsWindowsColor();
63
+ int fgBrightness = CalculateColorBrightness(fgWindows);
64
+
65
+ // If foreground is very light and background is also very light, force black caret.
66
+ if (fgBrightness > kCaretLightForegroundThreshold && Microsoft::ReactNative::isColorMeaningful(backgroundColor)) {
67
+ auto bgWindows = (*backgroundColor).AsWindowsColor();
68
+ int bgBrightness = CalculateColorBrightness(bgWindows);
69
+ if (bgBrightness > kCaretLightBackgroundThreshold) {
70
+ // Use opaque black caret
71
+ return defaultCaretColor;
72
+ }
73
+ }
74
+
75
+ return foregroundColor;
76
+ } else {
77
+ return defaultCaretColor;
78
+ }
79
+ }
80
+ #endif
81
+
33
82
  } // namespace Microsoft::ReactNative
@@ -4,10 +4,41 @@
4
4
  #pragma once
5
5
 
6
6
  #include <winrt/Windows.UI.h>
7
+ #ifdef USE_FABRIC
8
+ #include <react/renderer/graphics/Color.h>
9
+ #endif
7
10
 
8
11
  namespace Microsoft::ReactNative {
9
12
 
13
+ // RGB luminance weights per ITU-R BT.601 standard (legacy NTSC weights)
14
+ constexpr int kColorBrightnessRedWeight = 299; // Red coefficient: 299/1000 = 0.299
15
+ constexpr int kColorBrightnessGreenWeight = 587; // Green coefficient: 587/1000 = 0.587
16
+ constexpr int kColorBrightnessBlueWeight = 114; // Blue coefficient: 114/1000 = 0.114
17
+ constexpr int kColorBrightnessDivisor = 1000;
18
+
19
+ // Caret color threshold constants
20
+ constexpr int kCaretLightForegroundThreshold = 240;
21
+ constexpr int kCaretLightBackgroundThreshold = 186;
22
+ constexpr int kCaretSelectionBrightnessThreshold = 125;
23
+
10
24
  bool IsColorLight(const winrt::Windows::UI::Color &clr) noexcept;
11
25
  bool IsInHighContrastWin32() noexcept;
12
26
 
27
+ // Calculate brightness using ITU-R BT.601 luminance formula
28
+ int CalculateColorBrightness(const winrt::Windows::UI::Color &color) noexcept;
29
+
30
+ // Calculate brightness from RGB values
31
+ int CalculateColorBrightness(int r, int g, int b) noexcept;
32
+
33
+ #ifdef USE_FABRIC
34
+ // Check if a color is meaningful (handles both PAPER and Fabric architectures)
35
+ bool isColorMeaningful(const facebook::react::SharedColor &color) noexcept;
36
+
37
+ // Determine appropriate caret color based on foreground and background colors
38
+ facebook::react::SharedColor GetCaretColor(
39
+ const facebook::react::SharedColor &cursorColor,
40
+ const facebook::react::SharedColor &foregroundColor,
41
+ const facebook::react::SharedColor &backgroundColor) noexcept;
42
+ #endif
43
+
13
44
  } // namespace Microsoft::ReactNative
@@ -3,7 +3,7 @@
3
3
  <PropertyGroup>
4
4
  <OutputType>Exe</OutputType>
5
5
 
6
- <TargetFramework>net6.0</TargetFramework>
6
+ <TargetFramework>net8.0</TargetFramework>
7
7
  <Platforms>x64;x86;ARM64</Platforms>
8
8
  <RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
9
9
 
@@ -6,7 +6,7 @@
6
6
  <PublishProtocol>FileSystem</PublishProtocol>
7
7
  <Configuration>Debug</Configuration>
8
8
  <Platform>x64</Platform>
9
- <TargetFramework>net6.0</TargetFramework>
9
+ <TargetFramework>net8.0</TargetFramework>
10
10
  <PublishDir>$(OutDir)publish</PublishDir>
11
11
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
12
12
  <SelfContained>true</SelfContained>
@@ -6,7 +6,7 @@
6
6
  <PublishProtocol>FileSystem</PublishProtocol>
7
7
  <Configuration>Release</Configuration>
8
8
  <Platform>x64</Platform>
9
- <TargetFramework>net6.0</TargetFramework>
9
+ <TargetFramework>net8.0</TargetFramework>
10
10
  <PublishDir>$(OutDir)publish</PublishDir>
11
11
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
12
12
  <SelfContained>true</SelfContained>
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.80.0-preview.1</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.80.0-preview.10</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>80</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>79b0da7bfd78f59a7de9a025ab750e11005766e6</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>745af1bf80c450554801004e8bbbb716173f32c1</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -6,7 +6,7 @@
6
6
  <!-- Enabling this will (1) Include hermes glues in the Microsoft.ReactNative binaries AND (2) Make hermes the default engine -->
7
7
  <UseHermes Condition="'$(UseHermes)' == ''">true</UseHermes>
8
8
  <!-- This will be true if (1) the client want to use hermes by setting UseHermes to true OR (2) We are building for UWP where dynamic switching is enabled -->
9
- <HermesVersion Condition="'$(HermesVersion)' == ''">0.0.0-2505.2001-0e4bc3b9</HermesVersion>
9
+ <HermesVersion Condition="'$(HermesVersion)' == ''">0.0.0-2507.21007-eda7aef6</HermesVersion>
10
10
  <HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgMicrosoft_JavaScript_Hermes)')">$(PkgMicrosoft_JavaScript_Hermes)</HermesPackage>
11
11
  <HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\Microsoft.JavaScript.Hermes\$(HermesVersion)</HermesPackage>
12
12
  <EnableHermesInspectorInReleaseFlavor Condition="'$(EnableHermesInspectorInReleaseFlavor)' == ''">false</EnableHermesInspectorInReleaseFlavor>
@@ -2,6 +2,43 @@
2
2
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
 
4
4
  <PropertyGroup>
5
+ <!-- SDL MANDATORY WARNINGS (Microsoft Security Development Lifecycle) -->
6
+ <!-- These warnings MUST be enabled and fixed per SDL requirements -->
7
+ <!-- Work Item: #58386089 - Fix warnings identified by native code compiler -->
8
+ <SDLMandatoryWarnings>
9
+ 4018; <!-- 'expression' : signed/unsigned mismatch -->
10
+ 4055; <!-- 'conversion' : from data pointer to function pointer -->
11
+ 4146; <!-- unary minus operator applied to unsigned type -->
12
+ 4242; <!-- 'identifier' : conversion with possible loss of data -->
13
+ 4244; <!-- 'conversion' conversion with possible loss of data -->
14
+ 4267; <!-- 'var' : conversion from size_t with possible loss of data -->
15
+ 4302; <!-- 'conversion' : truncation from type1 to type2 -->
16
+ 4308; <!-- negative integral constant converted to unsigned type -->
17
+ 4509; <!-- nonstandard extension: SEH with destructor -->
18
+ 4510; <!-- 'class' : default constructor could not be generated -->
19
+ 4532; <!-- jump out of __finally/finally block undefined behavior -->
20
+ 4533; <!-- initialization skipped by instruction -->
21
+ 4610; <!-- object can never be instantiated -->
22
+ 4611; <!-- interaction between function and C++ destruction non-portable -->
23
+ 4700; <!-- uninitialized local variable used -->
24
+ 4701; <!-- potentially uninitialized local variable used -->
25
+ 4703; <!-- potentially uninitialized local pointer variable used -->
26
+ 4789; <!-- destination of memory copy too small -->
27
+ 4995; <!-- function marked as pragma deprecated -->
28
+ 4996 <!-- deprecated function (including std::) -->
29
+ </SDLMandatoryWarnings>
30
+
31
+ <!-- SDL RECOMMENDED WARNINGS (Strongly recommended to fix) -->
32
+ <SDLRecommendedWarnings>
33
+ 4287; <!-- unsigned/negative constant mismatch -->
34
+ 4365; <!-- signed/unsigned mismatch -->
35
+ 4388; <!-- signed/unsigned mismatch in comparison -->
36
+ 4545; <!-- expression before comma evaluates to function missing argument list -->
37
+ 4546; <!-- function call before comma missing argument list -->
38
+ 4547; <!-- operator before comma has no effect -->
39
+ 4549 <!-- operator before comma has no effect -->
40
+ </SDLRecommendedWarnings>
41
+
5
42
  <!-- Office pre-disabled warnings -->
6
43
  <!--
7
44
  C4201 - nonstandard extension used : nameless struct/union
@@ -31,8 +68,16 @@
31
68
  <!-- /permissive- by default to enforce standards conformance, unless ENABLEPermissive has been set -->
32
69
  <AdditionalOptions Condition="'$(ENABLEPermissive)' == ''">/permissive- %(AdditionalOptions)</AdditionalOptions>
33
70
  <DisableSpecificWarnings>$(OfficePreDisabledWarnings);$(ExtraWarningsToDisable);$(DisableSpecificWarnings)</DisableSpecificWarnings>
71
+
72
+ <!-- SDL REQUIREMENT: Treat warnings as errors -->
34
73
  <TreatWarningAsError>true</TreatWarningAsError>
74
+
75
+ <!-- SDL REQUIREMENT: Use /W4 warning level -->
35
76
  <WarningLevel>Level4</WarningLevel>
77
+
78
+ <!-- SDL REQUIREMENT: Explicitly enable mandatory warnings as errors -->
79
+ <!-- This ensures SDL mandatory warnings are NEVER disabled -->
80
+ <WarningAsError>$(SDLMandatoryWarnings);%(WarningAsError)</WarningAsError>
36
81
  </ClCompile>
37
82
  <Link>
38
83
  <!--
package/README.md CHANGED
@@ -58,6 +58,10 @@ Search the [existing issues](https://github.com/microsoft/react-native-windows/i
58
58
  ## Documentation
59
59
  React Native has [great documentation](https://reactnative.dev/docs/getting-started). React Native for Windows adds its own separate [Windows and macOS documentation](https://microsoft.github.io/react-native-windows/) for desktop platform information like API docs and blog updates.
60
60
 
61
+ ### Security Documentation
62
+ - **[Security Configuration Guide](https://github.com/microsoft/react-native-windows/blob/main/docs/security-configuration.md)** - Comprehensive guide for SDL-compliant security configurations
63
+ - **[Security Best Practices](https://github.com/microsoft/react-native-windows/blob/main/docs/security-best-practices.md)** - Secure coding patterns and security API usage
64
+
61
65
  ### Examples
62
66
  - Using the CLI in the [Getting Started](https://microsoft.github.io/react-native-windows/docs/getting-started) guide will set you up with a sample React Native for Windows app that you can begin editing right away.
63
67
  - Check the [samples repo](https://github.com/microsoft/react-native-windows-samples) for more standalone samples.
@@ -23,7 +23,7 @@ namespace facebook::react {
23
23
  ComponentDescriptorRegistry::ComponentDescriptorRegistry(
24
24
  ComponentDescriptorParameters parameters,
25
25
  const ComponentDescriptorProviderRegistry& providerRegistry,
26
- ContextContainer::Shared contextContainer)
26
+ std::shared_ptr<const ContextContainer> contextContainer)
27
27
  : parameters_(std::move(parameters)),
28
28
  providerRegistry_(providerRegistry),
29
29
  contextContainer_(std::move(contextContainer)) {}
@@ -1,4 +1,3 @@
1
-
2
1
  # Troubleshoot RNW dependencies
3
2
  param(
4
3
  [switch]$Install = $false,
@@ -88,9 +87,9 @@ $wingetver = "1.7.11261";
88
87
  $vsver = "17.11.0";
89
88
 
90
89
  # The exact .NET SDK version to check for
91
- $dotnetver = "6.0";
90
+ $dotnetver = "8.0";
92
91
  # Version name of the winget package
93
- $wingetDotNetVer = "6";
92
+ $wingetDotNetVer = "8";
94
93
 
95
94
  $v = [System.Environment]::OSVersion.Version;
96
95
  if ($env:Agent_BuildDirectory) {
@@ -460,9 +459,23 @@ $requirements = @(
460
459
  Install = {
461
460
  $ProgressPreference = 'Ignore';
462
461
  $url = "https://github.com/microsoft/WinAppDriver/releases/download/v1.2.1/WindowsApplicationDriver_1.2.1.msi";
462
+ $downloadPath = "$env:TEMP\WindowsApplicationDriver.msi"
463
463
  Write-Verbose "Downloading WinAppDriver from $url";
464
- Invoke-WebRequest -UseBasicParsing $url -OutFile $env:TEMP\WindowsApplicationDriver.msi
465
- & $env:TEMP\WindowsApplicationDriver.msi /q
464
+ Invoke-WebRequest -UseBasicParsing $url -OutFile $downloadPath
465
+
466
+ # SDL Compliance: Verify signature (Work Item 58386093)
467
+ $signature = Get-AuthenticodeSignature $downloadPath
468
+ if ($signature.Status -ne "Valid") {
469
+ Remove-Item $downloadPath -ErrorAction SilentlyContinue
470
+ throw "WinAppDriver signature verification failed"
471
+ }
472
+ if ($signature.SignerCertificate.Subject -notlike "*Microsoft*") {
473
+ Remove-Item $downloadPath -ErrorAction SilentlyContinue
474
+ throw "WinAppDriver not signed by Microsoft"
475
+ }
476
+
477
+ & $downloadPath /q
478
+ Remove-Item $downloadPath -ErrorAction SilentlyContinue
466
479
  };
467
480
  HasVerboseOutput = $true;
468
481
  Optional = $true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.80.0-preview.1",
3
+ "version": "0.80.0-preview.10",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "@react-native-community/cli": "17.0.0",
27
27
  "@react-native-community/cli-platform-android": "17.0.0",
28
28
  "@react-native-community/cli-platform-ios": "17.0.0",
29
- "@react-native-windows/cli": "0.80.0-preview.1",
29
+ "@react-native-windows/cli": "0.80.0-preview.7",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "0.80.0",
32
32
  "@react-native/codegen": "0.80.0",
@@ -144,8 +144,9 @@ async function postInstall(config = {}, options = {}) {
144
144
  module.exports = {
145
145
  name: 'React Native Windows Application (New Arch, WinAppSDK, C++)',
146
146
  description:
147
- "[Preview] A RNW app using RN's New Architecture, built in C++ and targeting WinAppSDK.",
147
+ "A RNW app using RN's New Architecture, built in C++ and targeting WinAppSDK.",
148
148
  preInstall,
149
149
  getFileMappings,
150
150
  postInstall,
151
+ isDefault: true,
151
152
  };
@@ -33,7 +33,7 @@ const config = {
33
33
  // We need to make sure that only one version is loaded for peerDependencies
34
34
  // So we block them at the root, and alias them to the versions in example's node_modules
35
35
  resolver: {
36
- blacklistRE: exclusionList(
36
+ blocklistRE: exclusionList(
37
37
  modules.map(
38
38
  (m) =>
39
39
  new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
@@ -13,7 +13,7 @@ function makeGenerateWindowsWrapper(language = 'cpp', isDefault = false) {
13
13
  const name = `React Native Windows Application (Old Arch, UWP, ${
14
14
  language === 'cs' ? 'C#' : 'C++'
15
15
  })`;
16
- const description = `A RNW app using RN's Old Architecture, built in ${
16
+ const description = `[Legacy] A RNW app using RN's Old Architecture, built in ${
17
17
  language === 'cs' ? 'C#' : 'C++'
18
18
  } and targeting UWP.`;
19
19
 
@@ -12,4 +12,4 @@
12
12
 
13
13
  const {makeGenerateWindowsWrapper} = require('../generateWrapper');
14
14
 
15
- module.exports = makeGenerateWindowsWrapper('cpp', true); // TODO: Remove this as the default
15
+ module.exports = makeGenerateWindowsWrapper('cpp');