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
@@ -1025,19 +1025,23 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1025
1025
  [self sendBlurNotification];
1026
1026
  [self removeSwipeGestureRecognizers];
1027
1027
  [self resignFirstResponder];
1028
- // if we leave the scroll view and go up, then scroll to top; if going down,
1029
- // scroll to bottom
1030
- // Similarly for left and right
1031
- if (context.focusHeading == UIFocusHeadingUp && self.snapToStart) {
1032
- [self scrollToVerticalOffset:0.0];
1033
- } else if(context.focusHeading == UIFocusHeadingDown && self.snapToEnd) {
1034
- [self scrollToVerticalOffset:self.scrollView.contentSize.height];
1035
- } else if(context.focusHeading == UIFocusHeadingLeft && self.snapToStart) {
1036
- [self scrollToHorizontalOffset:0.0];
1037
- } else if(context.focusHeading == UIFocusHeadingRight && self.snapToEnd) {
1038
- [self scrollToHorizontalOffset:self.scrollView.contentSize.width];
1028
+ // If scrolling is enabled:
1029
+ // - Scroll to the top when moving up and to the bottom when moving down.
1030
+ // - Similarly, scroll towards leading edge when moving towards leading edge and to the trailing edge when moving towards the trailing edge.
1031
+ BOOL isRTL = [[RCTI18nUtil sharedInstance] isRTL];
1032
+ BOOL isMovingTowardsLeadingEdge = (isRTL ? context.focusHeading == UIFocusHeadingRight : context.focusHeading == UIFocusHeadingLeft);
1033
+ BOOL isMovingTowardsTrailingEdge = (isRTL ? context.focusHeading == UIFocusHeadingLeft : context.focusHeading == UIFocusHeadingRight);
1034
+ if (self.scrollView.isScrollEnabled) {
1035
+ if (context.focusHeading == UIFocusHeadingUp && self.snapToStart) {
1036
+ [self scrollToVerticalOffset:0.0];
1037
+ } else if(context.focusHeading == UIFocusHeadingDown && self.snapToEnd) {
1038
+ [self scrollToVerticalOffset:self.scrollView.contentSize.height];
1039
+ } else if(isMovingTowardsLeadingEdge && self.snapToStart) {
1040
+ [self scrollToHorizontalOffset:0.0];
1041
+ } else if(isMovingTowardsLeadingEdge && self.snapToEnd) {
1042
+ [self scrollToHorizontalOffset:self.scrollView.contentSize.width];
1043
+ }
1039
1044
  }
1040
-
1041
1045
  }
1042
1046
  }
1043
1047
 
@@ -1093,22 +1097,31 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1093
1097
 
1094
1098
  - (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context
1095
1099
  {
1100
+ // If the previously focused item is this view and scrolling is disabled, defer to the superclass
1101
+ if (context.previouslyFocusedItem == self && !self.scrollView.isScrollEnabled) {
1102
+ return [super shouldUpdateFocusInContext:context];
1103
+ }
1104
+
1096
1105
  // Determine if the layout is Right-to-Left
1097
1106
  BOOL isRTL = [[RCTI18nUtil sharedInstance] isRTL];
1098
1107
  // Adjust for horizontal scrolling with RTL support
1099
1108
  if ([self isHorizontal:self.scrollView]) {
1100
- BOOL isNavigatingToEnd = (isRTL ? context.focusHeading == UIFocusHeadingLeft : context.focusHeading == UIFocusHeadingRight);
1101
- BOOL isNavigatingToStart = (isRTL ? context.focusHeading == UIFocusHeadingRight : context.focusHeading == UIFocusHeadingLeft);
1109
+ BOOL isMovingTowardsLeadingEdge = (isRTL ? context.focusHeading == UIFocusHeadingRight : context.focusHeading == UIFocusHeadingLeft);
1110
+ BOOL isMovingTowardsTrailingEdge = (isRTL ? context.focusHeading == UIFocusHeadingLeft : context.focusHeading == UIFocusHeadingRight);
1111
+
1112
+ BOOL isScrollingToLeading = (isMovingTowardsLeadingEdge && self.scrollView.contentOffset.x > 0);
1113
+ BOOL isScrollingToTrailing = (isMovingTowardsTrailingEdge && self.scrollView.contentOffset.x < self.scrollView.contentSize.width - MAX(self.scrollView.visibleSize.width, 1));
1102
1114
 
1103
- if ((isNavigatingToEnd && self.scrollView.contentOffset.x < self.scrollView.contentSize.width - self.scrollView.visibleSize.width) ||
1104
- (isNavigatingToStart && self.scrollView.contentOffset.x > 0)) {
1105
- return [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem];
1115
+ if (isScrollingToLeading || isScrollingToTrailing) {
1116
+ return (context.nextFocusedItem && [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem]);
1106
1117
  }
1107
1118
  } else {
1108
1119
  // Handle vertical scrolling as before
1109
- if ((context.focusHeading == UIFocusHeadingUp && self.scrollView.contentOffset.y > 0) ||
1110
- (context.focusHeading == UIFocusHeadingDown && self.scrollView.contentOffset.y < self.scrollView.contentSize.height - self.scrollView.visibleSize.height)) {
1111
- return [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem];
1120
+ BOOL isMovingUp = (context.focusHeading == UIFocusHeadingUp && self.scrollView.contentOffset.y > 0);
1121
+ BOOL isMovingDown = (context.focusHeading == UIFocusHeadingDown && self.scrollView.contentOffset.y < self.scrollView.contentSize.height - MAX(self.scrollView.visibleSize.height, 1));
1122
+
1123
+ if (isMovingUp || isMovingDown) {
1124
+ return (context.nextFocusedItem && [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem]);
1112
1125
  }
1113
1126
  }
1114
1127
  return [super shouldUpdateFocusInContext:context];
@@ -1154,11 +1167,21 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1154
1167
  _blockFirstTouch = NO;
1155
1168
  dispatch_async(dispatch_get_main_queue(), ^{
1156
1169
  CGFloat limitedOffset = yOffset;
1170
+
1171
+ // Ensure content size and visible size are non-negative
1172
+ CGFloat contentHeight = MAX(self.scrollView.contentSize.height, 0.0);
1173
+ CGFloat visibleHeight = MAX(self.scrollView.visibleSize.height, 0.0);
1174
+
1175
+ // Compute the maximum offset, ensuring it's non-negative
1176
+ CGFloat maxOffset = MAX(contentHeight - visibleHeight, 0.0);
1177
+
1178
+ // Clamp the offset within valid bounds
1157
1179
  limitedOffset = MAX(limitedOffset, 0.0);
1158
- limitedOffset = MIN(limitedOffset, self.scrollView.contentSize.height - self.scrollView.visibleSize.height);
1180
+ limitedOffset = MIN(limitedOffset, maxOffset);
1181
+
1159
1182
  [UIView animateWithDuration:[self swipeDuration] animations:^{
1160
1183
  self.scrollView.contentOffset =
1161
- CGPointMake(self.scrollView.contentOffset.x, limitedOffset);
1184
+ CGPointMake(self.scrollView.contentOffset.x, limitedOffset);
1162
1185
  }];
1163
1186
  });
1164
1187
  }
@@ -1168,11 +1191,21 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1168
1191
  _blockFirstTouch = NO;
1169
1192
  dispatch_async(dispatch_get_main_queue(), ^{
1170
1193
  CGFloat limitedOffset = xOffset;
1194
+
1195
+ // Ensure content size and visible size are non-negative
1196
+ CGFloat contentWidth = MAX(self.scrollView.contentSize.width, 0.0);
1197
+ CGFloat visibleWidth = MAX(self.scrollView.visibleSize.width, 0.0);
1198
+
1199
+ // Compute the maximum offset, ensuring it's non-negative
1200
+ CGFloat maxOffset = MAX(contentWidth - visibleWidth, 0.0);
1201
+
1202
+ // Clamp the offset within valid bounds
1171
1203
  limitedOffset = MAX(limitedOffset, 0.0);
1172
- limitedOffset = MIN(limitedOffset, self.scrollView.contentSize.width - self.scrollView.visibleSize.width);
1204
+ limitedOffset = MIN(limitedOffset, maxOffset);
1205
+
1173
1206
  [UIView animateWithDuration:[self swipeDuration] animations:^{
1174
1207
  self.scrollView.contentOffset =
1175
- CGPointMake(limitedOffset, self.scrollView.contentOffset.y);
1208
+ CGPointMake(limitedOffset, self.scrollView.contentOffset.y);
1176
1209
  }];
1177
1210
  });
1178
1211
  }
@@ -1205,7 +1238,9 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1205
1238
  return;
1206
1239
  }
1207
1240
 
1208
- CGFloat newOffset = self.scrollView.contentOffset.x - [self swipeHorizontalInterval];
1241
+ BOOL isRTL = [[RCTI18nUtil sharedInstance] isRTL];
1242
+ NSInteger horizontalInterval = [self swipeHorizontalInterval];
1243
+ CGFloat newOffset = self.scrollView.contentOffset.x + (isRTL ? horizontalInterval : -horizontalInterval);
1209
1244
  // NSLog(@"Swiped left to %f", newOffset);
1210
1245
  [self scrollToHorizontalOffset:newOffset];
1211
1246
  }
@@ -1216,7 +1251,9 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1216
1251
  return;
1217
1252
  }
1218
1253
 
1219
- CGFloat newOffset = self.scrollView.contentOffset.x + [self swipeHorizontalInterval];
1254
+ BOOL isRTL = [[RCTI18nUtil sharedInstance] isRTL];
1255
+ NSInteger horizontalInterval = [self swipeHorizontalInterval];
1256
+ CGFloat newOffset = self.scrollView.contentOffset.x + (isRTL ? -horizontalInterval : horizontalInterval);
1220
1257
  // NSLog(@"Swiped right to %f", newOffset);
1221
1258
  [self scrollToHorizontalOffset:newOffset];
1222
1259
  }
@@ -8,5 +8,5 @@
8
8
  // LICENSE file in the root directory of this source tree.
9
9
  //
10
10
 
11
- HEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_83_0 $(SRCROOT)/../third-party/folly-2024.01.01.00 $(SRCROOT)/../third-party/glog-0.3.5/src
11
+ HEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_83_0 $(SRCROOT)/../third-party/folly-2024.10.14.00 $(SRCROOT)/../third-party/glog-0.3.5/src
12
12
  OTHER_CFLAGS = -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1
@@ -21,7 +21,7 @@ folly_compiler_flags = folly_config[:compiler_flags]
21
21
  folly_version = folly_config[:version]
22
22
 
23
23
  socket_rocket_config = get_socket_rocket_config()
24
- socket_rocket_version = socket_rocket_config[:version]
24
+ socket_rocket_version = socket_rocket_config[:version]
25
25
 
26
26
  boost_compiler_flags = '-Wno-documentation'
27
27
 
@@ -49,6 +49,7 @@ header_search_paths = [
49
49
  "$(PODS_TARGET_SRCROOT)/ReactCommon",
50
50
  "$(PODS_ROOT)/boost",
51
51
  "$(PODS_ROOT)/DoubleConversion",
52
+ "$(PODS_ROOT)/fast_float/include",
52
53
  "$(PODS_ROOT)/fmt/include",
53
54
  "$(PODS_ROOT)/RCT-Folly",
54
55
  "${PODS_ROOT}/Headers/Public/FlipperKit",
@@ -2248,7 +2248,7 @@ public abstract interface class com/facebook/react/devsupport/HMRClient : com/fa
2248
2248
  public abstract fun disable ()V
2249
2249
  public abstract fun enable ()V
2250
2250
  public abstract fun registerBundle (Ljava/lang/String;)V
2251
- public abstract fun setup (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZ)V
2251
+ public abstract fun setup (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/lang/String;)V
2252
2252
  }
2253
2253
 
2254
2254
  public final class com/facebook/react/devsupport/InspectorFlags {
@@ -7859,6 +7859,7 @@ public class com/facebook/react/views/text/TextAttributeProps {
7859
7859
  public static final field TA_KEY_LETTER_SPACING S
7860
7860
  public static final field TA_KEY_LINE_BREAK_STRATEGY S
7861
7861
  public static final field TA_KEY_LINE_HEIGHT S
7862
+ public static final field TA_KEY_MAX_FONT_SIZE_MULTIPLIER S
7862
7863
  public static final field TA_KEY_OPACITY S
7863
7864
  public static final field TA_KEY_ROLE S
7864
7865
  public static final field TA_KEY_TEXT_DECORATION_COLOR S
@@ -7891,6 +7892,7 @@ public class com/facebook/react/views/text/TextAttributeProps {
7891
7892
  protected field mLetterSpacingInput F
7892
7893
  protected field mLineHeight F
7893
7894
  protected field mLineHeightInput F
7895
+ protected field mMaxFontSizeMultiplier F
7894
7896
  protected field mNumberOfLines I
7895
7897
  protected field mOpacity F
7896
7898
  protected field mRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
@@ -68,6 +68,7 @@ val prefabHeadersDir = project.file("$buildDir/prefab-headers")
68
68
  // Native versions which are defined inside the version catalog (libs.versions.toml)
69
69
  val BOOST_VERSION = libs.versions.boost.get()
70
70
  val DOUBLE_CONVERSION_VERSION = libs.versions.doubleconversion.get()
71
+ val FAST_FLOAT_VERSION = libs.versions.fastFloat.get()
71
72
  val FMT_VERSION = libs.versions.fmt.get()
72
73
  val FOLLY_VERSION = libs.versions.folly.get()
73
74
  val GLOG_VERSION = libs.versions.glog.get()
@@ -181,6 +182,7 @@ val preparePrefab by
181
182
  // react_nativemodule_core
182
183
  Pair(File(buildDir, "third-party-ndk/boost/boost_1_83_0/").absolutePath, ""),
183
184
  Pair(File(buildDir, "third-party-ndk/double-conversion/").absolutePath, ""),
185
+ Pair(File(buildDir, "third-party-ndk/fast_float/include/").absolutePath, ""),
184
186
  Pair(File(buildDir, "third-party-ndk/fmt/include/").absolutePath, ""),
185
187
  Pair(File(buildDir, "third-party-ndk/folly/").absolutePath, ""),
186
188
  Pair(File(buildDir, "third-party-ndk/glog/exported/").absolutePath, ""),
@@ -306,6 +308,27 @@ val prepareFolly by
306
308
  includeEmptyDirs = false
307
309
  into("$thirdPartyNdkDir/folly")
308
310
  }
311
+ val downloadFastFloat by
312
+ tasks.creating(Download::class) {
313
+ dependsOn(createNativeDepsDirectories)
314
+ src("https://github.com/fastfloat/fast_float/archive/v${FAST_FLOAT_VERSION}.tar.gz")
315
+ onlyIfModified(true)
316
+ overwrite(false)
317
+ retries(5)
318
+ quiet(true)
319
+ dest(File(downloadsDir, "fast_float-${FAST_FLOAT_VERSION}.tar.gz"))
320
+ }
321
+
322
+ val prepareFastFloat by
323
+ tasks.registering(Copy::class) {
324
+ dependsOn(if (dependenciesPath != null) emptyList() else listOf(downloadFastFloat))
325
+ from(dependenciesPath ?: tarTree(downloadFastFloat.dest))
326
+ from("src/main/jni/third-party/fast_float/")
327
+ include("fast_float-${FAST_FLOAT_VERSION}/include/**/*", "CMakeLists.txt")
328
+ eachFile { this.path = this.path.removePrefix("fast_float-${FAST_FLOAT_VERSION}/") }
329
+ includeEmptyDirs = false
330
+ into("$thirdPartyNdkDir/fast_float")
331
+ }
309
332
 
310
333
  val downloadFmt by
311
334
  tasks.creating(Download::class) {
@@ -543,6 +566,7 @@ android {
543
566
  "generateCodegenArtifactsFromSchema",
544
567
  prepareBoost,
545
568
  prepareDoubleConversion,
569
+ prepareFastFloat,
546
570
  prepareFmt,
547
571
  prepareFolly,
548
572
  prepareGlog,
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.76.6-0
1
+ VERSION_NAME=0.76.9-0
2
2
  react.internal.publishingGroup=io.github.react-native-tvos
3
3
 
4
4
  android.useAndroidX=true
@@ -25,4 +25,4 @@ binaryCompatibilityValidator.ignoredPackages=com.facebook.debug,\
25
25
  binaryCompatibilityValidator.nonPublicMarkers=com.facebook.react.common.annotations.VisibleForTesting,\
26
26
  com.facebook.react.common.annotations.UnstableReactNativeAPI
27
27
  binaryCompatibilityValidator.validationDisabled=true
28
- binaryCompatibilityValidator.outputApiFileName=ReactAndroid
28
+ binaryCompatibilityValidator.outputApiFileName=ReactAndroid
@@ -696,10 +696,12 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
696
696
  URL sourceUrl = new URL(getSourceUrl());
697
697
  String path = sourceUrl.getPath().substring(1); // strip initial slash in path
698
698
  String host = sourceUrl.getHost();
699
+ String scheme = sourceUrl.getProtocol();
699
700
  int port = sourceUrl.getPort() != -1 ? sourceUrl.getPort() : sourceUrl.getDefaultPort();
700
701
  mCurrentContext
701
702
  .getJSModule(HMRClient.class)
702
- .setup("android", path, host, port, mDevSettings.isHotModuleReplacementEnabled());
703
+ .setup(
704
+ "android", path, host, port, mDevSettings.isHotModuleReplacementEnabled(), scheme);
703
705
  } catch (MalformedURLException e) {
704
706
  showNewJavaError(e.getMessage(), e);
705
707
  }
@@ -26,8 +26,11 @@ public interface HMRClient extends JavaScriptModule {
26
26
  * @param host The host that the HMRClient should communicate with.
27
27
  * @param port The port that the HMRClient should communicate with on the host.
28
28
  * @param isEnabled Whether HMR is enabled initially.
29
+ * @param scheme The protocol that the HMRClient should communicate with on the host (defaults to
30
+ * http).
29
31
  */
30
- void setup(String platform, String bundleEntry, String host, int port, boolean isEnabled);
32
+ void setup(
33
+ String platform, String bundleEntry, String host, int port, boolean isEnabled, String scheme);
31
34
 
32
35
  /** Registers an additional JS bundle with HMRClient. */
33
36
  void registerBundle(String bundleUrl);
@@ -172,7 +172,7 @@ public class FabricUIManager
172
172
  private final CopyOnWriteArrayList<UIManagerListener> mListeners = new CopyOnWriteArrayList<>();
173
173
 
174
174
  private boolean mMountNotificationScheduled = false;
175
- private final List<Integer> mMountedSurfaceIds = new ArrayList<>();
175
+ private List<Integer> mSurfaceIdsWithPendingMountNotification = new ArrayList<>();
176
176
 
177
177
  @ThreadConfined(UI)
178
178
  @NonNull
@@ -1257,12 +1257,15 @@ public class FabricUIManager
1257
1257
 
1258
1258
  // Collect surface IDs for all the mount items
1259
1259
  for (MountItem mountItem : mountItems) {
1260
- if (mountItem != null && !mMountedSurfaceIds.contains(mountItem.getSurfaceId())) {
1261
- mMountedSurfaceIds.add(mountItem.getSurfaceId());
1260
+ if (mountItem != null
1261
+ && !mSurfaceIdsWithPendingMountNotification.contains(mountItem.getSurfaceId())) {
1262
+ mSurfaceIdsWithPendingMountNotification.add(mountItem.getSurfaceId());
1262
1263
  }
1263
1264
  }
1264
1265
 
1265
- if (!mMountNotificationScheduled && !mMountedSurfaceIds.isEmpty()) {
1266
+ if (!mMountNotificationScheduled && !mSurfaceIdsWithPendingMountNotification.isEmpty()) {
1267
+ mMountNotificationScheduled = true;
1268
+
1266
1269
  // Notify mount when the effects are visible and prevent mount hooks to
1267
1270
  // delay paint.
1268
1271
  UiThreadUtil.getUiThreadHandler()
@@ -1272,17 +1275,19 @@ public class FabricUIManager
1272
1275
  public void run() {
1273
1276
  mMountNotificationScheduled = false;
1274
1277
 
1278
+ // Create a copy in case mount hooks trigger more mutations
1279
+ final List<Integer> surfaceIdsToReportMount =
1280
+ mSurfaceIdsWithPendingMountNotification;
1281
+ mSurfaceIdsWithPendingMountNotification = new ArrayList<>();
1282
+
1275
1283
  final @Nullable Binding binding = mBinding;
1276
1284
  if (binding == null || mDestroyed) {
1277
- mMountedSurfaceIds.clear();
1278
1285
  return;
1279
1286
  }
1280
1287
 
1281
- for (int surfaceId : mMountedSurfaceIds) {
1288
+ for (int surfaceId : surfaceIdsToReportMount) {
1282
1289
  binding.reportMount(surfaceId);
1283
1290
  }
1284
-
1285
- mMountedSurfaceIds.clear();
1286
1291
  }
1287
1292
  });
1288
1293
  }
@@ -330,14 +330,11 @@ public class MountingManager {
330
330
  @AnyThread
331
331
  @ThreadConfined(ANY)
332
332
  public @Nullable EventEmitterWrapper getEventEmitter(int surfaceId, int reactTag) {
333
- SurfaceMountingManager surfaceMountingManager =
334
- (surfaceId == ViewUtil.NO_SURFACE_ID
335
- ? getSurfaceManagerForView(reactTag)
336
- : getSurfaceManager(surfaceId));
337
- if (surfaceMountingManager == null) {
333
+ SurfaceMountingManager smm = getSurfaceMountingManager(surfaceId, reactTag);
334
+ if (smm == null) {
338
335
  return null;
339
336
  }
340
- return surfaceMountingManager.getEventEmitter(reactTag);
337
+ return smm.getEventEmitter(reactTag);
341
338
  }
342
339
 
343
340
  /**
@@ -434,11 +431,21 @@ public class MountingManager {
434
431
  boolean canCoalesceEvent,
435
432
  @Nullable WritableMap params,
436
433
  @EventCategoryDef int eventCategory) {
437
- @Nullable SurfaceMountingManager smm = getSurfaceManager(surfaceId);
434
+ SurfaceMountingManager smm = getSurfaceMountingManager(surfaceId, reactTag);
438
435
  if (smm == null) {
439
- // Cannot queue event without valid surface mountng manager. Do nothing here.
436
+ FLog.d(
437
+ TAG,
438
+ "Cannot queue event without valid surface mounting manager for tag: %d, surfaceId: %d",
439
+ reactTag,
440
+ surfaceId);
440
441
  return;
441
442
  }
442
443
  smm.enqueuePendingEvent(reactTag, eventName, canCoalesceEvent, params, eventCategory);
443
444
  }
445
+
446
+ private @Nullable SurfaceMountingManager getSurfaceMountingManager(int surfaceId, int reactTag) {
447
+ return (surfaceId == ViewUtil.NO_SURFACE_ID
448
+ ? getSurfaceManagerForView(reactTag)
449
+ : getSurfaceManager(surfaceId));
450
+ }
444
451
  }
@@ -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", 76,
20
- "patch", 6,
20
+ "patch", 9,
21
21
  "prerelease", "0");
22
22
  }
@@ -61,6 +61,7 @@ public class TextAttributeProps {
61
61
  public static final short TA_KEY_LINE_BREAK_STRATEGY = 25;
62
62
  public static final short TA_KEY_ROLE = 26;
63
63
  public static final short TA_KEY_TEXT_TRANSFORM = 27;
64
+ public static final short TA_KEY_MAX_FONT_SIZE_MULTIPLIER = 29;
64
65
 
65
66
  public static final int UNSET = -1;
66
67
 
@@ -81,6 +82,7 @@ public class TextAttributeProps {
81
82
  protected float mLineHeight = Float.NaN;
82
83
  protected boolean mIsColorSet = false;
83
84
  protected boolean mAllowFontScaling = true;
85
+ protected float mMaxFontSizeMultiplier = Float.NaN;
84
86
  protected int mColor;
85
87
  protected boolean mIsBackgroundColorSet = false;
86
88
  protected int mBackgroundColor;
@@ -227,6 +229,9 @@ public class TextAttributeProps {
227
229
  case TA_KEY_TEXT_TRANSFORM:
228
230
  result.setTextTransform(entry.getStringValue());
229
231
  break;
232
+ case TA_KEY_MAX_FONT_SIZE_MULTIPLIER:
233
+ result.setMaxFontSizeMultiplier((float) entry.getDoubleValue());
234
+ break;
230
235
  }
231
236
  }
232
237
 
@@ -243,6 +248,8 @@ public class TextAttributeProps {
243
248
  result.setLineHeight(getFloatProp(props, ViewProps.LINE_HEIGHT, ReactConstants.UNSET));
244
249
  result.setLetterSpacing(getFloatProp(props, ViewProps.LETTER_SPACING, Float.NaN));
245
250
  result.setAllowFontScaling(getBooleanProp(props, ViewProps.ALLOW_FONT_SCALING, true));
251
+ result.setMaxFontSizeMultiplier(
252
+ getFloatProp(props, ViewProps.MAX_FONT_SIZE_MULTIPLIER, Float.NaN));
246
253
  result.setFontSize(getFloatProp(props, ViewProps.FONT_SIZE, ReactConstants.UNSET));
247
254
  result.setColor(props.hasKey(ViewProps.COLOR) ? props.getInt(ViewProps.COLOR, 0) : null);
248
255
  result.setColor(
@@ -411,7 +418,14 @@ public class TextAttributeProps {
411
418
  mAllowFontScaling = allowFontScaling;
412
419
  setFontSize(mFontSizeInput);
413
420
  setLineHeight(mLineHeightInput);
414
- setLetterSpacing(mLetterSpacingInput);
421
+ }
422
+ }
423
+
424
+ private void setMaxFontSizeMultiplier(float maxFontSizeMultiplier) {
425
+ if (maxFontSizeMultiplier != mMaxFontSizeMultiplier) {
426
+ mMaxFontSizeMultiplier = maxFontSizeMultiplier;
427
+ setFontSize(mFontSizeInput);
428
+ setLineHeight(mLineHeightInput);
415
429
  }
416
430
  }
417
431
 
@@ -420,7 +434,7 @@ public class TextAttributeProps {
420
434
  if (fontSize != ReactConstants.UNSET) {
421
435
  fontSize =
422
436
  mAllowFontScaling
423
- ? (float) Math.ceil(PixelUtil.toPixelFromSP(fontSize))
437
+ ? (float) Math.ceil(PixelUtil.toPixelFromSP(fontSize, mMaxFontSizeMultiplier))
424
438
  : (float) Math.ceil(PixelUtil.toPixelFromDIP(fontSize));
425
439
  }
426
440
  mFontSize = (int) fontSize;
@@ -49,6 +49,7 @@ add_library(fbjni ALIAS fbjni::fbjni)
49
49
  add_react_third_party_ndk_subdir(glog)
50
50
  add_react_third_party_ndk_subdir(boost)
51
51
  add_react_third_party_ndk_subdir(double-conversion)
52
+ add_react_third_party_ndk_subdir(fast_float)
52
53
  add_react_third_party_ndk_subdir(fmt)
53
54
  add_react_third_party_ndk_subdir(folly)
54
55
  add_react_third_party_ndk_subdir(jsc)
@@ -0,0 +1,13 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ cmake_minimum_required(VERSION 3.13)
7
+ set(CMAKE_VERBOSE_MAKEFILE on)
8
+
9
+ add_compile_options(-std=c++20 -fexceptions)
10
+
11
+ add_library(fast_float INTERFACE)
12
+
13
+ target_include_directories(fast_float INTERFACE include)
@@ -26,11 +26,8 @@ SET(folly_FLAGS
26
26
  SET(folly_runtime_SRC
27
27
  folly/Conv.cpp
28
28
  folly/Demangle.cpp
29
- folly/dynamic.cpp
30
29
  folly/FileUtil.cpp
31
30
  folly/Format.cpp
32
- folly/json_pointer.cpp
33
- folly/json.cpp
34
31
  folly/ScopeGuard.cpp
35
32
  folly/SharedMutex.cpp
36
33
  folly/String.cpp
@@ -42,6 +39,9 @@ SET(folly_runtime_SRC
42
39
  folly/detail/SplitStringSimd.cpp
43
40
  folly/detail/UniqueInstance.cpp
44
41
  folly/hash/SpookyHashV2.cpp
42
+ folly/json/dynamic.cpp
43
+ folly/json/json_pointer.cpp
44
+ folly/json/json.cpp
45
45
  folly/lang/CString.cpp
46
46
  folly/lang/SafeAssert.cpp
47
47
  folly/lang/ToAscii.cpp
@@ -51,8 +51,7 @@ SET(folly_runtime_SRC
51
51
  folly/synchronization/SanitizeThread.cpp
52
52
  folly/synchronization/ParkingLot.cpp
53
53
  folly/system/AtFork.cpp
54
- folly/system/ThreadId.cpp
55
- folly/system/ThreadName.cpp)
54
+ folly/system/ThreadId.cpp)
56
55
 
57
56
  add_library(folly_runtime STATIC ${folly_runtime_SRC})
58
57
 
@@ -67,4 +66,4 @@ target_compile_options(folly_runtime
67
66
  target_compile_options(folly_runtime PUBLIC ${folly_FLAGS})
68
67
 
69
68
  target_include_directories(folly_runtime PUBLIC .)
70
- target_link_libraries(folly_runtime glog double-conversion boost fmt)
69
+ target_link_libraries(folly_runtime glog double-conversion boost fmt fast_float)
@@ -53,7 +53,8 @@ Pod::Spec.new do |s|
53
53
  s.dependency "React-logger"
54
54
  s.dependency "glog"
55
55
  s.dependency "DoubleConversion"
56
- s.dependency "fmt", "9.1.0"
56
+ s.dependency "fast_float"
57
+ s.dependency "fmt"
57
58
  s.dependency "React-Core"
58
59
  s.dependency "React-debug"
59
60
  s.dependency "React-featureflags"
@@ -33,6 +33,7 @@ Pod::Spec.new do |s|
33
33
  "\"$(PODS_ROOT)/Headers/Private/Yoga\"",
34
34
  "\"$(PODS_TARGET_SRCROOT)\"",
35
35
  "\"$(PODS_ROOT)/DoubleConversion\"",
36
+ "\"$(PODS_ROOT)/fast_float/include\"",
36
37
  "\"$(PODS_ROOT)/fmt/include\"",
37
38
  ]
38
39
 
@@ -74,7 +75,8 @@ Pod::Spec.new do |s|
74
75
  s.dependency "React-logger"
75
76
  s.dependency "glog"
76
77
  s.dependency "DoubleConversion"
77
- s.dependency "fmt", "9.1.0"
78
+ s.dependency "fast_float"
79
+ s.dependency "fmt"
78
80
  s.dependency "React-Core"
79
81
  s.dependency "React-debug"
80
82
  s.dependency "React-featureflags"
@@ -30,6 +30,7 @@ header_search_path = [
30
30
  "\"$(PODS_ROOT)/RCT-Folly\"",
31
31
  "\"$(PODS_ROOT)/Headers/Private/Yoga\"",
32
32
  "\"$(PODS_ROOT)/DoubleConversion\"",
33
+ "\"$(PODS_ROOT)/fast_float/include\"",
33
34
  "\"$(PODS_ROOT)/fmt/include\"",
34
35
  ]
35
36
 
@@ -65,16 +66,17 @@ Pod::Spec.new do |s|
65
66
  s.module_name = 'React_FabricImage'
66
67
  end
67
68
 
68
- s.dependency folly_dep_name, folly_version
69
+ s.dependency folly_dep_name
69
70
 
70
- s.dependency "React-jsiexecutor", version
71
- s.dependency "RCTRequired", version
72
- s.dependency "RCTTypeSafety", version
71
+ s.dependency "React-jsiexecutor"
72
+ s.dependency "RCTRequired"
73
+ s.dependency "RCTTypeSafety"
73
74
  s.dependency "React-jsi"
74
75
  s.dependency "React-logger"
75
76
  s.dependency "glog"
76
77
  s.dependency "DoubleConversion"
77
- s.dependency "fmt", "9.1.0"
78
+ s.dependency "fast_float"
79
+ s.dependency "fmt"
78
80
  s.dependency "React-ImageManager"
79
81
  s.dependency "React-utils"
80
82
  s.dependency "Yoga"
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
34
34
  s.source = source
35
35
  s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility
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
  "DEFINES_MODULE" => "YES",
40
40
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
@@ -46,14 +46,15 @@ Pod::Spec.new do |s|
46
46
  # TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
47
47
  # Note: Update this only when ready to minimize breaking changes.
48
48
  s.subspec "turbomodule" do |ss|
49
- ss.dependency "React-callinvoker", version
50
- ss.dependency "React-perflogger", version
51
- ss.dependency "React-cxxreact", version
52
- ss.dependency "React-jsi", version
53
- ss.dependency "RCT-Folly", folly_version
54
- ss.dependency "React-logger", version
49
+ ss.dependency "React-callinvoker"
50
+ ss.dependency "React-perflogger"
51
+ ss.dependency "React-cxxreact"
52
+ ss.dependency "React-jsi"
53
+ ss.dependency "RCT-Folly"
54
+ ss.dependency "React-logger"
55
55
  ss.dependency "DoubleConversion"
56
- ss.dependency "fmt", "9.1.0"
56
+ ss.dependency "fast_float"
57
+ ss.dependency "fmt"
57
58
  ss.dependency "glog"
58
59
  if using_hermes
59
60
  ss.dependency "hermes-engine"
@@ -47,9 +47,12 @@ namespace {
47
47
  CxxModule::Callback convertCallback(
48
48
  std::function<void(folly::dynamic)> callback) {
49
49
  return [callback = std::move(callback)](std::vector<folly::dynamic> args) {
50
- callback(folly::dynamic(
51
- std::make_move_iterator(args.begin()),
52
- std::make_move_iterator(args.end())));
50
+ // after unpinning folly, can use folly::dynamic::array_range
51
+ folly::dynamic obj = folly::dynamic::array;
52
+ for (auto& arg : args) {
53
+ obj.push_back(std::move(arg));
54
+ }
55
+ callback(std::move(obj));
53
56
  };
54
57
  }
55
58