react-native 0.77.0-rc.0 → 0.77.0-rc.2

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 (27) hide show
  1. package/Libraries/Animated/NativeAnimatedAllowlist.js +4 -4
  2. package/Libraries/Animated/animations/Animation.js +1 -1
  3. package/Libraries/Animated/nodes/AnimatedProps.js +9 -1
  4. package/Libraries/Animated/nodes/AnimatedStyle.js +9 -1
  5. package/Libraries/Core/ReactNativeVersion.js +1 -1
  6. package/Libraries/Network/FormData.js +11 -3
  7. package/React/Base/RCTVersion.m +1 -1
  8. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +1 -1
  9. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +12 -0
  10. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +4 -9
  11. package/ReactAndroid/api/ReactAndroid.api +5 -0
  12. package/ReactAndroid/gradle.properties +1 -1
  13. package/ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.java +12 -13
  14. package/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.kt +13 -0
  15. package/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.kt +18 -0
  16. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  17. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +3 -2
  18. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  19. package/ReactCommon/react/runtime/ReactInstance.cpp +39 -35
  20. package/ReactCommon/react/runtime/ReactInstance.h +2 -1
  21. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +3 -2
  22. package/package.json +8 -8
  23. package/scripts/codegen/generate-artifacts-executor.js +5 -0
  24. package/sdks/hermesc/osx-bin/hermes +0 -0
  25. package/sdks/hermesc/osx-bin/hermesc +0 -0
  26. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  27. package/src/private/animated/useAnimatedPropsMemo.js +12 -4
@@ -106,17 +106,17 @@ export function allowTransformProp(prop: string): void {
106
106
  }
107
107
 
108
108
  export function isSupportedColorStyleProp(prop: string): boolean {
109
- return Object.hasOwn(SUPPORTED_COLOR_STYLES, prop);
109
+ return SUPPORTED_COLOR_STYLES.hasOwnProperty(prop);
110
110
  }
111
111
 
112
112
  export function isSupportedInterpolationParam(param: string): boolean {
113
- return Object.hasOwn(SUPPORTED_INTERPOLATION_PARAMS, param);
113
+ return SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(param);
114
114
  }
115
115
 
116
116
  export function isSupportedStyleProp(prop: string): boolean {
117
- return Object.hasOwn(SUPPORTED_STYLES, prop);
117
+ return SUPPORTED_STYLES.hasOwnProperty(prop);
118
118
  }
119
119
 
120
120
  export function isSupportedTransformProp(prop: string): boolean {
121
- return Object.hasOwn(SUPPORTED_TRANSFORMS, prop);
121
+ return SUPPORTED_TRANSFORMS.hasOwnProperty(prop);
122
122
  }
@@ -165,7 +165,7 @@ export default class Animation {
165
165
  const callback = this.#onEnd;
166
166
  if (callback != null) {
167
167
  this.#onEnd = null;
168
- queueMicrotask(() => callback(result));
168
+ callback(result);
169
169
  }
170
170
  }
171
171
  }
@@ -37,7 +37,7 @@ function createAnimatedProps(
37
37
  const key = keys[ii];
38
38
  const value = inputProps[key];
39
39
 
40
- if (allowlist == null || Object.hasOwn(allowlist, key)) {
40
+ if (allowlist == null || hasOwn(allowlist, key)) {
41
41
  let node;
42
42
  if (key === 'style') {
43
43
  node = AnimatedStyle.from(value, allowlist?.style);
@@ -271,3 +271,11 @@ export default class AnimatedProps extends AnimatedNode {
271
271
  };
272
272
  }
273
273
  }
274
+
275
+ // Supported versions of JSC do not implement the newer Object.hasOwn. Remove
276
+ // this shim when they do.
277
+ // $FlowIgnore[method-unbinding]
278
+ const _hasOwnProp = Object.prototype.hasOwnProperty;
279
+ const hasOwn: (obj: $ReadOnly<{...}>, prop: string) => boolean =
280
+ // $FlowIgnore[method-unbinding]
281
+ Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));
@@ -35,7 +35,7 @@ function createAnimatedStyle(
35
35
  const key = keys[ii];
36
36
  const value = inputStyle[key];
37
37
 
38
- if (allowlist == null || Object.hasOwn(allowlist, key)) {
38
+ if (allowlist == null || hasOwn(allowlist, key)) {
39
39
  let node;
40
40
  if (value != null && key === 'transform') {
41
41
  node = ReactNativeFeatureFlags.shouldUseAnimatedObjectForTransform()
@@ -241,3 +241,11 @@ export default class AnimatedStyle extends AnimatedWithChildren {
241
241
  };
242
242
  }
243
243
  }
244
+
245
+ // Supported versions of JSC do not implement the newer Object.hasOwn. Remove
246
+ // this shim when they do.
247
+ // $FlowIgnore[method-unbinding]
248
+ const _hasOwnProp = Object.prototype.hasOwnProperty;
249
+ const hasOwn: (obj: $ReadOnly<{...}>, prop: string) => boolean =
250
+ // $FlowIgnore[method-unbinding]
251
+ Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 77,
19
19
  patch: 0,
20
- prerelease: 'rc.0',
20
+ prerelease: 'rc.2',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -28,6 +28,15 @@ type FormDataPart =
28
28
  ...
29
29
  };
30
30
 
31
+ /**
32
+ * Encode a FormData filename compliant with RFC 2183
33
+ *
34
+ * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#directives
35
+ */
36
+ function encodeFilename(filename: string): string {
37
+ return encodeURIComponent(filename.replace(/\//g, '_'));
38
+ }
39
+
31
40
  /**
32
41
  * Polyfill for XMLHttpRequest2 FormData API, allowing multipart POST requests
33
42
  * with mixed data (string, native files) to be submitted via XMLHttpRequest.
@@ -82,9 +91,8 @@ class FormData {
82
91
  // content type (cf. web Blob interface.)
83
92
  if (typeof value === 'object' && !Array.isArray(value) && value) {
84
93
  if (typeof value.name === 'string') {
85
- headers['content-disposition'] += `; filename="${
86
- value.name
87
- }"; filename*=utf-8''${encodeURI(value.name)}`;
94
+ headers['content-disposition'] +=
95
+ `; filename="${encodeFilename(value.name)}"`;
88
96
  }
89
97
  if (typeof value.type === 'string') {
90
98
  headers['content-type'] = value.type;
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(77),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.0",
27
+ RCTVersionPrerelease: @"rc.2",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -10,7 +10,7 @@
10
10
  /**
11
11
  * UIView class for root <ModalHostView> component.
12
12
  */
13
- @interface RCTModalHostViewComponentView : RCTViewComponentView
13
+ @interface RCTModalHostViewComponentView : RCTViewComponentView <UIAdaptivePresentationControllerDelegate>
14
14
 
15
15
  /**
16
16
  * Subclasses may override this method and present the modal on different view controller.
@@ -149,6 +149,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
149
149
  {
150
150
  BOOL shouldBePresented = !_isPresented && _shouldPresent && self.window;
151
151
  if (shouldBePresented) {
152
+ self.viewController.presentationController.delegate = self;
153
+
152
154
  _isPresented = YES;
153
155
  [self presentViewController:self.viewController
154
156
  animated:_shouldAnimatePresentation
@@ -274,6 +276,16 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
274
276
  [childComponentView removeFromSuperview];
275
277
  }
276
278
 
279
+ #pragma mark - UIAdaptivePresentationControllerDelegate
280
+
281
+ - (void)presentationControllerDidAttemptToDismiss:(UIPresentationController *)controller
282
+ {
283
+ auto eventEmitter = [self modalEventEmitter];
284
+ if (eventEmitter) {
285
+ eventEmitter->onRequestClose({});
286
+ }
287
+ }
288
+
277
289
  @end
278
290
 
279
291
  #ifdef __cplusplus
@@ -189,10 +189,11 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
189
189
 
190
190
  UIEdgeInsets newEdgeInsets = _scrollView.contentInset;
191
191
  CGFloat inset = MAX(scrollViewLowerY - keyboardEndFrame.origin.y, 0);
192
+ const auto &props = static_cast<const ScrollViewProps &>(*_props);
192
193
  if (isInverted) {
193
- newEdgeInsets.top = MAX(inset, _scrollView.contentInset.top);
194
+ newEdgeInsets.top = MAX(inset, props.contentInset.top);
194
195
  } else {
195
- newEdgeInsets.bottom = MAX(inset, _scrollView.contentInset.bottom);
196
+ newEdgeInsets.bottom = MAX(inset, props.contentInset.bottom);
196
197
  }
197
198
 
198
199
  CGPoint newContentOffset = _scrollView.contentOffset;
@@ -210,12 +211,6 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
210
211
  contentDiff = keyboardEndFrame.origin.y - keyboardBeginFrame.origin.y;
211
212
  }
212
213
  } else {
213
- CGRect viewIntersection = CGRectIntersection(self.firstResponderFocus, keyboardEndFrame);
214
-
215
- if (CGRectIsNull(viewIntersection)) {
216
- return;
217
- }
218
-
219
214
  // Inner text field focused
220
215
  CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
221
216
  if (focusEnd > keyboardEndFrame.origin.y) {
@@ -247,7 +242,7 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
247
242
  animations:^{
248
243
  self->_scrollView.contentInset = newEdgeInsets;
249
244
  self->_scrollView.verticalScrollIndicatorInsets = newEdgeInsets;
250
- [self scrollToOffset:newContentOffset animated:NO];
245
+ [self scrollTo:newContentOffset.x y:newContentOffset.y animated:NO];
251
246
  }
252
247
  completion:nil];
253
248
  }
@@ -426,6 +426,10 @@ public abstract interface class com/facebook/react/ReactRootView$ReactRootViewEv
426
426
  public abstract fun onAttachedToReactInstance (Lcom/facebook/react/ReactRootView;)V
427
427
  }
428
428
 
429
+ public abstract class com/facebook/react/TurboReactPackage : com/facebook/react/BaseReactPackage {
430
+ public fun <init> ()V
431
+ }
432
+
429
433
  public abstract interface class com/facebook/react/ViewManagerOnDemandReactPackage {
430
434
  public abstract fun createViewManager (Lcom/facebook/react/bridge/ReactApplicationContext;Ljava/lang/String;)Lcom/facebook/react/uimanager/ViewManager;
431
435
  public abstract fun getViewManagerNames (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/Collection;
@@ -2959,6 +2963,7 @@ public abstract interface annotation class com/facebook/react/module/annotations
2959
2963
  public final class com/facebook/react/module/model/ReactModuleInfo {
2960
2964
  public static final field Companion Lcom/facebook/react/module/model/ReactModuleInfo$Companion;
2961
2965
  public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZ)V
2966
+ public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZZ)V
2962
2967
  public final fun canOverrideExistingModule ()Z
2963
2968
  public static final fun classIsTurboModule (Ljava/lang/Class;)Z
2964
2969
  public final fun className ()Ljava/lang/String;
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.77.0-rc.0
1
+ VERSION_NAME=0.77.0-rc.2
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -179,31 +179,30 @@ public abstract class HeadlessJsTaskService extends Service implements HeadlessJ
179
179
  }
180
180
 
181
181
  private void createReactContextAndScheduleTask(final HeadlessJsTaskConfig taskConfig) {
182
- final ReactHost reactHost = getReactHost();
183
-
184
- if (reactHost == null) { // old arch
185
- final ReactInstanceManager reactInstanceManager =
186
- getReactNativeHost().getReactInstanceManager();
187
-
188
- reactInstanceManager.addReactInstanceEventListener(
182
+ if (ReactNativeFeatureFlags.enableBridgelessArchitecture()) {
183
+ final ReactHost reactHost = getReactHost();
184
+ reactHost.addReactInstanceEventListener(
189
185
  new ReactInstanceEventListener() {
190
186
  @Override
191
187
  public void onReactContextInitialized(@NonNull ReactContext reactContext) {
192
188
  invokeStartTask(reactContext, taskConfig);
193
- reactInstanceManager.removeReactInstanceEventListener(this);
189
+ reactHost.removeReactInstanceEventListener(this);
194
190
  }
195
191
  });
196
- reactInstanceManager.createReactContextInBackground();
197
- } else { // new arch
198
- reactHost.addReactInstanceEventListener(
192
+ reactHost.start();
193
+ } else {
194
+ final ReactInstanceManager reactInstanceManager =
195
+ getReactNativeHost().getReactInstanceManager();
196
+
197
+ reactInstanceManager.addReactInstanceEventListener(
199
198
  new ReactInstanceEventListener() {
200
199
  @Override
201
200
  public void onReactContextInitialized(@NonNull ReactContext reactContext) {
202
201
  invokeStartTask(reactContext, taskConfig);
203
- reactHost.removeReactInstanceEventListener(this);
202
+ reactInstanceManager.removeReactInstanceEventListener(this);
204
203
  }
205
204
  });
206
- reactHost.start();
205
+ reactInstanceManager.createReactContextInBackground();
207
206
  }
208
207
  }
209
208
  }
@@ -0,0 +1,13 @@
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
9
+
10
+ @Deprecated(
11
+ message = "Use BaseReactPackage instead",
12
+ replaceWith = ReplaceWith(expression = "BaseReactPackage"))
13
+ public abstract class TurboReactPackage : BaseReactPackage() {}
@@ -21,6 +21,24 @@ public class ReactModuleInfo(
21
21
  public val isCxxModule: Boolean,
22
22
  public val isTurboModule: Boolean
23
23
  ) {
24
+
25
+ @Deprecated(
26
+ "This constructor is deprecated and will be removed in the future. Use ReactModuleInfo(String, String, boolean, boolean, boolean, boolean)]",
27
+ replaceWith =
28
+ ReplaceWith(
29
+ expression =
30
+ "ReactModuleInfo(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)"),
31
+ level = DeprecationLevel.WARNING)
32
+ public constructor(
33
+ name: String,
34
+ className: String,
35
+ canOverrideExistingModule: Boolean,
36
+ needsEagerInit: Boolean,
37
+ @Suppress("UNUSED_PARAMETER") hasConstants: Boolean,
38
+ isCxxModule: Boolean,
39
+ isTurboModule: Boolean
40
+ ) : this(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule)
41
+
24
42
  public companion object {
25
43
  /**
26
44
  * Checks if the passed class is a TurboModule. Useful to populate the parameter [isTurboModule]
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 77,
20
20
  "patch", 0,
21
- "prerelease", "rc.0");
21
+ "prerelease", "rc.2");
22
22
  }
@@ -622,11 +622,12 @@ public class ReactViewGroup extends ViewGroup
622
622
  /*package*/ void addViewWithSubviewClippingEnabled(
623
623
  final View child, int index, ViewGroup.LayoutParams params) {
624
624
  Assertions.assertCondition(mRemoveClippedSubviews);
625
- Rect clippingRect = Assertions.assertNotNull(mClippingRect);
626
- View[] childArray = Assertions.assertNotNull(mAllChildren);
627
625
  addInArray(child, index);
626
+
628
627
  // we add view as "clipped" and then run {@link #updateSubviewClipStatus} to conditionally
629
628
  // attach it
629
+ Rect clippingRect = Assertions.assertNotNull(mClippingRect);
630
+ View[] childArray = Assertions.assertNotNull(mAllChildren);
630
631
  int clippedSoFar = 0;
631
632
  for (int i = 0; i < index; i++) {
632
633
  if (isViewClipped(childArray[i])) {
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 77;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "rc.0";
21
+ std::string_view Prerelease = "rc.2";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -236,47 +236,51 @@ std::string simpleBasename(const std::string& path) {
236
236
  */
237
237
  void ReactInstance::loadScript(
238
238
  std::unique_ptr<const JSBigString> script,
239
- const std::string& sourceURL) {
239
+ const std::string& sourceURL,
240
+ std::function<void(jsi::Runtime& runtime)>&& completion) {
240
241
  auto buffer = std::make_shared<BigStringBuffer>(std::move(script));
241
242
  std::string scriptName = simpleBasename(sourceURL);
242
243
 
243
- runtimeScheduler_->scheduleWork(
244
- [this,
245
- scriptName,
246
- sourceURL,
247
- buffer = std::move(buffer),
248
- weakBufferedRuntimeExecuter = std::weak_ptr<BufferedRuntimeExecutor>(
249
- bufferedRuntimeExecutor_)](jsi::Runtime& runtime) {
250
- SystraceSection s("ReactInstance::loadScript");
251
- bool hasLogger(ReactMarker::logTaggedMarkerBridgelessImpl);
252
- if (hasLogger) {
253
- ReactMarker::logTaggedMarkerBridgeless(
254
- ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());
255
- }
244
+ runtimeScheduler_->scheduleWork([this,
245
+ scriptName,
246
+ sourceURL,
247
+ buffer = std::move(buffer),
248
+ weakBufferedRuntimeExecuter =
249
+ std::weak_ptr<BufferedRuntimeExecutor>(
250
+ bufferedRuntimeExecutor_),
251
+ completion](jsi::Runtime& runtime) {
252
+ SystraceSection s("ReactInstance::loadScript");
253
+ bool hasLogger(ReactMarker::logTaggedMarkerBridgelessImpl);
254
+ if (hasLogger) {
255
+ ReactMarker::logTaggedMarkerBridgeless(
256
+ ReactMarker::RUN_JS_BUNDLE_START, scriptName.c_str());
257
+ }
256
258
 
257
- runtime.evaluateJavaScript(buffer, sourceURL);
259
+ runtime.evaluateJavaScript(buffer, sourceURL);
258
260
 
259
- /**
260
- * TODO(T183610671): We need a safe/reliable way to enable the js
261
- * pipeline from javascript. Remove this after we figure that out, or
262
- * after we just remove the js pipeline.
263
- */
264
- if (!jsErrorHandler_->hasHandledFatalError()) {
265
- jsErrorHandler_->setRuntimeReady();
266
- }
261
+ /**
262
+ * TODO(T183610671): We need a safe/reliable way to enable the js
263
+ * pipeline from javascript. Remove this after we figure that out, or
264
+ * after we just remove the js pipeline.
265
+ */
266
+ if (!jsErrorHandler_->hasHandledFatalError()) {
267
+ jsErrorHandler_->setRuntimeReady();
268
+ }
267
269
 
268
- if (hasLogger) {
269
- ReactMarker::logTaggedMarkerBridgeless(
270
- ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());
271
- ReactMarker::logMarkerBridgeless(
272
- ReactMarker::INIT_REACT_RUNTIME_STOP);
273
- ReactMarker::logMarkerBridgeless(ReactMarker::APP_STARTUP_STOP);
274
- }
275
- if (auto strongBufferedRuntimeExecuter =
276
- weakBufferedRuntimeExecuter.lock()) {
277
- strongBufferedRuntimeExecuter->flush();
278
- }
279
- });
270
+ if (hasLogger) {
271
+ ReactMarker::logTaggedMarkerBridgeless(
272
+ ReactMarker::RUN_JS_BUNDLE_STOP, scriptName.c_str());
273
+ ReactMarker::logMarkerBridgeless(ReactMarker::INIT_REACT_RUNTIME_STOP);
274
+ ReactMarker::logMarkerBridgeless(ReactMarker::APP_STARTUP_STOP);
275
+ }
276
+ if (auto strongBufferedRuntimeExecuter =
277
+ weakBufferedRuntimeExecuter.lock()) {
278
+ strongBufferedRuntimeExecuter->flush();
279
+ }
280
+ if (completion) {
281
+ completion(runtime);
282
+ }
283
+ });
280
284
  }
281
285
 
282
286
  /*
@@ -49,7 +49,8 @@ class ReactInstance final : private jsinspector_modern::InstanceTargetDelegate {
49
49
 
50
50
  void loadScript(
51
51
  std::unique_ptr<const JSBigString> script,
52
- const std::string& sourceURL);
52
+ const std::string& sourceURL,
53
+ std::function<void(jsi::Runtime& runtime)>&& completion = nullptr);
53
54
 
54
55
  void registerSegment(uint32_t segmentId, const std::string& segmentPath);
55
56
 
@@ -472,8 +472,9 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
472
472
 
473
473
  auto script = std::make_unique<NSDataBigString>(source.data);
474
474
  const auto *url = deriveSourceURL(source.url).UTF8String;
475
- _reactInstance->loadScript(std::move(script), url);
476
- [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTInstanceDidLoadBundle" object:nil];
475
+ _reactInstance->loadScript(std::move(script), url, [](jsi::Runtime &_) {
476
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"RCTInstanceDidLoadBundle" object:nil];
477
+ });
477
478
  }
478
479
 
479
480
  - (void)_handleJSError:(const JsErrorHandler::ParsedError &)error withRuntime:(jsi::Runtime &)runtime
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.77.0-rc.0",
3
+ "version": "0.77.0-rc.2",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -108,13 +108,13 @@
108
108
  },
109
109
  "dependencies": {
110
110
  "@jest/create-cache-key-function": "^29.6.3",
111
- "@react-native/assets-registry": "0.77.0-rc.0",
112
- "@react-native/codegen": "0.77.0-rc.0",
113
- "@react-native/community-cli-plugin": "0.77.0-rc.0",
114
- "@react-native/gradle-plugin": "0.77.0-rc.0",
115
- "@react-native/js-polyfills": "0.77.0-rc.0",
116
- "@react-native/normalize-colors": "0.77.0-rc.0",
117
- "@react-native/virtualized-lists": "0.77.0-rc.0",
111
+ "@react-native/assets-registry": "0.77.0-rc.2",
112
+ "@react-native/codegen": "0.77.0-rc.2",
113
+ "@react-native/community-cli-plugin": "0.77.0-rc.2",
114
+ "@react-native/gradle-plugin": "0.77.0-rc.2",
115
+ "@react-native/js-polyfills": "0.77.0-rc.2",
116
+ "@react-native/normalize-colors": "0.77.0-rc.2",
117
+ "@react-native/virtualized-lists": "0.77.0-rc.2",
118
118
  "abort-controller": "^3.0.0",
119
119
  "anser": "^1.4.9",
120
120
  "ansi-regex": "^5.0.0",
@@ -778,6 +778,11 @@ function findFilesWithExtension(filePath, extension) {
778
778
  // Given a filepath, read the file and look for a string that starts with 'Class<RCTComponentViewProtocol> '
779
779
  // and ends with 'Cls(void)'. Return the string between the two.
780
780
  function findRCTComponentViewProtocolClass(filepath) {
781
+ // Exclude files provided by react-native
782
+ if (filepath.includes(`${path.sep}react-native${path.sep}`)) {
783
+ return null;
784
+ }
785
+
781
786
  const fileContent = fs.readFileSync(filepath, 'utf8');
782
787
  const regex = /Class<RCTComponentViewProtocol> (.*)Cls\(/;
783
788
  const match = fileContent.match(regex);
Binary file
Binary file
Binary file
@@ -113,7 +113,7 @@ export function createCompositeKeyForProps(
113
113
  const key = keys[ii];
114
114
  const value = props[key];
115
115
 
116
- if (allowlist == null || Object.hasOwn(allowlist, key)) {
116
+ if (allowlist == null || hasOwn(allowlist, key)) {
117
117
  let compositeKeyComponent;
118
118
  if (key === 'style') {
119
119
  // $FlowFixMe[incompatible-call] - `style` is a valid argument.
@@ -205,7 +205,7 @@ function createCompositeKeyForObject(
205
205
  for (let ii = 0, length = keys.length; ii < length; ii++) {
206
206
  const key = keys[ii];
207
207
 
208
- if (allowlist == null || Object.hasOwn(allowlist, key)) {
208
+ if (allowlist == null || hasOwn(allowlist, key)) {
209
209
  const value = object[key];
210
210
 
211
211
  let compositeKeyComponent;
@@ -250,7 +250,7 @@ export function areCompositeKeysEqual(
250
250
  }
251
251
  for (let ii = 0; ii < length; ii++) {
252
252
  const key = keys[ii];
253
- if (!Object.hasOwn(next, key)) {
253
+ if (!hasOwn(next, key)) {
254
254
  return false;
255
255
  }
256
256
  const prevComponent = prev[key];
@@ -336,7 +336,7 @@ function areCompositeKeyComponentsEqual(
336
336
  for (let ii = 0; ii < length; ii++) {
337
337
  const key = keys[ii];
338
338
  if (
339
- !Object.hasOwn(nullthrows(next), key) ||
339
+ !hasOwn(nullthrows(next), key) ||
340
340
  !areCompositeKeyComponentsEqual(prev[key], next[key])
341
341
  ) {
342
342
  return false;
@@ -346,3 +346,11 @@ function areCompositeKeyComponentsEqual(
346
346
  }
347
347
  return false;
348
348
  }
349
+
350
+ // Supported versions of JSC do not implement the newer Object.hasOwn. Remove
351
+ // this shim when they do.
352
+ // $FlowIgnore[method-unbinding]
353
+ const _hasOwnProp = Object.prototype.hasOwnProperty;
354
+ const hasOwn: (obj: $ReadOnly<{...}>, prop: string) => boolean =
355
+ // $FlowIgnore[method-unbinding]
356
+ Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));