react-native-tvos 0.76.0-0rc3 → 0.76.0-0rc4

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 (25) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.mm +1 -14
  2. package/Libraries/AppDelegate/RCTRootViewFactory.h +5 -23
  3. package/Libraries/AppDelegate/RCTRootViewFactory.mm +19 -25
  4. package/Libraries/Core/ReactNativeVersion.js +1 -1
  5. package/Libraries/Core/setUpDeveloperTools.js +5 -1
  6. package/Libraries/Utilities/HMRClient.js +6 -5
  7. package/React/Base/RCTVersion.m +1 -1
  8. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +2 -2
  9. package/React/Views/RCTBorderDrawing.m +6 -3
  10. package/ReactAndroid/gradle.properties +1 -1
  11. package/ReactAndroid/publish.gradle +2 -2
  12. package/ReactAndroid/src/main/java/com/facebook/react/flipper/ReactNativeFlipper.kt +2 -2
  13. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  14. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  15. package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1 -4
  16. package/ReactCommon/react/renderer/animations/utils.h +45 -0
  17. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +5 -0
  18. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +11 -0
  19. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +5 -0
  20. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +1 -2
  21. package/package.json +8 -8
  22. package/scripts/cocoapods/utils.rb +2 -9
  23. package/sdks/hermesc/osx-bin/hermes +0 -0
  24. package/sdks/hermesc/osx-bin/hermesc +0 -0
  25. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
@@ -285,19 +285,6 @@
285
285
  return [weakSelf sourceURLForBridge:bridge];
286
286
  };
287
287
 
288
- configuration.hostDidStartBlock = ^(RCTHost *_Nonnull host) {
289
- [weakSelf hostDidStart:host];
290
- };
291
-
292
- configuration.hostDidReceiveJSErrorStackBlock =
293
- ^(RCTHost *_Nonnull host,
294
- NSArray<NSDictionary<NSString *, id> *> *_Nonnull stack,
295
- NSString *_Nonnull message,
296
- NSUInteger exceptionId,
297
- BOOL isFatal) {
298
- [weakSelf host:host didReceiveJSErrorStack:stack message:message exceptionId:exceptionId isFatal:isFatal];
299
- };
300
-
301
288
  if ([self respondsToSelector:@selector(extraModulesForBridge:)]) {
302
289
  configuration.extraModulesForBridge = ^NSArray<id<RCTBridgeModule>> *_Nonnull(RCTBridge *_Nonnull bridge)
303
290
  {
@@ -319,7 +306,7 @@
319
306
  };
320
307
  }
321
308
 
322
- return [[RCTRootViewFactory alloc] initWithConfiguration:configuration andTurboModuleManagerDelegate:self];
309
+ return [[RCTRootViewFactory alloc] initWithTurboModuleDelegate:self hostDelegate:self configuration:configuration];
323
310
  }
324
311
 
325
312
  #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];
@@ -191,26 +205,6 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
191
205
  return rootView;
192
206
  }
193
207
 
194
- #pragma mark - RCTHostDelegate
195
-
196
- - (void)hostDidStart:(RCTHost *)host
197
- {
198
- if (self->_configuration.hostDidStartBlock) {
199
- self->_configuration.hostDidStartBlock(host);
200
- }
201
- }
202
-
203
- - (void)host:(RCTHost *)host
204
- didReceiveJSErrorStack:(NSArray<NSDictionary<NSString *, id> *> *)stack
205
- message:(NSString *)message
206
- exceptionId:(NSUInteger)exceptionId
207
- isFatal:(BOOL)isFatal
208
- {
209
- if (self->_configuration.hostDidReceiveJSErrorStackBlock) {
210
- self->_configuration.hostDidReceiveJSErrorStackBlock(host, stack, message, exceptionId, isFatal);
211
- }
212
- }
213
-
214
208
  #pragma mark - RCTCxxBridgeDelegate
215
209
  - (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
216
210
  {
@@ -269,7 +263,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
269
263
  __weak __typeof(self) weakSelf = self;
270
264
  RCTHost *reactHost =
271
265
  [[RCTHost alloc] initWithBundleURLProvider:self->_configuration.bundleURLBlock
272
- hostDelegate:self
266
+ hostDelegate:_hostDelegate
273
267
  turboModuleManagerDelegate:_turboModuleManagerDelegate
274
268
  jsEngineProvider:^std::shared_ptr<facebook::react::JSRuntimeFactory>() {
275
269
  return [weakSelf createJSRuntimeFactory];
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 76,
19
19
  patch: 0,
20
- prerelease: '0rc3',
20
+ prerelease: '0rc4',
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: @"0rc3",
27
+ RCTVersionPrerelease: @"0rc4",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -112,11 +112,11 @@ using namespace facebook::react;
112
112
  needsUpdateTitle = YES;
113
113
  }
114
114
 
115
+ [super updateProps:props oldProps:oldProps];
116
+
115
117
  if (needsUpdateTitle) {
116
118
  [self _updateTitle];
117
119
  }
118
-
119
- [super updateProps:props oldProps:oldProps];
120
120
  }
121
121
 
122
122
  #pragma mark -
@@ -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};
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.76.0-0rc3
1
+ VERSION_NAME=0.76.0-0rc4
2
2
  react.internal.publishingGroup=io.github.react-native-tvos
3
3
 
4
4
  android.useAndroidX=true
@@ -20,7 +20,7 @@ def sonatypeUsername = findProperty('SONATYPE_USERNAME')
20
20
  def sonatypePassword = findProperty('SONATYPE_PASSWORD')
21
21
 
22
22
  def reactAndroidProjectDir = project(':packages:react-native:ReactAndroid').projectDir
23
- def mavenTempLocalUrl = 'file:///var/folders/xp/yw_lp59x05d2mp0g0n2f_d240000gn/T/eas-build-workingdir/build/maven_local'
23
+ def mavenTempLocalUrl = 'file:///Users/expo/workingdir/build/maven_local'
24
24
  // Rewritten when copying this to ReactAndroid/publish.gradle
25
25
 
26
26
  publishing {
@@ -103,4 +103,4 @@ publishing {
103
103
  } else {
104
104
  logger.info('Signing disabled as the PGP key was not found')
105
105
  }
106
- }
106
+ }
@@ -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
  }
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 76,
20
20
  "patch", 0,
21
- "prerelease", "0rc3");
21
+ "prerelease", "0rc4");
22
22
  }
@@ -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 = "0rc3";
21
+ std::string_view Prerelease = "0rc4";
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-tvos",
3
- "version": "0.76.0-0rc3",
3
+ "version": "0.76.0-0rc4",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -110,13 +110,13 @@
110
110
  },
111
111
  "dependencies": {
112
112
  "@jest/create-cache-key-function": "^29.6.3",
113
- "@react-native/assets-registry": "0.76.0-rc.3",
114
- "@react-native/codegen": "0.76.0-rc.3",
115
- "@react-native/community-cli-plugin": "0.76.0-rc.3",
116
- "@react-native/gradle-plugin": "0.76.0-rc.3",
117
- "@react-native/js-polyfills": "0.76.0-rc.3",
118
- "@react-native/normalize-colors": "0.76.0-rc.3",
119
- "@react-native-tvos/virtualized-lists": "0.76.0-0rc3",
113
+ "@react-native/assets-registry": "0.76.0-rc.4",
114
+ "@react-native/codegen": "0.76.0-rc.4",
115
+ "@react-native/community-cli-plugin": "0.76.0-rc.4",
116
+ "@react-native/gradle-plugin": "0.76.0-rc.4",
117
+ "@react-native/js-polyfills": "0.76.0-rc.4",
118
+ "@react-native/normalize-colors": "0.76.0-rc.4",
119
+ "@react-native-tvos/virtualized-lists": "0.76.0-0rc4",
120
120
  "abort-controller": "^3.0.0",
121
121
  "anser": "^1.4.9",
122
122
  "ansi-regex": "^5.0.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
- return !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