react-native-windows 0.82.3 → 0.83.0-preview.1

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 (223) hide show
  1. package/.flowconfig +2 -7
  2. package/Libraries/Animated/components/AnimatedFlatList.js +5 -3
  3. package/Libraries/Animated/components/AnimatedImage.js +4 -3
  4. package/Libraries/Animated/components/AnimatedSectionList.js +2 -2
  5. package/Libraries/Animated/components/AnimatedText.js +7 -3
  6. package/Libraries/Animated/components/AnimatedView.js +3 -2
  7. package/Libraries/Animated/createAnimatedComponent.js +24 -12
  8. package/Libraries/Animated/nodes/AnimatedColor.js +26 -10
  9. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +43 -15
  10. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +43 -15
  11. package/Libraries/Components/ActivityIndicator/ActivityIndicator.d.ts +2 -2
  12. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +2 -2
  13. package/Libraries/Components/Glyph/Glyph.js +4 -1
  14. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.d.ts +2 -2
  15. package/Libraries/Components/RefreshControl/RefreshControl.d.ts +3 -3
  16. package/Libraries/Components/SafeAreaView/SafeAreaView.d.ts +2 -2
  17. package/Libraries/Components/ScrollView/ScrollView.js +1 -0
  18. package/Libraries/Components/ScrollView/ScrollView.windows.js +1 -0
  19. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +6 -6
  20. package/Libraries/Components/Switch/Switch.d.ts +2 -2
  21. package/Libraries/Components/Switch/Switch.windows.js +1 -1
  22. package/Libraries/Components/TextInput/TextInput.d.ts +2 -5
  23. package/Libraries/Components/TextInput/TextInput.js +6 -0
  24. package/Libraries/Components/TextInput/TextInput.windows.js +6 -0
  25. package/Libraries/Components/Touchable/TouchableBounce.js +7 -7
  26. package/Libraries/Components/Touchable/TouchableBounce.windows.js +7 -7
  27. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +1 -1
  28. package/Libraries/Components/View/ReactNativeStyleAttributes.js +19 -1
  29. package/Libraries/Components/View/View.d.ts +2 -2
  30. package/Libraries/Components/View/View.windows.js +0 -1
  31. package/Libraries/Components/View/ViewNativeComponent.js +13 -1
  32. package/Libraries/Core/ReactNativeVersion.js +3 -3
  33. package/Libraries/Core/setUpPerformance.js +2 -0
  34. package/Libraries/Debugging/DebuggingOverlay.js +14 -14
  35. package/Libraries/Debugging/DebuggingOverlayRegistry.js +8 -2
  36. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +5 -2
  37. package/Libraries/Image/Image.d.ts +3 -3
  38. package/Libraries/Image/ImageInjection.js +3 -6
  39. package/Libraries/Image/ImageTypes.flow.js +3 -7
  40. package/Libraries/Lists/FlatList.js +8 -8
  41. package/Libraries/Lists/SectionList.d.ts +5 -1
  42. package/Libraries/Lists/ViewabilityHelper.js +1 -1
  43. package/Libraries/Lists/VirtualizedList.js +1 -0
  44. package/Libraries/LogBox/UI/AnsiHighlight.js +4 -1
  45. package/Libraries/NativeComponent/BaseViewConfig.android.js +11 -2
  46. package/Libraries/NativeComponent/NativeComponentRegistry.d.ts +98 -0
  47. package/Libraries/NativeComponent/NativeComponentRegistry.js +2 -0
  48. package/Libraries/NativeComponent/NativeComponentRegistryUnstable.js +3 -1
  49. package/Libraries/NativeComponent/ViewConfigIgnore.windows.js +45 -0
  50. package/Libraries/Network/RCTNetworking.android.js +3 -1
  51. package/Libraries/Network/RCTNetworking.ios.js +3 -0
  52. package/Libraries/Network/RCTNetworking.windows.js +3 -0
  53. package/Libraries/Network/XMLHttpRequest.js +1 -41
  54. package/Libraries/Pressability/usePressability.js +14 -3
  55. package/Libraries/ReactNative/PaperUIManager.windows.js +3 -3
  56. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +20 -82
  57. package/Libraries/ReactNative/getNativeComponentAttributes.js +12 -0
  58. package/Libraries/Renderer/implementations/ReactFabric-dev.js +6759 -4478
  59. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3169 -3119
  60. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4732 -3535
  61. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +6646 -4070
  62. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3136 -2825
  63. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4761 -3312
  64. package/Libraries/Renderer/shims/ReactNative.js +3 -1
  65. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  66. package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +2 -1
  67. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -1
  68. package/Libraries/StyleSheet/StyleSheetTypes.js +44 -0
  69. package/Libraries/StyleSheet/processBackgroundPosition.js +284 -0
  70. package/Libraries/StyleSheet/processBackgroundRepeat.js +105 -0
  71. package/Libraries/StyleSheet/processBackgroundSize.js +104 -0
  72. package/Libraries/Text/Text.d.ts +2 -2
  73. package/Libraries/Text/TextNativeComponent.js +10 -0
  74. package/Libraries/TurboModule/TurboModuleRegistry.js +3 -9
  75. package/Libraries/Utilities/DevLoadingView.js +14 -6
  76. package/Libraries/Utilities/HMRClient.js +13 -5
  77. package/Microsoft.ReactNative/CompositionComponentView.idl +2 -0
  78. package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -0
  79. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +1 -1
  80. package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
  81. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +10 -40
  82. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +3 -80
  83. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +45 -12
  84. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +8 -0
  85. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +61 -74
  86. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +4 -0
  87. package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +1 -0
  88. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +4 -3
  89. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +2 -1
  90. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.cpp +245 -0
  91. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.h +80 -0
  92. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +20 -36
  93. package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +5 -0
  94. package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +1 -0
  95. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
  96. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +20 -94
  97. package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -3
  98. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +0 -41
  99. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +0 -11
  100. package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -3
  101. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +31 -101
  102. package/Microsoft.ReactNative/ReactNativeWin32App.h +2 -13
  103. package/Microsoft.ReactNative/ReactNativeWindow.idl +44 -0
  104. package/Microsoft.ReactNative.Cxx/AutoDraw.h +9 -1
  105. package/Microsoft.ReactNative.Cxx/ReactCommon/CallInvoker.h +13 -16
  106. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModule.h +24 -36
  107. package/Microsoft.ReactNative.Cxx/ReactCommon/TurboModuleUtils.h +5 -8
  108. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/AString.h +8 -6
  109. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Array.h +32 -49
  110. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +27 -76
  111. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +4 -2
  112. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/CallbackWrapper.h +19 -18
  113. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +25 -48
  114. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Convert.h +38 -31
  115. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Error.h +11 -6
  116. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/EventEmitter.h +47 -45
  117. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Function.h +69 -89
  118. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/HighResTimeStamp.h +8 -8
  119. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/LongLivedObject.h +6 -6
  120. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +16 -8
  121. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Object.h +17 -24
  122. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Promise.h +17 -17
  123. package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Value.h +20 -29
  124. package/Microsoft.ReactNative.Cxx/ReactCommon/react/debug/react_native_assert.h +2 -7
  125. package/Microsoft.ReactNative.Cxx/ReactCommon/react/timing/primitives.h +127 -115
  126. package/PropertySheets/Generated/PackageVersion.g.props +4 -4
  127. package/PropertySheets/Warnings.props +2 -1
  128. package/ReactCommon/ReactCommon.vcxproj +11 -2
  129. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/CxxNativeModule.cpp +2 -2
  130. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/Instance.cpp +4 -2
  131. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +4 -2
  132. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSIndexedRAMBundle.cpp +4 -2
  133. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/MethodCall.cpp +4 -2
  134. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ModuleRegistry.cpp +5 -3
  135. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +4 -4
  136. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/RAMBundleRegistry.cpp +6 -4
  137. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/ReactMarker.cpp +2 -0
  138. package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/TraceSection.h +25 -35
  139. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +86 -67
  140. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSIExecutor.cpp +15 -8
  141. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsiexecutor/jsireact/JSINativeModules.cpp +4 -2
  142. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +84 -68
  143. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +31 -35
  144. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +4 -5
  145. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/network/HttpUtils.cpp +2 -1
  146. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +24 -36
  147. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +28 -66
  148. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/webperformance/NativePerformance.cpp +5 -0
  149. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +3 -3
  150. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/image/conversions.h +8 -4
  151. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +19 -16
  152. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +8 -9
  153. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +25 -95
  154. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/BaseViewProps.cpp +36 -0
  155. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +85 -42
  156. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventDispatcher.cpp +2 -0
  157. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/EventQueueProcessor.cpp +2 -0
  158. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/primitives.h +25 -31
  159. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/UIManager.cpp +19 -5
  160. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +16 -1
  161. package/Scripts/Tfs/Layout-Desktop-Headers.ps1 +1 -15
  162. package/Scripts/creaternwapp.cmd +1 -1
  163. package/Scripts/perf/compare-results.js +357 -0
  164. package/Scripts/perf/create-perf-test.js +343 -0
  165. package/Scripts/perf/post-pr-comment.js +210 -0
  166. package/Shared/Hermes/HermesRuntimeTargetDelegate.cpp +8 -0
  167. package/Shared/Hermes/HermesRuntimeTargetDelegate.h +3 -0
  168. package/Shared/Shared.vcxitems +15 -3
  169. package/Shared/Shared.vcxitems.filters +11 -3
  170. package/codegen/NativeIntersectionObserverSpec.g.h +2 -0
  171. package/codegen/NativeNetworkingIOSSpec.g.h +2 -0
  172. package/codegen/NativePerformanceSpec.g.h +6 -0
  173. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +229 -139
  174. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +2 -1
  175. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +42 -25
  176. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +2 -1
  177. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +2 -1
  178. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +11 -6
  179. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +11 -6
  180. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +1 -0
  181. package/codegen/react/components/rnwcore/InputAccessory.g.h +2 -1
  182. package/codegen/react/components/rnwcore/ModalHostView.g.h +40 -23
  183. package/codegen/react/components/rnwcore/Props.cpp +6 -1
  184. package/codegen/react/components/rnwcore/Props.h +1 -0
  185. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +11 -6
  186. package/codegen/react/components/rnwcore/SafeAreaView.g.h +1 -0
  187. package/codegen/react/components/rnwcore/Switch.g.h +11 -6
  188. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +2 -1
  189. package/codegen/react/components/rnwcore/VirtualView.g.h +41 -8
  190. package/codegen/react/components/rnwcore/VirtualViewExperimental.g.h +45 -8
  191. package/codegen/rnwcoreJSI.h +3973 -6059
  192. package/index.js +6 -0
  193. package/index.windows.js +6 -0
  194. package/jest/mockComponent.js +6 -6
  195. package/jest/setup.js +15 -10
  196. package/package.json +27 -27
  197. package/src/private/components/virtualview/VirtualView.js +22 -27
  198. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +6 -0
  199. package/src/private/featureflags/ReactNativeFeatureFlags.js +100 -19
  200. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +18 -3
  201. package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
  202. package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -1
  203. package/src/private/specs_DEPRECATED/modules/NativeNetworkingIOS.js +1 -0
  204. package/src/private/webapis/dom/nodes/ReactNativeElement.js +12 -2
  205. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +76 -15
  206. package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +1 -0
  207. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  208. package/src/private/webapis/performance/ResourceTiming.js +31 -4
  209. package/src/private/webapis/performance/internals/RawPerformanceEntry.js +4 -1
  210. package/src/private/webapis/performance/specs/NativePerformance.js +3 -0
  211. package/stubs/double-conversion/double-conversion.h +5 -0
  212. package/templates/cpp-app/template.config.js +1 -1
  213. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
  214. package/templates/cpp-lib/template.config.js +1 -1
  215. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
  216. package/types/index.d.ts +1 -0
  217. package/types/public/ReactNativeTypes.d.ts +115 -2
  218. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +0 -152
  219. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/conversions.h +0 -1574
  220. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ShadowNode.cpp +0 -528
  221. package/Scripts/OpenSSL.nuspec +0 -39
  222. package/Scripts/OpenSSL.targets +0 -36
  223. package/codegen/rnwcoreJSI-generated.cpp +0 -3470
@@ -14,29 +14,37 @@ import NativeDevLoadingView from './NativeDevLoadingView';
14
14
 
15
15
  const COLOR_SCHEME = {
16
16
  dark: {
17
+ load: {
18
+ backgroundColor: '#fafafa',
19
+ textColor: '#242526',
20
+ },
17
21
  refresh: {
18
22
  backgroundColor: '#2584e8',
19
23
  textColor: '#ffffff',
20
24
  },
21
- load: {
22
- backgroundColor: '#fafafa',
23
- textColor: '#242526',
25
+ error: {
26
+ backgroundColor: '#1065AF',
27
+ textColor: '#ffffff',
24
28
  },
25
29
  },
26
30
  default: {
31
+ load: {
32
+ backgroundColor: '#404040',
33
+ textColor: '#ffffff',
34
+ },
27
35
  refresh: {
28
36
  backgroundColor: '#2584e8',
29
37
  textColor: '#ffffff',
30
38
  },
31
- load: {
32
- backgroundColor: '#404040',
39
+ error: {
40
+ backgroundColor: '#1065AF',
33
41
  textColor: '#ffffff',
34
42
  },
35
43
  },
36
44
  };
37
45
 
38
46
  export default {
39
- showMessage(message: string, type: 'load' | 'refresh') {
47
+ showMessage(message: string, type: 'load' | 'refresh' | 'error') {
40
48
  if (NativeDevLoadingView) {
41
49
  const colorScheme =
42
50
  getColorScheme() === 'dark' ? COLOR_SCHEME.dark : COLOR_SCHEME.default;
@@ -211,7 +211,9 @@ Error: ${e.message}`;
211
211
  setHMRUnavailableReason(error);
212
212
  });
213
213
 
214
+ let pendingUpdatesCount = 0;
214
215
  client.on('update-start', ({isInitialUpdate}) => {
216
+ pendingUpdatesCount++;
215
217
  currentCompileErrorMessage = null;
216
218
  didConnect = true;
217
219
 
@@ -228,12 +230,13 @@ Error: ${e.message}`;
228
230
  });
229
231
 
230
232
  client.on('update-done', () => {
231
- DevLoadingView.hide();
233
+ pendingUpdatesCount--;
234
+ if (pendingUpdatesCount === 0) {
235
+ DevLoadingView.hide();
236
+ }
232
237
  });
233
238
 
234
239
  client.on('error', data => {
235
- DevLoadingView.hide();
236
-
237
240
  if (data.type === 'GraphNotFoundError') {
238
241
  client.close();
239
242
  setHMRUnavailableReason(
@@ -253,8 +256,6 @@ Error: ${e.message}`;
253
256
  });
254
257
 
255
258
  client.on('close', closeEvent => {
256
- DevLoadingView.hide();
257
-
258
259
  // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.4.1
259
260
  // https://www.rfc-editor.org/rfc/rfc6455.html#section-7.1.5
260
261
  const isNormalOrUnsetCloseReason =
@@ -296,10 +297,17 @@ function setHMRUnavailableReason(reason: string) {
296
297
  }
297
298
  hmrUnavailableReason = reason;
298
299
 
300
+ const DevLoadingView = require('./DevLoadingView').default;
301
+ DevLoadingView.hide();
302
+
299
303
  // We only want to show a warning if Fast Refresh is on *and* if we ever
300
304
  // previously managed to connect successfully. We don't want to show
301
305
  // the warning to native engineers who use cached bundles without Metro.
302
306
  if (hmrClient.isEnabled() && didConnect) {
307
+ DevLoadingView.showMessage(
308
+ 'Fast Refresh disconnected. Reload app to reconnect.',
309
+ 'error',
310
+ );
303
311
  console.warn(reason);
304
312
  // (Not using the `warning` module to prevent a Buck cycle.)
305
313
  }
@@ -93,6 +93,8 @@ namespace Microsoft.ReactNative.Composition
93
93
  [webhosthidden]
94
94
  runtimeclass ContentIslandComponentView : ViewComponentView {
95
95
  void Connect(Microsoft.UI.Content.ContentIsland contentIsland);
96
+ DOC_STRING("The ChildSiteLink will be unavailable until after the ContentIslandComponentView is mounted")
97
+ Microsoft.UI.Content.ChildSiteLink ChildSiteLink { get; };
96
98
  };
97
99
 
98
100
  [experimental]
@@ -13,6 +13,7 @@ namespace Microsoft.ReactNative
13
13
  [default_interface]
14
14
  [webhosthidden]
15
15
  [experimental]
16
+ [deprecated("Use @ReactNativeWindow instead", deprecate, 1)]
16
17
  DOC_STRING("An HWND based host of RNW running on windows composition."
17
18
  "Provided as an ease of use function - most of the time HWND-less hosting would be preferable."
18
19
  "In the long term this is likely to be replaced with a more modern hosting interface.")
@@ -72,7 +72,7 @@ void ComponentView::onMounted() noexcept {
72
72
  m_mountedEvent(*this, *this);
73
73
  }
74
74
 
75
- bool ComponentView::isMounted() noexcept {
75
+ bool ComponentView::isMounted() const noexcept {
76
76
  return m_mounted;
77
77
  }
78
78
 
@@ -121,7 +121,7 @@ struct ComponentView
121
121
  virtual void onLostFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept;
122
122
  virtual void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept;
123
123
  virtual void onMounted() noexcept;
124
- bool isMounted() noexcept;
124
+ bool isMounted() const noexcept;
125
125
  virtual void onUnmounted() noexcept;
126
126
  void onDestroying() noexcept;
127
127
 
@@ -30,50 +30,20 @@ CompositionHwndHost::CompositionHwndHost() noexcept {}
30
30
  void CompositionHwndHost::Initialize(uint64_t hwnd) noexcept {
31
31
  m_hwnd = (HWND)hwnd;
32
32
 
33
- auto compositionContext =
34
- winrt::Microsoft::ReactNative::Composition::implementation::CompositionUIService::GetCompositionContext(
35
- ReactViewHost().ReactNativeHost().InstanceSettings().Properties());
36
- if (auto liftedCompositor =
37
- winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerCompositor(
38
- compositionContext)) {
39
- m_compRootView = winrt::Microsoft::ReactNative::ReactNativeIsland(liftedCompositor);
33
+ auto compositor = winrt::Microsoft::ReactNative::Composition::implementation::CompositionUIService::GetCompositor(
34
+ ReactViewHost().ReactNativeHost().InstanceSettings().Properties());
35
+ m_compRootView = winrt::Microsoft::ReactNative::ReactNativeIsland(compositor);
40
36
 
41
- auto bridge = winrt::Microsoft::UI::Content::DesktopChildSiteBridge::Create(
42
- liftedCompositor, winrt::Microsoft::UI::GetWindowIdFromWindow(m_hwnd));
37
+ auto bridge = winrt::Microsoft::UI::Content::DesktopChildSiteBridge::Create(
38
+ compositor, winrt::Microsoft::UI::GetWindowIdFromWindow(m_hwnd));
43
39
 
44
- auto island = m_compRootView.Island();
40
+ auto island = m_compRootView.Island();
45
41
 
46
- bridge.Connect(island);
47
- bridge.Show();
42
+ bridge.Connect(island);
43
+ bridge.Show();
48
44
 
49
- m_compRootView.ScaleFactor(ScaleFactor());
50
- bridge.ResizePolicy(winrt::Microsoft::UI::Content::ContentSizePolicy::ResizeContentToParentWindow);
51
- } else {
52
- m_compRootView = winrt::Microsoft::ReactNative::ReactNativeIsland();
53
- m_compRootView.as<winrt::Microsoft::ReactNative::Composition::Experimental::IInternalCompositionRootView>()
54
- .SetWindow(reinterpret_cast<uint64_t>(m_hwnd));
55
-
56
- auto compositor =
57
- winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerCompositor(
58
- compositionContext);
59
- auto interop = compositor.as<ABI::Windows::UI::Composition::Desktop::ICompositorDesktopInterop>();
60
- winrt::Windows::UI::Composition::Desktop::DesktopWindowTarget target{nullptr};
61
- check_hresult(interop->CreateDesktopWindowTarget(
62
- m_hwnd,
63
- false,
64
- reinterpret_cast<ABI::Windows::UI::Composition::Desktop::IDesktopWindowTarget **>(put_abi(target))));
65
-
66
- auto root = compositor.CreateContainerVisual();
67
- root.RelativeSizeAdjustment({1.0f, 1.0f});
68
- root.Offset({0, 0, 0});
69
- root.Comment(L"Root Visual");
70
- target.Root(root);
71
-
72
- m_compRootView.as<winrt::Microsoft::ReactNative::Composition::Experimental::IInternalCompositionRootView>()
73
- .InternalRootVisual(
74
- winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::CreateVisual(
75
- target.Root()));
76
- }
45
+ m_compRootView.ScaleFactor(ScaleFactor());
46
+ bridge.ResizePolicy(winrt::Microsoft::UI::Content::ContentSizePolicy::ResizeContentToParentWindow);
77
47
 
78
48
  m_compRootView.ReactViewHost(std::move(m_reactViewHost));
79
49
  m_compRootView.ScaleFactor(ScaleFactor());
@@ -709,86 +709,9 @@ void ComponentView::applyShadowProps(const facebook::react::ViewProps &viewProps
709
709
  shadow.Color(theme()->Color(*viewProps.shadowColor));
710
710
  }
711
711
 
712
- // Check if any border radius is set
713
- auto borderMetrics = BorderPrimitive::resolveAndAlignBorderMetrics(m_layoutMetrics, viewProps);
714
- bool hasBorderRadius = borderMetrics.borderRadii.topLeft.horizontal != 0 ||
715
- borderMetrics.borderRadii.topRight.horizontal != 0 || borderMetrics.borderRadii.bottomLeft.horizontal != 0 ||
716
- borderMetrics.borderRadii.bottomRight.horizontal != 0 || borderMetrics.borderRadii.topLeft.vertical != 0 ||
717
- borderMetrics.borderRadii.topRight.vertical != 0 || borderMetrics.borderRadii.bottomLeft.vertical != 0 ||
718
- borderMetrics.borderRadii.bottomRight.vertical != 0;
719
-
720
- if (hasBorderRadius) {
721
- // When borderRadius is set, we need to create a shadow mask that follows the rounded rectangle shape.
722
- // Use CompositionVisualSurface to capture the clipped visual's appearance as the shadow mask.
723
- bool maskSet = false;
724
-
725
- // Try Microsoft (WinUI3) Composition first
726
- auto msCompositor =
727
- winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerCompositor(
728
- m_compContext);
729
- if (msCompositor) {
730
- auto innerVisual =
731
- winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::InnerVisual(
732
- Visual());
733
- if (innerVisual) {
734
- // Create a VisualSurface that captures the visual (with its clip applied)
735
- auto visualSurface = msCompositor.CreateVisualSurface();
736
- visualSurface.SourceVisual(innerVisual);
737
- visualSurface.SourceSize(
738
- {m_layoutMetrics.frame.size.width * m_layoutMetrics.pointScaleFactor,
739
- m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor});
740
-
741
- // Create a brush from the visual surface to use as shadow mask
742
- auto maskBrush = msCompositor.CreateSurfaceBrush(visualSurface);
743
- maskBrush.Stretch(winrt::Microsoft::UI::Composition::CompositionStretch::Fill);
744
-
745
- // Get the inner shadow and set the mask
746
- auto innerShadow = winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::
747
- InnerDropShadow(shadow);
748
- if (innerShadow) {
749
- innerShadow.Mask(maskBrush);
750
- maskSet = true;
751
- }
752
- }
753
- }
754
-
755
- // Fallback to System (Windows.UI) Composition if Microsoft Composition is not available
756
- if (!maskSet) {
757
- auto sysCompositor =
758
- winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerCompositor(
759
- m_compContext);
760
- if (sysCompositor) {
761
- auto innerVisual =
762
- winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerVisual(
763
- Visual());
764
- if (innerVisual) {
765
- auto visualSurface = sysCompositor.CreateVisualSurface();
766
- visualSurface.SourceVisual(innerVisual);
767
- visualSurface.SourceSize(
768
- {m_layoutMetrics.frame.size.width * m_layoutMetrics.pointScaleFactor,
769
- m_layoutMetrics.frame.size.height * m_layoutMetrics.pointScaleFactor});
770
-
771
- auto maskBrush = sysCompositor.CreateSurfaceBrush(visualSurface);
772
- maskBrush.Stretch(winrt::Windows::UI::Composition::CompositionStretch::Fill);
773
-
774
- auto innerShadow =
775
- winrt::Microsoft::ReactNative::Composition::Experimental::SystemCompositionContextHelper::InnerDropShadow(
776
- shadow);
777
- if (innerShadow) {
778
- innerShadow.Mask(maskBrush);
779
- }
780
- }
781
- }
782
- }
783
-
784
- // Apply shadow to OuterVisual (which is not clipped) so the shadow can extend beyond the clip
785
- OuterVisual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(shadow);
786
- Visual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(nullptr);
787
- } else {
788
- // No border radius - apply shadow directly to Visual (original behavior)
789
- Visual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(shadow);
790
- OuterVisual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(nullptr);
791
- }
712
+ // Apply shadow to OuterVisual (not Visual) because Visual may have a rounded-corner clip
713
+ // from updateClippingPath, which would clip the shadow. OuterVisual is not clipped.
714
+ OuterVisual().as<winrt::Microsoft::ReactNative::Composition::Experimental::ISpriteVisual>().Shadow(shadow);
792
715
  }
793
716
 
794
717
  void ComponentView::updateTransformProps(
@@ -43,12 +43,30 @@ ContentIslandComponentView::ContentIslandComponentView(
43
43
  });
44
44
  }
45
45
 
46
- void ContentIslandComponentView::OnMounted() noexcept {
47
- m_childSiteLink = winrt::Microsoft::UI::Content::ChildSiteLink::Create(
48
- rootComponentView()->parentContentIsland(),
49
- winrt::Microsoft::ReactNative::Composition::Experimental::CompositionContextHelper::InnerVisual(Visual())
50
- .as<winrt::Microsoft::UI::Composition::ContainerVisual>());
51
- m_childSiteLink.ActualSize({m_layoutMetrics.frame.size.width, m_layoutMetrics.frame.size.height});
46
+ winrt::Microsoft::UI::Content::ContentIsland ContentIslandComponentView::ParentContentIsland() noexcept {
47
+ auto root = rootComponentView();
48
+ if (!root)
49
+ return nullptr;
50
+ return root->parentContentIsland();
51
+ }
52
+
53
+ winrt::Microsoft::UI::Content::ChildSiteLink ContentIslandComponentView::ChildSiteLink() noexcept {
54
+ if (!isMounted())
55
+ return nullptr;
56
+ if (!m_childSiteLink) {
57
+ m_childSiteLink = winrt::Microsoft::UI::Content::ChildSiteLink::Create(
58
+ m_parentContentIsland,
59
+ winrt::Microsoft::ReactNative::Composition::Experimental::CompositionContextHelper::InnerVisual(Visual())
60
+ .as<winrt::Microsoft::UI::Composition::ContainerVisual>());
61
+ }
62
+ return m_childSiteLink;
63
+ }
64
+
65
+ void ContentIslandComponentView::ConnectInternal() noexcept {
66
+ if (!m_islandToConnect)
67
+ return;
68
+
69
+ ChildSiteLink().ActualSize({m_layoutMetrics.frame.size.width, m_layoutMetrics.frame.size.height});
52
70
 
53
71
  // Issue #15557: Set initial LocalToParentTransformMatrix synchronously before Connect.
54
72
  // This fixes popup position being wrong even without scrolling.
@@ -74,10 +92,19 @@ void ContentIslandComponentView::OnMounted() noexcept {
74
92
  ConfigureChildSiteLinkAutomation();
75
93
 
76
94
  if (m_islandToConnect) {
95
+ Assert(m_childSiteLink.SiteView().IsConnected());
96
+ Assert(!m_islandToConnect.IsConnected());
97
+
77
98
  m_childSiteLink.Connect(m_islandToConnect);
78
99
  m_islandToConnect = nullptr;
79
100
  }
80
101
 
102
+ if (m_pendingNavigateFocus) {
103
+ m_navigationHost.NavigateFocus(
104
+ winrt::Microsoft::UI::Input::FocusNavigationRequest::Create(*m_pendingNavigateFocus));
105
+ m_pendingNavigateFocus.reset();
106
+ }
107
+
81
108
  ParentLayoutChanged();
82
109
  auto view = Parent();
83
110
  while (view) {
@@ -106,6 +133,11 @@ void ContentIslandComponentView::OnMounted() noexcept {
106
133
  }
107
134
  }
108
135
 
136
+ void ContentIslandComponentView::OnMounted() noexcept {
137
+ m_parentContentIsland = ParentContentIsland();
138
+ ConnectInternal();
139
+ }
140
+
109
141
  void ContentIslandComponentView::OnUnmounted() noexcept {
110
142
  m_layoutMetricChangedRevokers.clear();
111
143
 
@@ -198,7 +230,10 @@ void ContentIslandComponentView::onGotFocus(
198
230
  const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept {
199
231
  auto gotFocusEventArgs = args.as<winrt::Microsoft::ReactNative::implementation::GotFocusEventArgs>();
200
232
  const auto navigationReason = GetFocusNavigationReason(gotFocusEventArgs->Direction());
201
- m_navigationHost.NavigateFocus(winrt::Microsoft::UI::Input::FocusNavigationRequest::Create(navigationReason));
233
+ if (m_navigationHost)
234
+ m_navigationHost.NavigateFocus(winrt::Microsoft::UI::Input::FocusNavigationRequest::Create(navigationReason));
235
+ else
236
+ m_pendingNavigateFocus = navigationReason;
202
237
  }
203
238
 
204
239
  ContentIslandComponentView::~ContentIslandComponentView() noexcept {
@@ -239,6 +274,9 @@ void ContentIslandComponentView::Connect(const winrt::Microsoft::UI::Content::Co
239
274
  m_childSiteLink.Connect(contentIsland);
240
275
  } else {
241
276
  m_islandToConnect = contentIsland;
277
+ if (isMounted()) {
278
+ ConnectInternal();
279
+ }
242
280
  }
243
281
  }
244
282
 
@@ -247,13 +285,8 @@ void ContentIslandComponentView::prepareForRecycle() noexcept {
247
285
  }
248
286
 
249
287
  void ContentIslandComponentView::ConfigureChildSiteLinkAutomation() noexcept {
250
- // Use FrameworkBased to let the XamlIsland manage its own framework-level accessibility tree
251
- // and raise focus events naturally. This tells the system that the child island has its own
252
- // framework (WinUI/XAML) that manages automation.
253
288
  m_childSiteLink.AutomationOption(winrt::Microsoft::UI::Content::ContentAutomationOptions::FrameworkBased);
254
289
 
255
- // When using FrameworkBased mode, we don't register automation callbacks - let the XamlIsland handle its own UIA
256
- // tree.
257
290
  if (m_innerAutomationProvider) {
258
291
  m_innerAutomationProvider->SetChildSiteLink(m_childSiteLink);
259
292
  }
@@ -32,6 +32,8 @@ struct ContentIslandComponentView : ContentIslandComponentViewT<ContentIslandCom
32
32
  uint32_t index) noexcept override;
33
33
  void Connect(const winrt::Microsoft::UI::Content::ContentIsland &contentIsland) noexcept;
34
34
 
35
+ winrt::Microsoft::UI::Content::ChildSiteLink ChildSiteLink() noexcept;
36
+
35
37
  void updateLayoutMetrics(
36
38
  facebook::react::LayoutMetrics const &layoutMetrics,
37
39
  facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept;
@@ -58,15 +60,21 @@ struct ContentIslandComponentView : ContentIslandComponentViewT<ContentIslandCom
58
60
  void OnMounted() noexcept;
59
61
  void OnUnmounted() noexcept;
60
62
  void ParentLayoutChanged() noexcept;
63
+ void ConnectInternal() noexcept;
64
+ winrt::Microsoft::UI::Content::ContentIsland ParentContentIsland() noexcept;
61
65
 
62
66
  bool m_layoutChangePosted{false};
67
+ winrt::Microsoft::UI::Content::ContentIsland m_parentContentIsland{nullptr};
63
68
  winrt::Microsoft::UI::Content::ContentIsland m_islandToConnect{nullptr};
69
+ std::optional<winrt::Microsoft::UI::Input::FocusNavigationReason> m_pendingNavigateFocus;
70
+
64
71
  winrt::event_token m_mountedToken;
65
72
  winrt::event_token m_unmountedToken;
66
73
  std::vector<winrt::Microsoft::ReactNative::ComponentView::LayoutMetricsChanged_revoker> m_layoutMetricChangedRevokers;
67
74
  winrt::Microsoft::UI::Content::ChildSiteLink m_childSiteLink{nullptr};
68
75
  winrt::Microsoft::UI::Input::InputFocusNavigationHost m_navigationHost{nullptr};
69
76
  winrt::event_token m_navigationHostDepartFocusRequestedToken{};
77
+ std::optional<winrt::Microsoft::UI::Input::FocusNavigationReason> m_pendingFocus;
70
78
 
71
79
  // Issue #15557: Store ViewChanged subscriptions to parent ScrollViews for transform updates
72
80
  struct ViewChangedSubscription {