react-native-macos 0.72.4 → 0.72.6
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 +11 -0
- package/React/CxxBridge/JSCExecutorFactory.mm +17 -2
- package/React/Views/RCTView.m +14 -9
- 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 +29 -1
- 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,23 @@ 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
|
+
bool enableDebugger_ = true;
|
|
35
|
+
std::string debuggerName_ = "JSC React Native";
|
|
36
|
+
// macOS]
|
|
26
37
|
};
|
|
27
38
|
|
|
28
39
|
} // 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
|
package/React/Views/RCTView.m
CHANGED
|
@@ -1491,16 +1491,21 @@ setBorderColor() setBorderColor(Top) setBorderColor(Right) setBorderColor(Bottom
|
|
|
1491
1491
|
|
|
1492
1492
|
- (void)updateTrackingAreas
|
|
1493
1493
|
{
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1494
|
+
BOOL hasMouseHoverEvent = self.onMouseEnter || self.onMouseLeave;
|
|
1495
|
+
BOOL wouldRecreateIdenticalTrackingArea = hasMouseHoverEvent && _trackingArea && NSEqualRects(self.bounds, [_trackingArea rect]);
|
|
1496
|
+
|
|
1497
|
+
if (!wouldRecreateIdenticalTrackingArea) {
|
|
1498
|
+
if (_trackingArea) {
|
|
1499
|
+
[self removeTrackingArea:_trackingArea];
|
|
1500
|
+
}
|
|
1497
1501
|
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1502
|
+
if (hasMouseHoverEvent) {
|
|
1503
|
+
_trackingArea = [[NSTrackingArea alloc] initWithRect:self.bounds
|
|
1504
|
+
options:NSTrackingActiveAlways|NSTrackingMouseEnteredAndExited
|
|
1505
|
+
owner:self
|
|
1506
|
+
userInfo:nil];
|
|
1507
|
+
[self addTrackingArea:_trackingArea];
|
|
1508
|
+
}
|
|
1504
1509
|
}
|
|
1505
1510
|
|
|
1506
1511
|
[super updateTrackingAreas];
|
|
@@ -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();
|
|
@@ -293,7 +297,7 @@ class JSCRuntime : public jsi::Runtime {
|
|
|
293
297
|
} \
|
|
294
298
|
} while (0)
|
|
295
299
|
|
|
296
|
-
#if defined(
|
|
300
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) // [macOS]
|
|
297
301
|
// This takes care of watch and tvos (due to backwards compatibility in
|
|
298
302
|
// Availability.h
|
|
299
303
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0
|
|
@@ -316,6 +320,11 @@ class JSCRuntime : public jsi::Runtime {
|
|
|
316
320
|
#if __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_12
|
|
317
321
|
#define _JSC_NO_ARRAY_BUFFERS
|
|
318
322
|
#endif
|
|
323
|
+
// [macOS
|
|
324
|
+
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 130300
|
|
325
|
+
#define _JSC_HAS_INSPECTABLE
|
|
326
|
+
#endif
|
|
327
|
+
// macOS]
|
|
319
328
|
#endif
|
|
320
329
|
|
|
321
330
|
// JSStringRef utilities
|
|
@@ -392,6 +401,19 @@ JSCRuntime::JSCRuntime()
|
|
|
392
401
|
JSGlobalContextRelease(ctx_);
|
|
393
402
|
}
|
|
394
403
|
|
|
404
|
+
// [macOS
|
|
405
|
+
JSCRuntime::JSCRuntime(const facebook::jsc::RuntimeConfig& rc)
|
|
406
|
+
: JSCRuntime() {
|
|
407
|
+
#ifdef _JSC_HAS_INSPECTABLE
|
|
408
|
+
if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) {
|
|
409
|
+
JSGlobalContextSetInspectable(ctx_, rc.enableDebugger);
|
|
410
|
+
}
|
|
411
|
+
#endif
|
|
412
|
+
JSGlobalContextSetName(ctx_, JSStringCreateWithUTF8CString(rc.debuggerName.c_str()));
|
|
413
|
+
|
|
414
|
+
}
|
|
415
|
+
// macOS]
|
|
416
|
+
|
|
395
417
|
JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
|
|
396
418
|
: ctx_(JSGlobalContextRetain(ctx)),
|
|
397
419
|
ctxInvalid_(false)
|
|
@@ -1567,5 +1589,11 @@ std::unique_ptr<jsi::Runtime> makeJSCRuntime() {
|
|
|
1567
1589
|
return std::make_unique<JSCRuntime>();
|
|
1568
1590
|
}
|
|
1569
1591
|
|
|
1592
|
+
// [macOS
|
|
1593
|
+
std::unique_ptr<jsi::Runtime> makeJSCRuntime(const facebook::jsc::RuntimeConfig& rc) {
|
|
1594
|
+
return std::make_unique<JSCRuntime>(rc);
|
|
1595
|
+
}
|
|
1596
|
+
// macOS]
|
|
1597
|
+
|
|
1570
1598
|
} // namespace jsc
|
|
1571
1599
|
} // 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