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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
// JSI
|
|
7
|
+
#include <js_native_ext_api.h>
|
|
8
|
+
#include <jsi/jsi.h>
|
|
9
|
+
|
|
10
|
+
// Standard Library
|
|
11
|
+
#include <memory>
|
|
12
|
+
|
|
13
|
+
namespace Microsoft::JSI {
|
|
14
|
+
|
|
15
|
+
///
|
|
16
|
+
// NodeApiJsiRuntime factory function.
|
|
17
|
+
// TODO: Rename as MakeNapiJsiRuntime once code is dropped from V8-JSI.
|
|
18
|
+
///
|
|
19
|
+
std::unique_ptr<facebook::jsi::Runtime> __cdecl MakeNodeApiJsiRuntime(napi_env env) noexcept;
|
|
20
|
+
|
|
21
|
+
} // namespace Microsoft::JSI
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
<ClInclude Include="$(JSI_SourcePath)\jsi\jsi-inl.h" />
|
|
36
36
|
<ClInclude Include="$(JSI_SourcePath)\jsi\jsi.h" />
|
|
37
37
|
<ClInclude Include="$(MSBuildThisFileDirectory)DesktopWindowBridge.h" />
|
|
38
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.h" />
|
|
38
39
|
<ClInclude Include="$(MSBuildThisFileDirectory)TurboModuleProvider.h" />
|
|
39
40
|
<ClInclude Include="$(CallInvoker_SourcePath)\ReactCommon\CallInvoker.h" />
|
|
40
41
|
<ClInclude Include="$(MSBuildThisFileDirectory)XamlUtils.h" />
|
|
@@ -115,4 +116,9 @@
|
|
|
115
116
|
<ItemGroup>
|
|
116
117
|
<None Include="$(MSBuildThisFileDirectory)README.md" />
|
|
117
118
|
</ItemGroup>
|
|
119
|
+
<ItemGroup>
|
|
120
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.cpp">
|
|
121
|
+
<ExcludedFromBuild Condition="'$(UseV8)' != 'true'">true</ExcludedFromBuild>
|
|
122
|
+
</ClCompile>
|
|
123
|
+
</ItemGroup>
|
|
118
124
|
</Project>
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\JsiApiContext.cpp">
|
|
28
28
|
<Filter>JSI</Filter>
|
|
29
29
|
</ClCompile>
|
|
30
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.cpp">
|
|
31
|
+
<Filter>JSI</Filter>
|
|
32
|
+
</ClCompile>
|
|
30
33
|
</ItemGroup>
|
|
31
34
|
<ItemGroup>
|
|
32
35
|
<ClInclude Include="$(MSBuildThisFileDirectory)Crash.h" />
|
|
@@ -146,6 +149,9 @@
|
|
|
146
149
|
<ClInclude Include="$(MSBuildThisFileDirectory)XamlUtils.h">
|
|
147
150
|
<Filter>UI</Filter>
|
|
148
151
|
</ClInclude>
|
|
152
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.h">
|
|
153
|
+
<Filter>JSI</Filter>
|
|
154
|
+
</ClInclude>
|
|
149
155
|
</ItemGroup>
|
|
150
156
|
<ItemGroup>
|
|
151
157
|
<Filter Include="JSI">
|
package/Mso/future/futureWinRT.h
CHANGED
|
@@ -57,7 +57,9 @@ struct AsyncActionFutureAdapter : winrt::implements<
|
|
|
57
57
|
m_completedAssigned = true;
|
|
58
58
|
|
|
59
59
|
if (m_status == AsyncStatus::Started) {
|
|
60
|
-
m_completed = winrt::impl::make_agile_delegate(
|
|
60
|
+
m_completed = winrt::impl::make_agile_delegate(
|
|
61
|
+
[keepAlive = get_strong(), handler = std::move(handler)](
|
|
62
|
+
auto const &task, winrt::Windows::Foundation::AsyncStatus status) { handler(task, status); });
|
|
61
63
|
return;
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
<EnableHermesInspectorInReleaseFlavor Condition="'$(EnableHermesInspectorInReleaseFlavor)' == ''">false</EnableHermesInspectorInReleaseFlavor>
|
|
12
12
|
|
|
13
13
|
<UseV8 Condition="'$(UseV8)' == ''">false</UseV8>
|
|
14
|
-
<V8Version Condition="'$(V8Version)' == ''">0.65.
|
|
15
|
-
<
|
|
16
|
-
<
|
|
14
|
+
<V8Version Condition="'$(V8Version)' == ''">0.65.5</V8Version>
|
|
15
|
+
<V8PackageName>ReactNative.V8Jsi.Windows</V8PackageName>
|
|
16
|
+
<V8PackageName Condition="'$(V8AppPlatform)' != 'win32'">$(V8PackageName).UWP</V8PackageName>
|
|
17
|
+
<V8Package>$(SolutionDir)packages\$(V8PackageName).$(V8Version)</V8Package>
|
|
17
18
|
</PropertyGroup>
|
|
18
19
|
|
|
19
20
|
</Project>
|
|
@@ -28,10 +28,12 @@
|
|
|
28
28
|
<file src="$nugetroot$\x64\Release\React.Windows.Desktop\Microsoft.ReactNative.winmd" target="lib\ship\x64"/>
|
|
29
29
|
<file src="$nugetroot$\ARM64\Release\React.Windows.Desktop\Microsoft.ReactNative.winmd" target="lib\ship\ARM64"/>
|
|
30
30
|
|
|
31
|
-
<file src="$nugetroot$\x86\Debug\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**"
|
|
32
|
-
<file src="$nugetroot$\x64\Debug\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**"
|
|
33
|
-
<file src="$nugetroot$\
|
|
34
|
-
<file src="$nugetroot$\
|
|
31
|
+
<file src="$nugetroot$\x86\Debug\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**" target="lib\debug\x86" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
|
|
32
|
+
<file src="$nugetroot$\x64\Debug\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**" target="lib\debug\x64" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
|
|
33
|
+
<file src="$nugetroot$\ARM64\Debug\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**" target="lib\debug\ARM64" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
|
|
34
|
+
<file src="$nugetroot$\x86\Release\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**" target="lib\ship\x86" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
|
|
35
|
+
<file src="$nugetroot$\x64\Release\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**" target="lib\ship\x64" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
|
|
36
|
+
<file src="$nugetroot$\ARM64\Release\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**" target="lib\ship\ARM64" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
|
|
35
37
|
|
|
36
38
|
<file src="$nugetroot$\inc\callinvoker\ReactCommon\CallInvoker.h" target="inc\ReactCommon"/>
|
|
37
39
|
<file src="$nugetroot$\inc\runtimeexecutor\ReactCommon\RuntimeExecutor.h" target="inc\ReactCommon"/>
|
|
@@ -92,7 +92,7 @@ void NapiJsiV8RuntimeHolder::InitRuntime() noexcept {
|
|
|
92
92
|
// Associate environment to holder.
|
|
93
93
|
napi_set_instance_data(env, this, nullptr /*finalize_cb*/, nullptr /*finalize_hint*/);
|
|
94
94
|
|
|
95
|
-
m_runtime =
|
|
95
|
+
m_runtime = MakeNodeApiJsiRuntime(env);
|
|
96
96
|
m_ownThreadId = std::this_thread::get_id();
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -88,4 +88,83 @@ void MessageDispatchQueue::quitSynchronous() {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
//=============================================================================================
|
|
92
|
+
// MessageDispatchQueue2 implementation.
|
|
93
|
+
//=============================================================================================
|
|
94
|
+
|
|
95
|
+
MessageDispatchQueue2::MessageDispatchQueue2(
|
|
96
|
+
Mso::React::IDispatchQueue2 &dispatchQueue,
|
|
97
|
+
Mso::Functor<void(const Mso::ErrorCode &)> &&errorHandler,
|
|
98
|
+
Mso::Promise<void> &&whenQuit) noexcept
|
|
99
|
+
: m_stopped{false},
|
|
100
|
+
m_errorHandler{std::move(errorHandler)},
|
|
101
|
+
m_whenQuit{std::move(whenQuit)},
|
|
102
|
+
m_dispatchQueue{&dispatchQueue} {}
|
|
103
|
+
|
|
104
|
+
MessageDispatchQueue2::~MessageDispatchQueue2() noexcept {}
|
|
105
|
+
|
|
106
|
+
void MessageDispatchQueue2::runOnQueue(std::function<void()> &&func) {
|
|
107
|
+
if (m_stopped) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
m_dispatchQueue->Post([pThis = shared_from_this(), func = std::move(func)]() noexcept {
|
|
112
|
+
if (!pThis->m_stopped) {
|
|
113
|
+
pThis->tryFunc(func);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
void MessageDispatchQueue2::tryFunc(const std::function<void()> &func) noexcept {
|
|
119
|
+
try {
|
|
120
|
+
func();
|
|
121
|
+
} catch (const std::exception & /*ex*/) {
|
|
122
|
+
if (auto errorHandler = m_errorHandler.Get()) {
|
|
123
|
+
errorHandler->Invoke(Mso::ExceptionErrorProvider().MakeErrorCode(std::current_exception()));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
void MessageDispatchQueue2::runSync(const Mso::VoidFunctorRef &func) noexcept {
|
|
129
|
+
Mso::ManualResetEvent callbackFinished{};
|
|
130
|
+
|
|
131
|
+
m_dispatchQueue->InvokeElsePost(Mso::MakeDispatchTask(
|
|
132
|
+
/*callback:*/
|
|
133
|
+
[&func, &callbackFinished]() noexcept {
|
|
134
|
+
func();
|
|
135
|
+
callbackFinished.Set();
|
|
136
|
+
},
|
|
137
|
+
/*onCancel:*/ [&func, &callbackFinished]() noexcept { callbackFinished.Set(); }));
|
|
138
|
+
|
|
139
|
+
callbackFinished.Wait();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// runOnQueueSync and quitSynchronous are dangerous. They should only be
|
|
143
|
+
// used for initialization and cleanup.
|
|
144
|
+
void MessageDispatchQueue2::runOnQueueSync(std::function<void()> &&func) {
|
|
145
|
+
if (m_stopped) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
runSync([this, &func]() noexcept {
|
|
150
|
+
if (!m_stopped) {
|
|
151
|
+
tryFunc(func);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Once quitSynchronous() returns, no further work should run on the queue.
|
|
157
|
+
void MessageDispatchQueue2::quitSynchronous() {
|
|
158
|
+
m_stopped = true;
|
|
159
|
+
runSync([]() noexcept {});
|
|
160
|
+
|
|
161
|
+
if (m_whenQuit) {
|
|
162
|
+
m_dispatchQueue->Post([sharedThis = shared_from_this()]() noexcept {
|
|
163
|
+
if (auto thisPtr = sharedThis.get()) {
|
|
164
|
+
thisPtr->m_whenQuit.SetValue();
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
91
170
|
} // namespace Mso::React
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#pragma once
|
|
5
5
|
|
|
6
|
+
#include <IReactDispatcher.h>
|
|
6
7
|
#include <cxxreact/MessageQueueThread.h>
|
|
7
8
|
#include <functional/FunctorRef.h>
|
|
8
9
|
#include <future/Future.h>
|
|
@@ -43,4 +44,34 @@ struct MessageDispatchQueue : facebook::react::MessageQueueThread, std::enable_s
|
|
|
43
44
|
const Mso::Promise<void> m_whenQuit;
|
|
44
45
|
};
|
|
45
46
|
|
|
47
|
+
struct MessageDispatchQueue2 : facebook::react::MessageQueueThread,
|
|
48
|
+
std::enable_shared_from_this<MessageDispatchQueue2> {
|
|
49
|
+
MessageDispatchQueue2(
|
|
50
|
+
Mso::React::IDispatchQueue2 &dispatchQueue,
|
|
51
|
+
Mso::Functor<void(const Mso::ErrorCode &)> &&errorHandler,
|
|
52
|
+
Mso::Promise<void> &&whenQuit = nullptr) noexcept;
|
|
53
|
+
|
|
54
|
+
~MessageDispatchQueue2() noexcept override;
|
|
55
|
+
|
|
56
|
+
public: // FastMessageQueueThread implementation
|
|
57
|
+
void runOnQueue(std::function<void()> &&func) override;
|
|
58
|
+
|
|
59
|
+
// runOnQueueSync and quitSynchronous are dangerous. They should only be
|
|
60
|
+
// used for initialization and cleanup.
|
|
61
|
+
void runOnQueueSync(std::function<void()> &&func) override;
|
|
62
|
+
|
|
63
|
+
// Once quitSynchronous() returns, no further work should run on the queue.
|
|
64
|
+
void quitSynchronous() override;
|
|
65
|
+
|
|
66
|
+
private:
|
|
67
|
+
void runSync(const Mso::VoidFunctorRef &func) noexcept;
|
|
68
|
+
void tryFunc(const std::function<void()> &func) noexcept;
|
|
69
|
+
|
|
70
|
+
private:
|
|
71
|
+
std::atomic<bool> m_stopped;
|
|
72
|
+
Mso::CntPtr<Mso::React::IDispatchQueue2> m_dispatchQueue;
|
|
73
|
+
Mso::Functor<void(const Mso::ErrorCode &)> m_errorHandler;
|
|
74
|
+
const Mso::Promise<void> m_whenQuit;
|
|
75
|
+
};
|
|
76
|
+
|
|
46
77
|
} // namespace Mso::React
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@react-native-community/cli": "^6.0.0",
|
|
26
26
|
"@react-native-community/cli-platform-android": "^6.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-ios": "^6.0.0",
|
|
28
|
-
"@react-native-windows/cli": "0.65.
|
|
28
|
+
"@react-native-windows/cli": "0.65.2",
|
|
29
29
|
"@react-native/assets": "1.0.0",
|
|
30
30
|
"@react-native/normalize-color": "1.0.0",
|
|
31
31
|
"@react-native/polyfills": "1.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"ws": "^6.1.4"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@react-native-windows/codegen": "0.65.
|
|
58
|
+
"@react-native-windows/codegen": "0.65.1",
|
|
59
59
|
"@rnw-scripts/eslint-config": "1.1.6",
|
|
60
60
|
"@types/node": "^14.14.22",
|
|
61
61
|
"@types/react": "16.9.11",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"react-native": "^0.65.0"
|
|
79
79
|
},
|
|
80
80
|
"beachball": {
|
|
81
|
-
"defaultNpmTag": "
|
|
81
|
+
"defaultNpmTag": "v0.65-stable",
|
|
82
82
|
"gitTags": true,
|
|
83
83
|
"disallowedChangeTypes": [
|
|
84
84
|
"major",
|