react-native-macos 0.71.34 → 0.71.35

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.
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 71,
15
- patch: 34,
15
+ patch: 35,
16
16
  prerelease: null,
17
17
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(71),
26
- RCTVersionPatch: @(34),
26
+ RCTVersionPatch: @(35),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -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
- return std::make_unique<JSIExecutor>(
22
- facebook::jsc::makeJSCRuntime(), delegate, JSIExecutor::defaultTimeoutInvoker, runtimeInstaller_);
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
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.71.34
1
+ VERSION_NAME=0.71.35
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  # JVM Versions
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 71,
20
- "patch", 34,
20
+ "patch", 35,
21
21
  "prerelease", null);
22
22
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 71;
20
- int32_t Patch = 34;
20
+ int32_t Patch = 35;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.71.34",
3
+ "version": "0.71.35",
4
4
  "bin": "./cli.js",
5
5
  "description": "React Native for macOS",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "react": "18.2.0",
15
- "react-native-macos": "0.71.34"
15
+ "react-native-macos": "0.71.35"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@babel/core": "^7.20.0",