react-native-windows 0.65.2 → 0.65.6
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.
- package/CHANGELOG.json +79 -1
- package/CHANGELOG.md +43 -8
- package/Microsoft.ReactNative/IReactDispatcher.cpp +40 -2
- package/Microsoft.ReactNative/IReactDispatcher.h +19 -3
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +7 -6
- package/Microsoft.ReactNative/Modules/AppearanceModule.h +7 -3
- package/Microsoft.ReactNative/ReactCoreInjection.cpp +18 -9
- package/Microsoft.ReactNative/ReactCoreInjection.h +5 -6
- package/Microsoft.ReactNative/ReactCoreInjection.idl +5 -5
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +137 -130
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +2 -1
- package/Microsoft.ReactNative/RedBox.cpp +11 -9
- package/Microsoft.ReactNative/RedBox.h +2 -1
- package/Microsoft.ReactNative/RedBoxHandler.cpp +1 -1
- package/Microsoft.ReactNative/packages.config +1 -1
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +1993 -0
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.h +21 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +6 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +6 -0
- package/Mso/future/futureWinRT.h +3 -1
- package/PropertySheets/JSEngine.props +4 -3
- package/Scripts/OfficeReact.Win32.nuspec +6 -4
- package/Shared/JSI/NapiJsiV8RuntimeHolder.cpp +1 -1
- package/Shared/JSI/NapiJsiV8RuntimeHolder.h +1 -1
- package/Shared/Threading/MessageDispatchQueue.cpp +79 -0
- package/Shared/Threading/MessageDispatchQueue.h +31 -0
- package/package.json +4 -4
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,85 @@
|
|
|
2
2
|
"name": "react-native-windows",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 20 Oct 2021 19:14:15 GMT",
|
|
6
|
+
"tag": "react-native-windows_v0.65.6",
|
|
7
|
+
"version": "0.65.6",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Fix Arm64 Desktop linker experts due to mangled name mismatches",
|
|
12
|
+
"author": "dannyvv@microsoft.com",
|
|
13
|
+
"commit": "2169bb4bc9a4d801b480be9d84638a20a6b4a718",
|
|
14
|
+
"package": "react-native-windows"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 11 Oct 2021 15:06:57 GMT",
|
|
21
|
+
"tag": "react-native-windows_v0.65.5",
|
|
22
|
+
"version": "0.65.5",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"comment": "[0.65] Add ARM64 support to React.Windows.Desktop.Test.DLL",
|
|
27
|
+
"author": "julio.rocha@microsoft.com",
|
|
28
|
+
"commit": "61c436f7ba37dba9ae812dbd84a74d5c5944dfd1",
|
|
29
|
+
"package": "react-native-windows"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"comment": "Promote 0.65 to legacy",
|
|
33
|
+
"author": "ngerlem@microsoft.com",
|
|
34
|
+
"commit": "31e9fc28e3edddde4c7a86e40201aede6242e73c",
|
|
35
|
+
"package": "react-native-windows"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Mon, 04 Oct 2021 15:07:05 GMT",
|
|
42
|
+
"tag": "react-native-windows_v0.65.4",
|
|
43
|
+
"version": "0.65.4",
|
|
44
|
+
"comments": {
|
|
45
|
+
"patch": [
|
|
46
|
+
{
|
|
47
|
+
"comment": "Allow injection of custom UI thread",
|
|
48
|
+
"author": "30809111+acoates-ms@users.noreply.github.com",
|
|
49
|
+
"commit": "c5a4ad149cf0e9fbfa1be60592581081ac822d5f",
|
|
50
|
+
"package": "react-native-windows"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"comment": "Upgrade ReactNative.V8Jsi.Windows to 0.65.5",
|
|
54
|
+
"author": "julio.rocha@microsoft.com",
|
|
55
|
+
"commit": "e7a0d5fc8cca1a886f6788c5bfdf870ce201c62c",
|
|
56
|
+
"package": "react-native-windows"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"comment": "ReactNativeHost ReloadInstance and UnloadInstance actions do not always fire completed events",
|
|
60
|
+
"author": "30809111+acoates-ms@users.noreply.github.com",
|
|
61
|
+
"commit": "bd4794c46b84e38850491a23170da36dfef3c709",
|
|
62
|
+
"package": "react-native-windows"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"date": "Mon, 27 Sep 2021 15:07:16 GMT",
|
|
69
|
+
"tag": "react-native-windows_v0.65.3",
|
|
70
|
+
"version": "0.65.3",
|
|
71
|
+
"comments": {
|
|
72
|
+
"patch": [
|
|
73
|
+
{
|
|
74
|
+
"comment": "Migrate NapiJsiRuntime from V8-JSI #8617",
|
|
75
|
+
"author": "julio.rocha@microsoft.com",
|
|
76
|
+
"commit": "a5abc7af8435b8031d974e3d0f6e03cba787e53c",
|
|
77
|
+
"package": "react-native-windows"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"date": "Mon, 06 Sep 2021 15:06:57 GMT",
|
|
6
84
|
"tag": "react-native-windows_v0.65.2",
|
|
7
85
|
"version": "0.65.2",
|
|
8
86
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,56 @@
|
|
|
1
1
|
# Change Log - react-native-windows
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 20 Oct 2021 19:14:15 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.65.
|
|
7
|
+
## 0.65.6
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Wed, 20 Oct 2021 19:14:15 GMT
|
|
10
10
|
|
|
11
11
|
### Patches
|
|
12
12
|
|
|
13
|
-
- Fix
|
|
14
|
-
- Allow override of global.nativeLoggingHook (30809111+acoates-ms@users.noreply.github.com)
|
|
15
|
-
- UIA Heading support (agnel@microsoft.com)
|
|
16
|
-
- Cherry Pick e64bc29 (34109996+chiaramooney@users.noreply.github.com)
|
|
17
|
-
- Pass JSValueArgWriter around instead of immediately converting to dynamic (30809111+acoates-ms@users.noreply.github.com)
|
|
13
|
+
- Fix Arm64 Desktop linker experts due to mangled name mismatches (dannyvv@microsoft.com)
|
|
18
14
|
|
|
15
|
+
## 0.65.5
|
|
16
|
+
|
|
17
|
+
Mon, 11 Oct 2021 15:06:57 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- [0.65] Add ARM64 support to React.Windows.Desktop.Test.DLL (julio.rocha@microsoft.com)
|
|
22
|
+
- Promote 0.65 to legacy (ngerlem@microsoft.com)
|
|
23
|
+
|
|
24
|
+
## 0.65.4
|
|
25
|
+
|
|
26
|
+
Mon, 04 Oct 2021 15:07:05 GMT
|
|
27
|
+
|
|
28
|
+
### Patches
|
|
29
|
+
|
|
30
|
+
- Allow injection of custom UI thread (30809111+acoates-ms@users.noreply.github.com)
|
|
31
|
+
- Upgrade ReactNative.V8Jsi.Windows to 0.65.5 (julio.rocha@microsoft.com)
|
|
32
|
+
- ReactNativeHost ReloadInstance and UnloadInstance actions do not always fire completed events (30809111+acoates-ms@users.noreply.github.com)
|
|
33
|
+
|
|
34
|
+
## 0.65.3
|
|
35
|
+
|
|
36
|
+
Mon, 27 Sep 2021 15:07:16 GMT
|
|
37
|
+
|
|
38
|
+
### Patches
|
|
39
|
+
|
|
40
|
+
- Migrate NapiJsiRuntime from V8-JSI #8617 (julio.rocha@microsoft.com)
|
|
41
|
+
|
|
42
|
+
## 0.65.2
|
|
43
|
+
|
|
44
|
+
Mon, 06 Sep 2021 15:06:57 GMT
|
|
45
|
+
|
|
46
|
+
### Patches
|
|
47
|
+
|
|
48
|
+
- Fix race condition when building customer projects (dannyvv@microsoft.com)
|
|
49
|
+
- Allow override of global.nativeLoggingHook (30809111+acoates-ms@users.noreply.github.com)
|
|
50
|
+
- UIA Heading support (agnel@microsoft.com)
|
|
51
|
+
- Cherry Pick e64bc29 (34109996+chiaramooney@users.noreply.github.com)
|
|
52
|
+
- Pass JSValueArgWriter around instead of immediately converting to dynamic (30809111+acoates-ms@users.noreply.github.com)
|
|
53
|
+
|
|
19
54
|
## 0.65.1
|
|
20
55
|
|
|
21
56
|
Mon, 30 Aug 2021 15:06:56 GMT
|
|
@@ -10,6 +10,27 @@ using namespace Windows::Foundation;
|
|
|
10
10
|
|
|
11
11
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
12
12
|
|
|
13
|
+
// Implements IDispatchQueue2 on top of a custom IReactDispatcher provided by the application
|
|
14
|
+
struct WrappedReactDispatcher : public Mso::UnknownObject<Mso::React::IDispatchQueue2> {
|
|
15
|
+
WrappedReactDispatcher(const winrt::Microsoft::ReactNative::IReactDispatcher &dispatcher) noexcept
|
|
16
|
+
: m_dispatcher(dispatcher) {}
|
|
17
|
+
|
|
18
|
+
void Post(Mso::DispatchTask &&task) const noexcept override {
|
|
19
|
+
m_dispatcher.Post(task);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
void InvokeElsePost(Mso::DispatchTask &&task) const noexcept override {
|
|
23
|
+
if (m_dispatcher.HasThreadAccess()) {
|
|
24
|
+
task();
|
|
25
|
+
} else {
|
|
26
|
+
Post(std::move(task));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private:
|
|
31
|
+
winrt::Microsoft::ReactNative::IReactDispatcher m_dispatcher;
|
|
32
|
+
};
|
|
33
|
+
|
|
13
34
|
ReactDispatcher::ReactDispatcher(Mso::DispatchQueue &&queue) noexcept : m_queue{std::move(queue)} {}
|
|
14
35
|
|
|
15
36
|
bool ReactDispatcher::HasThreadAccess() noexcept {
|
|
@@ -20,12 +41,29 @@ void ReactDispatcher::Post(ReactDispatcherCallback const &callback) noexcept {
|
|
|
20
41
|
return m_queue.Post([callback]() noexcept { callback(); });
|
|
21
42
|
}
|
|
22
43
|
|
|
44
|
+
void ReactDispatcher::Post(Mso::DispatchTask &&task) const noexcept {
|
|
45
|
+
m_queue.Post(std::move(task));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
void ReactDispatcher::InvokeElsePost(Mso::DispatchTask &&task) const noexcept {
|
|
49
|
+
m_queue.InvokeElsePost(std::move(task));
|
|
50
|
+
}
|
|
51
|
+
|
|
23
52
|
/*static*/ IReactDispatcher ReactDispatcher::CreateSerialDispatcher() noexcept {
|
|
24
53
|
return make<ReactDispatcher>(Mso::DispatchQueue{});
|
|
25
54
|
}
|
|
26
55
|
|
|
27
|
-
/*static*/ Mso::
|
|
28
|
-
|
|
56
|
+
/*static*/ Mso::CntPtr<Mso::React::IDispatchQueue2> ReactDispatcher::GetUIDispatchQueue2(
|
|
57
|
+
IReactPropertyBag const &properties) noexcept {
|
|
58
|
+
auto iReactDispatcher = GetUIDispatcher(properties);
|
|
59
|
+
|
|
60
|
+
if (!iReactDispatcher)
|
|
61
|
+
return nullptr;
|
|
62
|
+
|
|
63
|
+
if (auto simpleDispatcher = iReactDispatcher.try_as<IDispatchQueue2>())
|
|
64
|
+
return simpleDispatcher.get();
|
|
65
|
+
|
|
66
|
+
return Mso::Make<WrappedReactDispatcher>(iReactDispatcher);
|
|
29
67
|
}
|
|
30
68
|
|
|
31
69
|
/*static*/ IReactDispatcher ReactDispatcher::UIThreadDispatcher() noexcept {
|
|
@@ -6,9 +6,23 @@
|
|
|
6
6
|
#include <dispatchQueue/dispatchQueue.h>
|
|
7
7
|
#include <winrt/Microsoft.ReactNative.h>
|
|
8
8
|
|
|
9
|
+
namespace Mso::React {
|
|
10
|
+
|
|
11
|
+
MSO_GUID(IDispatchQueue2, "a8d9db25-3d16-4476-ae65-682fcee1260c")
|
|
12
|
+
struct IDispatchQueue2 : ::IUnknown {
|
|
13
|
+
//! Post the task to the end of the queue for asynchronous invocation.
|
|
14
|
+
virtual void Post(Mso::DispatchTask &&task) const noexcept = 0;
|
|
15
|
+
|
|
16
|
+
//! Invoke the task immediately if the queue uses the current thread. Otherwise, post it.
|
|
17
|
+
//! The immediate execution ignores the suspend or shutdown states.
|
|
18
|
+
virtual void InvokeElsePost(Mso::DispatchTask &&task) const noexcept = 0;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
} // namespace Mso::React
|
|
22
|
+
|
|
9
23
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
10
24
|
|
|
11
|
-
struct ReactDispatcher : implements<ReactDispatcher,
|
|
25
|
+
struct ReactDispatcher : implements<ReactDispatcher, IReactDispatcher, Mso::React::IDispatchQueue2> {
|
|
12
26
|
ReactDispatcher() = default;
|
|
13
27
|
ReactDispatcher(Mso::DispatchQueue &&queue) noexcept;
|
|
14
28
|
|
|
@@ -17,8 +31,7 @@ struct ReactDispatcher : implements<ReactDispatcher, winrt::default_interface<IR
|
|
|
17
31
|
|
|
18
32
|
static IReactDispatcher CreateSerialDispatcher() noexcept;
|
|
19
33
|
|
|
20
|
-
static Mso::
|
|
21
|
-
|
|
34
|
+
static Mso::CntPtr<IDispatchQueue2> GetUIDispatchQueue2(IReactPropertyBag const &properties) noexcept;
|
|
22
35
|
static IReactDispatcher UIThreadDispatcher() noexcept;
|
|
23
36
|
static IReactPropertyName UIDispatcherProperty() noexcept;
|
|
24
37
|
static IReactDispatcher GetUIDispatcher(IReactPropertyBag const &properties) noexcept;
|
|
@@ -26,6 +39,9 @@ struct ReactDispatcher : implements<ReactDispatcher, winrt::default_interface<IR
|
|
|
26
39
|
|
|
27
40
|
static IReactPropertyName JSDispatcherProperty() noexcept;
|
|
28
41
|
|
|
42
|
+
void Post(Mso::DispatchTask &&task) const noexcept override;
|
|
43
|
+
void InvokeElsePost(Mso::DispatchTask &&task) const noexcept override;
|
|
44
|
+
|
|
29
45
|
private:
|
|
30
46
|
Mso::DispatchQueue m_queue;
|
|
31
47
|
};
|
|
@@ -16,11 +16,8 @@ namespace Microsoft::ReactNative {
|
|
|
16
16
|
|
|
17
17
|
AppearanceChangeListener::AppearanceChangeListener(
|
|
18
18
|
const Mso::React::IReactContext &context,
|
|
19
|
-
Mso::
|
|
20
|
-
:
|
|
21
|
-
// Ensure we're constructed on the UI thread
|
|
22
|
-
VerifyElseCrash(uiQueue.HasThreadAccess());
|
|
23
|
-
|
|
19
|
+
const Mso::React::IDispatchQueue2 &uiQueue) noexcept
|
|
20
|
+
: m_queue(&uiQueue), m_context(&context) {
|
|
24
21
|
if (auto currentApp = xaml::TryGetCurrentApplication()) {
|
|
25
22
|
m_currentTheme = currentApp.RequestedTheme();
|
|
26
23
|
|
|
@@ -29,7 +26,11 @@ AppearanceChangeListener::AppearanceChangeListener(
|
|
|
29
26
|
m_revoker = m_uiSettings.ColorValuesChanged(
|
|
30
27
|
winrt::auto_revoke, [weakThis{Mso::WeakPtr(this)}](const auto & /*sender*/, const auto & /*args*/) noexcept {
|
|
31
28
|
if (auto strongThis = weakThis.GetStrongPtr()) {
|
|
32
|
-
strongThis->
|
|
29
|
+
strongThis->m_queue->Post([weakThis]() noexcept {
|
|
30
|
+
if (auto strongThis = weakThis.GetStrongPtr()) {
|
|
31
|
+
strongThis->OnColorValuesChanged();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
}
|
|
@@ -3,30 +3,34 @@
|
|
|
3
3
|
|
|
4
4
|
#pragma once
|
|
5
5
|
|
|
6
|
-
#include <activeObject/activeObject.h>
|
|
7
6
|
#include <cxxreact/CxxModule.h>
|
|
8
7
|
#include <eventWaitHandle/eventWaitHandle.h>
|
|
9
8
|
|
|
10
9
|
#include <winrt/Windows.UI.ViewManagement.h>
|
|
11
10
|
|
|
11
|
+
#include <IReactDispatcher.h>
|
|
12
12
|
#include <React.h>
|
|
13
|
+
#include <object/refCountedObject.h>
|
|
13
14
|
#include "IReactInstance.h"
|
|
14
15
|
|
|
15
16
|
namespace Microsoft::ReactNative {
|
|
16
17
|
|
|
17
18
|
// Listens for the current theme on the UI thread, storing the most recent. Will emit JS events on Appearance change.
|
|
18
|
-
class AppearanceChangeListener final : public Mso::
|
|
19
|
+
class AppearanceChangeListener final : public Mso::RefCountedObject<Mso::RefCountStrategy::WeakRef, Mso::IRefCounted> {
|
|
19
20
|
using ApplicationTheme = xaml::ApplicationTheme;
|
|
20
21
|
using UISettings = winrt::Windows::UI::ViewManagement::UISettings;
|
|
21
22
|
|
|
22
23
|
public:
|
|
23
|
-
AppearanceChangeListener(
|
|
24
|
+
AppearanceChangeListener(
|
|
25
|
+
const Mso::React::IReactContext &context,
|
|
26
|
+
const Mso::React::IDispatchQueue2 &uiQueue) noexcept;
|
|
24
27
|
const char *GetColorScheme() const noexcept;
|
|
25
28
|
|
|
26
29
|
private:
|
|
27
30
|
static const char *ToString(ApplicationTheme theme) noexcept;
|
|
28
31
|
void OnColorValuesChanged() noexcept;
|
|
29
32
|
|
|
33
|
+
Mso::CntPtr<const Mso::React::IDispatchQueue2> m_queue;
|
|
30
34
|
UISettings m_uiSettings;
|
|
31
35
|
UISettings::ColorValuesChanged_revoker m_revoker;
|
|
32
36
|
std::atomic<ApplicationTheme> m_currentTheme;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
#include "ReactCoreInjection.h"
|
|
6
6
|
#include "ReactCoreInjection.g.cpp"
|
|
7
7
|
#include "ReactViewOptions.g.cpp"
|
|
8
|
+
#include <future/futureWinRT.h>
|
|
8
9
|
#include "IReactContext.h"
|
|
9
10
|
#include "ReactContext.h"
|
|
10
11
|
#include "ReactInstanceWin.h"
|
|
@@ -86,16 +87,18 @@ ReactViewHost::ReactViewHost(
|
|
|
86
87
|
|
|
87
88
|
// ReactViewOptions ReactViewHost::Options() noexcept;
|
|
88
89
|
// ReactNative::ReactNativeHost ReactViewHost::ReactHost() noexcept {}
|
|
89
|
-
|
|
90
|
-
m_viewHost->ReloadViewInstance();
|
|
90
|
+
winrt::Windows::Foundation::IAsyncAction ReactViewHost::ReloadViewInstance() noexcept {
|
|
91
|
+
return make<Mso::AsyncActionFutureAdapter>(m_viewHost->ReloadViewInstance());
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
winrt::Windows::Foundation::IAsyncAction ReactViewHost::ReloadViewInstanceWithOptions(
|
|
95
|
+
ReactNative::ReactViewOptions options) noexcept {
|
|
96
|
+
return make<Mso::AsyncActionFutureAdapter>(
|
|
97
|
+
m_viewHost->ReloadViewInstanceWithOptions(options.as<ReactViewOptions>()->CreateViewOptions()));
|
|
95
98
|
}
|
|
96
99
|
|
|
97
|
-
|
|
98
|
-
m_viewHost->UnloadViewInstance();
|
|
100
|
+
winrt::Windows::Foundation::IAsyncAction ReactViewHost::UnloadViewInstance() noexcept {
|
|
101
|
+
return make<Mso::AsyncActionFutureAdapter>(m_viewHost->UnloadViewInstance());
|
|
99
102
|
}
|
|
100
103
|
|
|
101
104
|
//! This class ensures that we access ReactRootView from UI thread.
|
|
@@ -149,10 +152,16 @@ struct ReactViewInstance : public Mso::UnknownObject<Mso::RefCountStrategy::Weak
|
|
|
149
152
|
}
|
|
150
153
|
};
|
|
151
154
|
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
winrt::Windows::Foundation::IAsyncAction ReactViewHost::AttachViewInstance(
|
|
156
|
+
ReactNative::IReactViewInstance viewInstance) noexcept {
|
|
157
|
+
return make<Mso::AsyncActionFutureAdapter>(
|
|
158
|
+
m_viewHost->AttachViewInstance(*Mso::Make<ReactViewInstance>(viewInstance, m_uiDispatcher)));
|
|
154
159
|
}
|
|
155
160
|
|
|
156
|
-
|
|
161
|
+
winrt::Windows::Foundation::IAsyncAction ReactViewHost::DetachViewInstance() noexcept {
|
|
162
|
+
Mso::Promise<void> promise;
|
|
163
|
+
promise.SetValue();
|
|
164
|
+
return make<Mso::AsyncActionFutureAdapter>(promise.AsFuture());
|
|
165
|
+
}
|
|
157
166
|
|
|
158
167
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -53,12 +53,11 @@ struct ReactViewHost : public winrt::implements<ReactViewHost, IReactViewHost> {
|
|
|
53
53
|
Mso::React::IReactViewHost &viewHost,
|
|
54
54
|
const winrt::Microsoft::ReactNative::IReactDispatcher &uiDispatcher);
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/*Windows::Foundation::IAsyncAction */ void DetachViewInstance() noexcept;
|
|
56
|
+
Windows::Foundation::IAsyncAction ReloadViewInstance() noexcept;
|
|
57
|
+
Windows::Foundation::IAsyncAction ReloadViewInstanceWithOptions(ReactNative::ReactViewOptions options) noexcept;
|
|
58
|
+
Windows::Foundation::IAsyncAction UnloadViewInstance() noexcept;
|
|
59
|
+
Windows::Foundation::IAsyncAction AttachViewInstance(IReactViewInstance viewInstance) noexcept;
|
|
60
|
+
Windows::Foundation::IAsyncAction DetachViewInstance() noexcept;
|
|
62
61
|
|
|
63
62
|
private:
|
|
64
63
|
Mso::CntPtr<Mso::React::IReactViewHost> m_viewHost;
|
|
@@ -50,19 +50,19 @@ DOC_STRING("Settings per each IReactViewHost associated with an IReactHost insta
|
|
|
50
50
|
interface IReactViewHost
|
|
51
51
|
{
|
|
52
52
|
DOC_STRING("Reloads the IReactViewInstance if it is attached.")
|
|
53
|
-
|
|
53
|
+
Windows.Foundation.IAsyncAction ReloadViewInstance();
|
|
54
54
|
|
|
55
55
|
DOC_STRING("Reloads IReactViewInstance if it is attached with a new set of options.")
|
|
56
|
-
|
|
56
|
+
Windows.Foundation.IAsyncAction ReloadViewInstanceWithOptions(ReactViewOptions options);
|
|
57
57
|
|
|
58
58
|
DOC_STRING("Unloads the attached IReactViewInstance.")
|
|
59
|
-
|
|
59
|
+
Windows.Foundation.IAsyncAction UnloadViewInstance();
|
|
60
60
|
|
|
61
61
|
DOC_STRING("Attaches IReactViewInstance to the IReactViewHost.")
|
|
62
|
-
|
|
62
|
+
Windows.Foundation.IAsyncAction AttachViewInstance(IReactViewInstance viewInstance);
|
|
63
63
|
|
|
64
64
|
DOC_STRING("Detaches IReactViewInstance from the IReactViewHost.")
|
|
65
|
-
|
|
65
|
+
Windows.Foundation.IAsyncAction DetachViewInstance();
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
[experimental]
|