react-native 0.76.4 → 0.76.6

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 (46) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +2 -1
  3. package/React/Base/RCTVersion.m +1 -1
  4. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +3 -0
  5. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +17 -18
  6. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +5 -0
  7. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +12 -9
  8. package/React/Views/ScrollView/RCTScrollView.h +2 -0
  9. package/React/Views/ScrollView/RCTScrollView.m +6 -0
  10. package/ReactAndroid/cmake-utils/ReactNative-application.cmake +18 -3
  11. package/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp +0 -13
  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/internal/featureflags/ReactNativeFeatureFlags.kt +1 -7
  15. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +1 -11
  16. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +1 -3
  17. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +1 -3
  18. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +1 -12
  19. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +1 -3
  20. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  21. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +1 -0
  22. package/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +17 -19
  23. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +1 -15
  24. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +1 -4
  25. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  26. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +1 -5
  27. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +1 -6
  28. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +47 -65
  29. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +2 -4
  30. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +1 -5
  31. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +1 -2
  32. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +1 -6
  33. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +1 -3
  34. package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +2 -3
  35. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +2 -0
  36. package/ReactCommon/react/runtime/ReactInstance.cpp +39 -35
  37. package/ReactCommon/react/runtime/ReactInstance.h +2 -1
  38. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +3 -2
  39. package/package.json +8 -8
  40. package/scripts/cocoapods/utils.rb +6 -6
  41. package/scripts/codegen/generate-artifacts-executor.js +20 -5
  42. package/sdks/hermesc/osx-bin/hermes +0 -0
  43. package/sdks/hermesc/osx-bin/hermesc +0 -0
  44. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  45. package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -6
  46. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
@@ -16,7 +16,7 @@ const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 76,
19
- patch: 4,
19
+ patch: 6,
20
20
  prerelease: null,
21
21
  };
22
22
 
@@ -36,6 +36,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
36
36
  {
37
37
  if (![self isDescendantOfView:scrollView]) {
38
38
  // View is outside scroll view
39
+ scrollView.firstResponderViewOutsideScrollView = self.backedTextInputView;
39
40
  return;
40
41
  }
41
42
 
@@ -456,7 +457,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
456
457
  _maxLength.integerValue - (NSInteger)backedTextInputView.attributedText.string.length + (NSInteger)range.length,
457
458
  0);
458
459
 
459
- if (text.length > _maxLength.integerValue) {
460
+ if (text.length > allowedLength) {
460
461
  // If we typed/pasted more than one character, limit the text inputted.
461
462
  if (text.length > 1) {
462
463
  if (allowedLength > 0) {
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(76),
26
- RCTVersionPatch: @(4),
26
+ RCTVersionPatch: @(6),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -38,6 +38,9 @@ NS_ASSUME_NONNULL_BEGIN
38
38
  /** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */
39
39
  @property (nonatomic, assign) CGRect firstResponderFocus;
40
40
 
41
+ /** newly-activated text input outside of the scroll view */
42
+ @property (nonatomic, weak) UIView *firstResponderViewOutsideScrollView;
43
+
41
44
  /*
42
45
  * Returns the subview of the scroll view that the component uses to mount all subcomponents into. That's useful to
43
46
  * separate component views from auxiliary views to be able to reliably implement pull-to-refresh- and RTL-related
@@ -182,16 +182,18 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
182
182
  UIViewAnimationCurve curve =
183
183
  (UIViewAnimationCurve)[notification.userInfo[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue];
184
184
  CGRect keyboardEndFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
185
+ CGRect keyboardBeginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];
185
186
 
186
187
  CGPoint absoluteViewOrigin = [self convertPoint:self.bounds.origin toView:nil];
187
188
  CGFloat scrollViewLowerY = isInverted ? absoluteViewOrigin.y : absoluteViewOrigin.y + self.bounds.size.height;
188
189
 
189
190
  UIEdgeInsets newEdgeInsets = _scrollView.contentInset;
190
191
  CGFloat inset = MAX(scrollViewLowerY - keyboardEndFrame.origin.y, 0);
192
+ const auto &props = static_cast<const ScrollViewProps &>(*_props);
191
193
  if (isInverted) {
192
- newEdgeInsets.top = MAX(inset, _scrollView.contentInset.top);
194
+ newEdgeInsets.top = MAX(inset, props.contentInset.top);
193
195
  } else {
194
- newEdgeInsets.bottom = MAX(inset, _scrollView.contentInset.bottom);
196
+ newEdgeInsets.bottom = MAX(inset, props.contentInset.bottom);
195
197
  }
196
198
 
197
199
  CGPoint newContentOffset = _scrollView.contentOffset;
@@ -203,21 +205,18 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
203
205
  from:self
204
206
  forEvent:nil]) {
205
207
  if (CGRectEqualToRect(_firstResponderFocus, CGRectNull)) {
206
- // Text input view is outside of the scroll view.
207
- return;
208
- }
209
-
210
- CGRect viewIntersection = CGRectIntersection(self.firstResponderFocus, keyboardEndFrame);
211
-
212
- if (CGRectIsNull(viewIntersection)) {
213
- return;
214
- }
215
-
216
- // Inner text field focused
217
- CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
218
- if (focusEnd > keyboardEndFrame.origin.y) {
219
- // Text field active region is below visible area with keyboard - update diff to bring into view
220
- contentDiff = keyboardEndFrame.origin.y - focusEnd;
208
+ UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
209
+ if (inputAccessoryView) {
210
+ // Text input view is within the inputAccessoryView.
211
+ contentDiff = keyboardEndFrame.origin.y - keyboardBeginFrame.origin.y;
212
+ }
213
+ } else {
214
+ // Inner text field focused
215
+ CGFloat focusEnd = CGRectGetMaxY(self.firstResponderFocus);
216
+ if (focusEnd > keyboardEndFrame.origin.y) {
217
+ // Text field active region is below visible area with keyboard - update diff to bring into view
218
+ contentDiff = keyboardEndFrame.origin.y - focusEnd;
219
+ }
221
220
  }
222
221
  }
223
222
 
@@ -243,7 +242,7 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
243
242
  animations:^{
244
243
  self->_scrollView.contentInset = newEdgeInsets;
245
244
  self->_scrollView.verticalScrollIndicatorInsets = newEdgeInsets;
246
- [self scrollToOffset:newContentOffset animated:NO];
245
+ [self scrollTo:newContentOffset.x y:newContentOffset.y animated:NO];
247
246
  }
248
247
  completion:nil];
249
248
  }
@@ -99,9 +99,11 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
99
99
  NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
100
100
  [_backedTextInputView.defaultTextAttributes mutableCopy];
101
101
 
102
+ #if !TARGET_OS_MACCATALYST
102
103
  RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
103
104
  eventEmitterWrapper.eventEmitter = _eventEmitter;
104
105
  defaultAttributes[RCTAttributedStringEventEmitterKey] = eventEmitterWrapper;
106
+ #endif
105
107
 
106
108
  _backedTextInputView.defaultTextAttributes = defaultAttributes;
107
109
  }
@@ -126,6 +128,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
126
128
  {
127
129
  if (![self isDescendantOfView:scrollView.scrollView] || !_backedTextInputView.isFirstResponder) {
128
130
  // View is outside scroll view or it's not a first responder.
131
+ scrollView.firstResponderViewOutsideScrollView = _backedTextInputView;
129
132
  return;
130
133
  }
131
134
 
@@ -260,8 +263,10 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
260
263
  if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) {
261
264
  NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
262
265
  RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes(RCTFontSizeMultiplier()));
266
+ #if !TARGET_OS_MACCATALYST
263
267
  defaultAttributes[RCTAttributedStringEventEmitterKey] =
264
268
  _backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
269
+ #endif
265
270
  _backedTextInputView.defaultTextAttributes = defaultAttributes;
266
271
  }
267
272
 
@@ -1003,15 +1003,10 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
1003
1003
  }
1004
1004
 
1005
1005
  // clipping
1006
+ self.currentContainerView.layer.mask = nil;
1006
1007
  if (self.currentContainerView.clipsToBounds) {
1007
1008
  BOOL clipToPaddingBox = ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox();
1008
- if (clipToPaddingBox) {
1009
- CALayer *maskLayer = [self createMaskLayer:RCTCGRectFromRect(_layoutMetrics.getPaddingFrame())
1010
- cornerInsets:RCTGetCornerInsets(
1011
- RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii),
1012
- RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths))];
1013
- self.currentContainerView.layer.mask = maskLayer;
1014
- } else {
1009
+ if (!clipToPaddingBox) {
1015
1010
  if (borderMetrics.borderRadii.isUniform()) {
1016
1011
  self.currentContainerView.layer.cornerRadius = borderMetrics.borderRadii.topLeft.horizontal;
1017
1012
  } else {
@@ -1033,9 +1028,17 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
1033
1028
  subview.layer.mask = [self createMaskLayer:subview.bounds cornerInsets:cornerInsets];
1034
1029
  }
1035
1030
  }
1031
+ } else if (
1032
+ !borderMetrics.borderWidths.isUniform() || borderMetrics.borderWidths.left != 0 ||
1033
+ !borderMetrics.borderRadii.isUniform()) {
1034
+ CALayer *maskLayer = [self createMaskLayer:RCTCGRectFromRect(_layoutMetrics.getPaddingFrame())
1035
+ cornerInsets:RCTGetCornerInsets(
1036
+ RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii),
1037
+ RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths))];
1038
+ self.currentContainerView.layer.mask = maskLayer;
1039
+ } else {
1040
+ self.currentContainerView.layer.cornerRadius = borderMetrics.borderRadii.topLeft.horizontal;
1036
1041
  }
1037
- } else {
1038
- self.currentContainerView.layer.mask = nil;
1039
1042
  }
1040
1043
  }
1041
1044
 
@@ -50,6 +50,8 @@
50
50
  @property (nonatomic, assign) BOOL inverted;
51
51
  /** Focus area of newly-activated text input relative to the window to compare against UIKeyboardFrameBegin/End */
52
52
  @property (nonatomic, assign) CGRect firstResponderFocus;
53
+ /** newly-activated text input outside of the scroll view */
54
+ @property (nonatomic, weak) UIView *firstResponderViewOutsideScrollView;
53
55
 
54
56
  // NOTE: currently these event props are only declared so we can export the
55
57
  // event names to JS - we don't call the blocks directly because scroll events
@@ -338,6 +338,12 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
338
338
  if (!didFocusExternalTextField && focusEnd > endFrame.origin.y) {
339
339
  // Text field active region is below visible area with keyboard - update diff to bring into view
340
340
  contentDiff = endFrame.origin.y - focusEnd;
341
+ } else {
342
+ UIView *inputAccessoryView = _firstResponderViewOutsideScrollView.inputAccessoryView;
343
+ if (inputAccessoryView) {
344
+ // Text input view is within the inputAccessoryView.
345
+ contentDiff = endFrame.origin.y - beginFrame.origin.y;
346
+ }
341
347
  }
342
348
  } else if (endFrame.origin.y <= beginFrame.origin.y) {
343
349
  // Keyboard opened for other reason
@@ -34,9 +34,24 @@ set(BUILD_DIR ${PROJECT_BUILD_DIR})
34
34
  file(TO_CMAKE_PATH "${BUILD_DIR}" BUILD_DIR)
35
35
  file(TO_CMAKE_PATH "${REACT_ANDROID_DIR}" REACT_ANDROID_DIR)
36
36
 
37
- file(GLOB input_SRC CONFIGURE_DEPENDS
38
- ${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp
39
- ${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
37
+ if (PROJECT_ROOT_DIR)
38
+ # This empty `if` is just to silence a CMake warning and make sure the `PROJECT_ROOT_DIR`
39
+ # variable is defined if user need to access it.
40
+ endif ()
41
+
42
+ file(GLOB override_cpp_SRC CONFIGURE_DEPENDS *.cpp)
43
+ # We check if the user is providing a custom OnLoad.cpp file. If so, we pick that
44
+ # for compilation. Otherwise we fallback to using the `default-app-setup/OnLoad.cpp`
45
+ # file instead.
46
+ if(override_cpp_SRC)
47
+ file(GLOB input_SRC CONFIGURE_DEPENDS
48
+ *.cpp
49
+ ${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
50
+ else()
51
+ file(GLOB input_SRC CONFIGURE_DEPENDS
52
+ ${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp
53
+ ${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
54
+ endif()
40
55
 
41
56
  add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC})
42
57
 
@@ -29,12 +29,7 @@
29
29
 
30
30
  #include <DefaultComponentsRegistry.h>
31
31
  #include <DefaultTurboModuleManagerDelegate.h>
32
- #if __has_include("<autolinking.h>")
33
- #define AUTOLINKING_AVAILABLE 1
34
32
  #include <autolinking.h>
35
- #else
36
- #define AUTOLINKING_AVAILABLE 0
37
- #endif
38
33
  #include <fbjni/fbjni.h>
39
34
  #include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
40
35
  #include <rncore.h>
@@ -61,10 +56,8 @@ void registerComponents(
61
56
  REACT_NATIVE_APP_COMPONENT_REGISTRATION(registry);
62
57
  #endif
63
58
 
64
- #if AUTOLINKING_AVAILABLE
65
59
  // And we fallback to the components autolinked
66
60
  autolinking_registerProviders(registry);
67
- #endif
68
61
  }
69
62
 
70
63
  std::shared_ptr<TurboModule> cxxModuleProvider(
@@ -78,12 +71,8 @@ std::shared_ptr<TurboModule> cxxModuleProvider(
78
71
  // return std::make_shared<NativeCxxModuleExample>(jsInvoker);
79
72
  // }
80
73
 
81
- #if AUTOLINKING_AVAILABLE
82
74
  // And we fallback to the CXX module providers autolinked
83
75
  return autolinking_cxxModuleProvider(name, jsInvoker);
84
- #endif
85
-
86
- return nullptr;
87
76
  }
88
77
 
89
78
  std::shared_ptr<TurboModule> javaModuleProvider(
@@ -112,12 +101,10 @@ std::shared_ptr<TurboModule> javaModuleProvider(
112
101
  return module;
113
102
  }
114
103
 
115
- #if AUTOLINKING_AVAILABLE
116
104
  // And we fallback to the module providers autolinked
117
105
  if (auto module = autolinking_ModuleProvider(name, params)) {
118
106
  return module;
119
107
  }
120
- #endif
121
108
 
122
109
  return nullptr;
123
110
  }
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.76.4
1
+ VERSION_NAME=0.76.6
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 (ReactFeatureFlags.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
  }
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<6cc52570dd571ddc792a0fd842c05dd9>>
7
+ * @generated SignedSource<<89491eb63a7ca59b17419ed4432a4f88>>
8
8
  */
9
9
 
10
10
  /**
@@ -34,12 +34,6 @@ public object ReactNativeFeatureFlags {
34
34
  @JvmStatic
35
35
  public fun commonTestFlag(): Boolean = accessor.commonTestFlag()
36
36
 
37
- /**
38
- * Adds support for recursively processing commits that mount synchronously (Android only).
39
- */
40
- @JvmStatic
41
- public fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean = accessor.allowRecursiveCommitsWithSynchronousMountOnAndroid()
42
-
43
37
  /**
44
38
  * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
45
39
  */
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<eca842a1b1c823b72136c625b3bfd16e>>
7
+ * @generated SignedSource<<9f741ec3df7cd5ecd8d5c3c099c86aba>>
8
8
  */
9
9
 
10
10
  /**
@@ -21,7 +21,6 @@ package com.facebook.react.internal.featureflags
21
21
 
22
22
  public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor {
23
23
  private var commonTestFlagCache: Boolean? = null
24
- private var allowRecursiveCommitsWithSynchronousMountOnAndroidCache: Boolean? = null
25
24
  private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
26
25
  private var completeReactInstanceCreationOnBgThreadOnAndroidCache: Boolean? = null
27
26
  private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
@@ -78,15 +77,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
78
77
  return cached
79
78
  }
80
79
 
81
- override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean {
82
- var cached = allowRecursiveCommitsWithSynchronousMountOnAndroidCache
83
- if (cached == null) {
84
- cached = ReactNativeFeatureFlagsCxxInterop.allowRecursiveCommitsWithSynchronousMountOnAndroid()
85
- allowRecursiveCommitsWithSynchronousMountOnAndroidCache = cached
86
- }
87
- return cached
88
- }
89
-
90
80
  override fun batchRenderingUpdatesInEventLoop(): Boolean {
91
81
  var cached = batchRenderingUpdatesInEventLoopCache
92
82
  if (cached == null) {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<ad54375c4ae3be2f377260887ae5aaf9>>
7
+ * @generated SignedSource<<774337b6aee6f528b0852704271ed96f>>
8
8
  */
9
9
 
10
10
  /**
@@ -30,8 +30,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
30
30
 
31
31
  @DoNotStrip @JvmStatic public external fun commonTestFlag(): Boolean
32
32
 
33
- @DoNotStrip @JvmStatic public external fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean
34
-
35
33
  @DoNotStrip @JvmStatic public external fun batchRenderingUpdatesInEventLoop(): Boolean
36
34
 
37
35
  @DoNotStrip @JvmStatic public external fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<2a0cd5a4875a54bb724e5765ffe7753e>>
7
+ * @generated SignedSource<<43c4ba7a6c4f5a12ada181c081f91bfc>>
8
8
  */
9
9
 
10
10
  /**
@@ -25,8 +25,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
25
25
 
26
26
  override fun commonTestFlag(): Boolean = false
27
27
 
28
- override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean = false
29
-
30
28
  override fun batchRenderingUpdatesInEventLoop(): Boolean = false
31
29
 
32
30
  override fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean = false
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<d02af2a8ef015c57d45aba8280539606>>
7
+ * @generated SignedSource<<0ca6ebf7ef1418d721b6f183f89b96a2>>
8
8
  */
9
9
 
10
10
  /**
@@ -25,7 +25,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
25
25
  private val accessedFeatureFlags = mutableSetOf<String>()
26
26
 
27
27
  private var commonTestFlagCache: Boolean? = null
28
- private var allowRecursiveCommitsWithSynchronousMountOnAndroidCache: Boolean? = null
29
28
  private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
30
29
  private var completeReactInstanceCreationOnBgThreadOnAndroidCache: Boolean? = null
31
30
  private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
@@ -83,16 +82,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
83
82
  return cached
84
83
  }
85
84
 
86
- override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean {
87
- var cached = allowRecursiveCommitsWithSynchronousMountOnAndroidCache
88
- if (cached == null) {
89
- cached = currentProvider.allowRecursiveCommitsWithSynchronousMountOnAndroid()
90
- accessedFeatureFlags.add("allowRecursiveCommitsWithSynchronousMountOnAndroid")
91
- allowRecursiveCommitsWithSynchronousMountOnAndroidCache = cached
92
- }
93
- return cached
94
- }
95
-
96
85
  override fun batchRenderingUpdatesInEventLoop(): Boolean {
97
86
  var cached = batchRenderingUpdatesInEventLoopCache
98
87
  if (cached == null) {
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<92b1214e3a526d7c67dcc7b0c2a131de>>
7
+ * @generated SignedSource<<94e1e69be22ec978859e3f242610f21b>>
8
8
  */
9
9
 
10
10
  /**
@@ -25,8 +25,6 @@ import com.facebook.proguard.annotations.DoNotStrip
25
25
  public interface ReactNativeFeatureFlagsProvider {
26
26
  @DoNotStrip public fun commonTestFlag(): Boolean
27
27
 
28
- @DoNotStrip public fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean
29
-
30
28
  @DoNotStrip public fun batchRenderingUpdatesInEventLoop(): Boolean
31
29
 
32
30
  @DoNotStrip public fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 76,
20
- "patch", 4,
20
+ "patch", 6,
21
21
  "prerelease", null);
22
22
  }
@@ -770,6 +770,7 @@ public class ReactViewGroup extends ViewGroup
770
770
  }
771
771
  }
772
772
  removeViewsInLayout(index - clippedSoFar, 1);
773
+ invalidate();
773
774
  }
774
775
  removeFromArray(index);
775
776
  }
@@ -501,27 +501,25 @@ void Binding::schedulerShouldRenderTransactions(
501
501
  return;
502
502
  }
503
503
 
504
- if (ReactNativeFeatureFlags::
505
- allowRecursiveCommitsWithSynchronousMountOnAndroid()) {
506
- std::vector<MountingTransaction> pendingTransactions;
507
-
508
- {
509
- // Retain the lock to access the pending transactions but not to execute
510
- // the mount operations because that method can call into this method
511
- // again.
512
- std::unique_lock<std::mutex> lock(pendingTransactionsMutex_);
513
- pendingTransactions_.swap(pendingTransactions);
514
- }
515
504
 
516
- for (auto& transaction : pendingTransactions) {
517
- mountingManager->executeMount(transaction);
518
- }
519
- } else {
505
+ std::vector<MountingTransaction> pendingTransactions;
506
+
507
+ {
508
+ // Retain the lock to access the pending transactions but not to execute
509
+ // the mount operations because that method can call into this method
510
+ // again.
511
+ //
512
+ // This can be re-entrant when mounting manager triggers state updates
513
+ // synchronously (this can happen when committing from the UI thread).
514
+ // This is safe because we're already combining all the transactions for the
515
+ // same surface ID in a single transaction in the pending transactions list,
516
+ // so operations won't run out of order.
520
517
  std::unique_lock<std::mutex> lock(pendingTransactionsMutex_);
521
- for (auto& transaction : pendingTransactions_) {
522
- mountingManager->executeMount(transaction);
523
- }
524
- pendingTransactions_.clear();
518
+ pendingTransactions_.swap(pendingTransactions);
519
+ }
520
+
521
+ for (auto& transaction : pendingTransactions) {
522
+ mountingManager->executeMount(transaction);
525
523
  }
526
524
  }
527
525
 
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<c23b21fca18699470580e54b99de1126>>
7
+ * @generated SignedSource<<68e5d4ce0ed3c237eeababaa04821101>>
8
8
  */
9
9
 
10
10
  /**
@@ -45,12 +45,6 @@ class ReactNativeFeatureFlagsProviderHolder
45
45
  return method(javaProvider_);
46
46
  }
47
47
 
48
- bool allowRecursiveCommitsWithSynchronousMountOnAndroid() override {
49
- static const auto method =
50
- getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("allowRecursiveCommitsWithSynchronousMountOnAndroid");
51
- return method(javaProvider_);
52
- }
53
-
54
48
  bool batchRenderingUpdatesInEventLoop() override {
55
49
  static const auto method =
56
50
  getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("batchRenderingUpdatesInEventLoop");
@@ -336,11 +330,6 @@ bool JReactNativeFeatureFlagsCxxInterop::commonTestFlag(
336
330
  return ReactNativeFeatureFlags::commonTestFlag();
337
331
  }
338
332
 
339
- bool JReactNativeFeatureFlagsCxxInterop::allowRecursiveCommitsWithSynchronousMountOnAndroid(
340
- facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
341
- return ReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid();
342
- }
343
-
344
333
  bool JReactNativeFeatureFlagsCxxInterop::batchRenderingUpdatesInEventLoop(
345
334
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
346
335
  return ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop();
@@ -591,9 +580,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
591
580
  makeNativeMethod(
592
581
  "commonTestFlag",
593
582
  JReactNativeFeatureFlagsCxxInterop::commonTestFlag),
594
- makeNativeMethod(
595
- "allowRecursiveCommitsWithSynchronousMountOnAndroid",
596
- JReactNativeFeatureFlagsCxxInterop::allowRecursiveCommitsWithSynchronousMountOnAndroid),
597
583
  makeNativeMethod(
598
584
  "batchRenderingUpdatesInEventLoop",
599
585
  JReactNativeFeatureFlagsCxxInterop::batchRenderingUpdatesInEventLoop),
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<89d0da3b2bb56a4ee3c887e6c57491b2>>
7
+ * @generated SignedSource<<bba5d2a290f39b6572db7f90b67e8469>>
8
8
  */
9
9
 
10
10
  /**
@@ -33,9 +33,6 @@ class JReactNativeFeatureFlagsCxxInterop
33
33
  static bool commonTestFlag(
34
34
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
35
35
 
36
- static bool allowRecursiveCommitsWithSynchronousMountOnAndroid(
37
- facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
38
-
39
36
  static bool batchRenderingUpdatesInEventLoop(
40
37
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
41
38
 
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 76;
20
- int32_t Patch = 4;
20
+ int32_t Patch = 6;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<6139aa47aac3e5682a453a416bc10236>>
7
+ * @generated SignedSource<<5c4ae3a29f0191428284e0c660353edf>>
8
8
  */
9
9
 
10
10
  /**
@@ -25,10 +25,6 @@ bool ReactNativeFeatureFlags::commonTestFlag() {
25
25
  return getAccessor().commonTestFlag();
26
26
  }
27
27
 
28
- bool ReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid() {
29
- return getAccessor().allowRecursiveCommitsWithSynchronousMountOnAndroid();
30
- }
31
-
32
28
  bool ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop() {
33
29
  return getAccessor().batchRenderingUpdatesInEventLoop();
34
30
  }