react-native-windows 0.70.0-preview.2 → 0.70.1
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/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Microsoft.ReactNative/JSDispatcherWriter.cpp +60 -22
- package/Microsoft.ReactNative/JSDispatcherWriter.h +5 -3
- package/Microsoft.ReactNative/Pch/pch.h +0 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +1 -0
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +146 -84
- package/Microsoft.ReactNative/TurboModulesProvider.h +5 -0
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +4 -2
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +84 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +1 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +3 -0
- package/Mso/src/dispatchQueue/uiScheduler_winrt.cpp +6 -1
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/Shared/InstanceManager.cpp +29 -0
- package/Shared/InstanceManager.h +14 -0
- package/Shared/Modules/HttpModule.cpp +4 -2
- package/Shared/Networking/IHttpResource.h +1 -1
- package/Shared/Networking/IRedirectEventSource.h +18 -0
- package/Shared/Networking/IWinRTHttpRequestFactory.h +22 -0
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +47 -16
- package/Shared/Networking/OriginPolicyHttpFilter.h +16 -3
- package/Shared/Networking/RedirectHttpFilter.cpp +283 -0
- package/Shared/Networking/RedirectHttpFilter.h +97 -0
- package/Shared/Networking/WinRTHttpResource.cpp +207 -154
- package/Shared/Networking/WinRTHttpResource.h +17 -4
- package/Shared/OInstance.cpp +16 -1
- package/Shared/OInstance.h +4 -13
- package/Shared/Shared.vcxitems +4 -0
- package/Shared/Shared.vcxitems.filters +12 -0
- package/package.json +8 -8
package/Shared/OInstance.cpp
CHANGED
|
@@ -106,12 +106,17 @@ class OJSIExecutorFactory : public JSExecutorFactory {
|
|
|
106
106
|
auto turboModuleManager = std::make_shared<TurboModuleManager>(turboModuleRegistry_, jsCallInvoker_);
|
|
107
107
|
|
|
108
108
|
// TODO: The binding here should also add the proxys that convert cxxmodules into turbomodules
|
|
109
|
+
// [vmoroz] Note, that we must not use the RN TurboCxxModule.h code because it uses global LongLivedObjectCollection
|
|
110
|
+
// instance that prevents us from using multiple RN instance in the same process.
|
|
109
111
|
auto binding = [turboModuleManager](const std::string &name) -> std::shared_ptr<TurboModule> {
|
|
110
112
|
return turboModuleManager->getModule(name);
|
|
111
113
|
};
|
|
112
114
|
|
|
113
115
|
TurboModuleBinding::install(
|
|
114
|
-
*runtimeHolder_->getRuntime(),
|
|
116
|
+
*runtimeHolder_->getRuntime(),
|
|
117
|
+
std::function(binding),
|
|
118
|
+
TurboModuleBindingMode::HostObject,
|
|
119
|
+
longLivedObjectCollection_);
|
|
115
120
|
|
|
116
121
|
// init TurboModule
|
|
117
122
|
for (const auto &moduleName : turboModuleManager->getEagerInitModuleNames()) {
|
|
@@ -133,17 +138,20 @@ class OJSIExecutorFactory : public JSExecutorFactory {
|
|
|
133
138
|
std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> runtimeHolder,
|
|
134
139
|
NativeLoggingHook loggingHook,
|
|
135
140
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry,
|
|
141
|
+
std::shared_ptr<LongLivedObjectCollection> longLivedObjectCollection,
|
|
136
142
|
bool isProfilingEnabled,
|
|
137
143
|
std::shared_ptr<CallInvoker> jsCallInvoker) noexcept
|
|
138
144
|
: runtimeHolder_{std::move(runtimeHolder)},
|
|
139
145
|
loggingHook_{std::move(loggingHook)},
|
|
140
146
|
turboModuleRegistry_{std::move(turboModuleRegistry)},
|
|
147
|
+
longLivedObjectCollection_{std::move(longLivedObjectCollection)},
|
|
141
148
|
jsCallInvoker_{std::move(jsCallInvoker)},
|
|
142
149
|
isProfilingEnabled_{isProfilingEnabled} {}
|
|
143
150
|
|
|
144
151
|
private:
|
|
145
152
|
std::shared_ptr<Microsoft::JSI::RuntimeHolderLazyInit> runtimeHolder_;
|
|
146
153
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry_;
|
|
154
|
+
std::shared_ptr<LongLivedObjectCollection> longLivedObjectCollection_;
|
|
147
155
|
std::shared_ptr<CallInvoker> jsCallInvoker_;
|
|
148
156
|
NativeLoggingHook loggingHook_;
|
|
149
157
|
bool isProfilingEnabled_;
|
|
@@ -160,6 +168,7 @@ void logMarker(const facebook::react::ReactMarker::ReactMarkerId /*id*/, const c
|
|
|
160
168
|
std::tuple<std::string, facebook::xplat::module::CxxModule::Provider, std::shared_ptr<MessageQueueThread>>>
|
|
161
169
|
&&cxxModules,
|
|
162
170
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry,
|
|
171
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> longLivedObjectCollection,
|
|
163
172
|
std::unique_ptr<InstanceCallback> &&callback,
|
|
164
173
|
std::shared_ptr<MessageQueueThread> jsQueue,
|
|
165
174
|
std::shared_ptr<MessageQueueThread> nativeQueue,
|
|
@@ -170,6 +179,7 @@ void logMarker(const facebook::react::ReactMarker::ReactMarkerId /*id*/, const c
|
|
|
170
179
|
std::move(jsBundleBasePath),
|
|
171
180
|
std::move(cxxModules),
|
|
172
181
|
std::move(turboModuleRegistry),
|
|
182
|
+
std::move(longLivedObjectCollection),
|
|
173
183
|
std::move(callback),
|
|
174
184
|
std::move(jsQueue),
|
|
175
185
|
std::move(nativeQueue),
|
|
@@ -199,6 +209,7 @@ void logMarker(const facebook::react::ReactMarker::ReactMarkerId /*id*/, const c
|
|
|
199
209
|
std::move(jsBundleBasePath),
|
|
200
210
|
std::move(cxxModules),
|
|
201
211
|
std::move(turboModuleRegistry),
|
|
212
|
+
nullptr,
|
|
202
213
|
std::move(callback),
|
|
203
214
|
std::move(jsQueue),
|
|
204
215
|
std::move(nativeQueue),
|
|
@@ -236,12 +247,14 @@ InstanceImpl::InstanceImpl(
|
|
|
236
247
|
std::tuple<std::string, facebook::xplat::module::CxxModule::Provider, std::shared_ptr<MessageQueueThread>>>
|
|
237
248
|
&&cxxModules,
|
|
238
249
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry,
|
|
250
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> longLivedObjectCollection,
|
|
239
251
|
std::unique_ptr<InstanceCallback> &&callback,
|
|
240
252
|
std::shared_ptr<MessageQueueThread> jsQueue,
|
|
241
253
|
std::shared_ptr<MessageQueueThread> nativeQueue,
|
|
242
254
|
std::shared_ptr<DevSettings> devSettings,
|
|
243
255
|
std::shared_ptr<IDevSupportManager> devManager)
|
|
244
256
|
: m_turboModuleRegistry(std::move(turboModuleRegistry)),
|
|
257
|
+
m_longLivedObjectCollection(std::move(longLivedObjectCollection)),
|
|
245
258
|
m_jsThread(std::move(jsQueue)),
|
|
246
259
|
m_nativeQueue(nativeQueue),
|
|
247
260
|
m_jsBundleBasePath(std::move(jsBundleBasePath)),
|
|
@@ -302,6 +315,7 @@ InstanceImpl::InstanceImpl(
|
|
|
302
315
|
m_devSettings->jsiRuntimeHolder,
|
|
303
316
|
m_devSettings->loggingCallback,
|
|
304
317
|
m_turboModuleRegistry,
|
|
318
|
+
m_longLivedObjectCollection,
|
|
305
319
|
!m_devSettings->useFastRefresh,
|
|
306
320
|
m_innerInstance->getJSCallInvoker());
|
|
307
321
|
} else {
|
|
@@ -365,6 +379,7 @@ InstanceImpl::InstanceImpl(
|
|
|
365
379
|
m_devSettings->jsiRuntimeHolder,
|
|
366
380
|
m_devSettings->loggingCallback,
|
|
367
381
|
m_turboModuleRegistry,
|
|
382
|
+
m_longLivedObjectCollection,
|
|
368
383
|
!m_devSettings->useFastRefresh,
|
|
369
384
|
m_innerInstance->getJSCallInvoker());
|
|
370
385
|
}
|
package/Shared/OInstance.h
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#include "InstanceManager.h"
|
|
11
11
|
|
|
12
12
|
// React Native
|
|
13
|
+
#include <ReactCommon/LongLivedObject.h>
|
|
13
14
|
#include <cxxreact/Instance.h>
|
|
14
15
|
|
|
15
16
|
// Standard Libriary
|
|
@@ -32,6 +33,7 @@ class InstanceImpl final : public InstanceWrapper, private ::std::enable_shared_
|
|
|
32
33
|
std::tuple<std::string, facebook::xplat::module::CxxModule::Provider, std::shared_ptr<MessageQueueThread>>>
|
|
33
34
|
&&cxxModules,
|
|
34
35
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry,
|
|
36
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> longLivedObjectCollection,
|
|
35
37
|
std::unique_ptr<InstanceCallback> &&callback,
|
|
36
38
|
std::shared_ptr<MessageQueueThread> jsQueue,
|
|
37
39
|
std::shared_ptr<MessageQueueThread> nativeQueue,
|
|
@@ -72,19 +74,7 @@ class InstanceImpl final : public InstanceWrapper, private ::std::enable_shared_
|
|
|
72
74
|
std::tuple<std::string, facebook::xplat::module::CxxModule::Provider, std::shared_ptr<MessageQueueThread>>>
|
|
73
75
|
&&cxxModules,
|
|
74
76
|
std::shared_ptr<TurboModuleRegistry> turboModuleRegistry,
|
|
75
|
-
std::
|
|
76
|
-
std::shared_ptr<MessageQueueThread> jsQueue,
|
|
77
|
-
std::shared_ptr<MessageQueueThread> nativeQueue,
|
|
78
|
-
std::shared_ptr<DevSettings> devSettings,
|
|
79
|
-
std::shared_ptr<IDevSupportManager> devManager);
|
|
80
|
-
|
|
81
|
-
InstanceImpl(
|
|
82
|
-
std::shared_ptr<Instance> &&instance,
|
|
83
|
-
std::string &&jsBundleBasePath,
|
|
84
|
-
std::string &&jsBundleRelativePath,
|
|
85
|
-
std::vector<
|
|
86
|
-
std::tuple<std::string, facebook::xplat::module::CxxModule::Provider, std::shared_ptr<MessageQueueThread>>>
|
|
87
|
-
&&cxxModules,
|
|
77
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> longLivedObjectCollection,
|
|
88
78
|
std::unique_ptr<InstanceCallback> &&callback,
|
|
89
79
|
std::shared_ptr<MessageQueueThread> jsQueue,
|
|
90
80
|
std::shared_ptr<MessageQueueThread> nativeQueue,
|
|
@@ -102,6 +92,7 @@ class InstanceImpl final : public InstanceWrapper, private ::std::enable_shared_
|
|
|
102
92
|
std::string m_jsBundleBasePath;
|
|
103
93
|
std::shared_ptr<facebook::react::ModuleRegistry> m_moduleRegistry;
|
|
104
94
|
std::shared_ptr<TurboModuleRegistry> m_turboModuleRegistry;
|
|
95
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> m_longLivedObjectCollection;
|
|
105
96
|
std::shared_ptr<MessageQueueThread> m_jsThread;
|
|
106
97
|
std::shared_ptr<MessageQueueThread> m_nativeQueue;
|
|
107
98
|
|
package/Shared/Shared.vcxitems
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\StatusBarManagerModule.cpp" />
|
|
57
57
|
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\WebSocketModule.cpp" />
|
|
58
58
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\OriginPolicyHttpFilter.cpp" />
|
|
59
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\RedirectHttpFilter.cpp" />
|
|
59
60
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\WinRTHttpResource.cpp" />
|
|
60
61
|
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\WinRTWebSocketResource.cpp" />
|
|
61
62
|
<ClCompile Include="$(MSBuildThisFileDirectory)OInstance.cpp" />
|
|
@@ -103,9 +104,12 @@
|
|
|
103
104
|
<ClInclude Include="$(MSBuildThisFileDirectory)Modules\HttpModule.h" />
|
|
104
105
|
<ClInclude Include="$(MSBuildThisFileDirectory)Modules\NetworkingModule.h" />
|
|
105
106
|
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\IHttpResource.h" />
|
|
107
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\IRedirectEventSource.h" />
|
|
106
108
|
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\IWebSocketResource.h" />
|
|
109
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\IWinRTHttpRequestFactory.h" />
|
|
107
110
|
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\OriginPolicy.h" />
|
|
108
111
|
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\OriginPolicyHttpFilter.h" />
|
|
112
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\RedirectHttpFilter.h" />
|
|
109
113
|
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\WinRTHttpResource.h" />
|
|
110
114
|
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\WinRTTypes.h" />
|
|
111
115
|
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\WinRTWebSocketResource.h" />
|
|
@@ -152,6 +152,9 @@
|
|
|
152
152
|
<ClCompile Include="$(MSBuildThisFileDirectory)Modules\FileReaderModule.cpp">
|
|
153
153
|
<Filter>Source Files\Modules</Filter>
|
|
154
154
|
</ClCompile>
|
|
155
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)Networking\RedirectHttpFilter.cpp">
|
|
156
|
+
<Filter>Source Files\Networking</Filter>
|
|
157
|
+
</ClCompile>
|
|
155
158
|
</ItemGroup>
|
|
156
159
|
<ItemGroup>
|
|
157
160
|
<Filter Include="Source Files">
|
|
@@ -457,6 +460,15 @@
|
|
|
457
460
|
<ClInclude Include="$(MSBuildThisFileDirectory)Modules\FileReaderModule.h">
|
|
458
461
|
<Filter>Header Files\Modules</Filter>
|
|
459
462
|
</ClInclude>
|
|
463
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\RedirectHttpFilter.h">
|
|
464
|
+
<Filter>Header Files\Networking</Filter>
|
|
465
|
+
</ClInclude>
|
|
466
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\IWinRTHttpRequestFactory.h">
|
|
467
|
+
<Filter>Header Files\Networking</Filter>
|
|
468
|
+
</ClInclude>
|
|
469
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)Networking\IRedirectEventSource.h">
|
|
470
|
+
<Filter>Header Files\Networking</Filter>
|
|
471
|
+
</ClInclude>
|
|
460
472
|
</ItemGroup>
|
|
461
473
|
<ItemGroup>
|
|
462
474
|
<None Include="$(MSBuildThisFileDirectory)tracing\rnw.wprp">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@react-native-community/cli": "^9.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "^9.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "^9.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.70.0
|
|
30
|
-
"@react-native-windows/virtualized-list": "0.70.0
|
|
29
|
+
"@react-native-windows/cli": "0.70.0",
|
|
30
|
+
"@react-native-windows/virtualized-list": "0.70.0",
|
|
31
31
|
"@react-native/assets": "1.0.0",
|
|
32
32
|
"@react-native/normalize-color": "2.0.0",
|
|
33
33
|
"@react-native/polyfills": "2.0.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"ws": "^6.1.4"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@react-native-windows/codegen": "0.70.0
|
|
62
|
+
"@react-native-windows/codegen": "0.70.0",
|
|
63
63
|
"@rnw-scripts/eslint-config": "1.1.13",
|
|
64
64
|
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.0.7",
|
|
65
65
|
"@rnw-scripts/just-task": "2.2.5",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"metro-config": "^0.70.1",
|
|
77
77
|
"prettier": "^2.4.1",
|
|
78
78
|
"react": "18.1.0",
|
|
79
|
-
"react-native": "0.70.0
|
|
79
|
+
"react-native": "0.70.0",
|
|
80
80
|
"react-native-platform-override": "^1.6.13",
|
|
81
81
|
"react-refresh": "^0.4.0",
|
|
82
82
|
"react-shallow-renderer": "16.14.1",
|
|
@@ -84,14 +84,14 @@
|
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"react": "18.1.0",
|
|
87
|
-
"react-native": "0.70.0
|
|
87
|
+
"react-native": "^0.70.0"
|
|
88
88
|
},
|
|
89
89
|
"beachball": {
|
|
90
|
-
"defaultNpmTag": "
|
|
90
|
+
"defaultNpmTag": "latest",
|
|
91
91
|
"disallowedChangeTypes": [
|
|
92
92
|
"major",
|
|
93
93
|
"minor",
|
|
94
|
-
"
|
|
94
|
+
"prerelease"
|
|
95
95
|
],
|
|
96
96
|
"gitTags": true
|
|
97
97
|
},
|