react-native-macos 0.71.34 → 0.71.36
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/React/Base/RCTVersion.m +1 -1
- package/React/CxxBridge/JSCExecutorFactory.h +15 -0
- package/React/CxxBridge/JSCExecutorFactory.mm +17 -2
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/jsc/JSCRuntime.cpp +28 -0
- package/ReactCommon/jsc/JSCRuntime.h +9 -0
- package/package.json +1 -1
- package/template/package.json +1 -1
package/React/Base/RCTVersion.m
CHANGED
|
@@ -17,12 +17,27 @@ class JSCExecutorFactory : public JSExecutorFactory {
|
|
|
17
17
|
explicit JSCExecutorFactory(JSIExecutor::RuntimeInstaller runtimeInstaller)
|
|
18
18
|
: runtimeInstaller_(std::move(runtimeInstaller)) {}
|
|
19
19
|
|
|
20
|
+
// [macOS
|
|
21
|
+
void setEnableDebugger(bool enableDebugger);
|
|
22
|
+
|
|
23
|
+
void setDebuggerName(const std::string &debuggerName);
|
|
24
|
+
// macOS]
|
|
25
|
+
|
|
20
26
|
std::unique_ptr<JSExecutor> createJSExecutor(
|
|
21
27
|
std::shared_ptr<ExecutorDelegate> delegate,
|
|
22
28
|
std::shared_ptr<MessageQueueThread> jsQueue) override;
|
|
23
29
|
|
|
24
30
|
private:
|
|
25
31
|
JSIExecutor::RuntimeInstaller runtimeInstaller_;
|
|
32
|
+
|
|
33
|
+
// [macOS
|
|
34
|
+
#if DEBUG
|
|
35
|
+
bool enableDebugger_ = true;
|
|
36
|
+
#else
|
|
37
|
+
bool enableDebugger_ = false;
|
|
38
|
+
#endif
|
|
39
|
+
std::string debuggerName_ = "JSC React Native";
|
|
40
|
+
// macOS]
|
|
26
41
|
};
|
|
27
42
|
|
|
28
43
|
} // namespace react
|
|
@@ -14,12 +14,27 @@
|
|
|
14
14
|
namespace facebook {
|
|
15
15
|
namespace react {
|
|
16
16
|
|
|
17
|
+
// [macOS
|
|
18
|
+
void JSCExecutorFactory::setEnableDebugger(bool enableDebugger) {
|
|
19
|
+
enableDebugger_ = enableDebugger;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
void JSCExecutorFactory::setDebuggerName(const std::string &debuggerName) {
|
|
23
|
+
debuggerName_ = debuggerName;
|
|
24
|
+
}
|
|
25
|
+
// macOS]
|
|
26
|
+
|
|
17
27
|
std::unique_ptr<JSExecutor> JSCExecutorFactory::createJSExecutor(
|
|
18
28
|
std::shared_ptr<ExecutorDelegate> delegate,
|
|
19
29
|
std::shared_ptr<MessageQueueThread> __unused jsQueue)
|
|
20
30
|
{
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
// [macOS
|
|
32
|
+
facebook::jsc::RuntimeConfig rc = {
|
|
33
|
+
.enableDebugger = enableDebugger_,
|
|
34
|
+
.debuggerName = debuggerName_,
|
|
35
|
+
};
|
|
36
|
+
return std::make_unique<JSIExecutor>(facebook::jsc::makeJSCRuntime(std::move(rc)), delegate, JSIExecutor::defaultTimeoutInvoker, runtimeInstaller_);
|
|
37
|
+
// macOS]
|
|
23
38
|
}
|
|
24
39
|
|
|
25
40
|
} // namespace react
|
|
@@ -36,6 +36,10 @@ class JSCRuntime : public jsi::Runtime {
|
|
|
36
36
|
public:
|
|
37
37
|
// Creates new context in new context group
|
|
38
38
|
JSCRuntime();
|
|
39
|
+
// [macOS
|
|
40
|
+
// Creates new context in new context group with config
|
|
41
|
+
JSCRuntime(const facebook::jsc::RuntimeConfig& rc);
|
|
42
|
+
// macOS]
|
|
39
43
|
// Retains ctx
|
|
40
44
|
JSCRuntime(JSGlobalContextRef ctx);
|
|
41
45
|
~JSCRuntime();
|
|
@@ -314,6 +318,11 @@ class JSCRuntime : public jsi::Runtime {
|
|
|
314
318
|
#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_12
|
|
315
319
|
#define _JSC_NO_ARRAY_BUFFERS
|
|
316
320
|
#endif
|
|
321
|
+
// [macOS
|
|
322
|
+
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130300
|
|
323
|
+
#define _JSC_HAS_INSPECTABLE
|
|
324
|
+
#endif
|
|
325
|
+
// macOS]
|
|
317
326
|
#endif
|
|
318
327
|
|
|
319
328
|
// JSStringRef utilities
|
|
@@ -390,6 +399,19 @@ JSCRuntime::JSCRuntime()
|
|
|
390
399
|
JSGlobalContextRelease(ctx_);
|
|
391
400
|
}
|
|
392
401
|
|
|
402
|
+
// [macOS
|
|
403
|
+
JSCRuntime::JSCRuntime(const facebook::jsc::RuntimeConfig& rc)
|
|
404
|
+
: JSCRuntime() {
|
|
405
|
+
#ifdef _JSC_HAS_INSPECTABLE
|
|
406
|
+
if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) {
|
|
407
|
+
JSGlobalContextSetInspectable(ctx_, rc.enableDebugger);
|
|
408
|
+
}
|
|
409
|
+
#endif
|
|
410
|
+
JSGlobalContextSetName(ctx_, JSStringCreateWithUTF8CString(rc.debuggerName.c_str()));
|
|
411
|
+
|
|
412
|
+
}
|
|
413
|
+
// macOS]
|
|
414
|
+
|
|
393
415
|
JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
|
|
394
416
|
: ctx_(JSGlobalContextRetain(ctx)),
|
|
395
417
|
ctxInvalid_(false)
|
|
@@ -1565,5 +1587,11 @@ std::unique_ptr<jsi::Runtime> makeJSCRuntime() {
|
|
|
1565
1587
|
return std::make_unique<JSCRuntime>();
|
|
1566
1588
|
}
|
|
1567
1589
|
|
|
1590
|
+
// [macOS
|
|
1591
|
+
std::unique_ptr<jsi::Runtime> makeJSCRuntime(const facebook::jsc::RuntimeConfig& rc) {
|
|
1592
|
+
return std::make_unique<JSCRuntime>(rc);
|
|
1593
|
+
}
|
|
1594
|
+
// macOS]
|
|
1595
|
+
|
|
1568
1596
|
} // namespace jsc
|
|
1569
1597
|
} // namespace facebook
|
|
@@ -13,7 +13,16 @@
|
|
|
13
13
|
namespace facebook {
|
|
14
14
|
namespace jsc {
|
|
15
15
|
|
|
16
|
+
// [macOS
|
|
17
|
+
struct RuntimeConfig {
|
|
18
|
+
bool enableDebugger;
|
|
19
|
+
std::string debuggerName;
|
|
20
|
+
};
|
|
21
|
+
// macOS]
|
|
22
|
+
|
|
16
23
|
std::unique_ptr<jsi::Runtime> makeJSCRuntime();
|
|
17
24
|
|
|
25
|
+
std::unique_ptr<jsi::Runtime> makeJSCRuntime(const facebook::jsc::RuntimeConfig& rc); // [macOS]
|
|
26
|
+
|
|
18
27
|
} // namespace jsc
|
|
19
28
|
} // namespace facebook
|
package/package.json
CHANGED