react-native-tvos 0.73.2-0 → 0.73.4-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 (50) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.h +0 -2
  2. package/Libraries/AppDelegate/RCTAppDelegate.mm +20 -13
  3. package/Libraries/Components/Touchable/TouchableBounce.js +4 -0
  4. package/Libraries/Components/Touchable/TouchableHighlight.js +5 -1
  5. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
  6. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
  7. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -0
  8. package/Libraries/Core/ReactNativeVersion.js +1 -1
  9. package/Libraries/Inspector/NetworkOverlay.js +1 -1
  10. package/Libraries/Lists/FillRateHelper.js +3 -3
  11. package/Libraries/Lists/FlatList.d.ts +1 -1
  12. package/Libraries/Lists/FlatList.js +2 -2
  13. package/Libraries/Lists/SectionList.d.ts +1 -1
  14. package/Libraries/Lists/SectionList.js +2 -2
  15. package/Libraries/Lists/SectionListModern.js +2 -2
  16. package/Libraries/Lists/ViewabilityHelper.js +3 -3
  17. package/Libraries/Lists/VirtualizeUtils.js +2 -2
  18. package/Libraries/Lists/VirtualizedList.js +9 -2094
  19. package/Libraries/Lists/VirtualizedListContext.js +2 -2
  20. package/Libraries/Lists/VirtualizedSectionList.js +3 -3
  21. package/Libraries/Modal/Modal.js +1 -1
  22. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  23. package/React/Base/RCTVersion.m +1 -1
  24. package/React/CoreModules/RCTDeviceInfo.mm +33 -0
  25. package/React/CoreModules/RCTRedBox.mm +17 -0
  26. package/React/Modules/RCTUIManager.m +9 -3
  27. package/React/Views/ScrollView/RCTScrollView.m +77 -0
  28. package/ReactAndroid/gradle.properties +1 -1
  29. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +1 -0
  30. package/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java +11 -0
  31. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  32. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +9 -1
  33. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  34. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +2 -2
  35. package/ReactCommon/react/renderer/core/EventEmitter.cpp +14 -6
  36. package/ReactCommon/react/renderer/debug/flags.h +2 -4
  37. package/ReactCommon/react/renderer/debug/tests/DebugStringConvertibleTest.cpp +2 -0
  38. package/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp +4 -0
  39. package/package.json +6 -5
  40. package/scripts/cocoapods/utils.rb +4 -40
  41. package/scripts/react-native-xcode.sh +1 -1
  42. package/scripts/react_native_pods.rb +0 -1
  43. package/sdks/.hermesversion +1 -1
  44. package/sdks/hermes-engine/utils/replace_hermes_version.js +1 -1
  45. package/sdks/hermesc/osx-bin/hermes +0 -0
  46. package/sdks/hermesc/osx-bin/hermesc +0 -0
  47. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  48. package/template/Gemfile +4 -2
  49. package/template/package.json +3 -3
  50. package/types/index.d.ts +1 -1
@@ -10,9 +10,9 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import {typeof VirtualizedListContextResetter as VirtualizedListContextResetterType} from '@react-native/virtualized-lists';
13
+ import {typeof VirtualizedListContextResetter as VirtualizedListContextResetterType} from '@react-native-tvos/virtualized-lists';
14
14
 
15
15
  const VirtualizedListContextResetter: VirtualizedListContextResetterType =
16
- require('@react-native/virtualized-lists').VirtualizedListContextResetter;
16
+ require('@react-native-tvos/virtualized-lists').VirtualizedListContextResetter;
17
17
 
18
18
  module.exports = {VirtualizedListContextResetter};
@@ -10,13 +10,13 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import {typeof VirtualizedSectionList as VirtualizedSectionListType} from '@react-native/virtualized-lists';
13
+ import {typeof VirtualizedSectionList as VirtualizedSectionListType} from '@react-native-tvos/virtualized-lists';
14
14
 
15
15
  const VirtualizedSectionList: VirtualizedSectionListType =
16
- require('@react-native/virtualized-lists').VirtualizedSectionList;
16
+ require('@react-native-tvos/virtualized-lists').VirtualizedSectionList;
17
17
 
18
18
  export type {
19
19
  SectionBase,
20
20
  ScrollToLocationParamsType,
21
- } from '@react-native/virtualized-lists';
21
+ } from '@react-native-tvos/virtualized-lists';
22
22
  module.exports = VirtualizedSectionList;
@@ -17,7 +17,7 @@ import {type EventSubscription} from '../vendor/emitter/EventEmitter';
17
17
  import ModalInjection from './ModalInjection';
18
18
  import NativeModalManager from './NativeModalManager';
19
19
  import RCTModalHostView from './RCTModalHostViewNativeComponent';
20
- import {VirtualizedListContextResetter} from '@react-native/virtualized-lists';
20
+ import {VirtualizedListContextResetter} from '@react-native-tvos/virtualized-lists';
21
21
 
22
22
  const ScrollView = require('../Components/ScrollView/ScrollView');
23
23
  const View = require('../Components/View/View');
@@ -16,7 +16,7 @@ const Switch = require('../Components/Switch/Switch').default;
16
16
  const TextInput = require('../Components/TextInput/TextInput');
17
17
  const View = require('../Components/View/View');
18
18
  const Text = require('../Text/Text');
19
- const {VirtualizedList} = require('@react-native/virtualized-lists');
19
+ const {VirtualizedList} = require('@react-native-tvos/virtualized-lists');
20
20
  const React = require('react');
21
21
  const ShallowRenderer = require('react-shallow-renderer');
22
22
  const ReactTestRenderer = require('react-test-renderer');
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(73),
26
- RCTVersionPatch: @(2),
26
+ RCTVersionPatch: @(4),
27
27
  RCTVersionPrerelease: @"0",
28
28
  };
29
29
  });
@@ -80,11 +80,44 @@ RCT_EXPORT_MODULE()
80
80
  object:nil];
81
81
 
82
82
  #endif
83
+
84
+ // TODO T175901725 - Registering the RCTDeviceInfo module to the notification is a short-term fix to unblock 0.73
85
+ // The actual behavior should be that the module is properly registered in the TurboModule/Bridge infrastructure
86
+ // and the infrastructure imperatively invoke the `invalidate` method, rather than listening to a notification.
87
+ // This is a temporary workaround until we can investigate the issue better as there might be other modules in a
88
+ // similar situation.
89
+ [[NSNotificationCenter defaultCenter] addObserver:self
90
+ selector:@selector(invalidate)
91
+ name:RCTBridgeWillInvalidateModulesNotification
92
+ object:nil];
83
93
  }
84
94
 
85
95
  - (void)invalidate
86
96
  {
87
97
  _invalidated = YES;
98
+ [self _cleanupObservers];
99
+ }
100
+
101
+ - (void)_cleanupObservers
102
+ {
103
+ [[NSNotificationCenter defaultCenter] removeObserver:self
104
+ name:RCTAccessibilityManagerDidUpdateMultiplierNotification
105
+ object:[_moduleRegistry moduleForName:"AccessibilityManager"]];
106
+ #if !TARGET_OS_TV
107
+ [[NSNotificationCenter defaultCenter] removeObserver:self
108
+ name:UIApplicationDidChangeStatusBarOrientationNotification
109
+ object:nil];
110
+ #endif
111
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
112
+
113
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:RCTUserInterfaceStyleDidChangeNotification object:nil];
114
+
115
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:RCTWindowFrameDidChangeNotification object:nil];
116
+
117
+ [[NSNotificationCenter defaultCenter] addObserver:self
118
+ selector:@selector(invalidate)
119
+ name:RCTBridgeWillInvalidateModulesNotification
120
+ object:nil];
88
121
  }
89
122
 
90
123
  static BOOL RCTIsIPhoneNotched()
@@ -302,6 +302,23 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
302
302
  return lineInfo;
303
303
  }
304
304
 
305
+ - (void)tableView:(UITableView *)tableView didUpdateFocusInContext:(UITableViewFocusUpdateContext *)context withAnimationCoordinator:(UIFocusAnimationCoordinator *)coordinator
306
+ {
307
+ UITableViewCell *previouslyFocusedItem = (UITableViewCell *)context.previouslyFocusedItem;
308
+ if ([previouslyFocusedItem isKindOfClass:[UITableViewCell class]]) {
309
+ [coordinator addCoordinatedUnfocusingAnimations:^(id<UIFocusAnimationContext> _Nonnull animationContext) {
310
+ previouslyFocusedItem.textLabel.textColor = [UIColor whiteColor];
311
+ } completion:nil];
312
+ }
313
+
314
+ UITableViewCell *nextFocusedItem = (UITableViewCell *)context.nextFocusedItem;
315
+ if ([nextFocusedItem isKindOfClass:[UITableViewCell class]]) {
316
+ [coordinator addCoordinatedFocusingAnimations:^(id<UIFocusAnimationContext> _Nonnull animationContext) {
317
+ nextFocusedItem.textLabel.textColor = [UIColor blackColor];
318
+ } completion:nil];
319
+ }
320
+ }
321
+
305
322
  #pragma mark - TableView
306
323
 
307
324
  - (NSInteger)numberOfSectionsInTableView:(__unused UITableView *)tableView
@@ -179,14 +179,20 @@ RCT_EXPORT_MODULE()
179
179
  _componentDataByName[componentData.name] = componentData;
180
180
  }
181
181
  }
182
-
182
+ // Preload the a11yManager as the RCTUIManager needs it to listen for notification
183
+ // By eagerly preloading it in the setBridge method, we make sure that the manager is
184
+ // properly initialized in the Main Thread and that we do not incur in any race condition
185
+ // or concurrency problem.
186
+ id<RCTBridgeModule> a11yManager = [self->_bridge moduleForName:@"AccessibilityManager"
187
+ lazilyLoadIfNecessary:YES];
188
+ __weak NSObject * a11yManagerWeakObject = a11yManager;
183
189
  // This dispatch_async avoids a deadlock while configuring native modules
184
190
  dispatch_async(dispatch_get_main_queue(), ^{
191
+ __strong NSObject * a11yManagerStrongObject = a11yManagerWeakObject;
185
192
  [[NSNotificationCenter defaultCenter] addObserver:self
186
193
  selector:@selector(didReceiveNewContentSizeMultiplier)
187
194
  name:@"RCTAccessibilityManagerDidUpdateMultiplierNotification"
188
- object:[self->_bridge moduleForName:@"AccessibilityManager"
189
- lazilyLoadIfNecessary:YES]];
195
+ object:a11yManagerStrongObject];
190
196
  });
191
197
  #if !TARGET_OS_TV
192
198
  [[NSNotificationCenter defaultCenter] addObserver:self
@@ -288,6 +288,7 @@
288
288
  NSString *_lastEmittedEventName;
289
289
  NSHashTable *_scrollListeners;
290
290
  NSMutableDictionary *_tvRemoteGestureRecognizers;
291
+ BOOL _blockFirstTouch;
291
292
  }
292
293
 
293
294
  - (void)_registerKeyboardListener
@@ -989,7 +990,11 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
989
990
  [self becomeFirstResponder];
990
991
  [self addSwipeGestureRecognizers];
991
992
  [self sendFocusNotification];
993
+ // if we enter the scroll view from different view then block first touch event since it is the event that triggered the focus
994
+ _blockFirstTouch = (unsigned long)context.focusHeading != 0;
995
+ [self addArrowsListeners];
992
996
  } else if (context.previouslyFocusedView == self) {
997
+ [self removeArrowsListeners];
993
998
  [self sendBlurNotification];
994
999
  [self removeSwipeGestureRecognizers];
995
1000
  [self resignFirstResponder];
@@ -1009,6 +1014,76 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1009
1014
  }
1010
1015
  }
1011
1016
 
1017
+ - (void) addArrowsListeners {
1018
+ [[NSNotificationCenter defaultCenter] addObserver:self
1019
+ selector:@selector(handleTVNavigationEventNotification:)
1020
+ name:@"RCTTVNavigationEventNotification"
1021
+ object:nil];
1022
+ }
1023
+
1024
+ - (void) removeArrowsListeners {
1025
+ [[NSNotificationCenter defaultCenter] removeObserver:self
1026
+ name:@"RCTTVNavigationEventNotification"
1027
+ object:nil];
1028
+ }
1029
+
1030
+
1031
+ - (void)handleTVNavigationEventNotification:(NSNotification *)notif
1032
+ {
1033
+ NSArray *supportedEvents = [NSArray arrayWithObjects:@"up", @"down", @"left", @"right", nil];
1034
+
1035
+ if (notif.object == nil || notif.object[@"eventType"] == nil || ![supportedEvents containsObject:notif.object[@"eventType"]] ) {
1036
+ return;
1037
+ }
1038
+
1039
+ if (_blockFirstTouch) {
1040
+ _blockFirstTouch = NO;
1041
+ return;
1042
+ }
1043
+
1044
+ if (![self isHorizontal:self.scrollView]) {
1045
+ if ([notif.object[@"eventType"] isEqual: @"down"]) {
1046
+ [self swipedDown];
1047
+ return;
1048
+ }
1049
+
1050
+ if ([notif.object[@"eventType"] isEqual: @"up"]) {
1051
+ [self swipedUp];
1052
+ return;
1053
+ }
1054
+ }
1055
+
1056
+ if ([notif.object[@"eventType"] isEqual: @"left"]) {
1057
+ [self swipedLeft];
1058
+ return;
1059
+ }
1060
+
1061
+ if ([notif.object[@"eventType"] isEqual: @"right"]) {
1062
+ [self swipedRight];
1063
+ return;
1064
+ }
1065
+ }
1066
+
1067
+ - (BOOL)shouldUpdateFocusInContext:(UIFocusUpdateContext *)context
1068
+ {
1069
+ // Keep focus inside the scroll view till the end of the content
1070
+ if ([self isHorizontal:self.scrollView]) {
1071
+ if ((context.focusHeading == UIFocusHeadingLeft && self.scrollView.contentOffset.x > 0)
1072
+ || (context.focusHeading == UIFocusHeadingRight && self.scrollView.contentOffset.x < self.scrollView.contentSize.width - self.scrollView.visibleSize.width)
1073
+ ) {
1074
+ return [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem];
1075
+ }
1076
+ } else {
1077
+ if ((context.focusHeading == UIFocusHeadingUp && self.scrollView.contentOffset.y > 0)
1078
+ || (context.focusHeading == UIFocusHeadingDown && self.scrollView.contentOffset.y < self.scrollView.contentSize.height - self.scrollView.visibleSize.height)
1079
+ ) {
1080
+ return [UIFocusSystem environment:self containsEnvironment:context.nextFocusedItem];
1081
+ }
1082
+ }
1083
+
1084
+ return [super shouldUpdateFocusInContext:context];
1085
+ }
1086
+
1012
1087
  - (void)sendFocusNotification
1013
1088
  {
1014
1089
  [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTTVNavigationEventNotification"
@@ -1048,6 +1123,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1048
1123
 
1049
1124
  - (void)swipeVerticalScrollToOffset:(CGFloat)yOffset
1050
1125
  {
1126
+ _blockFirstTouch = NO;
1051
1127
  dispatch_async(dispatch_get_main_queue(), ^{
1052
1128
  CGFloat limitedOffset = yOffset;
1053
1129
  limitedOffset = MAX(limitedOffset, 0.0);
@@ -1061,6 +1137,7 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
1061
1137
 
1062
1138
  - (void)swipeHorizontalScrollToOffset:(CGFloat)xOffset
1063
1139
  {
1140
+ _blockFirstTouch = NO;
1064
1141
  dispatch_async(dispatch_get_main_queue(), ^{
1065
1142
  CGFloat limitedOffset = xOffset;
1066
1143
  limitedOffset = MAX(limitedOffset, 0.0);
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.73.2-0
1
+ VERSION_NAME=0.73.4-0
2
2
 
3
3
  # react.internal.publishingGroup=com.facebook.react
4
4
  # For TV use this group
@@ -113,6 +113,7 @@ public abstract class ReactActivity extends AppCompatActivity
113
113
  @Override
114
114
  public void onRequestPermissionsResult(
115
115
  int requestCode, String[] permissions, int[] grantResults) {
116
+ super.onRequestPermissionsResult(requestCode, permissions, grantResults);
116
117
  mDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults);
117
118
  }
118
119
 
@@ -10,6 +10,8 @@ package com.facebook.react.bridge.queue;
10
10
  import android.os.Handler;
11
11
  import android.os.Looper;
12
12
  import android.os.Message;
13
+ import com.facebook.common.logging.FLog;
14
+ import com.facebook.react.common.ReactConstants;
13
15
 
14
16
  /** Handler that can catch and dispatch Exceptions to an Exception handler. */
15
17
  public class MessageQueueThreadHandler extends Handler {
@@ -26,6 +28,15 @@ public class MessageQueueThreadHandler extends Handler {
26
28
  try {
27
29
  super.dispatchMessage(msg);
28
30
  } catch (Exception e) {
31
+ if (e instanceof NullPointerException) {
32
+ FLog.e(
33
+ ReactConstants.TAG,
34
+ "Caught NullPointerException when dispatching message in MessageQueueThreadHandler. This is likely caused by runnable"
35
+ + "(msg.callback) being nulled in Android Handler after dispatching and before handling (see T170239922 for more details)."
36
+ + "Currently we observe that it only happen once which is during initialisation. Due to fixing probably involve Android "
37
+ + "System code, we decide to ignore here for now and print an error message for debugging purpose in case this cause more serious issues in future.");
38
+ return;
39
+ }
29
40
  mExceptionHandler.handleException(e);
30
41
  }
31
42
  }
@@ -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", 73,
20
- "patch", 2,
20
+ "patch", 4,
21
21
  "prerelease", "0");
22
22
  }
@@ -206,7 +206,15 @@ import java.util.Set;
206
206
  }
207
207
  for (String oldKey : keysToNormalize) {
208
208
  Object value = events.get(oldKey);
209
- String newKey = "top" + oldKey.substring(0, 1).toUpperCase() + oldKey.substring(1);
209
+ String baseKey = "";
210
+ if (oldKey.startsWith("on")) {
211
+ // Drop "on" prefix.
212
+ baseKey = oldKey.substring(2);
213
+ } else {
214
+ // Capitalize first letter.
215
+ baseKey = oldKey.substring(0, 1).toUpperCase() + oldKey.substring(1);
216
+ }
217
+ String newKey = "top" + baseKey;
210
218
  events.put(newKey, value);
211
219
  }
212
220
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 73;
20
- int32_t Patch = 2;
20
+ int32_t Patch = 4;
21
21
  std::string_view Prerelease = "0";
22
22
  } ReactNativeVersion;
23
23
 
@@ -991,7 +991,7 @@ void YogaLayoutableShadowNode::ensureConsistency() const {
991
991
  }
992
992
 
993
993
  void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const {
994
- #ifdef REACT_NATIVE_DEBUG
994
+ #if defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE)
995
995
  // Checking that the shapes of Yoga node children object look fine.
996
996
  // This is the only heuristic that might produce false-positive results
997
997
  // (really broken dangled nodes might look fine). This is useful as an early
@@ -1009,7 +1009,7 @@ void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const {
1009
1009
  }
1010
1010
 
1011
1011
  void YogaLayoutableShadowNode::ensureYogaChildrenAlignment() const {
1012
- #ifdef REACT_NATIVE_DEBUG
1012
+ #if defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE)
1013
1013
  // If the node is not a leaf node, checking that:
1014
1014
  // - All children are `YogaLayoutableShadowNode` subclasses.
1015
1015
  // - All Yoga children are owned/connected to corresponding children of
@@ -16,18 +16,26 @@
16
16
 
17
17
  namespace facebook::react {
18
18
 
19
+ static bool hasPrefix(const std::string& str, const std::string& prefix) {
20
+ return str.compare(0, prefix.length(), prefix) == 0;
21
+ }
22
+
19
23
  // TODO(T29874519): Get rid of "top" prefix once and for all.
20
24
  /*
21
- * Capitalizes the first letter of the event type and adds "top" prefix if
22
- * necessary (e.g. "layout" becames "topLayout").
25
+ * Replaces "on" with "top" if present. Or capitalizes the first letter and adds
26
+ * "top" prefix. E.g. "eventName" becomes "topEventName", "onEventName" also
27
+ * becomes "topEventName".
23
28
  */
24
29
  static std::string normalizeEventType(std::string type) {
25
30
  auto prefixedType = std::move(type);
26
- if (prefixedType.find("top", 0) != 0) {
27
- prefixedType.insert(0, "top");
28
- prefixedType[3] = static_cast<char>(toupper(prefixedType[3]));
31
+ if (facebook::react::hasPrefix(prefixedType, "top")) {
32
+ return prefixedType;
33
+ }
34
+ if (facebook::react::hasPrefix(prefixedType, "on")) {
35
+ return "top" + prefixedType.substr(2);
29
36
  }
30
- return prefixedType;
37
+ prefixedType[0] = static_cast<char>(toupper(prefixedType[0]));
38
+ return "top" + prefixedType;
31
39
  }
32
40
 
33
41
  std::mutex& EventEmitter::DispatchMutex() {
@@ -26,7 +26,7 @@
26
26
  // Enables some Shadow Tree introspection features (maintains a StubViewTree,
27
27
  // and logs prev/next tree and mutations if there are any discrepancies). If you
28
28
  // define this, also define `RN_DEBUG_STRING_CONVERTIBLE`.
29
- #ifdef REACT_NATIVE_DEBUG
29
+ #if (defined(REACT_NATIVE_DEBUG) && defined(WITH_FBSYSTRACE))
30
30
  #define RN_SHADOW_TREE_INTROSPECTION 1
31
31
  #endif
32
32
 
@@ -34,9 +34,7 @@
34
34
  // Enable if `RN_SHADOW_TREE_INTROSPECTION` is enabled.
35
35
  #ifdef RN_SHADOW_TREE_INTROSPECTION
36
36
  #define RN_DEBUG_STRING_CONVERTIBLE 1
37
- #endif
38
-
39
- #ifndef RN_DEBUG_STRING_CONVERTIBLE
37
+ #else
40
38
  #define RN_DEBUG_STRING_CONVERTIBLE 0
41
39
  #endif
42
40
 
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ #if RN_DEBUG_STRING_CONVERTIBLE
8
9
  #include <memory>
9
10
 
10
11
  #include <gtest/gtest.h>
@@ -82,3 +83,4 @@ TEST(DebugStringConvertibleTest, handleNodeWithComplexProps) {
82
83
  item->getDebugDescription().c_str(),
83
84
  "<View=hello x=1(height=100 width=200)/>");
84
85
  }
86
+ #endif
@@ -5,6 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ #if RN_DEBUG_STRING_CONVERTIBLE
9
+
8
10
  #include <exception>
9
11
 
10
12
  #include <glog/logging.h>
@@ -164,3 +166,5 @@ TEST(UITemplateProcessorTest, testConditionalBytecode) {
164
166
  root2->getChildren().at(0)->getProps());
165
167
  ASSERT_STREQ(child_props2->testId.c_str(), "cond_false");
166
168
  }
169
+
170
+ #endif
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.73.2-0",
3
+ "version": "0.73.4-0",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -98,16 +98,17 @@
98
98
  "@react-native-community/cli-platform-android": "12.3.2",
99
99
  "@react-native-community/cli-platform-ios": "12.3.2",
100
100
  "@react-native/assets-registry": "0.73.1",
101
- "@react-native/community-cli-plugin": "0.73.12",
102
- "@react-native/codegen": "0.73.2",
101
+ "@react-native/community-cli-plugin": "0.73.16",
102
+ "@react-native/codegen": "0.73.3",
103
103
  "@react-native/gradle-plugin": "0.73.4",
104
104
  "@react-native/js-polyfills": "0.73.1",
105
105
  "@react-native/normalize-colors": "0.73.2",
106
- "@react-native/virtualized-lists": "0.73.4",
106
+ "@react-native-tvos/virtualized-lists": "0.73.4-0",
107
107
  "abort-controller": "^3.0.0",
108
108
  "anser": "^1.4.9",
109
109
  "ansi-regex": "^5.0.0",
110
110
  "base64-js": "^1.5.1",
111
+ "chalk": "^4.0.0",
111
112
  "deprecated-react-native-prop-types": "^5.0.0",
112
113
  "event-target-shim": "^5.0.1",
113
114
  "flow-enums-runtime": "^0.0.6",
@@ -150,6 +151,6 @@
150
151
  ]
151
152
  },
152
153
  "devDependencies": {
153
- "react-native-core": "npm:react-native@0.73.2"
154
+ "react-native-core": "npm:react-native@0.73.4"
154
155
  }
155
156
  }
@@ -162,7 +162,7 @@ class ReactNativePodsUtils
162
162
  project.build_configurations.each do |config|
163
163
  # fix for weak linking
164
164
  self.safe_init(config, other_ld_flags_key)
165
- if self.is_using_xcode15_or_greater(:xcodebuild_manager => xcodebuild_manager)
165
+ if self.is_using_xcode15_0(:xcodebuild_manager => xcodebuild_manager)
166
166
  self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
167
167
  else
168
168
  self.remove_value_to_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
@@ -391,7 +391,7 @@ class ReactNativePodsUtils
391
391
  end
392
392
  end
393
393
 
394
- def self.is_using_xcode15_or_greater(xcodebuild_manager: Xcodebuild)
394
+ def self.is_using_xcode15_0(xcodebuild_manager: Xcodebuild)
395
395
  xcodebuild_version = xcodebuild_manager.version
396
396
 
397
397
  # The output of xcodebuild -version is something like
@@ -402,7 +402,8 @@ class ReactNativePodsUtils
402
402
  regex = /(\d+)\.(\d+)(?:\.(\d+))?/
403
403
  if match_data = xcodebuild_version.match(regex)
404
404
  major = match_data[1].to_i
405
- return major >= 15
405
+ minor = match_data[2].to_i
406
+ return major == 15 && minor == 0
406
407
  end
407
408
 
408
409
  return false
@@ -542,43 +543,6 @@ class ReactNativePodsUtils
542
543
  ReactNativePodsUtils.update_header_paths_if_depends_on(target_installation_result, "React-ImageManager", header_search_paths)
543
544
  end
544
545
 
545
- def self.get_plist_paths_from(user_project)
546
- info_plists = user_project
547
- .files
548
- .select { |p|
549
- p.name&.end_with?('Info.plist')
550
- }
551
- return info_plists
552
- end
553
-
554
- def self.update_ats_in_plist(plistPaths, parent)
555
- plistPaths.each do |plistPath|
556
- fullPlistPath = File.join(parent, plistPath.path)
557
- plist = Xcodeproj::Plist.read_from_path(fullPlistPath)
558
- ats_configs = {
559
- "NSAllowsArbitraryLoads" => false,
560
- "NSAllowsLocalNetworking" => true,
561
- }
562
- if plist.nil?
563
- plist = {
564
- "NSAppTransportSecurity" => ats_configs
565
- }
566
- else
567
- plist["NSAppTransportSecurity"] ||= {}
568
- plist["NSAppTransportSecurity"] = plist["NSAppTransportSecurity"].merge(ats_configs)
569
- end
570
- Xcodeproj::Plist.write_to_path(plist, fullPlistPath)
571
- end
572
- end
573
-
574
- def self.apply_ats_config(installer)
575
- user_project = installer.aggregate_targets
576
- .map{ |t| t.user_project }
577
- .first
578
- plistPaths = self.get_plist_paths_from(user_project)
579
- self.update_ats_in_plist(plistPaths, user_project.path.parent)
580
- end
581
-
582
546
  def self.react_native_pods
583
547
  return [
584
548
  "DoubleConversion",
@@ -127,7 +127,7 @@ fi
127
127
  PACKAGER_SOURCEMAP_FILE=
128
128
  if [[ $EMIT_SOURCEMAP == true ]]; then
129
129
  if [[ $USE_HERMES != false ]]; then
130
- PACKAGER_SOURCEMAP_FILE="$CONFIGURATION_BUILD_DIR/$(basename $SOURCEMAP_FILE)"
130
+ PACKAGER_SOURCEMAP_FILE="$CONFIGURATION_BUILD_DIR/$(basename "$SOURCEMAP_FILE")"
131
131
  else
132
132
  PACKAGER_SOURCEMAP_FILE="$SOURCEMAP_FILE"
133
133
  fi
@@ -312,7 +312,6 @@ def react_native_post_install(
312
312
  ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
313
313
  ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled)
314
314
  ReactNativePodsUtils.apply_xcode_15_patch(installer)
315
- ReactNativePodsUtils.apply_ats_config(installer)
316
315
  ReactNativePodsUtils.updateOSDeploymentTarget(installer)
317
316
 
318
317
  NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
@@ -1 +1 @@
1
- hermes-2023-11-21-RNv0.73.0-ab91a3dcf7cd8c892ffeb0f9c32730551aa7c2d4
1
+ hermes-2024-01-31-RNv0.73.3-398783c198253f61e0a5eb603f1eb7b55af6baa4
@@ -53,7 +53,7 @@ function shouldReplaceHermesConfiguration(configuration) {
53
53
  }
54
54
 
55
55
  function replaceHermesConfiguration(configuration, version, podsRoot) {
56
- const tarballURLPath = `${podsRoot}/hermes-engine-artifacts/hermes-ios-${version}-${configuration}.tar.gz`;
56
+ const tarballURLPath = `${podsRoot}/hermes-engine-artifacts/hermes-ios-${version.toLowerCase()}-${configuration.toLowerCase()}.tar.gz`;
57
57
 
58
58
  const finalLocation = 'hermes-engine';
59
59
  console.log('Preparing the final location');
Binary file
Binary file
Binary file
package/template/Gemfile CHANGED
@@ -3,5 +3,7 @@ source 'https://rubygems.org'
3
3
  # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
4
  ruby ">= 2.6.10"
5
5
 
6
- gem 'cocoapods', '~> 1.13'
7
- gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
6
+ # Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7
+ # bound in the template on Cocoapods with next React Native release.
8
+ gem 'cocoapods', '>= 1.13', '< 1.15'
9
+ gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
@@ -13,15 +13,15 @@
13
13
  "dependencies": {
14
14
  "expo": "^50.0.2",
15
15
  "react": "18.2.0",
16
- "react-native": "npm:react-native-tvos@0.73.2-0"
16
+ "react-native": "npm:react-native-tvos@0.73.4-0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@babel/core": "^7.20.0",
20
20
  "@babel/preset-env": "^7.20.0",
21
21
  "@babel/runtime": "^7.20.0",
22
- "@react-native/babel-preset": "0.73.19",
22
+ "@react-native/babel-preset": "0.73.21",
23
23
  "@react-native/eslint-config": "0.73.2",
24
- "@react-native/metro-config": "0.73.3",
24
+ "@react-native/metro-config": "0.73.5",
25
25
  "@react-native/typescript-config": "0.73.1",
26
26
  "@types/react": "^18.2.6",
27
27
  "@types/react-test-renderer": "^18.0.0",
package/types/index.d.ts CHANGED
@@ -116,7 +116,7 @@ export * from '../Libraries/LayoutAnimation/LayoutAnimation';
116
116
  export * from '../Libraries/Linking/Linking';
117
117
  export * from '../Libraries/Lists/FlatList';
118
118
  export * from '../Libraries/Lists/SectionList';
119
- export * from '@react-native/virtualized-lists';
119
+ export * from '@react-native-tvos/virtualized-lists';
120
120
  export * from '../Libraries/LogBox/LogBox';
121
121
  export * from '../Libraries/Modal/Modal';
122
122
  export * as Systrace from '../Libraries/Performance/Systrace';