react-native 0.74.0-rc.2 → 0.74.0-rc.3

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 (45) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.h +5 -8
  2. package/Libraries/AppDelegate/RCTAppDelegate.mm +56 -130
  3. package/Libraries/AppDelegate/RCTRootViewFactory.h +123 -0
  4. package/Libraries/AppDelegate/RCTRootViewFactory.mm +253 -0
  5. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  6. package/Libraries/Core/ReactNativeVersion.js +1 -1
  7. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  8. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +4 -0
  9. package/Libraries/StyleSheet/StyleSheetTypes.js +3 -0
  10. package/React/Base/RCTConvert.h +3 -0
  11. package/React/Base/RCTConvert.mm +9 -0
  12. package/React/Base/RCTVersion.m +1 -1
  13. package/React/CoreModules/RCTRedBox.mm +7 -1
  14. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +32 -0
  15. package/React/Views/RCTCursor.h +13 -0
  16. package/React/Views/RCTView.h +3 -0
  17. package/React/Views/RCTView.m +30 -0
  18. package/React/Views/RCTViewManager.m +2 -0
  19. package/ReactAndroid/api/ReactAndroid.api +2 -0
  20. package/ReactAndroid/build.gradle.kts +26 -0
  21. package/ReactAndroid/cmake-utils/ReactNative-application.cmake +6 -0
  22. package/ReactAndroid/gradle.properties +1 -1
  23. package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +1 -2
  24. package/ReactAndroid/src/main/java/com/facebook/react/ReactHost.kt +9 -0
  25. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +5 -0
  26. package/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java +0 -11
  27. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt +1 -1
  28. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +11 -6
  29. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  30. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +32 -0
  31. package/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp +0 -1
  32. package/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h +0 -4
  33. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  34. package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +9 -0
  35. package/ReactCommon/react/renderer/components/view/BaseViewProps.h +2 -0
  36. package/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp +1 -1
  37. package/ReactCommon/react/renderer/components/view/conversions.h +22 -0
  38. package/ReactCommon/react/renderer/components/view/primitives.h +2 -0
  39. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +37 -6
  40. package/package.json +2 -2
  41. package/sdks/hermesc/osx-bin/hermes +0 -0
  42. package/sdks/hermesc/osx-bin/hermesc +0 -0
  43. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  44. package/template/package.json +1 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultBindingsInstaller.kt +0 -20
@@ -192,7 +192,7 @@ export function parseComponentStack(message: string): ComponentStack {
192
192
  if (!s) {
193
193
  return null;
194
194
  }
195
- const match = s.match(/(.*) \(at (.*\.js):([\d]+)\)/);
195
+ const match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/);
196
196
  if (!match) {
197
197
  return null;
198
198
  }
@@ -27,6 +27,8 @@ export type DimensionValue =
27
27
  type AnimatableNumericValue = number | Animated.AnimatedNode;
28
28
  type AnimatableStringValue = string | Animated.AnimatedNode;
29
29
 
30
+ export type CursorValue = 'auto' | 'pointer';
31
+
30
32
  /**
31
33
  * Flex Prop Types
32
34
  * @see https://reactnative.dev/docs/flexbox
@@ -274,6 +276,7 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
274
276
  * Controls whether the View can be the target of touch events.
275
277
  */
276
278
  pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined;
279
+ cursor?: CursorValue | undefined;
277
280
  }
278
281
 
279
282
  export type FontVariant =
@@ -403,4 +406,5 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
403
406
  tintColor?: ColorValue | undefined;
404
407
  opacity?: AnimatableNumericValue | undefined;
405
408
  objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | undefined;
409
+ cursor?: CursorValue | undefined;
406
410
  }
@@ -37,6 +37,8 @@ export type EdgeInsetsValue = {
37
37
  export type DimensionValue = number | string | 'auto' | AnimatedNode | null;
38
38
  export type AnimatableNumericValue = number | AnimatedNode;
39
39
 
40
+ export type CursorValue = 'auto' | 'pointer';
41
+
40
42
  /**
41
43
  * React Native's layout system is based on Flexbox and is powered both
42
44
  * on iOS and Android by an open source project called `Yoga`:
@@ -729,6 +731,7 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
729
731
  opacity?: AnimatableNumericValue,
730
732
  elevation?: number,
731
733
  pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only',
734
+ cursor?: CursorValue,
732
735
  }>;
733
736
 
734
737
  export type ____ViewStyle_Internal = $ReadOnly<{
@@ -11,6 +11,7 @@
11
11
  #import <React/RCTAnimationType.h>
12
12
  #import <React/RCTBorderCurve.h>
13
13
  #import <React/RCTBorderStyle.h>
14
+ #import <React/RCTCursor.h>
14
15
  #import <React/RCTDefines.h>
15
16
  #import <React/RCTLog.h>
16
17
  #import <React/RCTPointerEvents.h>
@@ -80,6 +81,8 @@ typedef NSURL RCTFileURL;
80
81
  + (UIBarStyle)UIBarStyle:(id)json __deprecated;
81
82
  #endif
82
83
 
84
+ + (RCTCursor)RCTCursor:(id)json;
85
+
83
86
  + (CGFloat)CGFloat:(id)json;
84
87
  + (CGPoint)CGPoint:(id)json;
85
88
  + (CGSize)CGSize:(id)json;
@@ -545,6 +545,15 @@ RCT_ENUM_CONVERTER(
545
545
  UIBarStyleDefault,
546
546
  integerValue)
547
547
 
548
+ RCT_ENUM_CONVERTER(
549
+ RCTCursor,
550
+ (@{
551
+ @"auto" : @(RCTCursorAuto),
552
+ @"pointer" : @(RCTCursorPointer),
553
+ }),
554
+ RCTCursorAuto,
555
+ integerValue)
556
+
548
557
  static void convertCGStruct(const char *type, NSArray *fields, CGFloat *result, id json)
549
558
  {
550
559
  NSUInteger count = fields.count;
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(74),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.2",
27
+ RCTVersionPrerelease: @"rc.3",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -274,7 +274,13 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
274
274
 
275
275
  - (void)reload
276
276
  {
277
- [_actionDelegate reloadFromRedBoxController:self];
277
+ if (_actionDelegate != nil) {
278
+ [_actionDelegate reloadFromRedBoxController:self];
279
+ } else {
280
+ // In bridgeless mode `RCTRedBox` gets deallocated, we need to notify listeners anyway.
281
+ RCTTriggerReloadCommandListeners(@"Redbox");
282
+ [self dismiss];
283
+ }
278
284
  }
279
285
 
280
286
  - (void)showExtraDataViewController
@@ -257,6 +257,11 @@ using namespace facebook::react;
257
257
  self.layer.doubleSided = newViewProps.backfaceVisibility == BackfaceVisibility::Visible;
258
258
  }
259
259
 
260
+ // `cursor`
261
+ if (oldViewProps.cursor != newViewProps.cursor) {
262
+ needsInvalidateLayer = YES;
263
+ }
264
+
260
265
  // `shouldRasterize`
261
266
  if (oldViewProps.shouldRasterize != newViewProps.shouldRasterize) {
262
267
  self.layer.shouldRasterize = newViewProps.shouldRasterize;
@@ -592,6 +597,33 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
592
597
  layer.shadowPath = nil;
593
598
  }
594
599
 
600
+ #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000 /* __IPHONE_17_0 */
601
+ // Stage 1.5. Cursor / Hover Effects
602
+ if (@available(iOS 17.0, *)) {
603
+ UIHoverStyle *hoverStyle = nil;
604
+ if (_props->cursor == Cursor::Pointer) {
605
+ const RCTCornerInsets cornerInsets =
606
+ RCTGetCornerInsets(RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), UIEdgeInsetsZero);
607
+ #if TARGET_OS_IOS
608
+ // Due to an Apple bug, it seems on iOS, UIShapes made with `[UIShape shapeWithBezierPath:]`
609
+ // evaluate their shape on the superviews' coordinate space. This leads to the hover shape
610
+ // rendering incorrectly on iOS, iOS apps in compatibility mode on visionOS, but not on visionOS.
611
+ // To work around this, for iOS, we can calculate the border path based on `view.frame` (the
612
+ // superview's coordinate space) instead of view.bounds.
613
+ CGPathRef borderPath = RCTPathCreateWithRoundedRect(self.frame, cornerInsets, NULL);
614
+ #else // TARGET_OS_VISION
615
+ CGPathRef borderPath = RCTPathCreateWithRoundedRect(self.bounds, cornerInsets, NULL);
616
+ #endif
617
+ UIBezierPath *bezierPath = [UIBezierPath bezierPathWithCGPath:borderPath];
618
+ CGPathRelease(borderPath);
619
+ UIShape *shape = [UIShape shapeWithBezierPath:bezierPath];
620
+
621
+ hoverStyle = [UIHoverStyle styleWithEffect:[UIHoverAutomaticEffect effect] shape:shape];
622
+ }
623
+ [self setHoverStyle:hoverStyle];
624
+ }
625
+ #endif
626
+
595
627
  // Stage 2. Border Rendering
596
628
  const bool useCoreAnimationBorderRendering =
597
629
  borderMetrics.borderColors.isUniform() && borderMetrics.borderWidths.isUniform() &&
@@ -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
+ #import <Foundation/Foundation.h>
9
+
10
+ typedef NS_ENUM(NSInteger, RCTCursor) {
11
+ RCTCursorAuto,
12
+ RCTCursorPointer,
13
+ };
@@ -10,6 +10,7 @@
10
10
  #import <React/RCTBorderCurve.h>
11
11
  #import <React/RCTBorderStyle.h>
12
12
  #import <React/RCTComponent.h>
13
+ #import <React/RCTCursor.h>
13
14
  #import <React/RCTPointerEvents.h>
14
15
 
15
16
  extern const UIAccessibilityTraits SwitchAccessibilityTrait;
@@ -120,6 +121,8 @@ extern const UIAccessibilityTraits SwitchAccessibilityTrait;
120
121
  */
121
122
  @property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets;
122
123
 
124
+ @property (nonatomic, assign) RCTCursor cursor;
125
+
123
126
  /**
124
127
  * (Experimental and unused for Paper) Pointer event handlers.
125
128
  */
@@ -136,6 +136,7 @@ static NSString *RCTRecursiveAccessibilityLabel(UIView *view)
136
136
  _borderCurve = RCTBorderCurveCircular;
137
137
  _borderStyle = RCTBorderStyleSolid;
138
138
  _hitTestEdgeInsets = UIEdgeInsetsZero;
139
+ _cursor = RCTCursorAuto;
139
140
 
140
141
  _backgroundColor = super.backgroundColor;
141
142
  }
@@ -796,6 +797,8 @@ static CGFloat RCTDefaultIfNegativeTo(CGFloat defaultValue, CGFloat x)
796
797
 
797
798
  RCTUpdateShadowPathForView(self);
798
799
 
800
+ RCTUpdateHoverStyleForView(self);
801
+
799
802
  const RCTCornerRadii cornerRadii = [self cornerRadii];
800
803
  const UIEdgeInsets borderInsets = [self bordersAsInsets];
801
804
  const RCTBorderColors borderColors = [self borderColorsWithTraitCollection:self.traitCollection];
@@ -891,6 +894,33 @@ static void RCTUpdateShadowPathForView(RCTView *view)
891
894
  }
892
895
  }
893
896
 
897
+ static void RCTUpdateHoverStyleForView(RCTView *view)
898
+ {
899
+ #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000 /* __IPHONE_17_0 */
900
+ if (@available(iOS 17.0, *)) {
901
+ UIHoverStyle *hoverStyle = nil;
902
+ if ([view cursor] == RCTCursorPointer) {
903
+ const RCTCornerRadii cornerRadii = [view cornerRadii];
904
+ const RCTCornerInsets cornerInsets = RCTGetCornerInsets(cornerRadii, UIEdgeInsetsZero);
905
+ #if TARGET_OS_IOS
906
+ // Due to an Apple bug, it seems on iOS, `[UIShape shapeWithBezierPath:]` needs to
907
+ // be calculated in the superviews' coordinate space (view.frame). This is not true
908
+ // on other platforms like visionOS.
909
+ CGPathRef borderPath = RCTPathCreateWithRoundedRect(view.frame, cornerInsets, NULL);
910
+ #else // TARGET_OS_VISION
911
+ CGPathRef borderPath = RCTPathCreateWithRoundedRect(view.bounds, cornerInsets, NULL);
912
+ #endif
913
+ UIBezierPath *bezierPath = [UIBezierPath bezierPathWithCGPath:borderPath];
914
+ CGPathRelease(borderPath);
915
+ UIShape *shape = [UIShape shapeWithBezierPath:bezierPath];
916
+
917
+ hoverStyle = [UIHoverStyle styleWithEffect:[UIHoverHighlightEffect effect] shape:shape];
918
+ }
919
+ [view setHoverStyle:hoverStyle];
920
+ }
921
+ #endif
922
+ }
923
+
894
924
  - (void)updateClippingForLayer:(CALayer *)layer
895
925
  {
896
926
  CALayer *mask = nil;
@@ -13,6 +13,7 @@
13
13
  #import "RCTBridge.h"
14
14
  #import "RCTConvert+Transform.h"
15
15
  #import "RCTConvert.h"
16
+ #import "RCTCursor.h"
16
17
  #import "RCTLog.h"
17
18
  #import "RCTShadowView.h"
18
19
  #import "RCTUIManager.h"
@@ -195,6 +196,7 @@ RCT_REMAP_VIEW_PROPERTY(testID, reactAccessibilityElement.accessibilityIdentifie
195
196
 
196
197
  RCT_EXPORT_VIEW_PROPERTY(backgroundColor, UIColor)
197
198
  RCT_REMAP_VIEW_PROPERTY(backfaceVisibility, layer.doubleSided, css_backface_visibility_t)
199
+ RCT_EXPORT_VIEW_PROPERTY(cursor, RCTCursor)
198
200
  RCT_REMAP_VIEW_PROPERTY(opacity, alpha, CGFloat)
199
201
  RCT_REMAP_VIEW_PROPERTY(shadowColor, layer.shadowColor, CGColor)
200
202
  RCT_REMAP_VIEW_PROPERTY(shadowOffset, layer.shadowOffset, CGSize)
@@ -196,6 +196,7 @@ public abstract interface class com/facebook/react/ReactHost {
196
196
  public abstract fun getJsEngineResolutionAlgorithm ()Lcom/facebook/react/JSEngineResolutionAlgorithm;
197
197
  public abstract fun getLifecycleState ()Lcom/facebook/react/common/LifecycleState;
198
198
  public abstract fun getReactQueueConfiguration ()Lcom/facebook/react/bridge/queue/ReactQueueConfiguration;
199
+ public abstract fun onActivityResult (Landroid/app/Activity;IILandroid/content/Intent;)V
199
200
  public abstract fun onBackPressed ()Z
200
201
  public abstract fun onHostDestroy ()V
201
202
  public abstract fun onHostDestroy (Landroid/app/Activity;)V
@@ -3602,6 +3603,7 @@ public class com/facebook/react/runtime/ReactHostImpl : com/facebook/react/React
3602
3603
  public fun getLifecycleState ()Lcom/facebook/react/common/LifecycleState;
3603
3604
  public fun getMemoryPressureRouter ()Lcom/facebook/react/MemoryPressureRouter;
3604
3605
  public fun getReactQueueConfiguration ()Lcom/facebook/react/bridge/queue/ReactQueueConfiguration;
3606
+ public fun onActivityResult (Landroid/app/Activity;IILandroid/content/Intent;)V
3605
3607
  public fun onBackPressed ()Z
3606
3608
  public fun onHostDestroy ()V
3607
3609
  public fun onHostDestroy (Landroid/app/Activity;)V
@@ -125,6 +125,16 @@ val preparePrefab by
125
125
  "react/renderer/components/view/"),
126
126
  Pair("../ReactCommon/react/renderer/components/view/platform/android/", ""),
127
127
  )),
128
+ PrefabPreprocessingEntry(
129
+ "rrc_text",
130
+ Pair(
131
+ "../ReactCommon/react/renderer/components/text/",
132
+ "react/renderer/components/text/")),
133
+ PrefabPreprocessingEntry(
134
+ "rrc_textinput",
135
+ Pair(
136
+ "../ReactCommon/react/renderer/components/textinput/",
137
+ "react/renderer/components/androidtextinput/")),
128
138
  PrefabPreprocessingEntry(
129
139
  "rrc_legacyviewmanagerinterop",
130
140
  Pair(
@@ -138,6 +148,14 @@ val preparePrefab by
138
148
  PrefabPreprocessingEntry(
139
149
  "react_render_mapbuffer",
140
150
  Pair("../ReactCommon/react/renderer/mapbuffer/", "react/renderer/mapbuffer/")),
151
+ PrefabPreprocessingEntry(
152
+ "react_render_textlayoutmanager",
153
+ listOf(
154
+ Pair(
155
+ "../ReactCommon/react/renderer/textlayoutmanager/",
156
+ "react/renderer/textlayoutmanager/"),
157
+ Pair("../ReactCommon/react/renderer/textlayoutmanager/platform/android/", ""),
158
+ )),
141
159
  PrefabPreprocessingEntry(
142
160
  "yoga",
143
161
  listOf(
@@ -538,11 +556,14 @@ android {
538
556
  "rrc_image",
539
557
  "rrc_root",
540
558
  "rrc_view",
559
+ "rrc_text",
560
+ "rrc_textinput",
541
561
  "rrc_legacyviewmanagerinterop",
542
562
  "jsi",
543
563
  "glog",
544
564
  "fabricjni",
545
565
  "react_render_mapbuffer",
566
+ "react_render_textlayoutmanager",
546
567
  "yoga",
547
568
  "folly_runtime",
548
569
  "react_nativemodule_core",
@@ -662,6 +683,8 @@ android {
662
683
  create("rrc_image") { headers = File(prefabHeadersDir, "rrc_image").absolutePath }
663
684
  create("rrc_root") { headers = File(prefabHeadersDir, "rrc_root").absolutePath }
664
685
  create("rrc_view") { headers = File(prefabHeadersDir, "rrc_view").absolutePath }
686
+ create("rrc_text") { headers = File(prefabHeadersDir, "rrc_text").absolutePath }
687
+ create("rrc_textinput") { headers = File(prefabHeadersDir, "rrc_textinput").absolutePath }
665
688
  create("rrc_legacyviewmanagerinterop") {
666
689
  headers = File(prefabHeadersDir, "rrc_legacyviewmanagerinterop").absolutePath
667
690
  }
@@ -671,6 +694,9 @@ android {
671
694
  create("react_render_mapbuffer") {
672
695
  headers = File(prefabHeadersDir, "react_render_mapbuffer").absolutePath
673
696
  }
697
+ create("react_render_textlayoutmanager") {
698
+ headers = File(prefabHeadersDir, "react_render_textlayoutmanager").absolutePath
699
+ }
674
700
  create("yoga") { headers = File(prefabHeadersDir, "yoga").absolutePath }
675
701
  create("folly_runtime") { headers = File(prefabHeadersDir, "folly_runtime").absolutePath }
676
702
  create("react_nativemodule_core") {
@@ -74,10 +74,13 @@ add_library(react_cxxreactpackage ALIAS ReactAndroid::react_cxxreactpackage)
74
74
  add_library(react_render_core ALIAS ReactAndroid::react_render_core)
75
75
  add_library(react_render_graphics ALIAS ReactAndroid::react_render_graphics)
76
76
  add_library(rrc_view ALIAS ReactAndroid::rrc_view)
77
+ add_library(rrc_text ALIAS ReactAndroid::rrc_text)
78
+ add_library(rrc_textinput ALIAS ReactAndroid::rrc_textinput)
77
79
  add_library(jsi ALIAS ReactAndroid::jsi)
78
80
  add_library(glog ALIAS ReactAndroid::glog)
79
81
  add_library(fabricjni ALIAS ReactAndroid::fabricjni)
80
82
  add_library(react_render_mapbuffer ALIAS ReactAndroid::react_render_mapbuffer)
83
+ add_library(react_render_textlayoutmanager ALIAS ReactAndroid::react_render_textlayoutmanager)
81
84
  add_library(yoga ALIAS ReactAndroid::yoga)
82
85
  add_library(folly_runtime ALIAS ReactAndroid::folly_runtime)
83
86
  add_library(react_nativemodule_core ALIAS ReactAndroid::react_nativemodule_core)
@@ -106,8 +109,11 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
106
109
  react_render_graphics # prefab ready
107
110
  react_render_imagemanager # prefab ready
108
111
  react_render_mapbuffer # prefab ready
112
+ react_render_textlayoutmanager # prefab ready
109
113
  rrc_image # prefab ready
110
114
  rrc_view # prefab ready
115
+ rrc_text # prefab ready
116
+ rrc_textinput # prefab ready
111
117
  rrc_legacyviewmanagerinterop # prefab ready
112
118
  runtimeexecutor # prefab ready
113
119
  turbomodulejsijni # prefab ready
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.74.0-rc.2
1
+ VERSION_NAME=0.74.0-rc.3
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -139,8 +139,7 @@ public class ReactDelegate {
139
139
  public void onActivityResult(
140
140
  int requestCode, int resultCode, Intent data, boolean shouldForwardToReactInstance) {
141
141
  if (ReactFeatureFlags.enableBridgelessArchitecture) {
142
- // TODO T156475655: Implement onActivityResult for Bridgeless
143
- return;
142
+ mReactHost.onActivityResult(mActivity, requestCode, resultCode, data);
144
143
  } else {
145
144
  if (getReactNativeHost().hasInstance() && shouldForwardToReactInstance) {
146
145
  getReactNativeHost()
@@ -9,6 +9,7 @@ package com.facebook.react
9
9
 
10
10
  import android.app.Activity
11
11
  import android.content.Context
12
+ import android.content.Intent
12
13
  import android.os.Bundle
13
14
  import com.facebook.react.bridge.ReactContext
14
15
  import com.facebook.react.bridge.queue.ReactQueueConfiguration
@@ -111,6 +112,14 @@ public interface ReactHost {
111
112
  */
112
113
  public fun destroy(reason: String, ex: Exception?): TaskInterface<Void>
113
114
 
115
+ /* To be called when the host activity receives an activity result. */
116
+ public fun onActivityResult(
117
+ activity: Activity,
118
+ requestCode: Int,
119
+ resultCode: Int,
120
+ data: Intent?,
121
+ )
122
+
114
123
  public fun addBeforeDestroyListener(onBeforeDestroy: () -> Unit)
115
124
 
116
125
  public fun removeBeforeDestroyListener(onBeforeDestroy: () -> Unit)
@@ -998,6 +998,11 @@ public class ReactInstanceManager {
998
998
  if (names != null) {
999
999
  uniqueNames.addAll(names);
1000
1000
  }
1001
+ } else {
1002
+ FLog.w(
1003
+ ReactConstants.TAG,
1004
+ "Package %s is not a ViewManagerOnDemandReactPackage, view managers will not be loaded",
1005
+ reactPackage.getClass().getSimpleName());
1001
1006
  }
1002
1007
  Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
1003
1008
  }
@@ -10,8 +10,6 @@ package com.facebook.react.bridge.queue;
10
10
  import android.os.Handler;
11
11
  import android.os.Looper;
12
12
  import android.os.Message;
13
- import com.facebook.common.logging.FLog;
14
- import com.facebook.react.common.ReactConstants;
15
13
 
16
14
  /** Handler that can catch and dispatch Exceptions to an Exception handler. */
17
15
  public class MessageQueueThreadHandler extends Handler {
@@ -28,15 +26,6 @@ public class MessageQueueThreadHandler extends Handler {
28
26
  try {
29
27
  super.dispatchMessage(msg);
30
28
  } catch (Exception e) {
31
- if (e instanceof NullPointerException) {
32
- FLog.e(
33
- ReactConstants.TAG,
34
- "Caught NullPointerException when dispatching message in MessageQueueThreadHandler. This is likely caused by runnable"
35
- + "(msg.callback) being nulled in Android Handler after dispatching and before handling (see T170239922 for more details)."
36
- + "Currently we observe that it only happen once which is during initialisation. Due to fixing probably involve Android "
37
- + "System code, we decide to ignore here for now and print an error message for debugging purpose in case this cause more serious issues in future.");
38
- return;
39
- }
40
29
  mExceptionHandler.handleException(e);
41
30
  }
42
31
  }
@@ -43,7 +43,7 @@ public class DefaultReactHostDelegate(
43
43
  override val jsBundleLoader: JSBundleLoader,
44
44
  override val reactPackages: List<ReactPackage> = emptyList(),
45
45
  override val jsRuntimeFactory: JSRuntimeFactory = HermesInstance(),
46
- override val bindingsInstaller: BindingsInstaller = DefaultBindingsInstaller(),
46
+ override val bindingsInstaller: BindingsInstaller? = null,
47
47
  private val reactNativeConfig: ReactNativeConfig = ReactNativeConfig.DEFAULT_CONFIG,
48
48
  private val exceptionHandler: (Exception) -> Unit = {},
49
49
  override val turboModuleManagerDelegateBuilder: ReactPackageTurboModuleManagerDelegate.Builder
@@ -49,13 +49,18 @@ protected constructor(
49
49
  DefaultComponentsRegistry.register(componentFactory)
50
50
 
51
51
  val viewManagerRegistry =
52
- ViewManagerRegistry(
53
- object : ViewManagerResolver {
54
- override fun getViewManager(viewManagerName: String) =
55
- reactInstanceManager.createViewManager(viewManagerName)
52
+ if (lazyViewManagersEnabled) {
53
+ ViewManagerRegistry(
54
+ object : ViewManagerResolver {
55
+ override fun getViewManager(viewManagerName: String) =
56
+ reactInstanceManager.createViewManager(viewManagerName)
56
57
 
57
- override fun getViewManagerNames() = reactInstanceManager.viewManagerNames
58
- })
58
+ override fun getViewManagerNames() = reactInstanceManager.viewManagerNames
59
+ })
60
+ } else {
61
+ ViewManagerRegistry(
62
+ reactInstanceManager.getOrCreateViewManagers(reactApplicationContext))
63
+ }
59
64
 
60
65
  FabricUIManagerProviderImpl(
61
66
  componentFactory, ReactNativeConfig.DEFAULT_CONFIG, viewManagerRegistry)
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 74,
20
20
  "patch", 0,
21
- "prerelease", "rc.2");
21
+ "prerelease", "rc.3");
22
22
  }
@@ -15,6 +15,7 @@ import static java.lang.Boolean.TRUE;
15
15
 
16
16
  import android.app.Activity;
17
17
  import android.content.Context;
18
+ import android.content.Intent;
18
19
  import android.os.Bundle;
19
20
  import androidx.annotation.NonNull;
20
21
  import androidx.annotation.Nullable;
@@ -600,6 +601,37 @@ public class ReactHostImpl implements ReactHost {
600
601
  return null;
601
602
  }
602
603
 
604
+ /**
605
+ * To be called when the host activity receives an activity result.
606
+ *
607
+ * @param activity The host activity
608
+ */
609
+ @ThreadConfined(UI)
610
+ @Override
611
+ public void onActivityResult(
612
+ Activity activity, int requestCode, int resultCode, @Nullable Intent data) {
613
+ final String method =
614
+ "onActivityResult(activity = \""
615
+ + activity
616
+ + "\", requestCode = \""
617
+ + requestCode
618
+ + "\", resultCode = \""
619
+ + resultCode
620
+ + "\", data = \""
621
+ + data
622
+ + "\")";
623
+ log(method);
624
+
625
+ ReactContext currentContext = getCurrentReactContext();
626
+ if (currentContext != null) {
627
+ currentContext.onActivityResult(activity, requestCode, resultCode, data);
628
+ }
629
+ ReactSoftExceptionLogger.logSoftException(
630
+ TAG,
631
+ new ReactNoCrashSoftException(
632
+ "Tried to access onActivityResult while context is not ready"));
633
+ }
634
+
603
635
  @Nullable
604
636
  JavaScriptContextHolder getJavaScriptContextHolder() {
605
637
  final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult();
@@ -10,7 +10,6 @@
10
10
  #include <condition_variable>
11
11
  #include <mutex>
12
12
 
13
- #include <fb/log.h>
14
13
  #include <fbjni/NativeRunnable.h>
15
14
  #include <fbjni/fbjni.h>
16
15
  #include <jsi/jsi.h>
@@ -42,10 +42,6 @@ class JMessageQueueThread : public MessageQueueThread {
42
42
  */
43
43
  void quitSynchronous() override;
44
44
 
45
- JavaMessageQueueThread::javaobject jobj() {
46
- return m_jobj.get();
47
- }
48
-
49
45
  private:
50
46
  jni::global_ref<JavaMessageQueueThread::javaobject> m_jobj;
51
47
  };
@@ -18,7 +18,7 @@ constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 74;
20
20
  int32_t Patch = 0;
21
- std::string_view Prerelease = "rc.2";
21
+ std::string_view Prerelease = "rc.3";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -140,6 +140,14 @@ BaseViewProps::BaseViewProps(
140
140
  "shadowRadius",
141
141
  sourceProps.shadowRadius,
142
142
  {})),
143
+ cursor(
144
+ CoreFeatures::enablePropIteratorSetter ? sourceProps.cursor
145
+ : convertRawProp(
146
+ context,
147
+ rawProps,
148
+ "cursor",
149
+ sourceProps.cursor,
150
+ {})),
143
151
  transform(
144
152
  CoreFeatures::enablePropIteratorSetter ? sourceProps.transform
145
153
  : convertRawProp(
@@ -281,6 +289,7 @@ void BaseViewProps::setProp(
281
289
  RAW_SET_PROP_SWITCH_CASE_BASIC(collapsable);
282
290
  RAW_SET_PROP_SWITCH_CASE_BASIC(removeClippedSubviews);
283
291
  RAW_SET_PROP_SWITCH_CASE_BASIC(experimental_layoutConformance);
292
+ RAW_SET_PROP_SWITCH_CASE_BASIC(cursor);
284
293
  // events field
285
294
  VIEW_EVENT_CASE(PointerEnter);
286
295
  VIEW_EVENT_CASE(PointerEnterCapture);
@@ -52,6 +52,8 @@ class BaseViewProps : public YogaStylableProps, public AccessibilityProps {
52
52
  Float shadowOpacity{};
53
53
  Float shadowRadius{3};
54
54
 
55
+ Cursor cursor{};
56
+
55
57
  // Transform
56
58
  Transform transform{};
57
59
  TransformOrigin transformOrigin{};
@@ -60,7 +60,7 @@ void ViewShadowNode::initialize() noexcept {
60
60
  viewProps.accessibilityElementsHidden ||
61
61
  viewProps.accessibilityViewIsModal ||
62
62
  viewProps.importantForAccessibility != ImportantForAccessibility::Auto ||
63
- viewProps.removeClippedSubviews ||
63
+ viewProps.removeClippedSubviews || viewProps.cursor != Cursor::Auto ||
64
64
  HostPlatformViewTraitsInitializer::formsStackingContext(viewProps);
65
65
 
66
66
  bool formsView = formsStackingContext ||
@@ -705,6 +705,28 @@ inline void fromRawValue(
705
705
  react_native_expect(false);
706
706
  }
707
707
 
708
+ inline void fromRawValue(
709
+ const PropsParserContext& context,
710
+ const RawValue& value,
711
+ Cursor& result) {
712
+ result = Cursor::Auto;
713
+ react_native_expect(value.hasType<std::string>());
714
+ if (!value.hasType<std::string>()) {
715
+ return;
716
+ }
717
+ auto stringValue = (std::string)value;
718
+ if (stringValue == "auto") {
719
+ result = Cursor::Auto;
720
+ return;
721
+ }
722
+ if (stringValue == "pointer") {
723
+ result = Cursor::Pointer;
724
+ return;
725
+ }
726
+ LOG(ERROR) << "Could not parse Cursor:" << stringValue;
727
+ react_native_expect(false);
728
+ }
729
+
708
730
  inline void fromRawValue(
709
731
  const PropsParserContext& /*context*/,
710
732
  const RawValue& value,
@@ -91,6 +91,8 @@ enum class BorderCurve : uint8_t { Circular, Continuous };
91
91
 
92
92
  enum class BorderStyle : uint8_t { Solid, Dotted, Dashed };
93
93
 
94
+ enum class Cursor : uint8_t { Auto, Pointer };
95
+
94
96
  enum class LayoutConformance : uint8_t { Undefined, Classic, Strict };
95
97
 
96
98
  template <typename T>