react-native-tvos 0.73.1-3 → 0.73.4-0rc0

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 (58) 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 +1 -0
  5. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +4 -0
  6. package/Libraries/Components/Touchable/TouchableOpacity.js +4 -0
  7. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +4 -0
  8. package/Libraries/Core/ReactNativeVersion.js +2 -2
  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/Libraries/promiseRejectionTrackingOptions.js +5 -0
  24. package/README.md +11 -10
  25. package/React/Base/RCTVersion.m +2 -2
  26. package/React/CoreModules/RCTDeviceInfo.mm +33 -0
  27. package/React/CoreModules/RCTRedBox.mm +17 -0
  28. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +24 -1
  29. package/React/Modules/RCTUIManager.m +9 -3
  30. package/React/Views/RCTTVView.m +23 -0
  31. package/React/Views/ScrollView/RCTScrollView.m +81 -0
  32. package/ReactAndroid/build.gradle +1 -1
  33. package/ReactAndroid/gradle.properties +1 -1
  34. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +1 -0
  35. package/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java +11 -0
  36. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
  37. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +9 -1
  38. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +29 -4
  39. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  40. package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +2 -2
  41. package/ReactCommon/react/renderer/core/EventEmitter.cpp +14 -6
  42. package/ReactCommon/react/renderer/debug/flags.h +2 -4
  43. package/ReactCommon/react/renderer/debug/tests/DebugStringConvertibleTest.cpp +2 -0
  44. package/ReactCommon/react/renderer/templateprocessor/tests/UITemplateProcessorTest.cpp +4 -0
  45. package/package.json +11 -10
  46. package/scripts/cocoapods/utils.rb +4 -40
  47. package/scripts/react-native-xcode.sh +1 -1
  48. package/scripts/react_native_pods.rb +1 -2
  49. package/sdks/.hermesversion +1 -1
  50. package/sdks/hermes-engine/utils/replace_hermes_version.js +1 -1
  51. package/sdks/hermesc/osx-bin/hermes +0 -0
  52. package/sdks/hermesc/osx-bin/hermesc +0 -0
  53. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  54. package/template/Gemfile +4 -2
  55. package/template/metro.config.js +23 -2
  56. package/template/package.json +5 -5
  57. package/third-party-podspecs/boost.podspec +1 -1
  58. package/types/index.d.ts +1 -1
@@ -100,8 +100,6 @@
100
100
  * By default, it assigns the rootView to the view property of the rootViewController
101
101
  * If you are not using a simple UIViewController, then there could be other methods to use to setup the rootView.
102
102
  * For example: UISplitViewController requires `setViewController(_:for:)`
103
- *
104
- * @return: void
105
103
  */
106
104
  - (void)setRootView:(UIView *)rootView toRootViewController:(UIViewController *)rootViewController;
107
105
 
@@ -49,6 +49,19 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
49
49
 
50
50
  #endif
51
51
 
52
+ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabricEnabled)
53
+ {
54
+ #ifdef RCT_NEW_ARCH_ENABLED
55
+ NSMutableDictionary *mutableProps = [initialProps mutableCopy] ?: [NSMutableDictionary new];
56
+ // Hardcoding the Concurrent Root as it it not recommended to
57
+ // have the concurrentRoot turned off when Fabric is enabled.
58
+ mutableProps[kRNConcurrentRoot] = @(isFabricEnabled);
59
+ return mutableProps;
60
+ #else
61
+ return initialProps;
62
+ #endif
63
+ }
64
+
52
65
  @interface RCTAppDelegate () <RCTCxxBridgeDelegate> {
53
66
  std::shared_ptr<facebook::react::RuntimeScheduler> _runtimeScheduler;
54
67
  }
@@ -76,10 +89,13 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
76
89
  {
77
90
  BOOL enableTM = NO;
78
91
  BOOL enableBridgeless = NO;
92
+ BOOL fabricEnabled = NO;
79
93
  #if RCT_NEW_ARCH_ENABLED
80
94
  enableTM = self.turboModuleEnabled;
81
95
  enableBridgeless = self.bridgelessEnabled;
96
+ fabricEnabled = [self fabricEnabled];
82
97
  #endif
98
+ NSDictionary *initProps = updateInitialProps([self prepareInitialProps], fabricEnabled);
83
99
 
84
100
  RCTAppSetupPrepareApp(application, enableTM);
85
101
 
@@ -88,7 +104,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
88
104
  if (enableBridgeless) {
89
105
  #if RCT_NEW_ARCH_ENABLED
90
106
  // Enable native view config interop only if both bridgeless mode and Fabric is enabled.
91
- RCTSetUseNativeViewConfigsInBridgelessMode([self fabricEnabled]);
107
+ RCTSetUseNativeViewConfigsInBridgelessMode(fabricEnabled);
92
108
 
93
109
  // Enable TurboModule interop by default in Bridgeless mode
94
110
  RCTEnableTurboModuleInterop(YES);
@@ -97,8 +113,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
97
113
  [self createReactHost];
98
114
  [self unstable_registerLegacyComponents];
99
115
  [RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
100
- RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName:self.moduleName
101
- initialProperties:launchOptions];
116
+ RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName:self.moduleName initialProperties:initProps];
102
117
 
103
118
  RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc]
104
119
  initWithSurface:surface
@@ -118,7 +133,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
118
133
  [self unstable_registerLegacyComponents];
119
134
  [RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
120
135
  #endif
121
- NSDictionary *initProps = [self prepareInitialProps];
136
+
122
137
  rootView = [self createRootViewWithBridge:self.bridge moduleName:self.moduleName initProps:initProps];
123
138
  }
124
139
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
@@ -140,15 +155,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
140
155
 
141
156
  - (NSDictionary *)prepareInitialProps
142
157
  {
143
- NSMutableDictionary *initProps = self.initialProps ? [self.initialProps mutableCopy] : [NSMutableDictionary new];
144
-
145
- #ifdef RCT_NEW_ARCH_ENABLED
146
- // Hardcoding the Concurrent Root as it it not recommended to
147
- // have the concurrentRoot turned off when Fabric is enabled.
148
- initProps[kRNConcurrentRoot] = @([self fabricEnabled]);
149
- #endif
150
-
151
- return initProps;
158
+ return self.initialProps;
152
159
  }
153
160
 
154
161
  - (RCTBridge *)createBridgeWithDelegate:(id<RCTBridgeDelegate>)delegate launchOptions:(NSDictionary *)launchOptions
@@ -234,6 +234,10 @@ class TouchableBounce extends React.Component<Props, State> {
234
234
  this.state.pressability.configure(this._createPressabilityConfig());
235
235
  }
236
236
 
237
+ componentDidMount(): mixed {
238
+ this.state.pressability.configure(this._createPressabilityConfig());
239
+ }
240
+
237
241
  componentWillUnmount(): void {
238
242
  if (Platform.isTV) {
239
243
  if (this._tvTouchable != null) {
@@ -408,6 +408,7 @@ class TouchableHighlight extends React.Component<Props, State> {
408
408
  },
409
409
  });
410
410
  }
411
+ this.state.pressability.configure(this._createPressabilityConfig());
411
412
  }
412
413
 
413
414
  componentDidUpdate(prevProps: Props, prevState: State) {
@@ -371,6 +371,10 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
371
371
  this.state.pressability.configure(this._createPressabilityConfig());
372
372
  }
373
373
 
374
+ componentDidMount(): mixed {
375
+ this.state.pressability.configure(this._createPressabilityConfig());
376
+ }
377
+
374
378
  componentWillUnmount(): void {
375
379
  if (Platform.isTV) {
376
380
  if (this._tvTouchable != null) {
@@ -356,6 +356,10 @@ class TouchableOpacity extends React.Component<Props, State> {
356
356
  }
357
357
  }
358
358
 
359
+ componentDidMount(): void {
360
+ this.state.pressability.configure(this._createPressabilityConfig());
361
+ }
362
+
359
363
  componentWillUnmount(): void {
360
364
  if (Platform.isTV) {
361
365
  if (this._tvTouchable != null) {
@@ -223,6 +223,10 @@ class TouchableWithoutFeedback extends React.Component<Props, State> {
223
223
  this.state.pressability.configure(createPressabilityConfig(this.props));
224
224
  }
225
225
 
226
+ componentDidMount(): mixed {
227
+ this.state.pressability.configure(createPressabilityConfig(this.props));
228
+ }
229
+
226
230
  componentWillUnmount(): void {
227
231
  if (Platform.isTV) {
228
232
  if (this._tvTouchable != null) {
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
- patch: 1,
16
- prerelease: '3',
15
+ patch: 4,
16
+ prerelease: '0rc0',
17
17
  };
@@ -10,7 +10,7 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import type {RenderItemProps} from '@react-native/virtualized-lists';
13
+ import type {RenderItemProps} from '@react-native-tvos/virtualized-lists';
14
14
 
15
15
  const ScrollView = require('../Components/ScrollView/ScrollView');
16
16
  const TouchableHighlight = require('../Components/Touchable/TouchableHighlight');
@@ -10,10 +10,10 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import {typeof FillRateHelper as FillRateHelperType} from '@react-native/virtualized-lists';
13
+ import {typeof FillRateHelper as FillRateHelperType} from '@react-native-tvos/virtualized-lists';
14
14
 
15
15
  const FillRateHelper: FillRateHelperType =
16
- require('@react-native/virtualized-lists').FillRateHelper;
16
+ require('@react-native-tvos/virtualized-lists').FillRateHelper;
17
17
 
18
- export type {FillRateInfo} from '@react-native/virtualized-lists';
18
+ export type {FillRateInfo} from '@react-native-tvos/virtualized-lists';
19
19
  module.exports = FillRateHelper;
@@ -13,7 +13,7 @@ import type {
13
13
  ViewToken,
14
14
  VirtualizedListProps,
15
15
  ViewabilityConfig,
16
- } from '@react-native/virtualized-lists';
16
+ } from '@react-native-tvos/virtualized-lists';
17
17
  import type {ScrollViewComponent} from '../Components/ScrollView/ScrollView';
18
18
  import type {StyleProp} from '../StyleSheet/StyleSheet';
19
19
  import type {ViewStyle} from '../StyleSheet/StyleSheetTypes';
@@ -15,13 +15,13 @@ import type {
15
15
  RenderItemType,
16
16
  ViewabilityConfigCallbackPair,
17
17
  ViewToken,
18
- } from '@react-native/virtualized-lists';
18
+ } from '@react-native-tvos/virtualized-lists';
19
19
 
20
20
  import {type ScrollResponderType} from '../Components/ScrollView/ScrollView';
21
21
  import {
22
22
  VirtualizedList,
23
23
  keyExtractor as defaultKeyExtractor,
24
- } from '@react-native/virtualized-lists';
24
+ } from '@react-native-tvos/virtualized-lists';
25
25
  import memoizeOne from 'memoize-one';
26
26
 
27
27
  const View = require('../Components/View/View');
@@ -11,7 +11,7 @@ import type * as React from 'react';
11
11
  import type {
12
12
  ListRenderItemInfo,
13
13
  VirtualizedListWithoutRenderItemProps,
14
- } from '@react-native/virtualized-lists';
14
+ } from '@react-native-tvos/virtualized-lists';
15
15
  import type {
16
16
  ScrollView,
17
17
  ScrollViewProps,
@@ -15,10 +15,10 @@ import type {
15
15
  ScrollToLocationParamsType,
16
16
  SectionBase as _SectionBase,
17
17
  VirtualizedSectionListProps,
18
- } from '@react-native/virtualized-lists';
18
+ } from '@react-native-tvos/virtualized-lists';
19
19
 
20
20
  import Platform from '../Utilities/Platform';
21
- import {VirtualizedSectionList} from '@react-native/virtualized-lists';
21
+ import {VirtualizedSectionList} from '@react-native-tvos/virtualized-lists';
22
22
  import * as React from 'react';
23
23
 
24
24
  type Item = any;
@@ -15,11 +15,11 @@ import type {
15
15
  ScrollToLocationParamsType,
16
16
  SectionBase as _SectionBase,
17
17
  VirtualizedSectionListProps,
18
- } from '@react-native/virtualized-lists';
18
+ } from '@react-native-tvos/virtualized-lists';
19
19
  import type {AbstractComponent, Element, ElementRef} from 'react';
20
20
 
21
21
  import Platform from '../Utilities/Platform';
22
- import {VirtualizedSectionList} from '@react-native/virtualized-lists';
22
+ import {VirtualizedSectionList} from '@react-native-tvos/virtualized-lists';
23
23
  import React, {forwardRef, useImperativeHandle, useRef} from 'react';
24
24
 
25
25
  type Item = any;
@@ -14,11 +14,11 @@ export type {
14
14
  ViewToken,
15
15
  ViewabilityConfig,
16
16
  ViewabilityConfigCallbackPair,
17
- } from '@react-native/virtualized-lists';
17
+ } from '@react-native-tvos/virtualized-lists';
18
18
 
19
- import {typeof ViewabilityHelper as ViewabilityHelperType} from '@react-native/virtualized-lists';
19
+ import {typeof ViewabilityHelper as ViewabilityHelperType} from '@react-native-tvos/virtualized-lists';
20
20
 
21
21
  const ViewabilityHelper: ViewabilityHelperType =
22
- require('@react-native/virtualized-lists').ViewabilityHelper;
22
+ require('@react-native-tvos/virtualized-lists').ViewabilityHelper;
23
23
 
24
24
  module.exports = ViewabilityHelper;
@@ -10,9 +10,9 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import {typeof keyExtractor as KeyExtractorType} from '@react-native/virtualized-lists';
13
+ import {typeof keyExtractor as KeyExtractorType} from '@react-native-tvos/virtualized-lists';
14
14
 
15
15
  const keyExtractor: KeyExtractorType =
16
- require('@react-native/virtualized-lists').keyExtractor;
16
+ require('@react-native-tvos/virtualized-lists').keyExtractor;
17
17
 
18
18
  module.exports = {keyExtractor};