microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.36k stars 1.14k forks source link

Improve Microsoft.ReactNative.dll Instance management API #4542

Open vmoroz opened 4 years ago

vmoroz commented 4 years ago

Task: Improve Microsoft.ReactNative.dll Instance management API

Summary

Currently IReactNativeHost exposes only rudimentary API to reload ReactNative instance. It does not even allow to observe the result of the asynchronous operation. We must improve the IReactNativeHost to be matching the functionality of the IReactHost that we have internally.

Motivation

asklar commented 4 years ago

@vmoroz @chrisglein similar/same as #4549 ?

vmoroz commented 4 years ago

@asklar, this task is about improving the "outer" API, while the #4549 is concerned about refactoring the internals. E.g. removing the MS Office-specific namespaces as you have pointed in some PR feedback. As for this task, currently the IDL for the ReactnativeHost exposes only ReloadInstance from the Mso::React::IReactHost and this method returns void. It must return IAsyncAction. We also must expose other methods such as UnloadInstace, and maybe others that help to control and observe the ReactInstance lifetime.