-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
AgendaIssue tagged for discussion at next weekly meetingIssue tagged for discussion at next weekly meetingNeeds: Dev DesignPartner: FacebookWorkstream: Component ParityClose the parity gap between RNW and RN for core RN components and their supporting APIs.Close the parity gap between RNW and RN for core RN components and their supporting APIs.enhancement
Milestone
Description
Summary
It feels like over time, XamlUIService has become a bit of a dumping ground for various APIs.
- It was originally created in 2809c9a to handle looking up tags from elements.
- Then we added an option to get a singleton XamlRoot in f52d494
- Then we added options to set the HWND in bdd23dc
- The an accessibility workaround in 2dfb964
- There is a proposed addition for getting the React tag and ReactRootView here: Adds GetReactRootView method to XamlUIService #10403
- And another proposal for adding a mechanism to invoke nested Yoga layout here: Add method to invoke nested Yoga layout #10237
It feels like we should separate concerns a bit here and expose a few new APIs:
XamlUIServicecan 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.:
void XamlUIService::GetElementFromTag(int64_t tag)
void XamlUIService::GetReactTag(xaml::DependencyObject view)
ReactRootView XamlUIService::GetReactRootView(xaml::DependencyObject view)
- A per root view
ReactWindowServicecould be added to ReactRootView to handle things like getting / setting the HWND, getting / setting the XamlRoot, getting / setting the accessibility root, etc.
ReactWindowService ReactRootView::WindowService()
void ReactWindowService::XamlRoot(XamlRoot root);
XamlRoot ReactWindowService::XamlRoot();
void ReactWindowService::HWND(int64_t);
uint64_t ReactWindowService::HWND();
// Do not exist yet, but would be needed to feed scale factors to Yoga
double ReactWindowService::ScaleFactor();
void ReactWindowService::ScaleFactor(double scaleFactor);
- A service for the AccessibilityInfoModule,
AccessibilityInfoService:
AccessibilityInfoService ReactContext::AccessibilityInfoService();
void AccessibilityInfoService::AccessibleRoot(xaml::FrameworkElement root);
xaml::FrameworkElement AccessibilityInfoService::AccessibleRoot();
- An API for event dispatching,
EventDispatcher:
EventDispatcher ReactContext::EventDispatcher()
void EventDispatcher::DispatchEvent(...)
// Does not exist yet, but would be useful
void EventDispatcher::DispatchCoalescedEvent(...)
- An API for UIManager,
UIManagerService:
UIManagerService ReactContext::UIManagerService()
void UIManagerService::UpdateYogaLayout(int64_t tag);
// Does not exist yet, but would expose public surfaces for functionality in iOS/Android
void UIManagerService::AddOnBatchCompleteListener(...);
Motivation
Separation of concerns for the collection of methods exposed in XamlUIService.
Basic Example
No response
Open Questions
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
AgendaIssue tagged for discussion at next weekly meetingIssue tagged for discussion at next weekly meetingNeeds: Dev DesignPartner: FacebookWorkstream: Component ParityClose the parity gap between RNW and RN for core RN components and their supporting APIs.Close the parity gap between RNW and RN for core RN components and their supporting APIs.enhancement