Open rozele opened 2 years ago
The thing I like most about attaching something like ReactWindowService to ReactRootView is that it would force us to think about multi-window scenarios any time we add functionality that involves HWND / window message loops / XamlRoot / etc.
We could potentially lump the AccessibilityInfoService and UIManagerService into a single "NativeModuleService" catch all for utilities needed for core native modules. Or put the AccessibilityInfoService APIs into the WindowService, since this is a catch all for issues related to creating win32 windows for WinUI 3 or XamlIslands, and the AccessibilityInfoModule workarounds are similar in theme.
The original reason for XamlUIService was to try to get anything Xaml specific out of the primary interfaces, since Office is trying to get its platform onto the same APIs as the public RNW, but Office isn't using Xaml yet and couldn't have any Xaml interfaces in the main interfaces.
We were hoping to eventually get to a place where there is a UI agnostic core set of APIs / DLL. And then more specific DLLs for each UI technology. So we could have a MS.RN.Core.dll, and a MS.RN.Xaml.dll, so keeping the xaml APIs on separate interfaces was an explicit goal.
Summary
It feels like over time, XamlUIService has become a bit of a dumping ground for various APIs.
It feels like we should separate concerns a bit here and expose a few new APIs:
XamlUIService
can remain as a translation layer between XAML views and the React shadow tree to fill the gap of missing shadow nodes in the exposed ABI, e.g.:A per root view
ReactWindowService
could be added to ReactRootView to handle things like getting / setting the HWND, getting / setting the XamlRoot, getting / setting the accessibility root, etc.A service for the AccessibilityInfoModule,
AccessibilityInfoService
:An API for event dispatching,
EventDispatcher
:An API for UIManager,
UIManagerService
:Motivation
Separation of concerns for the collection of methods exposed in XamlUIService.
Basic Example
No response
Open Questions
No response