react-native 0.76.0-rc.2 → 0.76.0-rc.4

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 (36) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.h +3 -0
  2. package/Libraries/AppDelegate/RCTAppDelegate.mm +24 -23
  3. package/Libraries/AppDelegate/RCTRootViewFactory.h +5 -23
  4. package/Libraries/AppDelegate/RCTRootViewFactory.mm +19 -25
  5. package/Libraries/Blob/RCTFileReaderModule.mm +4 -3
  6. package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +17 -0
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/Core/setUpDeveloperTools.js +5 -1
  9. package/Libraries/Utilities/HMRClient.js +6 -5
  10. package/React/Base/RCTVersion.m +1 -1
  11. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +24 -2
  12. package/React/Views/RCTBorderDrawing.m +6 -3
  13. package/ReactAndroid/api/ReactAndroid.api +9 -0
  14. package/ReactAndroid/gradle.properties +1 -1
  15. package/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java +5 -0
  16. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +0 -3
  17. package/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java +37 -4
  18. package/ReactAndroid/src/main/java/com/facebook/react/flipper/ReactNativeFlipper.kt +2 -2
  19. package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevMenuModule.kt +46 -0
  20. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  21. package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.java +5 -0
  22. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +1 -1
  23. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  24. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1 -4
  25. package/ReactCommon/react/renderer/animations/utils.h +45 -0
  26. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +5 -0
  27. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +11 -0
  28. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +5 -0
  29. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +1 -2
  30. package/cli.js +14 -0
  31. package/jest-preset.js +1 -5
  32. package/package.json +10 -10
  33. package/scripts/cocoapods/utils.rb +2 -9
  34. package/sdks/hermesc/osx-bin/hermes +0 -0
  35. package/sdks/hermesc/osx-bin/hermesc +0 -0
  36. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
@@ -64,6 +64,9 @@ NS_ASSUME_NONNULL_BEGIN
64
64
  @property (nonatomic, strong, nullable) NSDictionary *initialProps;
65
65
  @property (nonatomic, strong, nonnull) RCTRootViewFactory *rootViewFactory;
66
66
 
67
+ /// If `automaticallyLoadReactNativeWindow` is set to `true`, the React Native window will be loaded automatically.
68
+ @property (nonatomic, assign) BOOL automaticallyLoadReactNativeWindow;
69
+
67
70
  @property (nonatomic, nullable) RCTSurfacePresenterBridgeAdapter *bridgeAdapter;
68
71
 
69
72
  /**
@@ -12,6 +12,7 @@
12
12
  #import <React/RCTSurfacePresenterBridgeAdapter.h>
13
13
  #import <React/RCTUtils.h>
14
14
  #import <ReactCommon/RCTHost.h>
15
+ #include <UIKit/UIKit.h>
15
16
  #import <objc/runtime.h>
16
17
  #import <react/featureflags/ReactNativeFeatureFlags.h>
17
18
  #import <react/featureflags/ReactNativeFeatureFlagsDefaults.h>
@@ -38,6 +39,14 @@
38
39
 
39
40
  @implementation RCTAppDelegate
40
41
 
42
+ - (instancetype)init
43
+ {
44
+ if (self = [super init]) {
45
+ _automaticallyLoadReactNativeWindow = YES;
46
+ }
47
+ return self;
48
+ }
49
+
41
50
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
42
51
  {
43
52
  [self _setUpFeatureFlags];
@@ -47,23 +56,28 @@
47
56
  RCTAppSetupPrepareApp(application, self.turboModuleEnabled);
48
57
 
49
58
  self.rootViewFactory = [self createRCTRootViewFactory];
59
+ if (self.newArchEnabled || self.fabricEnabled) {
60
+ [RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
61
+ }
62
+
63
+ if (self.automaticallyLoadReactNativeWindow) {
64
+ [self loadReactNativeWindow:launchOptions];
65
+ }
66
+
67
+ return YES;
68
+ }
50
69
 
70
+ - (void)loadReactNativeWindow:(NSDictionary *)launchOptions
71
+ {
51
72
  UIView *rootView = [self.rootViewFactory viewWithModuleName:self.moduleName
52
73
  initialProperties:self.initialProps
53
74
  launchOptions:launchOptions];
54
75
 
55
- if (self.newArchEnabled || self.fabricEnabled) {
56
- [RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
57
- }
58
-
59
76
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
60
77
  UIViewController *rootViewController = [self createRootViewController];
61
78
  [self setRootView:rootView toRootViewController:rootViewController];
62
- self.window.rootViewController = rootViewController;
63
- self.window.windowScene.delegate = self;
64
- [self.window makeKeyAndVisible];
65
-
66
- return YES;
79
+ _window.rootViewController = rootViewController;
80
+ [_window makeKeyAndVisible];
67
81
  }
68
82
 
69
83
  - (void)applicationDidEnterBackground:(UIApplication *)application
@@ -261,19 +275,6 @@
261
275
  return [weakSelf sourceURLForBridge:bridge];
262
276
  };
263
277
 
264
- configuration.hostDidStartBlock = ^(RCTHost *_Nonnull host) {
265
- [weakSelf hostDidStart:host];
266
- };
267
-
268
- configuration.hostDidReceiveJSErrorStackBlock =
269
- ^(RCTHost *_Nonnull host,
270
- NSArray<NSDictionary<NSString *, id> *> *_Nonnull stack,
271
- NSString *_Nonnull message,
272
- NSUInteger exceptionId,
273
- BOOL isFatal) {
274
- [weakSelf host:host didReceiveJSErrorStack:stack message:message exceptionId:exceptionId isFatal:isFatal];
275
- };
276
-
277
278
  if ([self respondsToSelector:@selector(extraModulesForBridge:)]) {
278
279
  configuration.extraModulesForBridge = ^NSArray<id<RCTBridgeModule>> *_Nonnull(RCTBridge *_Nonnull bridge)
279
280
  {
@@ -295,7 +296,7 @@
295
296
  };
296
297
  }
297
298
 
298
- return [[RCTRootViewFactory alloc] initWithConfiguration:configuration andTurboModuleManagerDelegate:self];
299
+ return [[RCTRootViewFactory alloc] initWithTurboModuleDelegate:self hostDelegate:self configuration:configuration];
299
300
  }
300
301
 
301
302
  #pragma mark - Feature Flags
@@ -12,6 +12,7 @@
12
12
  @protocol RCTCxxBridgeDelegate;
13
13
  @protocol RCTComponentViewFactoryComponentProvider;
14
14
  @protocol RCTTurboModuleManagerDelegate;
15
+ @protocol RCTHostDelegate;
15
16
  @class RCTBridge;
16
17
  @class RCTHost;
17
18
  @class RCTRootView;
@@ -30,13 +31,6 @@ typedef NSURL *_Nullable (^RCTBundleURLBlock)(void);
30
31
  typedef NSArray<id<RCTBridgeModule>> *_Nonnull (^RCTExtraModulesForBridgeBlock)(RCTBridge *bridge);
31
32
  typedef NSDictionary<NSString *, Class> *_Nonnull (^RCTExtraLazyModuleClassesForBridge)(RCTBridge *bridge);
32
33
  typedef BOOL (^RCTBridgeDidNotFindModuleBlock)(RCTBridge *bridge, NSString *moduleName);
33
- typedef void (^RCTHostDidStartBlock)(RCTHost *host);
34
- typedef void (^RCTHostDidReceiveJSErrorStackBlock)(
35
- RCTHost *host,
36
- NSArray<NSDictionary<NSString *, id> *> *stack,
37
- NSString *message,
38
- NSUInteger exceptionId,
39
- BOOL isFatal);
40
34
 
41
35
  #pragma mark - RCTRootViewFactory Configuration
42
36
  @interface RCTRootViewFactoryConfiguration : NSObject
@@ -147,22 +141,6 @@ typedef void (^RCTHostDidReceiveJSErrorStackBlock)(
147
141
  */
148
142
  @property (nonatomic, nullable) RCTBridgeDidNotFindModuleBlock bridgeDidNotFindModule;
149
143
 
150
- /**
151
- * Called when `RCTHost` started.
152
- * @parameter: host - The started `RCTHost`.
153
- */
154
- @property (nonatomic, nullable) RCTHostDidStartBlock hostDidStartBlock;
155
-
156
- /**
157
- * Called when `RCTHost` received JS error.
158
- * @parameter: host - `RCTHost` which received js error.
159
- * @parameter: stack - JS error stack.
160
- * @parameter: message - Error message.
161
- * @parameter: exceptionId - Exception ID.
162
- * @parameter: isFatal - YES if JS error is fatal.
163
- */
164
- @property (nonatomic, nullable) RCTHostDidReceiveJSErrorStackBlock hostDidReceiveJSErrorStackBlock;
165
-
166
144
  @end
167
145
 
168
146
  #pragma mark - RCTRootViewFactory
@@ -187,6 +165,10 @@ typedef void (^RCTHostDidReceiveJSErrorStackBlock)(
187
165
 
188
166
  - (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configuration;
189
167
 
168
+ - (instancetype)initWithTurboModuleDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
169
+ hostDelegate:(id<RCTHostDelegate>)hostdelegate
170
+ configuration:(RCTRootViewFactoryConfiguration *)configuration;
171
+
190
172
  /**
191
173
  * This method can be used to create new RCTRootViews on demand.
192
174
  *
@@ -83,7 +83,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
83
83
 
84
84
  @end
85
85
 
86
- @interface RCTRootViewFactory () <RCTContextContainerHandling, RCTHostDelegate> {
86
+ @interface RCTRootViewFactory () <RCTContextContainerHandling> {
87
87
  std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
88
88
  facebook::react::ContextContainer::Shared _contextContainer;
89
89
  }
@@ -95,15 +95,18 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
95
95
  @end
96
96
 
97
97
  @implementation RCTRootViewFactory {
98
- RCTRootViewFactoryConfiguration *_configuration;
99
98
  __weak id<RCTTurboModuleManagerDelegate> _turboModuleManagerDelegate;
99
+ __weak id<RCTHostDelegate> _hostDelegate;
100
+ RCTRootViewFactoryConfiguration *_configuration;
100
101
  }
101
102
 
102
- - (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configuration
103
- andTurboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
103
+ - (instancetype)initWithTurboModuleDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
104
+ hostDelegate:(id<RCTHostDelegate>)hostdelegate
105
+ configuration:(RCTRootViewFactoryConfiguration *)configuration
104
106
  {
105
107
  if (self = [super init]) {
106
108
  _configuration = configuration;
109
+ _hostDelegate = hostdelegate;
107
110
  _contextContainer = std::make_shared<const facebook::react::ContextContainer>();
108
111
  _reactNativeConfig = std::make_shared<const facebook::react::EmptyReactNativeConfig>();
109
112
  _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
@@ -112,6 +115,17 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
112
115
  return self;
113
116
  }
114
117
 
118
+ - (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configuration
119
+ andTurboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
120
+ {
121
+ id<RCTHostDelegate> hostDelegate = [turboModuleManagerDelegate conformsToProtocol:@protocol(RCTHostDelegate)]
122
+ ? (id<RCTHostDelegate>)turboModuleManagerDelegate
123
+ : nil;
124
+ return [self initWithTurboModuleDelegate:turboModuleManagerDelegate
125
+ hostDelegate:hostDelegate
126
+ configuration:configuration];
127
+ }
128
+
115
129
  - (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configuration
116
130
  {
117
131
  return [self initWithConfiguration:configuration andTurboModuleManagerDelegate:nil];
@@ -188,26 +202,6 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
188
202
  return rootView;
189
203
  }
190
204
 
191
- #pragma mark - RCTHostDelegate
192
-
193
- - (void)hostDidStart:(RCTHost *)host
194
- {
195
- if (self->_configuration.hostDidStartBlock) {
196
- self->_configuration.hostDidStartBlock(host);
197
- }
198
- }
199
-
200
- - (void)host:(RCTHost *)host
201
- didReceiveJSErrorStack:(NSArray<NSDictionary<NSString *, id> *> *)stack
202
- message:(NSString *)message
203
- exceptionId:(NSUInteger)exceptionId
204
- isFatal:(BOOL)isFatal
205
- {
206
- if (self->_configuration.hostDidReceiveJSErrorStackBlock) {
207
- self->_configuration.hostDidReceiveJSErrorStackBlock(host, stack, message, exceptionId, isFatal);
208
- }
209
- }
210
-
211
205
  #pragma mark - RCTCxxBridgeDelegate
212
206
  - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
213
207
  {
@@ -266,7 +260,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
266
260
  __weak __typeof(self) weakSelf = self;
267
261
  RCTHost *reactHost =
268
262
  [[RCTHost alloc] initWithBundleURLProvider:self->_configuration.bundleURLBlock
269
- hostDelegate:self
263
+ hostDelegate:_hostDelegate
270
264
  turboModuleManagerDelegate:_turboModuleManagerDelegate
271
265
  jsEngineProvider:^std::shared_ptr<facebook::react::JSRuntimeFactory>() {
272
266
  return [weakSelf createJSRuntimeFactory];
@@ -72,9 +72,10 @@ RCT_EXPORT_METHOD(readAsDataURL
72
72
  nil);
73
73
  } else {
74
74
  NSString *type = [RCTConvert NSString:blob[@"type"]];
75
- NSString *text = [NSString stringWithFormat:@"data:%@;base64,%@",
76
- type != nil && [type length] > 0 ? type : @"application/octet-stream",
77
- [data base64EncodedStringWithOptions:0]];
75
+ NSString *text = [NSString
76
+ stringWithFormat:@"data:%@;base64,%@",
77
+ ![type isEqual:[NSNull null]] && [type length] > 0 ? type : @"application/octet-stream",
78
+ [data base64EncodedStringWithOptions:0]];
78
79
 
79
80
  resolve(text);
80
81
  }
@@ -9,6 +9,7 @@
9
9
  */
10
10
 
11
11
  import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
12
+ import type {DimensionsPayload} from '../../Utilities/NativeDeviceInfo';
12
13
  import type {
13
14
  ViewLayout,
14
15
  ViewLayoutEvent,
@@ -18,6 +19,7 @@ import type {KeyboardEvent, KeyboardMetrics} from './Keyboard';
18
19
 
19
20
  import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation';
20
21
  import StyleSheet from '../../StyleSheet/StyleSheet';
22
+ import Dimensions from '../../Utilities/Dimensions';
21
23
  import Platform from '../../Utilities/Platform';
22
24
  import {type EventSubscription} from '../../vendor/emitter/EventEmitter';
23
25
  import AccessibilityInfo from '../AccessibilityInfo/AccessibilityInfo';
@@ -66,6 +68,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
66
68
  viewRef: {current: React.ElementRef<typeof View> | null, ...};
67
69
  _initialFrameHeight: number = 0;
68
70
  _bottom: number = 0;
71
+ _windowWidth: number = Dimensions.get('window').width;
69
72
 
70
73
  constructor(props: Props) {
71
74
  super(props);
@@ -130,6 +133,10 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
130
133
  }
131
134
  };
132
135
 
136
+ _onDimensionsChange = ({window}: DimensionsPayload) => {
137
+ this._windowWidth = window?.width ?? 0;
138
+ };
139
+
133
140
  // Avoid unnecessary renders if the KeyboardAvoidingView is disabled.
134
141
  _setBottom = (value: number) => {
135
142
  const enabled = this.props.enabled ?? true;
@@ -145,6 +152,15 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
145
152
  return;
146
153
  }
147
154
 
155
+ if (
156
+ Platform.OS === 'ios' &&
157
+ this._windowWidth !== this._keyboardEvent.endCoordinates.width
158
+ ) {
159
+ // The keyboard is not the standard bottom-of-the-screen keyboard. For example, floating keyboard on iPadOS.
160
+ this._setBottom(0);
161
+ return;
162
+ }
163
+
148
164
  const {duration, easing, endCoordinates} = this._keyboardEvent;
149
165
  const height = await this._relativeKeyboardHeight(endCoordinates);
150
166
 
@@ -178,6 +194,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
178
194
  if (Platform.OS === 'ios') {
179
195
  this._subscriptions = [
180
196
  Keyboard.addListener('keyboardWillChangeFrame', this._onKeyboardChange),
197
+ Dimensions.addEventListener('change', this._onDimensionsChange),
181
198
  ];
182
199
  } else {
183
200
  this._subscriptions = [
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 76,
19
19
  patch: 0,
20
- prerelease: 'rc.2',
20
+ prerelease: 'rc.4',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -42,9 +42,13 @@ if (__DEV__) {
42
42
  if (!Platform.isTesting) {
43
43
  const HMRClient = require('../Utilities/HMRClient');
44
44
 
45
+ // [0.76 only] When under React Native DevTools, log "JavaScript logs will
46
+ // be removed from Metro..." warning, and continue to forward logs.
45
47
  if (global.__FUSEBOX_HAS_FULL_CONSOLE_SUPPORT__) {
46
48
  HMRClient.unstable_notifyFuseboxConsoleEnabled();
47
- } else if (console._isPolyfilled) {
49
+ }
50
+
51
+ if (console._isPolyfilled) {
48
52
  // We assume full control over the console and send JavaScript logs to Metro.
49
53
  [
50
54
  'trace',
@@ -153,11 +153,12 @@ const HMRClient: HMRClientNativeInterface = {
153
153
  level: 'info',
154
154
  data: [
155
155
  '\n' +
156
- '\x1b[7m' +
157
- ' \x1b[1mJavaScript logs have moved!\x1b[22m They will now appear in the debugger console. ' +
158
- 'Tip: Type \x1b[1mj\x1b[22m in the terminal to open the debugger (requires Google Chrome ' +
159
- 'or Microsoft Edge).' +
160
- '\x1b[27m' +
156
+ '\u001B[7m' +
157
+ ' \u001B[1m💡 JavaScript logs will be removed from Metro in React ' +
158
+ 'Native 0.77!\u001B[22m Please use React Native DevTools as your ' +
159
+ 'default tool. Tip: Type \u001B[1mj\u001B[22m in the terminal to ' +
160
+ 'open (requires Google Chrome or Microsoft Edge).' +
161
+ '\u001B[27m' +
161
162
  '\n',
162
163
  ],
163
164
  }),
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(76),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.2",
27
+ RCTVersionPrerelease: @"rc.4",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -49,6 +49,11 @@ using namespace facebook::react;
49
49
  [_refreshControl addTarget:self
50
50
  action:@selector(handleUIControlEventValueChanged)
51
51
  forControlEvents:UIControlEventValueChanged];
52
+
53
+ const auto &concreteProps = static_cast<const PullToRefreshViewProps &>(*_props);
54
+
55
+ _refreshControl.tintColor = RCTUIColorFromSharedColor(concreteProps.tintColor);
56
+ [self _updateProgressViewOffset:concreteProps.progressViewOffset];
52
57
  }
53
58
 
54
59
  #pragma mark - RCTComponentViewProtocol
@@ -78,6 +83,14 @@ using namespace facebook::react;
78
83
  }
79
84
  }
80
85
 
86
+ if (newConcreteProps.tintColor != oldConcreteProps.tintColor) {
87
+ _refreshControl.tintColor = RCTUIColorFromSharedColor(newConcreteProps.tintColor);
88
+ }
89
+
90
+ if (newConcreteProps.progressViewOffset != oldConcreteProps.progressViewOffset) {
91
+ [self _updateProgressViewOffset:newConcreteProps.progressViewOffset];
92
+ }
93
+
81
94
  BOOL needsUpdateTitle = NO;
82
95
 
83
96
  if (newConcreteProps.title != oldConcreteProps.title) {
@@ -88,11 +101,11 @@ using namespace facebook::react;
88
101
  needsUpdateTitle = YES;
89
102
  }
90
103
 
104
+ [super updateProps:props oldProps:oldProps];
105
+
91
106
  if (needsUpdateTitle) {
92
107
  [self _updateTitle];
93
108
  }
94
-
95
- [super updateProps:props oldProps:oldProps];
96
109
  }
97
110
 
98
111
  #pragma mark -
@@ -102,6 +115,15 @@ using namespace facebook::react;
102
115
  static_cast<const PullToRefreshViewEventEmitter &>(*_eventEmitter).onRefresh({});
103
116
  }
104
117
 
118
+ - (void)_updateProgressViewOffset:(Float)progressViewOffset
119
+ {
120
+ _refreshControl.bounds = CGRectMake(
121
+ _refreshControl.bounds.origin.x,
122
+ -progressViewOffset,
123
+ _refreshControl.bounds.size.width,
124
+ _refreshControl.bounds.size.height);
125
+ }
126
+
105
127
  - (void)_updateTitle
106
128
  {
107
129
  const auto &concreteProps = static_cast<const PullToRefreshViewProps &>(*_props);
@@ -182,7 +182,7 @@ static CGPathRef RCTPathCreateOuterOutline(BOOL drawToEdge, CGRect rect, RCTCorn
182
182
  }
183
183
 
184
184
  static UIGraphicsImageRenderer *
185
- RCTUIGraphicsImageRenderer(CGSize size, CGColorRef backgroundColor, BOOL hasCornerRadii, BOOL drawToEdge)
185
+ RCTMakeUIGraphicsImageRenderer(CGSize size, CGColorRef backgroundColor, BOOL hasCornerRadii, BOOL drawToEdge)
186
186
  {
187
187
  const CGFloat alpha = CGColorGetAlpha(backgroundColor);
188
188
  const BOOL opaque = (drawToEdge || !hasCornerRadii) && alpha == 1.0;
@@ -231,7 +231,9 @@ static UIImage *RCTGetSolidBorderImage(
231
231
  } : viewSize;
232
232
 
233
233
  UIGraphicsImageRenderer *const imageRenderer =
234
- RCTUIGraphicsImageRenderer(size, backgroundColor, hasCornerRadii, drawToEdge);
234
+ RCTMakeUIGraphicsImageRenderer(size, backgroundColor, hasCornerRadii, drawToEdge);
235
+
236
+ CGColorRetain(backgroundColor);
235
237
  UIImage *image = [imageRenderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull rendererContext) {
236
238
  const CGContextRef context = rendererContext.CGContext;
237
239
  const CGRect rect = {.size = size};
@@ -242,6 +244,7 @@ static UIImage *RCTGetSolidBorderImage(
242
244
  CGContextAddPath(context, path);
243
245
  CGContextFillPath(context);
244
246
  }
247
+ CGColorRelease(backgroundColor);
245
248
 
246
249
  CGContextAddPath(context, path);
247
250
  CGPathRelease(path);
@@ -481,7 +484,7 @@ static UIImage *RCTGetDashedOrDottedBorderImage(
481
484
 
482
485
  const BOOL hasCornerRadii = RCTCornerRadiiAreAboveThreshold(cornerRadii);
483
486
  UIGraphicsImageRenderer *const imageRenderer =
484
- RCTUIGraphicsImageRenderer(viewSize, backgroundColor, hasCornerRadii, drawToEdge);
487
+ RCTMakeUIGraphicsImageRenderer(viewSize, backgroundColor, hasCornerRadii, drawToEdge);
485
488
  return [imageRenderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull rendererContext) {
486
489
  const CGContextRef context = rendererContext.CGContext;
487
490
  const CGRect rect = {.size = viewSize};
@@ -3314,6 +3314,15 @@ public final class com/facebook/react/modules/core/TimingModule : com/facebook/f
3314
3314
  public final class com/facebook/react/modules/core/TimingModule$Companion {
3315
3315
  }
3316
3316
 
3317
+ public final class com/facebook/react/modules/debug/DevMenuModule : com/facebook/fbreact/specs/NativeDevMenuSpec {
3318
+ public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;Lcom/facebook/react/devsupport/interfaces/DevSupportManager;)V
3319
+ public fun debugRemotely (Z)V
3320
+ public fun reload ()V
3321
+ public fun setHotLoadingEnabled (Z)V
3322
+ public fun setProfilingEnabled (Z)V
3323
+ public fun show ()V
3324
+ }
3325
+
3317
3326
  public final class com/facebook/react/modules/debug/DevSettingsModule : com/facebook/fbreact/specs/NativeDevSettingsSpec {
3318
3327
  public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;Lcom/facebook/react/devsupport/interfaces/DevSupportManager;)V
3319
3328
  public fun addListener (Ljava/lang/String;)V
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.76.0-rc.2
1
+ VERSION_NAME=0.76.0-rc.4
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -27,6 +27,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule;
27
27
  import com.facebook.react.modules.core.ExceptionsManagerModule;
28
28
  import com.facebook.react.modules.core.HeadlessJsTaskSupportModule;
29
29
  import com.facebook.react.modules.core.TimingModule;
30
+ import com.facebook.react.modules.debug.DevMenuModule;
30
31
  import com.facebook.react.modules.debug.DevSettingsModule;
31
32
  import com.facebook.react.modules.debug.SourceCodeModule;
32
33
  import com.facebook.react.modules.deviceinfo.DeviceInfoModule;
@@ -49,6 +50,7 @@ import java.util.Map;
49
50
  AndroidInfoModule.class,
50
51
  DeviceEventManagerModule.class,
51
52
  DeviceInfoModule.class,
53
+ DevMenuModule.class,
52
54
  DevSettingsModule.class,
53
55
  ExceptionsManagerModule.class,
54
56
  LogBoxModule.class,
@@ -108,6 +110,7 @@ class CoreModulesPackage extends BaseReactPackage implements ReactPackageLogger
108
110
  AndroidInfoModule.class,
109
111
  DeviceEventManagerModule.class,
110
112
  DeviceInfoModule.class,
113
+ DevMenuModule.class,
111
114
  DevSettingsModule.class,
112
115
  ExceptionsManagerModule.class,
113
116
  LogBoxModule.class,
@@ -142,6 +145,8 @@ class CoreModulesPackage extends BaseReactPackage implements ReactPackageLogger
142
145
  return new AndroidInfoModule(reactContext);
143
146
  case DeviceEventManagerModule.NAME:
144
147
  return new DeviceEventManagerModule(reactContext, mHardwareBackBtnHandler);
148
+ case DevMenuModule.NAME:
149
+ return new DevMenuModule(reactContext, mReactInstanceManager.getDevSupportManager());
145
150
  case DevSettingsModule.NAME:
146
151
  return new DevSettingsModule(reactContext, mReactInstanceManager.getDevSupportManager());
147
152
  case ExceptionsManagerModule.NAME:
@@ -289,10 +289,7 @@ public class ReactDelegate {
289
289
  // With Bridgeless enabled, create and start the surface
290
290
  if (ReactFeatureFlags.enableBridgelessArchitecture) {
291
291
  if (mReactSurface == null) {
292
- // Create a ReactSurface
293
292
  mReactSurface = mReactHost.createSurface(mActivity, appKey, mLaunchOptions);
294
- // Set main Activity's content view
295
- mActivity.setContentView(mReactSurface.getView());
296
293
  }
297
294
  mReactSurface.start();
298
295
  } else {
@@ -17,6 +17,7 @@ import android.view.ViewGroup;
17
17
  import androidx.annotation.NonNull;
18
18
  import androidx.annotation.Nullable;
19
19
  import androidx.fragment.app.Fragment;
20
+ import com.facebook.react.config.ReactFeatureFlags;
20
21
  import com.facebook.react.modules.core.PermissionAwareActivity;
21
22
  import com.facebook.react.modules.core.PermissionListener;
22
23
 
@@ -69,9 +70,15 @@ public class ReactFragment extends Fragment implements PermissionAwareActivity {
69
70
  if (mainComponentName == null) {
70
71
  throw new IllegalStateException("Cannot loadApp if component name is null");
71
72
  }
72
- mReactDelegate =
73
- new ReactDelegate(
74
- getActivity(), getReactNativeHost(), mainComponentName, launchOptions, fabricEnabled);
73
+ if (ReactFeatureFlags.enableBridgelessArchitecture) {
74
+ mReactDelegate =
75
+ new ReactDelegate(
76
+ getActivity(), getReactHost(), mainComponentName, launchOptions);
77
+ } else {
78
+ mReactDelegate =
79
+ new ReactDelegate(
80
+ getActivity(), getReactNativeHost(), mainComponentName, launchOptions, fabricEnabled);
81
+ }
75
82
  }
76
83
 
77
84
  /**
@@ -81,8 +88,34 @@ public class ReactFragment extends Fragment implements PermissionAwareActivity {
81
88
  * implement {@code ReactApplication} or you simply have a different mechanism for storing a
82
89
  * {@code ReactNativeHost}, e.g. as a static field somewhere.
83
90
  */
91
+ @Nullable
84
92
  protected ReactNativeHost getReactNativeHost() {
85
- return ((ReactApplication) getActivity().getApplication()).getReactNativeHost();
93
+ ReactApplication application = ((ReactApplication) getActivity().getApplication());
94
+ if (application != null) {
95
+ return application.getReactNativeHost();
96
+ } else {
97
+ return null;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Get the {@link ReactHost} used by this app. By default, assumes {@link
103
+ * Activity#getApplication()} is an instance of {@link ReactApplication} and calls {@link
104
+ * ReactApplication#getReactHost()}. Override this method if your application class does not
105
+ * implement {@code ReactApplication} or you simply have a different mechanism for storing a
106
+ * {@code ReactHost}, e.g. as a static field somewhere.
107
+ *
108
+ * <p>If you're using Old Architecture/Bridge Mode, this method should return null as {@link
109
+ * ReactHost} is a Bridgeless-only concept.
110
+ */
111
+ @Nullable
112
+ protected ReactHost getReactHost() {
113
+ ReactApplication application = ((ReactApplication) getActivity().getApplication());
114
+ if (application != null) {
115
+ return application.getReactHost();
116
+ } else {
117
+ return null;
118
+ }
86
119
  }
87
120
 
88
121
  protected ReactDelegate getReactDelegate() {
@@ -19,7 +19,7 @@ import com.facebook.react.ReactInstanceManager
19
19
  message =
20
20
  "ReactNative/Flipper integration is deprecated. Please remove the call to initializeFlipper from your MainApplication.java",
21
21
  replaceWith = ReplaceWith(""),
22
- level = DeprecationLevel.WARNING)
22
+ level = DeprecationLevel.ERROR)
23
23
  public object ReactNativeFlipper {
24
24
  @Suppress("UNUSED_PARAMETER")
25
25
  @JvmStatic
@@ -27,7 +27,7 @@ public object ReactNativeFlipper {
27
27
  message =
28
28
  "ReactNative/Flipper integration is deprecated. Please remove the call to initializeFlipper from your MainApplication.java",
29
29
  replaceWith = ReplaceWith(""),
30
- level = DeprecationLevel.WARNING)
30
+ level = DeprecationLevel.ERROR)
31
31
  public fun initializeFlipper(context: Context, reactInstanceManager: ReactInstanceManager) {
32
32
  // no-op
33
33
  }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ package com.facebook.react.modules.debug
9
+
10
+ import com.facebook.fbreact.specs.NativeDevMenuSpec
11
+ import com.facebook.react.bridge.ReactApplicationContext
12
+ import com.facebook.react.bridge.UiThreadUtil
13
+ import com.facebook.react.devsupport.interfaces.DevSupportManager
14
+ import com.facebook.react.module.annotations.ReactModule
15
+
16
+ /** Module that exposes the DevMenu to JS so that it can be used to programmatically open it. */
17
+ @ReactModule(name = NativeDevMenuSpec.NAME)
18
+ public class DevMenuModule(
19
+ reactContext: ReactApplicationContext?,
20
+ private val devSupportManager: DevSupportManager
21
+ ) : NativeDevMenuSpec(reactContext) {
22
+
23
+ override fun show() {
24
+ if (devSupportManager.devSupportEnabled) {
25
+ devSupportManager.showDevOptionsDialog()
26
+ }
27
+ }
28
+
29
+ override fun reload() {
30
+ if (devSupportManager.devSupportEnabled) {
31
+ UiThreadUtil.runOnUiThread { devSupportManager.handleReloadJS() }
32
+ }
33
+ }
34
+
35
+ override fun debugRemotely(enableDebug: Boolean) {
36
+ devSupportManager.setRemoteJSDebugEnabled(enableDebug)
37
+ }
38
+
39
+ override fun setProfilingEnabled(enabled: Boolean) {
40
+ // iOS only
41
+ }
42
+
43
+ override fun setHotLoadingEnabled(enabled: Boolean) {
44
+ devSupportManager.setHotModuleReplacementEnabled(enabled)
45
+ }
46
+ }
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 76,
20
20
  "patch", 0,
21
- "prerelease", "rc.2");
21
+ "prerelease", "rc.4");
22
22
  }
@@ -23,6 +23,7 @@ import com.facebook.react.module.model.ReactModuleInfoProvider;
23
23
  import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
24
24
  import com.facebook.react.modules.core.DeviceEventManagerModule;
25
25
  import com.facebook.react.modules.core.ExceptionsManagerModule;
26
+ import com.facebook.react.modules.debug.DevMenuModule;
26
27
  import com.facebook.react.modules.debug.DevSettingsModule;
27
28
  import com.facebook.react.modules.debug.SourceCodeModule;
28
29
  import com.facebook.react.modules.deviceinfo.DeviceInfoModule;
@@ -35,6 +36,7 @@ import java.util.Map;
35
36
  nativeModules = {
36
37
  AndroidInfoModule.class,
37
38
  DeviceInfoModule.class,
39
+ DevMenuModule.class,
38
40
  DevSettingsModule.class,
39
41
  SourceCodeModule.class,
40
42
  LogBoxModule.class,
@@ -61,6 +63,8 @@ class CoreReactPackage extends BaseReactPackage {
61
63
  return new DeviceInfoModule(reactContext);
62
64
  case SourceCodeModule.NAME:
63
65
  return new SourceCodeModule(reactContext);
66
+ case DevMenuModule.NAME:
67
+ return new DevMenuModule(reactContext, mDevSupportManager);
64
68
  case DevSettingsModule.NAME:
65
69
  return new DevSettingsModule(reactContext, mDevSupportManager);
66
70
  case DeviceEventManagerModule.NAME:
@@ -108,6 +112,7 @@ class CoreReactPackage extends BaseReactPackage {
108
112
  AndroidInfoModule.class,
109
113
  DeviceInfoModule.class,
110
114
  SourceCodeModule.class,
115
+ DevMenuModule.class,
111
116
  DevSettingsModule.class,
112
117
  DeviceEventManagerModule.class,
113
118
  LogBoxModule.class,
@@ -446,7 +446,7 @@ public class TextLayoutManager {
446
446
  ? paragraphAttributes.getBoolean(PA_KEY_INCLUDE_FONT_PADDING)
447
447
  : DEFAULT_INCLUDE_FONT_PADDING;
448
448
  int hyphenationFrequency =
449
- TextAttributeProps.getTextBreakStrategy(
449
+ TextAttributeProps.getHyphenationFrequency(
450
450
  paragraphAttributes.getString(PA_KEY_HYPHENATION_FREQUENCY));
451
451
  boolean adjustFontSizeToFit =
452
452
  paragraphAttributes.contains(PA_KEY_ADJUST_FONT_SIZE_TO_FIT)
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 76;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "rc.2";
21
+ std::string_view Prerelease = "rc.4";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -790,10 +790,7 @@ LayoutAnimationKeyFrameManager::pullTransaction(
790
790
  finalConflictingMutations.end(),
791
791
  &shouldFirstComeBeforeSecondMutation);
792
792
 
793
- std::stable_sort(
794
- immediateMutations.begin(),
795
- immediateMutations.end(),
796
- &shouldFirstComeBeforeSecondRemovesOnly);
793
+ handleShouldFirstComeBeforeSecondRemovesOnly(immediateMutations);
797
794
 
798
795
  animation.keyFrames = keyFramesToAnimate;
799
796
  inflightAnimations_.push_back(std::move(animation));
@@ -24,6 +24,40 @@ static inline bool shouldFirstComeBeforeSecondRemovesOnly(
24
24
  (lhs.index > rhs.index);
25
25
  }
26
26
 
27
+ static inline void handleShouldFirstComeBeforeSecondRemovesOnly(
28
+ ShadowViewMutation::List& list) noexcept {
29
+ std::unordered_map<std::string, std::vector<ShadowViewMutation>>
30
+ removeMutationsByTag;
31
+ ShadowViewMutation::List finalList;
32
+ for (auto& mutation : list) {
33
+ if (mutation.type == ShadowViewMutation::Type::Remove) {
34
+ auto key = std::to_string(mutation.parentShadowView.tag);
35
+ removeMutationsByTag[key].push_back(mutation);
36
+ } else {
37
+ finalList.push_back(mutation);
38
+ }
39
+ }
40
+
41
+ if (removeMutationsByTag.size() == 0) {
42
+ return;
43
+ }
44
+
45
+ for (auto& mutationsPair : removeMutationsByTag) {
46
+ if (mutationsPair.second.size() > 1) {
47
+ std::stable_sort(
48
+ mutationsPair.second.begin(),
49
+ mutationsPair.second.end(),
50
+ &shouldFirstComeBeforeSecondRemovesOnly);
51
+ }
52
+ finalList.insert(
53
+ finalList.begin(),
54
+ mutationsPair.second.begin(),
55
+ mutationsPair.second.end());
56
+ }
57
+
58
+ list = finalList;
59
+ }
60
+
27
61
  static inline bool shouldFirstComeBeforeSecondMutation(
28
62
  const ShadowViewMutation& lhs,
29
63
  const ShadowViewMutation& rhs) noexcept {
@@ -55,6 +89,17 @@ static inline bool shouldFirstComeBeforeSecondMutation(
55
89
  lhs.type == ShadowViewMutation::Type::Insert) {
56
90
  return false;
57
91
  }
92
+
93
+ // Remove comes before Update
94
+ if (lhs.type == ShadowViewMutation::Type::Remove &&
95
+ rhs.type == ShadowViewMutation::Type::Update) {
96
+ return true;
97
+ }
98
+ if (rhs.type == ShadowViewMutation::Type::Remove &&
99
+ lhs.type == ShadowViewMutation::Type::Update) {
100
+ return false;
101
+ }
102
+
58
103
  } else {
59
104
  // Make sure that removes on the same level are sorted - highest indices
60
105
  // must come first.
@@ -35,6 +35,11 @@ typedef NSURL *_Nullable (^RCTHostBundleURLProvider)(void);
35
35
 
36
36
  - (void)hostDidStart:(RCTHost *)host;
37
37
 
38
+ @optional
39
+ - (void)loadBundleAtURL:(NSURL *)sourceURL
40
+ onProgress:(RCTSourceLoadProgressBlock)onProgress
41
+ onComplete:(RCTSourceLoadBlock)loadCallback;
42
+
38
43
  @end
39
44
 
40
45
  @protocol RCTHostRuntimeDelegate <NSObject>
@@ -329,6 +329,17 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho
329
329
  [self.runtimeDelegate host:self didInitializeRuntime:runtime];
330
330
  }
331
331
 
332
+ - (void)loadBundleAtURL:(NSURL *)sourceURL
333
+ onProgress:(RCTSourceLoadProgressBlock)onProgress
334
+ onComplete:(RCTSourceLoadBlock)loadCallback
335
+ {
336
+ if ([_hostDelegate respondsToSelector:@selector(loadBundleAtURL:onProgress:onComplete:)]) {
337
+ [_hostDelegate loadBundleAtURL:sourceURL onProgress:onProgress onComplete:loadCallback];
338
+ } else {
339
+ [RCTJavaScriptLoader loadBundleAtURL:sourceURL onProgress:onProgress onComplete:loadCallback];
340
+ }
341
+ }
342
+
332
343
  #pragma mark - RCTContextContainerHandling
333
344
 
334
345
  - (void)didCreateContextContainer:(std::shared_ptr<facebook::react::ContextContainer>)contextContainer
@@ -8,6 +8,7 @@
8
8
  #import <UIKit/UIKit.h>
9
9
 
10
10
  #import <React/RCTDefines.h>
11
+ #import <React/RCTJavaScriptLoader.h>
11
12
  #import <jsinspector-modern/ReactCdp.h>
12
13
  #import <react/runtime/JSRuntimeFactory.h>
13
14
  #import <react/runtime/ReactInstance.h>
@@ -44,6 +45,10 @@ RCT_EXTERN void RCTInstanceSetRuntimeDiagnosticFlags(NSString *_Nullable flags);
44
45
 
45
46
  - (void)instance:(RCTInstance *)instance didInitializeRuntime:(facebook::jsi::Runtime &)runtime;
46
47
 
48
+ - (void)loadBundleAtURL:(NSURL *)sourceURL
49
+ onProgress:(RCTSourceLoadProgressBlock)onProgress
50
+ onComplete:(RCTSourceLoadBlock)loadCallback;
51
+
47
52
  @end
48
53
 
49
54
  /**
@@ -25,7 +25,6 @@
25
25
  #import <React/RCTDisplayLink.h>
26
26
  #import <React/RCTEventDispatcherProtocol.h>
27
27
  #import <React/RCTFollyConvert.h>
28
- #import <React/RCTJavaScriptLoader.h>
29
28
  #import <React/RCTLog.h>
30
29
  #import <React/RCTLogBox.h>
31
30
  #import <React/RCTModuleData.h>
@@ -428,7 +427,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
428
427
  #endif
429
428
 
430
429
  __weak __typeof(self) weakSelf = self;
431
- [RCTJavaScriptLoader loadBundleAtURL:sourceURL
430
+ [_delegate loadBundleAtURL:sourceURL
432
431
  onProgress:^(RCTLoadingProgress *progressData) {
433
432
  __typeof(self) strongSelf = weakSelf;
434
433
  if (!strongSelf) {
package/cli.js CHANGED
@@ -15,6 +15,7 @@ const chalk = require('chalk');
15
15
  const {get} = require('https');
16
16
  const semver = require('semver');
17
17
  const {URL} = require('url');
18
+ const {spawn} = require('child_process');
18
19
 
19
20
  const deprecated = () => {
20
21
  throw new Error(
@@ -200,6 +201,19 @@ async function main() {
200
201
  warnWithDeprecationSchedule();
201
202
  }
202
203
  warnWhenRunningInit();
204
+
205
+ const proc = spawn(
206
+ 'npx',
207
+ ['@react-native-community/cli', ...process.argv.slice(2)],
208
+ {
209
+ stdio: 'inherit',
210
+ },
211
+ );
212
+
213
+ const code = await new Promise(resolve => {
214
+ proc.on('exit', resolve);
215
+ });
216
+ process.exit(code);
203
217
  }
204
218
 
205
219
  try {
package/jest-preset.js CHANGED
@@ -15,11 +15,7 @@ module.exports = {
15
15
  platforms: ['android', 'ios', 'native'],
16
16
  },
17
17
  transform: {
18
- '^.+\\.(js)$': [
19
- 'babel-jest',
20
- {plugins: ['babel-plugin-syntax-hermes-parser']},
21
- ],
22
- '^.+\\.(ts|tsx)$': 'babel-jest',
18
+ '^.+\\.(js|ts|tsx)$': 'babel-jest',
23
19
  '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': require.resolve(
24
20
  './jest/assetFileTransformer.js',
25
21
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.76.0-rc.2",
3
+ "version": "0.76.0-rc.4",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -109,13 +109,13 @@
109
109
  },
110
110
  "dependencies": {
111
111
  "@jest/create-cache-key-function": "^29.6.3",
112
- "@react-native/assets-registry": "0.76.0-rc.2",
113
- "@react-native/codegen": "0.76.0-rc.2",
114
- "@react-native/community-cli-plugin": "0.76.0-rc.2",
115
- "@react-native/gradle-plugin": "0.76.0-rc.2",
116
- "@react-native/js-polyfills": "0.76.0-rc.2",
117
- "@react-native/normalize-colors": "0.76.0-rc.2",
118
- "@react-native/virtualized-lists": "0.76.0-rc.2",
112
+ "@react-native/assets-registry": "0.76.0-rc.4",
113
+ "@react-native/codegen": "0.76.0-rc.4",
114
+ "@react-native/community-cli-plugin": "0.76.0-rc.4",
115
+ "@react-native/gradle-plugin": "0.76.0-rc.4",
116
+ "@react-native/js-polyfills": "0.76.0-rc.4",
117
+ "@react-native/normalize-colors": "0.76.0-rc.4",
118
+ "@react-native/virtualized-lists": "0.76.0-rc.4",
119
119
  "abort-controller": "^3.0.0",
120
120
  "anser": "^1.4.9",
121
121
  "ansi-regex": "^5.0.0",
@@ -131,8 +131,8 @@
131
131
  "jest-environment-node": "^29.6.3",
132
132
  "jsc-android": "^250231.0.0",
133
133
  "memoize-one": "^5.0.0",
134
- "metro-runtime": "^0.81.0-alpha.0",
135
- "metro-source-map": "^0.81.0-alpha.0",
134
+ "metro-runtime": "^0.81.0-alpha.2",
135
+ "metro-source-map": "^0.81.0-alpha.2",
136
136
  "mkdirp": "^0.5.1",
137
137
  "nullthrows": "^1.1.1",
138
138
  "pretty-format": "^29.7.0",
@@ -236,16 +236,9 @@ class ReactNativePodsUtils
236
236
  if !file_manager.exist?("#{file_path}.local")
237
237
  # When installing pods with a yarn alias, yarn creates a fake yarn and node executables
238
238
  # in a temporary folder.
239
- # Using `type -a` we are able to retrieve all the paths of an executable and we can
240
- # exclude the temporary ones.
239
+ # Using `node --print "process.argv[0]";` we are able to retrieve the actual path from which node is running.
241
240
  # see https://github.com/facebook/react-native/issues/43285 for more info
242
- node_binary = `type -a node`.split("\n").map { |path|
243
- path.gsub!("node is ", "")
244
- }.select { |b|
245
- !b.start_with?("/var")
246
- }
247
-
248
- node_binary = node_binary[0]
241
+ node_binary = `node --print "process.argv[0]";`
249
242
  system("echo 'export NODE_BINARY=#{node_binary}' > #{file_path}.local")
250
243
  end
251
244
  end
Binary file
Binary file
Binary file