react-native 0.79.1 → 0.79.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 (49) hide show
  1. package/Libraries/AppDelegate/RCTReactNativeFactory.mm +8 -0
  2. package/Libraries/Blob/URL.js +13 -1
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/React/Base/RCTVersion.m +1 -1
  5. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +12 -0
  6. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +18 -0
  7. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +18 -4
  8. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +1 -1
  9. package/ReactAndroid/gradle.properties +1 -1
  10. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +13 -1
  11. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +21 -1
  12. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +5 -1
  13. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +5 -1
  14. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +23 -1
  15. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt +4 -0
  16. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +5 -1
  17. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  18. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +2 -2
  19. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +0 -3
  20. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +29 -1
  21. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +7 -1
  22. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  23. package/ReactCommon/jsc/React-jsc.podspec +1 -1
  24. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +9 -1
  25. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +11 -1
  26. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +45 -9
  27. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +6 -2
  28. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +9 -1
  29. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +19 -1
  30. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +3 -1
  31. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +11 -1
  32. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +5 -1
  33. package/ReactCommon/react/renderer/core/ShadowNode.cpp +14 -4
  34. package/ReactCommon/react/renderer/core/ShadowNode.h +6 -0
  35. package/ReactCommon/react/renderer/mounting/updateMountedFlag.cpp +6 -0
  36. package/ReactCommon/react/runtime/TimerManager.cpp +6 -4
  37. package/ReactCommon/react/runtime/TimerManager.h +3 -1
  38. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +0 -1
  39. package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +9 -5
  40. package/package.json +8 -8
  41. package/scripts/codegen/generate-artifacts-executor.js +53 -18
  42. package/sdks/.hermesversion +1 -1
  43. package/sdks/hermesc/osx-bin/hermes +0 -0
  44. package/sdks/hermesc/osx-bin/hermesc +0 -0
  45. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  46. package/src/private/featureflags/ReactNativeFeatureFlags.js +11 -1
  47. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -1
  48. package/types/index.d.ts +1 -1
  49. package/types/tsconfig.test.json +16 -0
@@ -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<<55a526204b386d34058c86183d5b97ac>>
7
+ * @generated SignedSource<<53e965423f2957b37e0470c607cc45a4>>
8
8
  */
9
9
 
10
10
  /**
@@ -214,6 +214,11 @@ class ReactNativeFeatureFlags {
214
214
  */
215
215
  RN_EXPORT static bool traceTurboModulePromiseRejectionsOnAndroid();
216
216
 
217
+ /**
218
+ * When enabled, runtime shadow node references will be updated during the commit. This allows running RSNRU from any thread without corrupting the renderer state.
219
+ */
220
+ RN_EXPORT static bool updateRuntimeShadowNodeReferencesOnCommit();
221
+
217
222
  /**
218
223
  * In Bridgeless mode, use the always available javascript error reporting pipeline.
219
224
  */
@@ -244,6 +249,11 @@ class ReactNativeFeatureFlags {
244
249
  */
245
250
  RN_EXPORT static bool useRawPropsJsiValue();
246
251
 
252
+ /**
253
+ * Use the state stored on the source shadow node when cloning it instead of reading in the most recent state on the shadow node family.
254
+ */
255
+ RN_EXPORT static bool useShadowNodeStateOnClone();
256
+
247
257
  /**
248
258
  * In Bridgeless mode, should legacy NativeModules use the TurboModule system?
249
259
  */
@@ -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<<c30a4dea1d32e2838f6e5db6442a3f78>>
7
+ * @generated SignedSource<<5ff3ac57eb17d9b6642d98f2fc35bd9d>>
8
8
  */
9
9
 
10
10
  /**
@@ -659,6 +659,24 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid
659
659
  return flagValue.value();
660
660
  }
661
661
 
662
+ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit() {
663
+ auto flagValue = updateRuntimeShadowNodeReferencesOnCommit_.load();
664
+
665
+ if (!flagValue.has_value()) {
666
+ // This block is not exclusive but it is not necessary.
667
+ // If multiple threads try to initialize the feature flag, we would only
668
+ // be accessing the provider multiple times but the end state of this
669
+ // instance and the returned flag value would be the same.
670
+
671
+ markFlagAsAccessed(35, "updateRuntimeShadowNodeReferencesOnCommit");
672
+
673
+ flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit();
674
+ updateRuntimeShadowNodeReferencesOnCommit_ = flagValue;
675
+ }
676
+
677
+ return flagValue.value();
678
+ }
679
+
662
680
  bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
663
681
  auto flagValue = useAlwaysAvailableJSErrorHandling_.load();
664
682
 
@@ -668,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
668
686
  // be accessing the provider multiple times but the end state of this
669
687
  // instance and the returned flag value would be the same.
670
688
 
671
- markFlagAsAccessed(35, "useAlwaysAvailableJSErrorHandling");
689
+ markFlagAsAccessed(36, "useAlwaysAvailableJSErrorHandling");
672
690
 
673
691
  flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
674
692
  useAlwaysAvailableJSErrorHandling_ = flagValue;
@@ -686,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::useEditTextStockAndroidFocusBehavior() {
686
704
  // be accessing the provider multiple times but the end state of this
687
705
  // instance and the returned flag value would be the same.
688
706
 
689
- markFlagAsAccessed(36, "useEditTextStockAndroidFocusBehavior");
707
+ markFlagAsAccessed(37, "useEditTextStockAndroidFocusBehavior");
690
708
 
691
709
  flagValue = currentProvider_->useEditTextStockAndroidFocusBehavior();
692
710
  useEditTextStockAndroidFocusBehavior_ = flagValue;
@@ -704,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
704
722
  // be accessing the provider multiple times but the end state of this
705
723
  // instance and the returned flag value would be the same.
706
724
 
707
- markFlagAsAccessed(37, "useFabricInterop");
725
+ markFlagAsAccessed(38, "useFabricInterop");
708
726
 
709
727
  flagValue = currentProvider_->useFabricInterop();
710
728
  useFabricInterop_ = flagValue;
@@ -722,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
722
740
  // be accessing the provider multiple times but the end state of this
723
741
  // instance and the returned flag value would be the same.
724
742
 
725
- markFlagAsAccessed(38, "useNativeViewConfigsInBridgelessMode");
743
+ markFlagAsAccessed(39, "useNativeViewConfigsInBridgelessMode");
726
744
 
727
745
  flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
728
746
  useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -740,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() {
740
758
  // be accessing the provider multiple times but the end state of this
741
759
  // instance and the returned flag value would be the same.
742
760
 
743
- markFlagAsAccessed(39, "useOptimizedEventBatchingOnAndroid");
761
+ markFlagAsAccessed(40, "useOptimizedEventBatchingOnAndroid");
744
762
 
745
763
  flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
746
764
  useOptimizedEventBatchingOnAndroid_ = flagValue;
@@ -758,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
758
776
  // be accessing the provider multiple times but the end state of this
759
777
  // instance and the returned flag value would be the same.
760
778
 
761
- markFlagAsAccessed(40, "useRawPropsJsiValue");
779
+ markFlagAsAccessed(41, "useRawPropsJsiValue");
762
780
 
763
781
  flagValue = currentProvider_->useRawPropsJsiValue();
764
782
  useRawPropsJsiValue_ = flagValue;
@@ -767,6 +785,24 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
767
785
  return flagValue.value();
768
786
  }
769
787
 
788
+ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() {
789
+ auto flagValue = useShadowNodeStateOnClone_.load();
790
+
791
+ if (!flagValue.has_value()) {
792
+ // This block is not exclusive but it is not necessary.
793
+ // If multiple threads try to initialize the feature flag, we would only
794
+ // be accessing the provider multiple times but the end state of this
795
+ // instance and the returned flag value would be the same.
796
+
797
+ markFlagAsAccessed(42, "useShadowNodeStateOnClone");
798
+
799
+ flagValue = currentProvider_->useShadowNodeStateOnClone();
800
+ useShadowNodeStateOnClone_ = flagValue;
801
+ }
802
+
803
+ return flagValue.value();
804
+ }
805
+
770
806
  bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
771
807
  auto flagValue = useTurboModuleInterop_.load();
772
808
 
@@ -776,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
776
812
  // be accessing the provider multiple times but the end state of this
777
813
  // instance and the returned flag value would be the same.
778
814
 
779
- markFlagAsAccessed(41, "useTurboModuleInterop");
815
+ markFlagAsAccessed(43, "useTurboModuleInterop");
780
816
 
781
817
  flagValue = currentProvider_->useTurboModuleInterop();
782
818
  useTurboModuleInterop_ = flagValue;
@@ -794,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
794
830
  // be accessing the provider multiple times but the end state of this
795
831
  // instance and the returned flag value would be the same.
796
832
 
797
- markFlagAsAccessed(42, "useTurboModules");
833
+ markFlagAsAccessed(44, "useTurboModules");
798
834
 
799
835
  flagValue = currentProvider_->useTurboModules();
800
836
  useTurboModules_ = flagValue;
@@ -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<<95aa4a8b8859f26b901112df1517b1f1>>
7
+ * @generated SignedSource<<267385c8df88a5d1eb7f1e2478209d39>>
8
8
  */
9
9
 
10
10
  /**
@@ -67,12 +67,14 @@ class ReactNativeFeatureFlagsAccessor {
67
67
  bool removeTurboModuleManagerDelegateMutex();
68
68
  bool throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS();
69
69
  bool traceTurboModulePromiseRejectionsOnAndroid();
70
+ bool updateRuntimeShadowNodeReferencesOnCommit();
70
71
  bool useAlwaysAvailableJSErrorHandling();
71
72
  bool useEditTextStockAndroidFocusBehavior();
72
73
  bool useFabricInterop();
73
74
  bool useNativeViewConfigsInBridgelessMode();
74
75
  bool useOptimizedEventBatchingOnAndroid();
75
76
  bool useRawPropsJsiValue();
77
+ bool useShadowNodeStateOnClone();
76
78
  bool useTurboModuleInterop();
77
79
  bool useTurboModules();
78
80
 
@@ -86,7 +88,7 @@ class ReactNativeFeatureFlagsAccessor {
86
88
  std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
87
89
  bool wasOverridden_;
88
90
 
89
- std::array<std::atomic<const char*>, 43> accessedFeatureFlags_;
91
+ std::array<std::atomic<const char*>, 45> accessedFeatureFlags_;
90
92
 
91
93
  std::atomic<std::optional<bool>> commonTestFlag_;
92
94
  std::atomic<std::optional<bool>> disableMountItemReorderingAndroid_;
@@ -123,12 +125,14 @@ class ReactNativeFeatureFlagsAccessor {
123
125
  std::atomic<std::optional<bool>> removeTurboModuleManagerDelegateMutex_;
124
126
  std::atomic<std::optional<bool>> throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS_;
125
127
  std::atomic<std::optional<bool>> traceTurboModulePromiseRejectionsOnAndroid_;
128
+ std::atomic<std::optional<bool>> updateRuntimeShadowNodeReferencesOnCommit_;
126
129
  std::atomic<std::optional<bool>> useAlwaysAvailableJSErrorHandling_;
127
130
  std::atomic<std::optional<bool>> useEditTextStockAndroidFocusBehavior_;
128
131
  std::atomic<std::optional<bool>> useFabricInterop_;
129
132
  std::atomic<std::optional<bool>> useNativeViewConfigsInBridgelessMode_;
130
133
  std::atomic<std::optional<bool>> useOptimizedEventBatchingOnAndroid_;
131
134
  std::atomic<std::optional<bool>> useRawPropsJsiValue_;
135
+ std::atomic<std::optional<bool>> useShadowNodeStateOnClone_;
132
136
  std::atomic<std::optional<bool>> useTurboModuleInterop_;
133
137
  std::atomic<std::optional<bool>> useTurboModules_;
134
138
  };
@@ -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<<e80434127379886a001ffcbace6ba619>>
7
+ * @generated SignedSource<<48bb4ea50c42676aee161ea1594a6aec>>
8
8
  */
9
9
 
10
10
  /**
@@ -167,6 +167,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
167
167
  return false;
168
168
  }
169
169
 
170
+ bool updateRuntimeShadowNodeReferencesOnCommit() override {
171
+ return false;
172
+ }
173
+
170
174
  bool useAlwaysAvailableJSErrorHandling() override {
171
175
  return false;
172
176
  }
@@ -191,6 +195,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
191
195
  return false;
192
196
  }
193
197
 
198
+ bool useShadowNodeStateOnClone() override {
199
+ return false;
200
+ }
201
+
194
202
  bool useTurboModuleInterop() override {
195
203
  return false;
196
204
  }
@@ -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<<21aeeeaa1a402f91b616180114887a58>>
7
+ * @generated SignedSource<<e92353bf22b82344bc6ab97f08ca724c>>
8
8
  */
9
9
 
10
10
  /**
@@ -360,6 +360,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
360
360
  return ReactNativeFeatureFlagsDefaults::traceTurboModulePromiseRejectionsOnAndroid();
361
361
  }
362
362
 
363
+ bool updateRuntimeShadowNodeReferencesOnCommit() override {
364
+ auto value = values_["updateRuntimeShadowNodeReferencesOnCommit"];
365
+ if (!value.isNull()) {
366
+ return value.getBool();
367
+ }
368
+
369
+ return ReactNativeFeatureFlagsDefaults::updateRuntimeShadowNodeReferencesOnCommit();
370
+ }
371
+
363
372
  bool useAlwaysAvailableJSErrorHandling() override {
364
373
  auto value = values_["useAlwaysAvailableJSErrorHandling"];
365
374
  if (!value.isNull()) {
@@ -414,6 +423,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
414
423
  return ReactNativeFeatureFlagsDefaults::useRawPropsJsiValue();
415
424
  }
416
425
 
426
+ bool useShadowNodeStateOnClone() override {
427
+ auto value = values_["useShadowNodeStateOnClone"];
428
+ if (!value.isNull()) {
429
+ return value.getBool();
430
+ }
431
+
432
+ return ReactNativeFeatureFlagsDefaults::useShadowNodeStateOnClone();
433
+ }
434
+
417
435
  bool useTurboModuleInterop() override {
418
436
  auto value = values_["useTurboModuleInterop"];
419
437
  if (!value.isNull()) {
@@ -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<<b4ba05d9dee950f242db8f3a830a75da>>
7
+ * @generated SignedSource<<d8f7773c6f24c715a6c0e0ab703677fd>>
8
8
  */
9
9
 
10
10
  /**
@@ -60,12 +60,14 @@ class ReactNativeFeatureFlagsProvider {
60
60
  virtual bool removeTurboModuleManagerDelegateMutex() = 0;
61
61
  virtual bool throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS() = 0;
62
62
  virtual bool traceTurboModulePromiseRejectionsOnAndroid() = 0;
63
+ virtual bool updateRuntimeShadowNodeReferencesOnCommit() = 0;
63
64
  virtual bool useAlwaysAvailableJSErrorHandling() = 0;
64
65
  virtual bool useEditTextStockAndroidFocusBehavior() = 0;
65
66
  virtual bool useFabricInterop() = 0;
66
67
  virtual bool useNativeViewConfigsInBridgelessMode() = 0;
67
68
  virtual bool useOptimizedEventBatchingOnAndroid() = 0;
68
69
  virtual bool useRawPropsJsiValue() = 0;
70
+ virtual bool useShadowNodeStateOnClone() = 0;
69
71
  virtual bool useTurboModuleInterop() = 0;
70
72
  virtual bool useTurboModules() = 0;
71
73
  };
@@ -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<<651dc228bd4959a90c82de905a8b6c40>>
7
+ * @generated SignedSource<<76f1f689940817c1df6ace2f8dd062e7>>
8
8
  */
9
9
 
10
10
  /**
@@ -219,6 +219,11 @@ bool NativeReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid(
219
219
  return ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid();
220
220
  }
221
221
 
222
+ bool NativeReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit(
223
+ jsi::Runtime& /*runtime*/) {
224
+ return ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit();
225
+ }
226
+
222
227
  bool NativeReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling(
223
228
  jsi::Runtime& /*runtime*/) {
224
229
  return ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling();
@@ -249,6 +254,11 @@ bool NativeReactNativeFeatureFlags::useRawPropsJsiValue(
249
254
  return ReactNativeFeatureFlags::useRawPropsJsiValue();
250
255
  }
251
256
 
257
+ bool NativeReactNativeFeatureFlags::useShadowNodeStateOnClone(
258
+ jsi::Runtime& /*runtime*/) {
259
+ return ReactNativeFeatureFlags::useShadowNodeStateOnClone();
260
+ }
261
+
252
262
  bool NativeReactNativeFeatureFlags::useTurboModuleInterop(
253
263
  jsi::Runtime& /*runtime*/) {
254
264
  return ReactNativeFeatureFlags::useTurboModuleInterop();
@@ -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<<1a082675338773d1a6259fabfd2f652f>>
7
+ * @generated SignedSource<<af8c15575ff94feff9dadaaf8becdf18>>
8
8
  */
9
9
 
10
10
  /**
@@ -107,6 +107,8 @@ class NativeReactNativeFeatureFlags
107
107
 
108
108
  bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime& runtime);
109
109
 
110
+ bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime& runtime);
111
+
110
112
  bool useAlwaysAvailableJSErrorHandling(jsi::Runtime& runtime);
111
113
 
112
114
  bool useEditTextStockAndroidFocusBehavior(jsi::Runtime& runtime);
@@ -119,6 +121,8 @@ class NativeReactNativeFeatureFlags
119
121
 
120
122
  bool useRawPropsJsiValue(jsi::Runtime& runtime);
121
123
 
124
+ bool useShadowNodeStateOnClone(jsi::Runtime& runtime);
125
+
122
126
  bool useTurboModuleInterop(jsi::Runtime& runtime);
123
127
 
124
128
  bool useTurboModules(jsi::Runtime& runtime);
@@ -112,7 +112,9 @@ ShadowNode::ShadowNode(
112
112
  fragment.children ? fragment.children : sourceShadowNode.children_),
113
113
  state_(
114
114
  fragment.state ? fragment.state
115
- : sourceShadowNode.getMostRecentState()),
115
+ : (ReactNativeFeatureFlags::useShadowNodeStateOnClone()
116
+ ? sourceShadowNode.state_
117
+ : sourceShadowNode.getMostRecentState())),
116
118
  orderIndex_(sourceShadowNode.orderIndex_),
117
119
  family_(sourceShadowNode.family_),
118
120
  traits_(sourceShadowNode.traits_) {
@@ -308,20 +310,28 @@ void ShadowNode::setRuntimeShadowNodeReference(
308
310
  runtimeShadowNodeReference_ = runtimeShadowNodeReference;
309
311
  }
310
312
 
313
+ void ShadowNode::updateRuntimeShadowNodeReference(
314
+ const Shared& destinationShadowNode) const {
315
+ if (auto reference = runtimeShadowNodeReference_.lock()) {
316
+ reference->shadowNode = destinationShadowNode;
317
+ }
318
+ }
319
+
311
320
  void ShadowNode::transferRuntimeShadowNodeReference(
312
321
  const Shared& destinationShadowNode) const {
313
322
  destinationShadowNode->runtimeShadowNodeReference_ =
314
323
  runtimeShadowNodeReference_;
315
324
 
316
- if (auto reference = runtimeShadowNodeReference_.lock()) {
317
- reference->shadowNode = destinationShadowNode;
325
+ if (!ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit()) {
326
+ updateRuntimeShadowNodeReference(destinationShadowNode);
318
327
  }
319
328
  }
320
329
 
321
330
  void ShadowNode::transferRuntimeShadowNodeReference(
322
331
  const Shared& destinationShadowNode,
323
332
  const ShadowNodeFragment& fragment) const {
324
- if (useRuntimeShadowNodeReferenceUpdateOnThread &&
333
+ if ((ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit() ||
334
+ useRuntimeShadowNodeReferenceUpdateOnThread) &&
325
335
  fragment.runtimeShadowNodeReference) {
326
336
  transferRuntimeShadowNodeReference(destinationShadowNode);
327
337
  }
@@ -187,6 +187,12 @@ class ShadowNode : public Sealable,
187
187
  void setRuntimeShadowNodeReference(const std::shared_ptr<ShadowNodeWrapper>&
188
188
  runtimeShadowNodeReference) const;
189
189
 
190
+ /*
191
+ * Update the runtime reference to point to the provided shadow node.
192
+ */
193
+ void updateRuntimeShadowNodeReference(
194
+ const Shared& destinationShadowNode) const;
195
+
190
196
  /*
191
197
  * Transfer the runtime reference to this `ShadowNode` to a new instance,
192
198
  * updating the reference to point to the new `ShadowNode` referencing it.
@@ -7,6 +7,8 @@
7
7
 
8
8
  #include "updateMountedFlag.h"
9
9
 
10
+ #include <react/featureflags/ReactNativeFeatureFlags.h>
11
+
10
12
  namespace facebook::react {
11
13
  void updateMountedFlag(
12
14
  const ShadowNode::ListOfShared& oldChildren,
@@ -47,6 +49,10 @@ void updateMountedFlag(
47
49
  newChild->setMounted(true);
48
50
  oldChild->setMounted(false);
49
51
 
52
+ if (ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit()) {
53
+ newChild->updateRuntimeShadowNodeReference(newChild);
54
+ }
55
+
50
56
  updateMountedFlag(oldChild->getChildren(), newChild->getChildren());
51
57
  }
52
58
 
@@ -242,8 +242,9 @@ void TimerManager::attachGlobals(jsi::Runtime& runtime) {
242
242
  }
243
243
 
244
244
  if (!args[0].isObject() || !args[0].asObject(rt).isFunction(rt)) {
245
- // Do not throw any error to match web spec
246
- return timerIndex_++;
245
+ // Do not throw any error to match web spec; instead return 0, an
246
+ // invalid timer id
247
+ return 0;
247
248
  }
248
249
 
249
250
  auto callback = args[0].getObject(rt).getFunction(rt);
@@ -300,8 +301,9 @@ void TimerManager::attachGlobals(jsi::Runtime& runtime) {
300
301
  }
301
302
 
302
303
  if (!args[0].isObject() || !args[0].asObject(rt).isFunction(rt)) {
303
- throw jsi::JSError(
304
- rt, "The first argument to setInterval must be a function.");
304
+ // Do not throw any error to match web spec; instead return 0, an
305
+ // invalid timer id
306
+ return 0;
305
307
  }
306
308
  auto callback = args[0].getObject(rt).getFunction(rt);
307
309
  auto delay = count > 1
@@ -93,7 +93,9 @@ class TimerManager {
93
93
 
94
94
  // Each timeout that is registered on this queue gets a sequential id. This
95
95
  // is the global count from which those are assigned.
96
- TimerHandle timerIndex_{0};
96
+ // As per WHATWG HTML 8.6.1 (Timers) ids must be greater than zero, i.e. start
97
+ // at 1
98
+ TimerHandle timerIndex_{1};
97
99
 
98
100
  // The React Native microtask queue is used to back public APIs including
99
101
  // `queueMicrotask`, `clearImmediate`, and `setImmediate` (which is used by
@@ -474,7 +474,6 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
474
474
 
475
475
  if (error) {
476
476
  [strongSelf handleBundleLoadingError:error];
477
- [strongSelf invalidate];
478
477
  return;
479
478
  }
480
479
  // DevSettings module is needed by _loadScriptFromSource's callback so prior initialization is required
@@ -267,7 +267,9 @@ TEST_F(ReactInstanceTest, testSetTimeoutWithoutDelay) {
267
267
  EXPECT_CALL(
268
268
  *mockRegistry_,
269
269
  createTimer(_, 0)); // If delay is not provided, it should use 0
270
- eval("setTimeout(() => {});");
270
+ auto val = eval("setTimeout(() => {});");
271
+ expectNoError();
272
+ EXPECT_EQ(val.asNumber(), 1); // First timer id should start at 1
271
273
  }
272
274
 
273
275
  TEST_F(ReactInstanceTest, testSetTimeoutWithPassThroughArgs) {
@@ -299,8 +301,9 @@ TEST_F(ReactInstanceTest, testSetTimeoutWithInvalidArgs) {
299
301
  getErrorMessage("setTimeout();"),
300
302
  "setTimeout must be called with at least one argument (the function to call).");
301
303
 
302
- eval("setTimeout('invalid');");
304
+ auto val = eval("setTimeout('invalid')");
303
305
  expectNoError();
306
+ EXPECT_EQ(val.asNumber(), 0);
304
307
 
305
308
  eval("setTimeout(() => {}, 'invalid');");
306
309
  expectNoError();
@@ -417,9 +420,10 @@ TEST_F(ReactInstanceTest, testSetIntervalWithInvalidArgs) {
417
420
  EXPECT_EQ(
418
421
  getErrorMessage("setInterval();"),
419
422
  "setInterval must be called with at least one argument (the function to call).");
420
- EXPECT_EQ(
421
- getErrorMessage("setInterval('invalid', 100);"),
422
- "The first argument to setInterval must be a function.");
423
+
424
+ auto val = eval("setInterval('invalid', 100)");
425
+ expectNoError();
426
+ EXPECT_EQ(val.asNumber(), 0);
423
427
  }
424
428
 
425
429
  TEST_F(ReactInstanceTest, testClearInterval) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.79.1",
3
+ "version": "0.79.3",
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.7.0",
111
- "@react-native/assets-registry": "0.79.1",
112
- "@react-native/codegen": "0.79.1",
113
- "@react-native/community-cli-plugin": "0.79.1",
114
- "@react-native/gradle-plugin": "0.79.1",
115
- "@react-native/js-polyfills": "0.79.1",
116
- "@react-native/normalize-colors": "0.79.1",
117
- "@react-native/virtualized-lists": "0.79.1",
111
+ "@react-native/assets-registry": "0.79.3",
112
+ "@react-native/codegen": "0.79.3",
113
+ "@react-native/community-cli-plugin": "0.79.3",
114
+ "@react-native/gradle-plugin": "0.79.3",
115
+ "@react-native/js-polyfills": "0.79.3",
116
+ "@react-native/normalize-colors": "0.79.3",
117
+ "@react-native/virtualized-lists": "0.79.3",
118
118
  "abort-controller": "^3.0.0",
119
119
  "anser": "^1.4.9",
120
120
  "ansi-regex": "^5.0.0",