react-native-windows 0.64.18 → 0.64.22

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.
@@ -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
@@ -34,6 +34,7 @@
34
34
  <ClInclude Include="$(JSI_SourcePath)\jsi\instrumentation.h" />
35
35
  <ClInclude Include="$(JSI_SourcePath)\jsi\jsi-inl.h" />
36
36
  <ClInclude Include="$(JSI_SourcePath)\jsi\jsi.h" />
37
+ <ClInclude Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.h" />
37
38
  <ClInclude Include="$(MSBuildThisFileDirectory)TurboModuleProvider.h" />
38
39
  <ClInclude Include="$(CallInvoker_SourcePath)\ReactCommon\CallInvoker.h" />
39
40
  <ClInclude Include="$(TurboModule_SourcePath)\ReactCommon\LongLivedObject.h" />
@@ -123,4 +124,9 @@
123
124
  <ItemGroup>
124
125
  <None Include="$(MSBuildThisFileDirectory)README.md" />
125
126
  </ItemGroup>
127
+ <ItemGroup>
128
+ <ClCompile Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.cpp">
129
+ <ExcludedFromBuild Condition="'$(UseV8)' != 'true'">true</ExcludedFromBuild>
130
+ </ClCompile>
131
+ </ItemGroup>
126
132
  </Project>
@@ -27,6 +27,9 @@
27
27
  <ClCompile Include="$(TurboModule_SourcePath)\ReactCommon\TurboModuleUtils.cpp">
28
28
  <Filter>TurboModule</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" />
@@ -145,6 +148,9 @@
145
148
  <ClInclude Include="$(TurboModule_SourcePath)\ReactCommon\TurboModuleUtils.h">
146
149
  <Filter>TurboModule</Filter>
147
150
  </ClInclude>
151
+ <ClInclude Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.h">
152
+ <Filter>JSI</Filter>
153
+ </ClInclude>
148
154
  </ItemGroup>
149
155
  <ItemGroup>
150
156
  <Filter Include="JSI">
@@ -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(handler);
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
 
@@ -9,9 +9,10 @@
9
9
  <HermesArch Condition="'$(HermesArch)' == ''">uwp</HermesArch>
10
10
 
11
11
  <UseV8 Condition="('$(UseV8)' == '') OR ('$(Platform)' == 'ARM')">false</UseV8>
12
- <V8Version Condition="'$(V8Version)' == ''">0.64.24</V8Version>
13
- <V8Package Condition="'$(V8Package)' == '' AND '$(V8AppPlatform)' == 'win32'">$(SolutionDir)packages\ReactNative.V8Jsi.Windows.$(V8Version)</V8Package>
14
- <V8Package Condition="'$(V8Package)' == '' AND '$(V8AppPlatform)' != 'win32'">$(SolutionDir)packages\ReactNative.V8Jsi.Windows.UWP.$(V8Version)</V8Package>
12
+ <V8Version Condition="'$(V8Version)' == ''">0.64.27</V8Version>
13
+ <V8PackageName>ReactNative.V8Jsi.Windows</V8PackageName>
14
+ <V8PackageName Condition="'$(V8AppPlatform)' != 'win32'">$(V8PackageName).UWP</V8PackageName>
15
+ <V8Package>$(SolutionDir)packages\$(V8PackageName).$(V8Version)</V8Package>
15
16
  </PropertyGroup>
16
17
 
17
- </Project>
18
+ </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.**" 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$\x86\Release\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**" target="lib\ship\x86" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
34
- <file src="$nugetroot$\x64\Release\React.Windows.Desktop.Test.DLL\React.Windows.Desktop.Test.**" target="lib\ship\x64" exclude="**\*.iobj;**\*.ipdb;**\*.exp;**\*.ilk" />
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"/>
@@ -106,13 +106,6 @@ void WebSocketJSExecutor::registerBundle(uint32_t bundleId, const std::string &b
106
106
  std::terminate();
107
107
  }
108
108
 
109
- void WebSocketJSExecutor::flush() {
110
- folly::dynamic jarray = folly::dynamic::array();
111
- auto calls = Call("flushedQueue", jarray);
112
- if (m_delegate && !IsInError())
113
- m_delegate->callNativeModules(*this, folly::parseJson(std::move(calls)), true);
114
- }
115
-
116
109
  void WebSocketJSExecutor::callFunction(
117
110
  const std::string &moduleId,
118
111
  const std::string &methodId,
@@ -75,7 +75,6 @@ class WebSocketJSExecutor : public facebook::react::JSExecutor,
75
75
  std::string Call(const std::string &methodName, folly::dynamic &arguments);
76
76
  std::future<std::string> SendMessageAsync(int requestId, const std::string &message);
77
77
  void OnMessageReceived(const std::string &msg);
78
- void flush();
79
78
 
80
79
  void SetState(State state) noexcept {
81
80
  m_state = state;
@@ -434,6 +434,25 @@ InstanceImpl::InstanceImpl(
434
434
  !m_devSettings->useFastRefresh,
435
435
  m_innerInstance->getJSCallInvoker());
436
436
  } else {
437
+ #if defined(USE_V8)
438
+ std::unique_ptr<facebook::jsi::ScriptStore> scriptStore = nullptr;
439
+ std::unique_ptr<facebook::jsi::PreparedScriptStore> preparedScriptStore = nullptr;
440
+
441
+ char tempPath[MAX_PATH];
442
+ if (GetTempPathA(MAX_PATH, tempPath)) {
443
+ preparedScriptStore = std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(tempPath);
444
+ }
445
+
446
+ m_devSettings->jsiRuntimeHolder = std::make_shared<facebook::react::V8JSIRuntimeHolder>(
447
+ m_devSettings, m_jsThread, std::move(scriptStore), std::move(preparedScriptStore));
448
+
449
+ jsef = std::make_shared<OJSIExecutorFactory>(
450
+ m_devSettings->jsiRuntimeHolder,
451
+ m_devSettings->loggingCallback,
452
+ m_turboModuleRegistry,
453
+ !m_devSettings->useFastRefresh,
454
+ m_innerInstance->getJSCallInvoker());
455
+ #else
437
456
  // We use the older non-JSI ChakraExecutor pipeline as a fallback as of
438
457
  // now. This will go away once we completely move to JSI flow.
439
458
  ChakraInstanceArgs instanceArgs;
@@ -470,6 +489,7 @@ InstanceImpl::InstanceImpl(
470
489
  : CreateMemoryTracker(std::shared_ptr<MessageQueueThread>{m_nativeQueue});
471
490
 
472
491
  jsef = std::make_shared<ChakraExecutorFactory>(std::move(instanceArgs));
492
+ #endif
473
493
  }
474
494
  }
475
495
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.64.18",
3
+ "version": "0.64.22",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  "@react-native-community/cli": "^5.0.1-alpha.0",
26
26
  "@react-native-community/cli-platform-android": "^5.0.1-alpha.0",
27
27
  "@react-native-community/cli-platform-ios": "^5.0.1-alpha.0",
28
- "@react-native-windows/cli": "0.64.5",
28
+ "@react-native-windows/cli": "0.64.6",
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",