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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 77,
19
19
  patch: 0,
20
- prerelease: 'rc.2',
20
+ prerelease: 'rc.4',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(77),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"rc.2",
27
+ RCTVersionPrerelease: @"rc.4",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -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
  }
@@ -262,8 +264,10 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
262
264
  if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) {
263
265
  NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
264
266
  RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes(RCTFontSizeMultiplier()));
267
+ #if !TARGET_OS_MACCATALYST
265
268
  defaultAttributes[RCTAttributedStringEventEmitterKey] =
266
269
  _backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
270
+ #endif
267
271
  _backedTextInputView.defaultTextAttributes = defaultAttributes;
268
272
  }
269
273
 
@@ -7836,6 +7836,7 @@ public class com/facebook/react/views/view/ReactViewGroup : android/view/ViewGro
7836
7836
  protected fun dispatchSetPressed (Z)V
7837
7837
  public fun draw (Landroid/graphics/Canvas;)V
7838
7838
  protected fun drawChild (Landroid/graphics/Canvas;Landroid/view/View;J)Z
7839
+ public fun endViewTransition (Landroid/view/View;)V
7839
7840
  protected fun getChildDrawingOrder (II)I
7840
7841
  public fun getClippingRect (Landroid/graphics/Rect;)V
7841
7842
  public fun getHitSlopRect ()Landroid/graphics/Rect;
@@ -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.77.0-rc.2
1
+ VERSION_NAME=0.77.0-rc.4
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 77,
20
20
  "patch", 0,
21
- "prerelease", "rc.2");
21
+ "prerelease", "rc.4");
22
22
  }
@@ -62,9 +62,6 @@ public abstract class ReactClippingViewManager<T : ReactViewGroup> : ViewGroupMa
62
62
  if (removeClippedSubviews) {
63
63
  val child = getChildAt(parent, index)
64
64
  if (child != null) {
65
- if (child.parent != null) {
66
- parent.removeView(child)
67
- }
68
65
  parent.removeViewWithSubviewClippingEnabled(child)
69
66
  }
70
67
  } else {
@@ -56,6 +56,8 @@ import com.facebook.react.uimanager.style.BorderRadiusProp;
56
56
  import com.facebook.react.uimanager.style.BorderStyle;
57
57
  import com.facebook.react.uimanager.style.LogicalEdge;
58
58
  import com.facebook.react.uimanager.style.Overflow;
59
+ import java.util.HashSet;
60
+ import java.util.Set;
59
61
 
60
62
  /**
61
63
  * Backing for a React View. Has support for borders, but since borders aren't common, lazy
@@ -134,6 +136,7 @@ public class ReactViewGroup extends ViewGroup
134
136
  private @Nullable ViewGroupDrawingOrderHelper mDrawingOrderHelper;
135
137
  private float mBackfaceOpacity;
136
138
  private String mBackfaceVisibility;
139
+ private @Nullable Set<Integer> mChildrenRemovedWhileTransitioning;
137
140
 
138
141
  /**
139
142
  * Creates a new `ReactViewGroup` instance.
@@ -167,6 +170,7 @@ public class ReactViewGroup extends ViewGroup
167
170
  mDrawingOrderHelper = null;
168
171
  mBackfaceOpacity = 1.f;
169
172
  mBackfaceVisibility = "visible";
173
+ mChildrenRemovedWhileTransitioning = null;
170
174
  }
171
175
 
172
176
  /* package */ void recycleView() {
@@ -349,6 +353,7 @@ public class ReactViewGroup extends ViewGroup
349
353
  return;
350
354
  }
351
355
  mRemoveClippedSubviews = removeClippedSubviews;
356
+ mChildrenRemovedWhileTransitioning = null;
352
357
  if (removeClippedSubviews) {
353
358
  mClippingRect = new Rect();
354
359
  ReactClippingViewGroupHelper.calculateClippingRect(this, mClippingRect);
@@ -402,6 +407,26 @@ public class ReactViewGroup extends ViewGroup
402
407
  updateClippingToRect(mClippingRect);
403
408
  }
404
409
 
410
+ @Override
411
+ public void endViewTransition(View view) {
412
+ super.endViewTransition(view);
413
+ if (mChildrenRemovedWhileTransitioning != null) {
414
+ mChildrenRemovedWhileTransitioning.remove(view.getId());
415
+ }
416
+ }
417
+
418
+ private void trackChildViewTransition(int childId) {
419
+ if (mChildrenRemovedWhileTransitioning == null) {
420
+ mChildrenRemovedWhileTransitioning = new HashSet<>();
421
+ }
422
+ mChildrenRemovedWhileTransitioning.add(childId);
423
+ }
424
+
425
+ private boolean isChildRemovedWhileTransitioning(View child) {
426
+ return mChildrenRemovedWhileTransitioning != null
427
+ && mChildrenRemovedWhileTransitioning.contains(child.getId());
428
+ }
429
+
405
430
  private void updateClippingToRect(Rect clippingRect) {
406
431
  Assertions.assertNotNull(mAllChildren);
407
432
  int clippedSoFar = 0;
@@ -548,6 +573,12 @@ public class ReactViewGroup extends ViewGroup
548
573
  } else {
549
574
  setChildrenDrawingOrderEnabled(false);
550
575
  }
576
+
577
+ // The parent might not be null in case the child is transitioning.
578
+ if (child.getParent() != null) {
579
+ trackChildViewTransition(child.getId());
580
+ }
581
+
551
582
  super.onViewRemoved(child);
552
583
  }
553
584
 
@@ -677,6 +708,7 @@ public class ReactViewGroup extends ViewGroup
677
708
  }
678
709
  }
679
710
  removeViewsInLayout(index - clippedSoFar, 1);
711
+ invalidate();
680
712
  }
681
713
  removeFromArray(index);
682
714
  }
@@ -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.2";
21
+ std::string_view Prerelease = "rc.4";
22
22
  } ReactNativeVersion;
23
23
 
24
24
  } // namespace facebook::react
@@ -403,6 +403,7 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
403
403
  {
404
404
  auto nsAttributedStringFragment = RCTNSAttributedStringFragmentFromFragment(fragment, placeholderImage);
405
405
 
406
+ #if !TARGET_OS_MACCATALYST
406
407
  if (fragment.parentShadowView.componentHandle) {
407
408
  RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
408
409
  eventEmitterWrapper.eventEmitter = fragment.parentShadowView.eventEmitter;
@@ -413,6 +414,7 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
413
414
  [nsAttributedStringFragment addAttributes:additionalTextAttributes
414
415
  range:NSMakeRange(0, nsAttributedStringFragment.length)];
415
416
  }
417
+ #endif
416
418
 
417
419
  return nsAttributedStringFragment;
418
420
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.77.0-rc.2",
3
+ "version": "0.77.0-rc.4",
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.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",
111
+ "@react-native/assets-registry": "0.77.0-rc.4",
112
+ "@react-native/codegen": "0.77.0-rc.4",
113
+ "@react-native/community-cli-plugin": "0.77.0-rc.4",
114
+ "@react-native/gradle-plugin": "0.77.0-rc.4",
115
+ "@react-native/js-polyfills": "0.77.0-rc.4",
116
+ "@react-native/normalize-colors": "0.77.0-rc.4",
117
+ "@react-native/virtualized-lists": "0.77.0-rc.4",
118
118
  "abort-controller": "^3.0.0",
119
119
  "anser": "^1.4.9",
120
120
  "ansi-regex": "^5.0.0",
@@ -44,10 +44,10 @@ class ReactNativePodsUtils
44
44
  end
45
45
 
46
46
  def self.set_gcc_preprocessor_definition_for_React_hermes(installer)
47
- self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-hermes", "Debug")
48
- self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-jsinspector", "Debug")
49
- self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "hermes-engine", "Debug")
50
- self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-RuntimeHermes", "Debug")
47
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-hermes", :debug)
48
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-jsinspector", :debug)
49
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "hermes-engine", :debug)
50
+ self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "HERMES_ENABLE_DEBUGGER=1", "React-RuntimeHermes", :debug)
51
51
  end
52
52
 
53
53
  def self.turn_off_resource_bundle_react_core(installer)
@@ -193,11 +193,11 @@ class ReactNativePodsUtils
193
193
 
194
194
  private
195
195
 
196
- def self.add_build_settings_to_pod(installer, settings_name, settings_value, target_pod_name, configuration)
196
+ def self.add_build_settings_to_pod(installer, settings_name, settings_value, target_pod_name, configuration_type)
197
197
  installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
198
198
  if pod_name.to_s == target_pod_name
199
199
  target_installation_result.native_target.build_configurations.each do |config|
200
- if configuration == nil || (configuration != nil && config.name.include?(configuration))
200
+ if configuration_type == nil || (configuration_type != nil && config.type == configuration_type)
201
201
  config.build_settings[settings_name] ||= '$(inherited) '
202
202
  config.build_settings[settings_name] << settings_value
203
203
  end
@@ -763,6 +763,16 @@ function findFilesWithExtension(filePath, extension) {
763
763
  const dir = fs.readdirSync(filePath);
764
764
  dir.forEach(file => {
765
765
  const absolutePath = path.join(filePath, file);
766
+ // Exclude files provided by react-native
767
+ if (absolutePath.includes(`${path.sep}react-native${path.sep}`)) {
768
+ return null;
769
+ }
770
+
771
+ // Skip hidden folders, that starts with `.`
772
+ if (absolutePath.includes(`${path.sep}.`)) {
773
+ return null;
774
+ }
775
+
766
776
  if (
767
777
  fs.existsSync(absolutePath) &&
768
778
  fs.statSync(absolutePath).isDirectory()
@@ -778,11 +788,6 @@ function findFilesWithExtension(filePath, extension) {
778
788
  // Given a filepath, read the file and look for a string that starts with 'Class<RCTComponentViewProtocol> '
779
789
  // and ends with 'Cls(void)'. Return the string between the two.
780
790
  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
-
786
791
  const fileContent = fs.readFileSync(filepath, 'utf8');
787
792
  const regex = /Class<RCTComponentViewProtocol> (.*)Cls\(/;
788
793
  const match = fileContent.match(regex);
Binary file
Binary file
Binary file