react-native-windows 0.63.36 → 0.63.40

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
@@ -17,6 +17,7 @@
17
17
  <ProjectCapability Include="SourceItemsFromImports" />
18
18
  </ItemGroup>
19
19
  <ItemGroup>
20
+ <ClInclude Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.h" />
20
21
  <ClInclude Include="$(MSBuildThisFileDirectory)CppWinRTIncludes.h" />
21
22
  <ClInclude Include="$(MSBuildThisFileDirectory)Crash.h" />
22
23
  <ClInclude Include="$(MSBuildThisFileDirectory)ReactHandleHelper.h" />
@@ -65,4 +66,9 @@
65
66
  <ClCompile Include="$(MSBuildThisFileDirectory)ModuleRegistration.cpp" />
66
67
  <ClCompile Include="$(MSBuildThisFileDirectory)ReactPromise.cpp" />
67
68
  </ItemGroup>
69
+ <ItemGroup>
70
+ <ClCompile Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.cpp">
71
+ <ExcludedFromBuild Condition="'$(USE_V8)' != 'true'">true</ExcludedFromBuild>
72
+ </ClCompile>
73
+ </ItemGroup>
68
74
  </Project>
@@ -33,7 +33,7 @@
33
33
  <HERMES_ARCH Condition="'$(HERMES_ARCH)' == ''">uwp</HERMES_ARCH>
34
34
 
35
35
  <USE_V8 Condition="('$(USE_V8)' == '') OR ('$(Platform)' == 'ARM')">false</USE_V8>
36
- <V8_Version Condition="'$(V8_Version)' == ''">0.63.10</V8_Version>
36
+ <V8_Version Condition="'$(V8_Version)' == ''">0.63.17</V8_Version>
37
37
  <V8_Package Condition="'$(V8_Package)' == '' AND '$(V8AppPlatform)' == 'win32'">$(SolutionDir)packages\ReactNative.V8Jsi.Windows.$(V8_Version)</V8_Package>
38
38
  <V8_Package Condition="'$(V8_Package)' == '' AND '$(V8AppPlatform)' != 'win32'">$(SolutionDir)packages\ReactNative.V8Jsi.Windows.UWP.$(V8_Version)</V8_Package>
39
39
 
@@ -111,6 +111,7 @@
111
111
  <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
112
112
  <RuntimeTypeInfo>false</RuntimeTypeInfo>
113
113
  <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
114
+ <ShowIncludes Condition="'$(ShowIncludes)' == 'true'">true</ShowIncludes>
114
115
  </ClCompile>
115
116
  </ItemDefinitionGroup>
116
117
 
@@ -30,9 +30,10 @@ enum class JSIEngineOverride : int32_t {
30
30
  ChakraCore = 2, // Use the JSIExecutorFactory with ChakraCoreRuntime
31
31
  Hermes = 3, // Use the JSIExecutorFactory with Hermes
32
32
  V8 = 4, // Use the JSIExecutorFactory with V8
33
- V8NAPI = 5, // Use the JSIExecutorFactory with V8-NAPI
33
+ V8Lite = 5, // Use the JSIExecutorFactory with V8-NAPI
34
+ V8NodeApi = 6, // Use the JSIExecutorFactory with V8 via ABI-safe NAPI
34
35
 
35
- Last = V8NAPI
36
+ Last = V8NodeApi
36
37
  };
37
38
 
38
39
  struct ChakraBundleMetadata {
@@ -50,6 +50,7 @@
50
50
  #include "HermesRuntimeHolder.h"
51
51
  #endif
52
52
  #if defined(USE_V8)
53
+ #include <NapiJsiV8RuntimeHolder.h>
53
54
  #include "BaseScriptStoreImpl.h"
54
55
  #include "V8JSIRuntimeHolder.h"
55
56
  #endif
@@ -151,6 +152,9 @@ std::string GetJSBundleFilePath(const std::string &jsBundleBasePath, const std::
151
152
  } // namespace
152
153
 
153
154
  using namespace facebook;
155
+ using namespace Microsoft::JSI;
156
+
157
+ using std::make_shared;
154
158
 
155
159
  namespace facebook {
156
160
  namespace react {
@@ -413,6 +417,34 @@ InstanceImpl::InstanceImpl(
413
417
  m_devSettings->jsiRuntimeHolder =
414
418
  std::make_shared<Microsoft::JSI::ChakraRuntimeHolder>(m_devSettings, m_jsThread, nullptr, nullptr);
415
419
  break;
420
+ case JSIEngineOverride::V8NodeApi: {
421
+ #if defined(USE_V8)
422
+ std::unique_ptr<facebook::jsi::PreparedScriptStore> preparedScriptStore;
423
+
424
+ wchar_t tempPath[MAX_PATH];
425
+ if (GetTempPathW(static_cast<DWORD>(std::size(tempPath)), tempPath)) {
426
+ preparedScriptStore =
427
+ std::make_unique<facebook::react::BasePreparedScriptStoreImpl>(winrt::to_string(tempPath));
428
+ }
429
+
430
+ if (!preparedScriptStore) {
431
+ if (m_devSettings->errorCallback)
432
+ m_devSettings->errorCallback("Could not initialize prepared script store");
433
+
434
+ break;
435
+ }
436
+
437
+ m_devSettings->jsiRuntimeHolder = make_shared<NapiJsiV8RuntimeHolder>(
438
+ m_devSettings, m_jsThread, nullptr /*scriptStore*/, std::move(preparedScriptStore));
439
+
440
+ break;
441
+ #else
442
+ if (m_devSettings->errorCallback)
443
+ m_devSettings->errorCallback("JSI/V8/NAPI engine is not available in this build");
444
+ assert(false);
445
+ [[fallthrough]];
446
+ #endif
447
+ }
416
448
  case JSIEngineOverride::ChakraCore:
417
449
  default: // TODO: Add other engines once supported
418
450
  m_devSettings->jsiRuntimeHolder =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.63.36",
3
+ "version": "0.63.40",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@babel/runtime": "^7.8.4",
25
- "@react-native-windows/cli": "0.63.12",
25
+ "@react-native-windows/cli": "0.63.14",
26
26
  "abort-controller": "^3.0.0",
27
27
  "anser": "^1.4.9",
28
28
  "base64-js": "^1.1.2",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "beachball": {
68
68
  "defaultNpmTag": "v0.63-stable",
69
- "gitTags": true,
69
+ "gitTags": false,
70
70
  "disallowedChangeTypes": [
71
71
  "major",
72
72
  "minor",