react-native-windows 0.66.0 → 0.66.4
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 +103 -1
- package/CHANGELOG.md +43 -4
- package/Chakra/Chakra.vcxitems +0 -1
- package/Chakra/Chakra.vcxitems.filters +0 -3
- package/Chakra/ChakraHelpers.cpp +0 -267
- package/Chakra/ChakraInstanceArgs.h +0 -5
- package/Chakra/ChakraPlatform.h +0 -4
- package/Chakra/ChakraTracing.cpp +0 -33
- package/Chakra/ChakraValue.h +0 -4
- package/Chakra/Utf8DebugExtensions.cpp +0 -5
- package/Chakra/Utf8DebugExtensions.h +0 -6
- package/Libraries/AppTheme/AppTheme.d.ts +3 -2
- package/Libraries/AppTheme/AppTheme.js +20 -2
- package/Libraries/AppTheme/AppTheme.js.map +1 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +3 -3
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +3 -5
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +0 -4
- package/Microsoft.ReactNative/ReactRootView.cpp +28 -3
- package/Microsoft.ReactNative/ReactRootView.h +6 -0
- package/Microsoft.ReactNative/Version.rc +1 -1
- package/Microsoft.ReactNative/Views/DevMenu.cpp +0 -1
- package/Microsoft.ReactNative/Views/RootViewManager.cpp +8 -9
- package/PropertySheets/JSEngine.props +0 -3
- package/PropertySheets/React.Cpp.props +2 -1
- package/Scripts/Microsoft.ReactNative.targets +1 -1
- package/Shared/HermesRuntimeHolder.cpp +3 -1
- package/Shared/HermesSamplingProfiler.cpp +6 -7
- package/Shared/HermesShim.cpp +85 -0
- package/Shared/HermesShim.h +19 -0
- package/Shared/JSI/ChakraApi.cpp +1 -37
- package/Shared/JSI/ChakraApi.h +0 -4
- package/Shared/JSI/ChakraJsiRuntime_edgemode.cpp +1 -5
- package/Shared/JSI/ChakraRuntime.cpp +0 -12
- package/Shared/JSI/ChakraRuntimeFactory.h +0 -2
- package/Shared/OInstance.cpp +12 -29
- package/Shared/Shared.vcxitems +5 -10
- package/Shared/Shared.vcxitems.filters +6 -3
- package/package.json +3 -3
- package/template/metro.config.js +8 -1
- package/template/metro.devMode.config.js +3 -1
- package/Chakra/ChakraCoreDebugger.h +0 -147
- package/Scripts/Microsoft.ChakraCore.ARM64.nuspec +0 -50
- package/Scripts/Microsoft.ChakraCore.ARM64.targets +0 -15
- package/Shared/JSI/ChakraCoreRuntime.h +0 -59
package/Shared/OInstance.cpp
CHANGED
|
@@ -45,11 +45,9 @@
|
|
|
45
45
|
#include <safeint.h>
|
|
46
46
|
#include "PackagerConnection.h"
|
|
47
47
|
|
|
48
|
-
#if defined(INCLUDE_HERMES)
|
|
49
48
|
#include <hermes/BytecodeVersion.h>
|
|
50
|
-
|
|
51
49
|
#include "HermesRuntimeHolder.h"
|
|
52
|
-
|
|
50
|
+
|
|
53
51
|
#if defined(USE_V8)
|
|
54
52
|
#include <JSI/NapiJsiV8RuntimeHolder.h>
|
|
55
53
|
|
|
@@ -307,7 +305,8 @@ InstanceImpl::InstanceImpl(
|
|
|
307
305
|
facebook::react::tracing::initializeETW();
|
|
308
306
|
#endif
|
|
309
307
|
|
|
310
|
-
if (m_devSettings->
|
|
308
|
+
if (m_devSettings->jsiEngineOverride == JSIEngineOverride::Hermes && m_devSettings->useDirectDebugger &&
|
|
309
|
+
!m_devSettings->useWebDebugger) {
|
|
311
310
|
m_devManager->StartInspector(m_devSettings->sourceBundleHost, m_devSettings->sourceBundlePort);
|
|
312
311
|
}
|
|
313
312
|
|
|
@@ -359,14 +358,9 @@ InstanceImpl::InstanceImpl(
|
|
|
359
358
|
assert(m_devSettings->jsiEngineOverride != JSIEngineOverride::Default);
|
|
360
359
|
switch (m_devSettings->jsiEngineOverride) {
|
|
361
360
|
case JSIEngineOverride::Hermes:
|
|
362
|
-
#if defined(INCLUDE_HERMES)
|
|
363
361
|
m_devSettings->jsiRuntimeHolder = std::make_shared<HermesRuntimeHolder>(m_devSettings, m_jsThread);
|
|
364
362
|
m_devSettings->inlineSourceMap = false;
|
|
365
363
|
break;
|
|
366
|
-
#else
|
|
367
|
-
assert(false); // Hermes is not available in this build, fallthrough
|
|
368
|
-
[[fallthrough]];
|
|
369
|
-
#endif
|
|
370
364
|
case JSIEngineOverride::V8: {
|
|
371
365
|
#if defined(USE_V8)
|
|
372
366
|
std::unique_ptr<facebook::jsi::ScriptStore> scriptStore = nullptr;
|
|
@@ -385,12 +379,6 @@ InstanceImpl::InstanceImpl(
|
|
|
385
379
|
[[fallthrough]];
|
|
386
380
|
#endif
|
|
387
381
|
}
|
|
388
|
-
case JSIEngineOverride::Chakra:
|
|
389
|
-
// Applies only to ChakraCore-linked binaries.
|
|
390
|
-
Microsoft::React::SetRuntimeOptionBool("JSI.ForceSystemChakra", true);
|
|
391
|
-
m_devSettings->jsiRuntimeHolder =
|
|
392
|
-
std::make_shared<Microsoft::JSI::ChakraRuntimeHolder>(m_devSettings, m_jsThread, nullptr, nullptr);
|
|
393
|
-
break;
|
|
394
382
|
case JSIEngineOverride::V8NodeApi: {
|
|
395
383
|
#if defined(USE_V8)
|
|
396
384
|
std::unique_ptr<facebook::jsi::PreparedScriptStore> preparedScriptStore;
|
|
@@ -418,6 +406,7 @@ InstanceImpl::InstanceImpl(
|
|
|
418
406
|
[[fallthrough]];
|
|
419
407
|
#endif
|
|
420
408
|
}
|
|
409
|
+
case JSIEngineOverride::Chakra:
|
|
421
410
|
case JSIEngineOverride::ChakraCore:
|
|
422
411
|
default: // TODO: Add other engines once supported
|
|
423
412
|
m_devSettings->jsiRuntimeHolder =
|
|
@@ -506,7 +495,7 @@ void InstanceImpl::loadBundleInternal(std::string &&jsBundleRelativePath, bool s
|
|
|
506
495
|
}
|
|
507
496
|
|
|
508
497
|
int64_t currentTimeInMilliSeconds =
|
|
509
|
-
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono
|
|
498
|
+
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch())
|
|
510
499
|
.count();
|
|
511
500
|
m_devManager->UpdateBundleStatus(true, currentTimeInMilliSeconds);
|
|
512
501
|
|
|
@@ -577,11 +566,7 @@ void InstanceImpl::loadBundleInternal(std::string &&jsBundleRelativePath, bool s
|
|
|
577
566
|
// Otherwise all bundles (User and Platform) are loaded through
|
|
578
567
|
// platformBundles.
|
|
579
568
|
if (PathFileExistsA(fullBundleFilePath.c_str())) {
|
|
580
|
-
#if defined(_CHAKRACORE_H_)
|
|
581
569
|
auto bundleString = FileMappingBigString::fromPath(fullBundleFilePath);
|
|
582
|
-
#else
|
|
583
|
-
auto bundleString = JSBigFileString::fromPath(fullBundleFilePath);
|
|
584
|
-
#endif
|
|
585
570
|
m_innerInstance->loadScriptFromString(std::move(bundleString), std::move(fullBundleFilePath), synchronously);
|
|
586
571
|
}
|
|
587
572
|
|
|
@@ -592,10 +577,6 @@ void InstanceImpl::loadBundleInternal(std::string &&jsBundleRelativePath, bool s
|
|
|
592
577
|
m_innerInstance->loadScriptFromString(std::move(bundleString), jsBundleRelativePath, synchronously);
|
|
593
578
|
#endif
|
|
594
579
|
}
|
|
595
|
-
#if defined(_CHAKRACORE_H_)
|
|
596
|
-
} catch (const facebook::react::ChakraJSException &e) {
|
|
597
|
-
m_devSettings->errorCallback(std::string{e.what()} + "\r\n" + e.getStack());
|
|
598
|
-
#endif
|
|
599
580
|
} catch (const std::exception &e) {
|
|
600
581
|
m_devSettings->errorCallback(e.what());
|
|
601
582
|
} catch (const winrt::hresult_error &hrerr) {
|
|
@@ -608,7 +589,9 @@ void InstanceImpl::loadBundleInternal(std::string &&jsBundleRelativePath, bool s
|
|
|
608
589
|
}
|
|
609
590
|
|
|
610
591
|
InstanceImpl::~InstanceImpl() {
|
|
611
|
-
|
|
592
|
+
if (m_devSettings->jsiEngineOverride == JSIEngineOverride::Hermes) {
|
|
593
|
+
m_devManager->StopInspector();
|
|
594
|
+
}
|
|
612
595
|
m_nativeQueue->quitSynchronous();
|
|
613
596
|
}
|
|
614
597
|
|
|
@@ -624,10 +607,10 @@ std::vector<std::unique_ptr<NativeModule>> InstanceImpl::GetDefaultNativeModules
|
|
|
624
607
|
},
|
|
625
608
|
nativeQueue));
|
|
626
609
|
|
|
627
|
-
// TODO: This is not included for UWP because we have a different module which
|
|
628
|
-
// is added later. However, this one is designed
|
|
629
|
-
// so that we can base a UWP version on it. We need to do that but is not high
|
|
630
|
-
// priority.
|
|
610
|
+
// TODO: This is not included for UWP because we have a different module which
|
|
611
|
+
// is added later. However, this one is designed
|
|
612
|
+
// so that we can base a UWP version on it. We need to do that but is not high
|
|
613
|
+
// priority.
|
|
631
614
|
#if (defined(_MSC_VER) && !defined(WINRT))
|
|
632
615
|
modules.push_back(std::make_unique<CxxNativeModule>(
|
|
633
616
|
m_innerInstance,
|
package/Shared/Shared.vcxitems
CHANGED
|
@@ -26,15 +26,10 @@
|
|
|
26
26
|
<ClCompile Include="$(MSBuildThisFileDirectory)DevSupportManager.cpp" />
|
|
27
27
|
<ClCompile Include="$(MSBuildThisFileDirectory)Executors\WebSocketJSExecutor.cpp" />
|
|
28
28
|
<ClCompile Include="$(MSBuildThisFileDirectory)Executors\WebSocketJSExecutorFactory.cpp" />
|
|
29
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)HermesRuntimeHolder.cpp"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)
|
|
33
|
-
<ExcludedFromBuild Condition="'$(IncludeHermes)' != 'true'">true</ExcludedFromBuild>
|
|
34
|
-
</ClCompile>
|
|
35
|
-
<ClCompile Include="$(MSBuildThisFileDirectory)InspectorPackagerConnection.cpp">
|
|
36
|
-
<ExcludedFromBuild Condition="'$(IncludeHermes)' != 'true'">true</ExcludedFromBuild>
|
|
37
|
-
</ClCompile>
|
|
29
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)HermesRuntimeHolder.cpp" />
|
|
30
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)HermesSamplingProfiler.cpp" />
|
|
31
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)HermesShim.cpp" />
|
|
32
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)InspectorPackagerConnection.cpp" />
|
|
38
33
|
<ClCompile Include="$(MSBuildThisFileDirectory)InstanceManager.cpp" />
|
|
39
34
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSBigAbiString.cpp" />
|
|
40
35
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\ChakraApi.cpp" />
|
|
@@ -79,9 +74,9 @@
|
|
|
79
74
|
<ClInclude Include="$(MSBuildThisFileDirectory)AsyncStorage\FollyDynamicConverter.h" />
|
|
80
75
|
<ClInclude Include="$(MSBuildThisFileDirectory)AsyncStorage\KeyValueStorage.h" />
|
|
81
76
|
<ClInclude Include="$(MSBuildThisFileDirectory)HermesSamplingProfiler.h" />
|
|
77
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)HermesShim.h" />
|
|
82
78
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\ByteArrayBuffer.h" />
|
|
83
79
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\ChakraApi.h" />
|
|
84
|
-
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\ChakraCoreRuntime.h" />
|
|
85
80
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\ChakraRuntime.h" />
|
|
86
81
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\ChakraRuntimeArgs.h" />
|
|
87
82
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\ChakraRuntimeFactory.h" />
|
|
@@ -130,6 +130,9 @@
|
|
|
130
130
|
<ClCompile Include="$(MSBuildThisFileDirectory)HermesSamplingProfiler.cpp">
|
|
131
131
|
<Filter>Source Files</Filter>
|
|
132
132
|
</ClCompile>
|
|
133
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)HermesShim.cpp">
|
|
134
|
+
<Filter>Source Files</Filter>
|
|
135
|
+
</ClCompile>
|
|
133
136
|
</ItemGroup>
|
|
134
137
|
<ItemGroup>
|
|
135
138
|
<Filter Include="Source Files">
|
|
@@ -363,9 +366,6 @@
|
|
|
363
366
|
<Filter>Header Files\JSI</Filter>
|
|
364
367
|
</ClInclude>
|
|
365
368
|
<ClInclude Include="$(MSBuildThisFileDirectory)..\include\Shared\cdebug.h" />
|
|
366
|
-
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\ChakraCoreRuntime.h">
|
|
367
|
-
<Filter>Header Files\JSI</Filter>
|
|
368
|
-
</ClInclude>
|
|
369
369
|
<ClInclude Include="$(MSBuildThisFileDirectory)InspectorPackagerConnection.h">
|
|
370
370
|
<Filter>Header Files</Filter>
|
|
371
371
|
</ClInclude>
|
|
@@ -378,6 +378,9 @@
|
|
|
378
378
|
<ClInclude Include="$(MSBuildThisFileDirectory)HermesSamplingProfiler.h">
|
|
379
379
|
<Filter>Header Files</Filter>
|
|
380
380
|
</ClInclude>
|
|
381
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)HermesShim.h">
|
|
382
|
+
<Filter>Header Files</Filter>
|
|
383
|
+
</ClInclude>
|
|
381
384
|
</ItemGroup>
|
|
382
385
|
<ItemGroup>
|
|
383
386
|
<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.66.
|
|
3
|
+
"version": "0.66.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "^6.0.0",
|
|
27
27
|
"@react-native-community/cli-platform-android": "^6.0.0",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "^6.0.0",
|
|
29
|
-
"@react-native-windows/cli": "0.66.
|
|
29
|
+
"@react-native-windows/cli": "0.66.1",
|
|
30
30
|
"@react-native-windows/virtualized-list": "0.66.0",
|
|
31
31
|
"@react-native/assets": "1.0.0",
|
|
32
32
|
"@react-native/normalize-color": "1.0.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"react": "17.0.2",
|
|
84
|
-
"react-native": "0.66.0"
|
|
84
|
+
"react-native": "^0.66.0"
|
|
85
85
|
},
|
|
86
86
|
"beachball": {
|
|
87
87
|
"defaultNpmTag": "latest",
|
package/template/metro.config.js
CHANGED
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @format
|
|
6
6
|
*/
|
|
7
|
+
const fs = require('fs');
|
|
7
8
|
const path = require('path');
|
|
8
9
|
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
|
9
10
|
|
|
11
|
+
const rnwPath = fs.realpathSync(
|
|
12
|
+
path.resolve(require.resolve('react-native-windows/package.json'), '..'),
|
|
13
|
+
);
|
|
14
|
+
|
|
10
15
|
module.exports = {
|
|
11
16
|
resolver: {
|
|
12
17
|
blockList: exclusionList([
|
|
@@ -14,7 +19,9 @@ module.exports = {
|
|
|
14
19
|
new RegExp(
|
|
15
20
|
`${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
|
|
16
21
|
),
|
|
17
|
-
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip
|
|
22
|
+
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
|
|
23
|
+
new RegExp(`${rnwPath}/build/.*`),
|
|
24
|
+
new RegExp(`${rnwPath}/target/.*`),
|
|
18
25
|
/.*\.ProjectImports\.zip/,
|
|
19
26
|
]),
|
|
20
27
|
},
|
|
@@ -34,7 +34,9 @@ module.exports = {
|
|
|
34
34
|
new RegExp(
|
|
35
35
|
`${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
|
|
36
36
|
),
|
|
37
|
-
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip
|
|
37
|
+
// This prevents "react-native run-windows" from hitting: EBUSY: resource busy or locked, open msbuild.ProjectImports.zip or other files produced by msbuild
|
|
38
|
+
new RegExp(`${rnwPath}/build/.*`),
|
|
39
|
+
new RegExp(`${rnwPath}/target/.*`),
|
|
38
40
|
/.*\.ProjectImports\.zip/,
|
|
39
41
|
]),
|
|
40
42
|
},
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
#pragma once
|
|
4
|
-
|
|
5
|
-
#include <exception>
|
|
6
|
-
#include <stdexcept>
|
|
7
|
-
|
|
8
|
-
#include <ChakraDebugProtocolHandler.h>
|
|
9
|
-
#include <ChakraDebugService.h>
|
|
10
|
-
|
|
11
|
-
class DebugProtocolHandler {
|
|
12
|
-
private:
|
|
13
|
-
JsDebugProtocolHandler m_protocolHandler{nullptr};
|
|
14
|
-
|
|
15
|
-
public:
|
|
16
|
-
DebugProtocolHandler(JsRuntimeHandle runtime) {
|
|
17
|
-
JsDebugProtocolHandler protocolHandler;
|
|
18
|
-
|
|
19
|
-
JsErrorCode result = JsDebugProtocolHandlerCreate(runtime, &protocolHandler);
|
|
20
|
-
|
|
21
|
-
if (result != JsNoError) {
|
|
22
|
-
throw new std::runtime_error("Unable to create debug protocol handler.");
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
m_protocolHandler = protocolHandler;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
~DebugProtocolHandler() {
|
|
29
|
-
Destroy();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
JsErrorCode Connect(bool breakOnNextLine, JsDebugProtocolHandlerSendResponseCallback callback, void *callbackState) {
|
|
33
|
-
JsErrorCode result = JsDebugProtocolHandlerConnect(m_protocolHandler, breakOnNextLine, callback, callbackState);
|
|
34
|
-
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
JsErrorCode Destroy() {
|
|
39
|
-
JsErrorCode result = JsNoError;
|
|
40
|
-
|
|
41
|
-
if (m_protocolHandler != nullptr) {
|
|
42
|
-
result = JsDebugProtocolHandlerDestroy(m_protocolHandler);
|
|
43
|
-
|
|
44
|
-
if (result == JsNoError) {
|
|
45
|
-
m_protocolHandler = nullptr;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
JsErrorCode Disconnect() {
|
|
53
|
-
JsErrorCode result = JsDebugProtocolHandlerDisconnect(m_protocolHandler);
|
|
54
|
-
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
JsDebugProtocolHandler GetHandle() {
|
|
59
|
-
return m_protocolHandler;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
JsErrorCode ProcessCommandQueue() {
|
|
63
|
-
JsErrorCode result = JsDebugProtocolHandlerProcessCommandQueue(m_protocolHandler);
|
|
64
|
-
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
JsErrorCode SetCommandQueueCallback(JsDebugProtocolHandlerCommandQueueCallback callback, void *callbackState) {
|
|
69
|
-
JsErrorCode result = JsDebugProtocolHandlerSetCommandQueueCallback(m_protocolHandler, callback, callbackState);
|
|
70
|
-
|
|
71
|
-
return result;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
JsErrorCode WaitForDebugger() {
|
|
75
|
-
JsErrorCode result = JsDebugProtocolHandlerWaitForDebugger(m_protocolHandler);
|
|
76
|
-
|
|
77
|
-
return result;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
JsErrorCode GetConsoleObject(JsValueRef *consoleObject) {
|
|
81
|
-
JsErrorCode result = JsDebugProtocolHandlerCreateConsoleObject(m_protocolHandler, consoleObject);
|
|
82
|
-
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
class DebugService {
|
|
88
|
-
private:
|
|
89
|
-
JsDebugService m_service{nullptr};
|
|
90
|
-
|
|
91
|
-
public:
|
|
92
|
-
DebugService(JsRuntimeHandle runtime) {
|
|
93
|
-
JsDebugService service;
|
|
94
|
-
|
|
95
|
-
JsErrorCode result = JsDebugServiceCreate(&service);
|
|
96
|
-
|
|
97
|
-
if (result != JsNoError) {
|
|
98
|
-
throw new std::exception("Unable to create debug service.");
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
m_service = service;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
~DebugService() {
|
|
105
|
-
Destroy();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
JsErrorCode Close() {
|
|
109
|
-
JsErrorCode result = JsDebugServiceClose(m_service);
|
|
110
|
-
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
JsErrorCode Destroy() {
|
|
115
|
-
JsErrorCode result = JsNoError;
|
|
116
|
-
|
|
117
|
-
if (m_service != nullptr) {
|
|
118
|
-
result = JsDebugServiceDestroy(m_service);
|
|
119
|
-
|
|
120
|
-
if (result == JsNoError) {
|
|
121
|
-
m_service = nullptr;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
JsErrorCode Listen(uint16_t port) {
|
|
129
|
-
JsErrorCode result = JsDebugServiceListen(m_service, port);
|
|
130
|
-
|
|
131
|
-
return result;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
JsErrorCode
|
|
135
|
-
RegisterHandler(std::string const &runtimeName, DebugProtocolHandler &protocolHandler, bool breakOnNextLine) {
|
|
136
|
-
JsErrorCode result =
|
|
137
|
-
JsDebugServiceRegisterHandler(m_service, runtimeName.c_str(), protocolHandler.GetHandle(), breakOnNextLine);
|
|
138
|
-
|
|
139
|
-
return result;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
JsErrorCode UnregisterHandler(std::string const &runtimeName) {
|
|
143
|
-
JsErrorCode result = JsDebugServiceUnregisterHandler(m_service, runtimeName.c_str());
|
|
144
|
-
|
|
145
|
-
return result;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
|
|
3
|
-
<!--
|
|
4
|
-
Sample usage:
|
|
5
|
-
|
|
6
|
-
nuget pack Microsoft.ChakraCore.ARM64.nuspec `
|
|
7
|
-
-Properties "id=ReactWindows.ChakraCore.ARM64;targetRoot=D:\chakra;repoUrl=https://github.com/microsoft/ChakraCore;repoBranch=master;repoCommit=$(git rev-parse HEAD)" `
|
|
8
|
-
-Version 1.11.20.0
|
|
9
|
-
-->
|
|
10
|
-
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
|
11
|
-
<metadata>
|
|
12
|
-
<!-- i.e.: Microsoft.ChakraCore.vc140.ARM64 -->
|
|
13
|
-
<id>$id$</id>
|
|
14
|
-
<version>$version$</version>
|
|
15
|
-
<authors>Microsoft</authors>
|
|
16
|
-
<owners>Chakra Team</owners>
|
|
17
|
-
<licenseUrl>https://github.com/Microsoft/ChakraCore/blob/master/LICENSE.txt</licenseUrl>
|
|
18
|
-
<projectUrl>https://github.com/Microsoft/ChakraCore</projectUrl>
|
|
19
|
-
<repository type="git" url="$repoUrl$" branch="$repoBranch$" commit="$repoCommit$" />
|
|
20
|
-
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
|
21
|
-
<developmentDependency>true</developmentDependency>
|
|
22
|
-
<description>ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge.</description>
|
|
23
|
-
<releaseNotes>https://github.com/Microsoft/ChakraCore/wiki/Roadmap#release-notes</releaseNotes>
|
|
24
|
-
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
|
25
|
-
<language>en-US</language>
|
|
26
|
-
<tags>Chakra,ChakraCore,javascript,js,ecmascript,compiler,platform,oss,opensource,native,nativepackage,C++,vc140</tags>
|
|
27
|
-
<dependencies>
|
|
28
|
-
<group targetFramework="native" />
|
|
29
|
-
</dependencies>
|
|
30
|
-
</metadata>
|
|
31
|
-
<files>
|
|
32
|
-
<!--Build-->
|
|
33
|
-
<file src="Microsoft.ChakraCore.ARM64.targets" target="build\native\$id$.targets"/>
|
|
34
|
-
|
|
35
|
-
<!--Lib-->
|
|
36
|
-
<file src="$targetroot$\arm64_release\ChakraCore.dll" target="lib\native\v140\arm64\release\ChakraCore.dll" />
|
|
37
|
-
<file src="$targetroot$\arm64_release\ChakraCore.lib" target="lib\native\v140\arm64\release\ChakraCore.lib" />
|
|
38
|
-
<file src="$targetroot$\arm64_release\ChakraCore.pdb" target="lib\native\v140\arm64\release\ChakraCore.pdb" />
|
|
39
|
-
<file src="$targetroot$\arm64_release\ch.exe" target="lib\native\v140\arm64\release\ch.exe" />
|
|
40
|
-
<file src="$targetroot$\arm64_release\ch.pdb" target="lib\native\v140\arm64\release\ch.pdb" />
|
|
41
|
-
|
|
42
|
-
<!--Copying Release to Debug for now-->
|
|
43
|
-
<file src="$targetroot$\arm64_release\ChakraCore.dll" target="lib\native\v140\arm64\debug\ChakraCore.dll" />
|
|
44
|
-
<file src="$targetroot$\arm64_release\ChakraCore.lib" target="lib\native\v140\arm64\debug\ChakraCore.lib" />
|
|
45
|
-
<file src="$targetroot$\arm64_release\ChakraCore.pdb" target="lib\native\v140\arm64\debug\ChakraCore.pdb" />
|
|
46
|
-
<file src="$targetroot$\arm64_release\ch.exe" target="lib\native\v140\arm64\debug\ch.exe" />
|
|
47
|
-
<file src="$targetroot$\arm64_release\ch.pdb" target="lib\native\v140\arm64\debug\ch.pdb" />
|
|
48
|
-
|
|
49
|
-
</files>
|
|
50
|
-
</package>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<Project ToolVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3
|
-
<ItemDefinitionGroup>
|
|
4
|
-
<Link>
|
|
5
|
-
<AdditionalDependencies>$(MSBuildThisFileDirectory)..\..\lib\native\v140\$(Platform)\$(Configuration)\ChakraCore.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
6
|
-
</Link>
|
|
7
|
-
<!-- <ClCompile>
|
|
8
|
-
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
9
|
-
</ClCompile> -->
|
|
10
|
-
</ItemDefinitionGroup>
|
|
11
|
-
<ItemGroup>
|
|
12
|
-
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\native\v140\$(Platform)\$(Configuration)\ChakraCore.dll" />
|
|
13
|
-
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\lib\native\v140\$(Platform)\$(Configuration)\ChakraCore.pdb" />
|
|
14
|
-
</ItemGroup>
|
|
15
|
-
</Project>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
#pragma once
|
|
5
|
-
|
|
6
|
-
#include "ChakraRuntime.h"
|
|
7
|
-
|
|
8
|
-
#include "ChakraCore.h"
|
|
9
|
-
#include "ChakraCoreDebugger.h"
|
|
10
|
-
|
|
11
|
-
namespace Microsoft::JSI {
|
|
12
|
-
|
|
13
|
-
class ChakraCoreRuntime : public ChakraRuntime {
|
|
14
|
-
public:
|
|
15
|
-
ChakraCoreRuntime(ChakraRuntimeArgs &&args) noexcept;
|
|
16
|
-
|
|
17
|
-
~ChakraCoreRuntime() noexcept;
|
|
18
|
-
|
|
19
|
-
#pragma region ChakraRuntime
|
|
20
|
-
|
|
21
|
-
void setupNativePromiseContinuation() noexcept override;
|
|
22
|
-
|
|
23
|
-
void startDebuggingIfNeeded() override;
|
|
24
|
-
|
|
25
|
-
void stopDebuggingIfNeeded() override;
|
|
26
|
-
|
|
27
|
-
std::unique_ptr<const facebook::jsi::Buffer> generatePreparedScript(
|
|
28
|
-
const std::string &sourceURL,
|
|
29
|
-
const facebook::jsi::Buffer &sourceBuffer) noexcept override;
|
|
30
|
-
|
|
31
|
-
facebook::jsi::Value evaluateJavaScriptSimple(const facebook::jsi::Buffer &buffer, const std::string &sourceURL)
|
|
32
|
-
override;
|
|
33
|
-
|
|
34
|
-
bool evaluateSerializedScript(
|
|
35
|
-
const facebook::jsi::Buffer &scriptBuffer,
|
|
36
|
-
const facebook::jsi::Buffer &serializedScriptBuffer,
|
|
37
|
-
const std::string &sourceURL,
|
|
38
|
-
JsValueRef *result) override;
|
|
39
|
-
|
|
40
|
-
#pragma endregion
|
|
41
|
-
|
|
42
|
-
private:
|
|
43
|
-
JsErrorCode enableDebugging(
|
|
44
|
-
JsRuntimeHandle runtime,
|
|
45
|
-
std::string const &runtimeName,
|
|
46
|
-
bool breakOnNextLine,
|
|
47
|
-
uint16_t port,
|
|
48
|
-
std::unique_ptr<DebugProtocolHandler> &debugProtocolHandler,
|
|
49
|
-
std::unique_ptr<DebugService> &debugService);
|
|
50
|
-
|
|
51
|
-
void ProcessDebuggerCommandQueue();
|
|
52
|
-
|
|
53
|
-
static void CALLBACK ProcessDebuggerCommandQueueCallback(void *callbackState);
|
|
54
|
-
|
|
55
|
-
std::unique_ptr<DebugProtocolHandler> m_debugProtocolHandler;
|
|
56
|
-
std::unique_ptr<DebugService> m_debugService;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
} // namespace Microsoft::JSI
|