react-native-tvos 0.76.6-0 → 0.76.9-0

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.
Files changed (84) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -5
  2. package/Libraries/AppDelegate/RCTAppSetupUtils.mm +3 -1
  3. package/Libraries/AppDelegate/RCTRootViewFactory.mm +3 -3
  4. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
  5. package/Libraries/Blob/React-RCTBlob.podspec +3 -1
  6. package/Libraries/Components/TV/TVFocusGuideView.js +0 -1
  7. package/Libraries/Components/View/ViewPropTypes.d.ts +4 -2
  8. package/Libraries/Core/ReactNativeVersion.js +1 -1
  9. package/Libraries/Image/RCTImageLoader.mm +9 -1
  10. package/Libraries/Network/FormData.js +11 -3
  11. package/Libraries/Network/RCTDataRequestHandler.mm +17 -3
  12. package/Libraries/Network/RCTFileRequestHandler.mm +17 -3
  13. package/Libraries/Utilities/Appearance.js +3 -1
  14. package/React/Base/RCTVersion.m +1 -1
  15. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +2 -5
  16. package/React/CoreModules/React-CoreModules.podspec +9 -10
  17. package/React/CxxModule/RCTCxxMethod.mm +10 -2
  18. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +85 -31
  19. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -7
  20. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +5 -2
  21. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -0
  22. package/React/React-RCTFabric.podspec +1 -0
  23. package/React/Views/RCTTVView.m +5 -2
  24. package/React/Views/ScrollView/RCTScrollView.m +63 -26
  25. package/React/third-party.xcconfig +1 -1
  26. package/React-Core.podspec +2 -1
  27. package/ReactAndroid/api/ReactAndroid.api +3 -1
  28. package/ReactAndroid/build.gradle.kts +24 -0
  29. package/ReactAndroid/gradle.properties +2 -2
  30. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +3 -1
  31. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/HMRClient.java +4 -1
  32. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +13 -8
  33. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java +15 -8
  34. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  35. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +16 -2
  36. package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -0
  37. package/ReactAndroid/src/main/jni/third-party/fast_float/CMakeLists.txt +13 -0
  38. package/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +5 -6
  39. package/ReactCommon/React-Fabric.podspec +2 -1
  40. package/ReactCommon/React-FabricComponents.podspec +3 -1
  41. package/ReactCommon/React-FabricImage.podspec +7 -5
  42. package/ReactCommon/ReactCommon.podspec +9 -8
  43. package/ReactCommon/cxxreact/CxxNativeModule.cpp +6 -3
  44. package/ReactCommon/cxxreact/React-cxxreact.podspec +11 -10
  45. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  46. package/ReactCommon/hermes/React-hermes.podspec +7 -6
  47. package/ReactCommon/jsi/React-jsi.podspec +4 -3
  48. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +7 -6
  49. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +4 -4
  50. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  51. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +9 -0
  52. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +24 -13
  53. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +3 -1
  54. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +5 -0
  55. package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +2 -0
  56. package/ReactCommon/react/renderer/attributedstring/conversions.h +5 -0
  57. package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +12 -0
  58. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +4 -2
  59. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -2
  60. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -0
  61. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +24 -3
  62. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +6 -46
  63. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +4 -5
  64. package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -0
  65. package/cli.js +11 -2
  66. package/gradle/libs.versions.toml +4 -3
  67. package/package.json +8 -8
  68. package/react-native.config.js +24 -23
  69. package/scripts/cocoapods/codegen_utils.rb +1 -2
  70. package/scripts/cocoapods/helpers.rb +13 -1
  71. package/scripts/cocoapods/new_architecture.rb +1 -0
  72. package/scripts/cocoapods/utils.rb +2 -0
  73. package/scripts/react_native_pods.rb +14 -0
  74. package/sdks/hermes-engine/hermes-utils.rb +3 -1
  75. package/sdks/hermesc/linux64-bin/hermesc +0 -0
  76. package/sdks/hermesc/osx-bin/hermes +0 -0
  77. package/sdks/hermesc/osx-bin/hermesc +0 -0
  78. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  79. package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
  80. package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
  81. package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
  82. package/third-party-podspecs/RCT-Folly.podspec +19 -11
  83. package/third-party-podspecs/fast_float.podspec +29 -0
  84. package/third-party-podspecs/fmt.podspec +2 -2
@@ -35,24 +35,25 @@ Pod::Spec.new do |s|
35
35
  s.exclude_files = "SampleCxxModule.*"
36
36
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
37
37
  s.pod_target_xcconfig = {
38
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
38
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
39
39
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
40
40
  }
41
41
  s.header_dir = "cxxreact"
42
42
 
43
43
  s.dependency "boost"
44
44
  s.dependency "DoubleConversion"
45
- s.dependency "fmt", "9.1.0"
46
- s.dependency "RCT-Folly", folly_version
45
+ s.dependency "fast_float"
46
+ s.dependency "fmt"
47
+ s.dependency "RCT-Folly"
47
48
  s.dependency "glog"
48
49
  add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
49
- s.dependency "React-callinvoker", version
50
- s.dependency "React-runtimeexecutor", version
51
- s.dependency "React-perflogger", version
52
- s.dependency "React-jsi", version
53
- s.dependency "React-logger", version
54
- s.dependency "React-debug", version
55
- s.dependency "React-timing", version
50
+ s.dependency "React-callinvoker"
51
+ s.dependency "React-runtimeexecutor"
52
+ s.dependency "React-perflogger"
53
+ s.dependency "React-jsi"
54
+ s.dependency "React-logger"
55
+ s.dependency "React-debug"
56
+ s.dependency "React-timing"
56
57
 
57
58
  s.resource_bundles = {'React-cxxreact_privacy' => 'PrivacyInfo.xcprivacy'}
58
59
 
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 76;
20
- int32_t Patch = 6;
20
+ int32_t Patch = 9;
21
21
  std::string_view Prerelease = "0";
22
22
  } ReactNativeVersion;
23
23
 
@@ -36,17 +36,18 @@ Pod::Spec.new do |s|
36
36
  s.public_header_files = "executor/HermesExecutorFactory.h"
37
37
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
38
38
  s.pod_target_xcconfig = {
39
- "HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
39
+ "HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
40
40
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
41
41
  }
42
42
  s.header_dir = "reacthermes"
43
- s.dependency "React-cxxreact", version
44
- s.dependency "React-jsiexecutor", version
43
+ s.dependency "React-cxxreact"
44
+ s.dependency "React-jsiexecutor"
45
45
  add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
46
- s.dependency "React-perflogger", version
47
- s.dependency "RCT-Folly", folly_version
46
+ s.dependency "React-perflogger"
47
+ s.dependency "RCT-Folly"
48
48
  s.dependency "DoubleConversion"
49
- s.dependency "fmt", "9.1.0"
49
+ s.dependency "fast_float"
50
+ s.dependency "fmt"
50
51
  s.dependency "glog"
51
52
  s.dependency "hermes-engine"
52
53
  s.dependency "React-jsi"
@@ -37,13 +37,14 @@ Pod::Spec.new do |s|
37
37
 
38
38
  s.header_dir = "jsi"
39
39
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
40
- s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
40
+ s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
41
41
  "DEFINES_MODULE" => "YES" }
42
42
 
43
43
  s.dependency "boost"
44
44
  s.dependency "DoubleConversion"
45
- s.dependency "fmt", "9.1.0"
46
- s.dependency "RCT-Folly", folly_version
45
+ s.dependency "fast_float"
46
+ s.dependency "fmt"
47
+ s.dependency "RCT-Folly"
47
48
  s.dependency "glog"
48
49
 
49
50
  s.source_files = "**/*.{cpp,h}"
@@ -32,16 +32,17 @@ Pod::Spec.new do |s|
32
32
  s.source = source
33
33
  s.source_files = "jsireact/*.{cpp,h}"
34
34
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
35
- s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
35
+ s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
36
36
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
37
37
  s.header_dir = "jsireact"
38
38
 
39
- s.dependency "React-cxxreact", version
40
- s.dependency "React-jsi", version
41
- s.dependency "React-perflogger", version
42
- s.dependency "RCT-Folly", folly_version
39
+ s.dependency "React-cxxreact"
40
+ s.dependency "React-jsi"
41
+ s.dependency "React-perflogger"
42
+ s.dependency "RCT-Folly"
43
43
  s.dependency "DoubleConversion"
44
- s.dependency "fmt", "9.1.0"
44
+ s.dependency "fast_float"
45
+ s.dependency "fmt"
45
46
  s.dependency "glog"
46
47
  add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
47
48
 
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  s.header_dir = 'jsinspector-modern'
38
38
  s.compiler_flags = folly_compiler_flags
39
39
  s.pod_target_xcconfig = {
40
- "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
40
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
41
41
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
42
42
  "DEFINES_MODULE" => "YES"
43
43
  }.merge!(use_frameworks ? {
@@ -49,12 +49,12 @@ Pod::Spec.new do |s|
49
49
  end
50
50
 
51
51
  s.dependency "glog"
52
- s.dependency "RCT-Folly", folly_version
52
+ s.dependency "RCT-Folly"
53
53
  s.dependency "React-featureflags"
54
54
  s.dependency "DoubleConversion"
55
- s.dependency "React-runtimeexecutor", version
55
+ s.dependency "React-runtimeexecutor"
56
56
  s.dependency "React-jsi"
57
- s.dependency "React-perflogger", version
57
+ s.dependency "React-perflogger"
58
58
  if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
59
59
  s.dependency "hermes-engine"
60
60
  end
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
34
34
  s.platforms = min_supported_versions
35
35
  s.source = source
36
36
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
37
- s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
37
+ s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
38
38
  "USE_HEADERMAP" => "YES",
39
39
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
40
40
  "GCC_WARN_PEDANTIC" => "YES" }
@@ -123,6 +123,15 @@ std::vector<ExportedMethod> parseExportedMethods(std::string moduleName, Class m
123
123
  NSArray<RCTMethodArgument *> *arguments;
124
124
  SEL objCMethodSelector = NSSelectorFromString(RCTParseMethodSignature(methodInfo->objcName, &arguments));
125
125
  NSMethodSignature *objCMethodSignature = [moduleClass instanceMethodSignatureForSelector:objCMethodSelector];
126
+ if (objCMethodSignature == nullptr) {
127
+ RCTLogWarn(
128
+ @"The objective-c `%s` method signature for the JS method `%@` can not be found in the ObjecitveC definition of the %s module.\nThe `%@` JS method will not be available.",
129
+ methodInfo->objcName,
130
+ jsMethodName,
131
+ moduleName.c_str(),
132
+ jsMethodName);
133
+ continue;
134
+ }
126
135
  std::string objCMethodReturnType = [objCMethodSignature methodReturnType];
127
136
 
128
137
  if (objCMethodSignature.numberOfArguments - 2 != [arguments count]) {
@@ -57,7 +57,7 @@ static jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *va
57
57
 
58
58
  static jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value)
59
59
  {
60
- return jsi::String::createFromUtf8(runtime, [value UTF8String] ?: "");
60
+ return jsi::String::createFromUtf8(runtime, [value UTF8String] ? [value UTF8String] : "");
61
61
  }
62
62
 
63
63
  static jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value)
@@ -195,7 +195,11 @@ static jsi::Value createJSRuntimeError(jsi::Runtime &runtime, const std::string
195
195
  /**
196
196
  * Creates JSError with current JS runtime and NSException stack trace.
197
197
  */
198
- static jsi::JSError convertNSExceptionToJSError(jsi::Runtime &runtime, NSException *exception)
198
+ static jsi::JSError convertNSExceptionToJSError(
199
+ jsi::Runtime &runtime,
200
+ NSException *exception,
201
+ const std::string &moduleName,
202
+ const std::string &methodName)
199
203
  {
200
204
  std::string reason = [exception.reason UTF8String];
201
205
 
@@ -206,7 +210,8 @@ static jsi::JSError convertNSExceptionToJSError(jsi::Runtime &runtime, NSExcepti
206
210
  cause.setProperty(
207
211
  runtime, "stackReturnAddresses", convertNSArrayToJSIArray(runtime, exception.callStackReturnAddresses));
208
212
 
209
- jsi::Value error = createJSRuntimeError(runtime, "Exception in HostFunction: " + reason);
213
+ std::string message = moduleName + "." + methodName + " raised an exception: " + reason;
214
+ jsi::Value error = createJSRuntimeError(runtime, message);
210
215
  error.asObject(runtime).setProperty(runtime, "cause", std::move(cause));
211
216
  return {runtime, std::move(error)};
212
217
  }
@@ -338,28 +343,34 @@ id ObjCTurboModule::performMethodInvocation(
338
343
  }
339
344
 
340
345
  if (isSync) {
341
- TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodNameStr.c_str());
346
+ TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodName);
342
347
  } else {
343
- TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodNameStr.c_str(), asyncCallCounter);
348
+ TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodName, asyncCallCounter);
344
349
  }
345
350
 
346
351
  @try {
347
352
  [inv invokeWithTarget:strongModule];
348
353
  } @catch (NSException *exception) {
349
- throw convertNSExceptionToJSError(runtime, exception);
354
+ if (isSync) {
355
+ // We can only convert NSException to JSError in sync method calls.
356
+ // See https://github.com/reactwg/react-native-new-architecture/discussions/276#discussioncomment-12567155
357
+ throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
358
+ } else {
359
+ @throw exception;
360
+ }
350
361
  } @finally {
351
362
  [retainedObjectsForInvocation removeAllObjects];
352
363
  }
353
364
 
354
365
  if (!isSync) {
355
- TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodNameStr.c_str(), asyncCallCounter);
366
+ TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodName, asyncCallCounter);
356
367
  return;
357
368
  }
358
369
 
359
370
  void *rawResult;
360
371
  [inv getReturnValue:&rawResult];
361
372
  result = (__bridge id)rawResult;
362
- TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodNameStr.c_str());
373
+ TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodName);
363
374
  };
364
375
 
365
376
  if (isSync) {
@@ -401,23 +412,23 @@ void ObjCTurboModule::performVoidMethodInvocation(
401
412
  }
402
413
 
403
414
  if (shouldVoidMethodsExecuteSync_) {
404
- TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodNameStr.c_str());
415
+ TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodName);
405
416
  } else {
406
- TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodNameStr.c_str(), asyncCallCounter);
417
+ TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodName, asyncCallCounter);
407
418
  }
408
419
 
409
420
  @try {
410
421
  [inv invokeWithTarget:strongModule];
411
422
  } @catch (NSException *exception) {
412
- throw convertNSExceptionToJSError(runtime, exception);
423
+ throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
413
424
  } @finally {
414
425
  [retainedObjectsForInvocation removeAllObjects];
415
426
  }
416
427
 
417
428
  if (shouldVoidMethodsExecuteSync_) {
418
- TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodNameStr.c_str());
429
+ TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodName);
419
430
  } else {
420
- TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodNameStr.c_str(), asyncCallCounter);
431
+ TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodName, asyncCallCounter);
421
432
  }
422
433
 
423
434
  return;
@@ -27,6 +27,7 @@ header_search_paths = [
27
27
  "\"$(PODS_ROOT)/boost\"",
28
28
  "\"$(PODS_ROOT)/RCT-Folly\"",
29
29
  "\"$(PODS_ROOT)/DoubleConversion\"",
30
+ "\"$(PODS_ROOT)/fast_float/include\"",
30
31
  "\"$(PODS_ROOT)/fmt/include\"",
31
32
  "\"$(PODS_ROOT)/Headers/Private/React-Core\"",
32
33
  ]
@@ -62,7 +63,8 @@ Pod::Spec.new do |s|
62
63
 
63
64
  s.dependency "RCT-Folly"
64
65
  s.dependency "DoubleConversion"
65
- s.dependency "fmt", "9.1.0"
66
+ s.dependency "fast_float"
67
+ s.dependency "fmt"
66
68
  s.dependency "React-Core"
67
69
  s.dependency "React-cxxreact"
68
70
  s.dependency "React-jsi"
@@ -46,6 +46,9 @@ void TextAttributes::apply(TextAttributes textAttributes) {
46
46
  allowFontScaling = textAttributes.allowFontScaling.has_value()
47
47
  ? textAttributes.allowFontScaling
48
48
  : allowFontScaling;
49
+ maxFontSizeMultiplier = !std::isnan(textAttributes.maxFontSizeMultiplier)
50
+ ? textAttributes.maxFontSizeMultiplier
51
+ : maxFontSizeMultiplier;
49
52
  dynamicTypeRamp = textAttributes.dynamicTypeRamp.has_value()
50
53
  ? textAttributes.dynamicTypeRamp
51
54
  : dynamicTypeRamp;
@@ -168,6 +171,7 @@ bool TextAttributes::operator==(const TextAttributes& rhs) const {
168
171
  rhs.accessibilityRole,
169
172
  rhs.role,
170
173
  rhs.textTransform) &&
174
+ floatEquality(maxFontSizeMultiplier, rhs.maxFontSizeMultiplier) &&
171
175
  floatEquality(opacity, rhs.opacity) &&
172
176
  floatEquality(fontSize, rhs.fontSize) &&
173
177
  floatEquality(fontSizeMultiplier, rhs.fontSizeMultiplier) &&
@@ -213,6 +217,7 @@ SharedDebugStringConvertibleList TextAttributes::getDebugProps() const {
213
217
  debugStringConvertibleItem("allowFontScaling", allowFontScaling),
214
218
  debugStringConvertibleItem("dynamicTypeRamp", dynamicTypeRamp),
215
219
  debugStringConvertibleItem("letterSpacing", letterSpacing),
220
+ debugStringConvertibleItem("maxFontSizeMultiplier", maxFontSizeMultiplier),
216
221
 
217
222
  // Paragraph Styles
218
223
  debugStringConvertibleItem("lineHeight", lineHeight),
@@ -51,6 +51,7 @@ class TextAttributes : public DebugStringConvertible {
51
51
  std::optional<FontStyle> fontStyle{};
52
52
  std::optional<FontVariant> fontVariant{};
53
53
  std::optional<bool> allowFontScaling{};
54
+ Float maxFontSizeMultiplier{std::numeric_limits<Float>::quiet_NaN()};
54
55
  std::optional<DynamicTypeRamp> dynamicTypeRamp{};
55
56
  Float letterSpacing{std::numeric_limits<Float>::quiet_NaN()};
56
57
  std::optional<TextTransform> textTransform{};
@@ -117,6 +118,7 @@ struct hash<facebook::react::TextAttributes> {
117
118
  textAttributes.opacity,
118
119
  textAttributes.fontFamily,
119
120
  textAttributes.fontSize,
121
+ textAttributes.maxFontSizeMultiplier,
120
122
  textAttributes.fontSizeMultiplier,
121
123
  textAttributes.fontWeight,
122
124
  textAttributes.fontStyle,
@@ -909,6 +909,7 @@ constexpr static MapBuffer::Key TA_KEY_LINE_BREAK_STRATEGY = 25;
909
909
  constexpr static MapBuffer::Key TA_KEY_ROLE = 26;
910
910
  constexpr static MapBuffer::Key TA_KEY_TEXT_TRANSFORM = 27;
911
911
  constexpr static MapBuffer::Key TA_KEY_ALIGNMENT_VERTICAL = 28;
912
+ constexpr static MapBuffer::Key TA_KEY_MAX_FONT_SIZE_MULTIPLIER = 29;
912
913
 
913
914
  // constants for ParagraphAttributes serialization
914
915
  constexpr static MapBuffer::Key PA_KEY_MAX_NUMBER_OF_LINES = 0;
@@ -1003,6 +1004,10 @@ inline MapBuffer toMapBuffer(const TextAttributes& textAttributes) {
1003
1004
  builder.putBool(
1004
1005
  TA_KEY_ALLOW_FONT_SCALING, *textAttributes.allowFontScaling);
1005
1006
  }
1007
+ if (!std::isnan(textAttributes.maxFontSizeMultiplier)) {
1008
+ builder.putDouble(
1009
+ TA_KEY_MAX_FONT_SIZE_MULTIPLIER, textAttributes.maxFontSizeMultiplier);
1010
+ }
1006
1011
  if (!std::isnan(textAttributes.letterSpacing)) {
1007
1012
  builder.putDouble(TA_KEY_LETTER_SPACING, textAttributes.letterSpacing);
1008
1013
  }
@@ -73,6 +73,12 @@ static TextAttributes convertRawProp(
73
73
  "allowFontScaling",
74
74
  sourceTextAttributes.allowFontScaling,
75
75
  defaultTextAttributes.allowFontScaling);
76
+ textAttributes.maxFontSizeMultiplier = convertRawProp(
77
+ context,
78
+ rawProps,
79
+ "maxFontSizeMultiplier",
80
+ sourceTextAttributes.maxFontSizeMultiplier,
81
+ defaultTextAttributes.maxFontSizeMultiplier);
76
82
  textAttributes.dynamicTypeRamp = convertRawProp(
77
83
  context,
78
84
  rawProps,
@@ -266,6 +272,12 @@ void BaseTextProps::setProp(
266
272
  defaults, value, textAttributes, fontVariant, "fontVariant");
267
273
  REBUILD_FIELD_SWITCH_CASE(
268
274
  defaults, value, textAttributes, allowFontScaling, "allowFontScaling");
275
+ REBUILD_FIELD_SWITCH_CASE(
276
+ defaults,
277
+ value,
278
+ textAttributes,
279
+ maxFontSizeMultiplier,
280
+ "maxFontSizeMultiplier");
269
281
  REBUILD_FIELD_SWITCH_CASE(
270
282
  defaults, value, textAttributes, letterSpacing, "letterSpacing");
271
283
  REBUILD_FIELD_SWITCH_CASE(
@@ -24,6 +24,7 @@ header_search_paths = [
24
24
  "\"$(PODS_ROOT)/RCT-Folly\"",
25
25
  "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\"",
26
26
  "\"$(PODS_ROOT)/DoubleConversion\"",
27
+ "\"$(PODS_ROOT)/fast_float/include\"",
27
28
  "\"$(PODS_ROOT)/fmt/include\""
28
29
  ]
29
30
 
@@ -55,8 +56,9 @@ Pod::Spec.new do |s|
55
56
  s.header_mappings_dir = "../../.."
56
57
  end
57
58
 
58
- s.dependency "RCT-Folly", folly_version
59
+ s.dependency "RCT-Folly"
59
60
  s.dependency "DoubleConversion"
60
- s.dependency "fmt", "9.1.0"
61
+ s.dependency "fast_float"
62
+ s.dependency "fmt"
61
63
  add_dependency(s, "React-debug")
62
64
  end
@@ -29,6 +29,7 @@ Pod::Spec.new do |s|
29
29
  "\"$(PODS_TARGET_SRCROOT)/../../../\"",
30
30
  "\"$(PODS_ROOT)/RCT-Folly\"",
31
31
  "\"$(PODS_ROOT)/DoubleConversion\"",
32
+ "\"$(PODS_ROOT)/fast_float/include\"",
32
33
  "\"$(PODS_ROOT)/fmt/include\""
33
34
  ]
34
35
 
@@ -61,10 +62,11 @@ Pod::Spec.new do |s|
61
62
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
62
63
 
63
64
  s.dependency "glog"
64
- s.dependency "RCT-Folly/Fabric", folly_version
65
+ s.dependency "RCT-Folly/Fabric"
65
66
  s.dependency "React-jsi"
66
67
  s.dependency "React-jsiexecutor"
67
68
  s.dependency "React-utils"
68
69
  s.dependency "DoubleConversion"
69
- s.dependency "fmt", "9.1.0"
70
+ s.dependency "fast_float"
71
+ s.dependency "fmt"
70
72
  end
@@ -27,6 +27,7 @@ Pod::Spec.new do |s|
27
27
  "\"$(PODS_TARGET_SRCROOT)\"",
28
28
  "\"$(PODS_ROOT)/RCT-Folly\"",
29
29
  "\"$(PODS_ROOT)/DoubleConversion\"",
30
+ "\"$(PODS_ROOT)/fast_float/include\"",
30
31
  "\"$(PODS_ROOT)/fmt/include\"",
31
32
  ].join(" ")
32
33
 
@@ -52,8 +52,29 @@ BOOL RCTIsAttributedStringEffectivelySame(
52
52
  NSDictionary<NSAttributedStringKey, id> *insensitiveAttributes,
53
53
  const facebook::react::TextAttributes &baseTextAttributes);
54
54
 
55
- @interface RCTWeakEventEmitterWrapper : NSObject
56
- @property (nonatomic, assign) facebook::react::SharedEventEmitter eventEmitter;
57
- @end
55
+ static inline NSData *RCTWrapEventEmitter(const facebook::react::SharedEventEmitter &eventEmitter)
56
+ {
57
+ auto eventEmitterPtr = new std::weak_ptr<const facebook::react::EventEmitter>(eventEmitter);
58
+ return [[NSData alloc] initWithBytesNoCopy:eventEmitterPtr
59
+ length:sizeof(eventEmitterPtr)
60
+ deallocator:^(void *ptrToDelete, NSUInteger) {
61
+ delete (std::weak_ptr<facebook::react::EventEmitter> *)ptrToDelete;
62
+ }];
63
+ }
64
+
65
+ static inline facebook::react::SharedEventEmitter RCTUnwrapEventEmitter(NSData *data)
66
+ {
67
+ if (data.length == 0) {
68
+ return nullptr;
69
+ }
70
+
71
+ auto weakPtr = dynamic_cast<std::weak_ptr<const facebook::react::EventEmitter> *>(
72
+ (std::weak_ptr<const facebook::react::EventEmitter> *)data.bytes);
73
+ if (weakPtr) {
74
+ return weakPtr->lock();
75
+ }
76
+
77
+ return nullptr;
78
+ }
58
79
 
59
80
  NS_ASSUME_NONNULL_END
@@ -16,45 +16,6 @@
16
16
 
17
17
  using namespace facebook::react;
18
18
 
19
- @implementation RCTWeakEventEmitterWrapper {
20
- std::weak_ptr<const EventEmitter> _weakEventEmitter;
21
- }
22
-
23
- - (void)setEventEmitter:(SharedEventEmitter)eventEmitter
24
- {
25
- _weakEventEmitter = eventEmitter;
26
- }
27
-
28
- - (SharedEventEmitter)eventEmitter
29
- {
30
- return _weakEventEmitter.lock();
31
- }
32
-
33
- - (void)dealloc
34
- {
35
- _weakEventEmitter.reset();
36
- }
37
-
38
- - (BOOL)isEqual:(id)object
39
- {
40
- // We consider the underlying EventEmitter as the identity
41
- if (![object isKindOfClass:[self class]]) {
42
- return NO;
43
- }
44
-
45
- auto thisEventEmitter = [self eventEmitter];
46
- auto otherEventEmitter = [((RCTWeakEventEmitterWrapper *)object) eventEmitter];
47
- return thisEventEmitter == otherEventEmitter;
48
- }
49
-
50
- - (NSUInteger)hash
51
- {
52
- // We consider the underlying EventEmitter as the identity
53
- return (NSUInteger)_weakEventEmitter.lock().get();
54
- }
55
-
56
- @end
57
-
58
19
  inline static UIFontWeight RCTUIFontWeightFromInteger(NSInteger fontWeight)
59
20
  {
60
21
  assert(fontWeight > 50);
@@ -139,6 +100,7 @@ inline static CGFloat RCTBaseSizeForDynamicTypeRamp(const DynamicTypeRamp &dynam
139
100
  inline static CGFloat RCTEffectiveFontSizeMultiplierFromTextAttributes(const TextAttributes &textAttributes)
140
101
  {
141
102
  if (textAttributes.allowFontScaling.value_or(true)) {
103
+ CGFloat fontSizeMultiplier = !isnan(textAttributes.fontSizeMultiplier) ? textAttributes.fontSizeMultiplier : 1.0;
142
104
  if (textAttributes.dynamicTypeRamp.has_value()) {
143
105
  DynamicTypeRamp dynamicTypeRamp = textAttributes.dynamicTypeRamp.value();
144
106
  UIFontMetrics *fontMetrics =
@@ -146,10 +108,11 @@ inline static CGFloat RCTEffectiveFontSizeMultiplierFromTextAttributes(const Tex
146
108
  // Using a specific font size reduces rounding errors from -scaledValueForValue:
147
109
  CGFloat requestedSize =
148
110
  isnan(textAttributes.fontSize) ? RCTBaseSizeForDynamicTypeRamp(dynamicTypeRamp) : textAttributes.fontSize;
149
- return [fontMetrics scaledValueForValue:requestedSize] / requestedSize;
150
- } else {
151
- return textAttributes.fontSizeMultiplier;
111
+ fontSizeMultiplier = [fontMetrics scaledValueForValue:requestedSize] / requestedSize;
152
112
  }
113
+ CGFloat maxFontSizeMultiplier =
114
+ !isnan(textAttributes.maxFontSizeMultiplier) ? textAttributes.maxFontSizeMultiplier : 0.0;
115
+ return maxFontSizeMultiplier >= 1.0 ? fminf(maxFontSizeMultiplier, fontSizeMultiplier) : fontSizeMultiplier;
153
116
  } else {
154
117
  return 1.0;
155
118
  }
@@ -407,10 +370,8 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
407
370
  {
408
371
  auto nsAttributedStringFragment = RCTNSAttributedStringFragmentFromFragment(fragment, placeholderImage);
409
372
 
410
- #if !TARGET_OS_MACCATALYST
411
373
  if (fragment.parentShadowView.componentHandle) {
412
- RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
413
- eventEmitterWrapper.eventEmitter = fragment.parentShadowView.eventEmitter;
374
+ auto eventEmitterWrapper = RCTWrapEventEmitter(fragment.parentShadowView.eventEmitter);
414
375
 
415
376
  NSDictionary<NSAttributedStringKey, id> *additionalTextAttributes =
416
377
  @{RCTAttributedStringEventEmitterKey : eventEmitterWrapper};
@@ -418,7 +379,6 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
418
379
  [nsAttributedStringFragment addAttributes:additionalTextAttributes
419
380
  range:NSMakeRange(0, nsAttributedStringFragment.length)];
420
381
  }
421
- #endif
422
382
 
423
383
  return nsAttributedStringFragment;
424
384
  }
@@ -280,11 +280,10 @@ static NSLineBreakMode RCTNSLineBreakModeFromEllipsizeMode(EllipsizeMode ellipsi
280
280
  // after (fraction == 1.0) the last character, then the attribute is valid.
281
281
  if (textStorage.length > 0 && (fraction > 0 || characterIndex > 0) &&
282
282
  (fraction < 1 || characterIndex < textStorage.length - 1)) {
283
- RCTWeakEventEmitterWrapper *eventEmitterWrapper =
284
- (RCTWeakEventEmitterWrapper *)[textStorage attribute:RCTAttributedStringEventEmitterKey
285
- atIndex:characterIndex
286
- effectiveRange:NULL];
287
- return eventEmitterWrapper.eventEmitter;
283
+ NSData *eventEmitterWrapper = (NSData *)[textStorage attribute:RCTAttributedStringEventEmitterKey
284
+ atIndex:characterIndex
285
+ effectiveRange:NULL];
286
+ return RCTUnwrapEventEmitter(eventEmitterWrapper);
288
287
  }
289
288
 
290
289
  return nil;
@@ -24,6 +24,7 @@ header_search_paths = [
24
24
  "\"$(PODS_TARGET_SRCROOT)/..\"",
25
25
  "\"$(PODS_ROOT)/RCT-Folly\"",
26
26
  "\"$(PODS_ROOT)/DoubleConversion\"",
27
+ "\"$(PODS_ROOT)/fast_float/include\"",
27
28
  "\"$(PODS_ROOT)/fmt/include\""
28
29
  ]
29
30
 
package/cli.js CHANGED
@@ -23,6 +23,15 @@ const deprecated = () => {
23
23
  );
24
24
  };
25
25
 
26
+ function findCommunityCli(startDir = process.cwd()) {
27
+ // With isolated node_modules (eg pnpm), we won't be able to find
28
+ // `@react-native-community/cli` starting from the `react-native` directory.
29
+ // Instead, we should use the project root, which we assume to be the cwd.
30
+ const options = {paths: [startDir]};
31
+ const rncli = require.resolve('@react-native-community/cli', options);
32
+ return require(rncli);
33
+ }
34
+
26
35
  function isMissingCliDependency(error) {
27
36
  return (
28
37
  error.code === 'MODULE_NOT_FOUND' &&
@@ -217,7 +226,7 @@ async function main() {
217
226
  }
218
227
 
219
228
  try {
220
- return require('@react-native-community/cli').run(name);
229
+ return findCommunityCli().run(name);
221
230
  } catch (e) {
222
231
  if (isMissingCliDependency(e)) {
223
232
  warnWithExplicitDependency();
@@ -231,7 +240,7 @@ if (require.main === module) {
231
240
  main();
232
241
  } else {
233
242
  try {
234
- cli = require('@react-native-community/cli');
243
+ cli = findCommunityCli();
235
244
  } catch (e) {
236
245
  // We silence @react-native-community/cli missing as it is no
237
246
  // longer a dependency
@@ -23,7 +23,7 @@ javax-annotation-api = "1.3.2"
23
23
  javax-inject = "1"
24
24
  jsr305 = "3.0.2"
25
25
  junit = "4.13.2"
26
- kotlin = "1.9.24"
26
+ kotlin = "1.9.25"
27
27
  mockito = "3.12.4"
28
28
  nexus-publish = "1.3.0"
29
29
  okhttp = "4.9.2"
@@ -35,8 +35,9 @@ yoga-proguard-annotations = "1.19.0"
35
35
  # Native Dependencies
36
36
  boost="1_83_0"
37
37
  doubleconversion="1.1.6"
38
- fmt="9.1.0"
39
- folly="2024.01.01.00"
38
+ fastFloat="6.1.4"
39
+ fmt="11.0.2"
40
+ folly="2024.10.14.00"
40
41
  glog="0.3.5"
41
42
  gtest="1.12.1"
42
43