Skip to content

Commit 4e855df

Browse files
committed
Revert "Use RN_SERIALIZABLE_STATE for conditional getDiffProps code (#51516)"
This reverts commit f900551.
1 parent 827a685 commit 4e855df

File tree

21 files changed

+39
-24
lines changed

21 files changed

+39
-24
lines changed

.github/workflows/test-all.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,11 @@ jobs:
439439
uses: ./.github/actions/build-android
440440
with:
441441
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
442-
run-e2e-tests: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
442+
run-e2e-tests: true # ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
443443
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
444444

445445
test_e2e_android_rntester:
446-
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
446+
# if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
447447
runs-on: 4-core-ubuntu
448448
needs: [build_android]
449449
strategy:

packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void ImageProps::setProp(
174174
}
175175
}
176176

177-
#ifdef RN_SERIALIZABLE_STATE
177+
#ifdef ANDROID
178178

179179
static folly::dynamic convertImageSource(const ImageSource& imageSource) {
180180
folly::dynamic imageSourceResult = folly::dynamic::object();

packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ class ImageProps final : public ViewProps {
4646
Float fadeDuration{};
4747
bool progressiveRenderingEnabled{};
4848

49-
#ifdef RN_SERIALIZABLE_STATE
49+
#ifdef ANDROID
50+
5051
folly::dynamic getDiffProps(const Props* prevProps) const override;
52+
5153
#endif
5254
};
5355

packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ SharedDebugStringConvertibleList ScrollViewProps::getDebugProps() const {
592592
}
593593
#endif
594594

595-
#ifdef RN_SERIALIZABLE_STATE
595+
#ifdef ANDROID
596596

597597
static folly::dynamic convertScrollViewMaintainVisibleContentPosition(
598598
const ScrollViewMaintainVisibleContentPosition& value) {

packages/react-native/ReactCommon/react/renderer/components/scrollview/ScrollViewProps.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ class ScrollViewProps final : public ViewProps {
8383
SharedDebugStringConvertibleList getDebugProps() const override;
8484
#endif
8585

86-
#ifdef RN_SERIALIZABLE_STATE
86+
#ifdef ANDROID
87+
8788
folly::dynamic getDiffProps(const Props* prevProps) const override;
89+
8890
#endif
8991
};
9092

packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ SharedDebugStringConvertibleList BaseTextProps::getDebugProps() const {
357357
}
358358
#endif
359359

360-
#ifdef RN_SERIALIZABLE_STATE
360+
#ifdef ANDROID
361361

362362
static folly::dynamic toDynamic(const Size& size) {
363363
folly::dynamic sizeResult = folly::dynamic::object();

packages/react-native/ReactCommon/react/renderer/components/text/BaseTextProps.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ class BaseTextProps {
4242
SharedDebugStringConvertibleList getDebugProps() const;
4343
#endif
4444

45-
#ifdef RN_SERIALIZABLE_STATE
45+
#ifdef ANDROID
46+
4647
void appendTextAttributesProps(
4748
folly::dynamic& result,
4849
const BaseTextProps* prevProps) const;
50+
4951
#endif
5052
};
5153

packages/react-native/ReactCommon/react/renderer/components/text/ParagraphProps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ SharedDebugStringConvertibleList ParagraphProps::getDebugProps() const {
152152
}
153153
#endif
154154

155-
#ifdef RN_SERIALIZABLE_STATE
155+
#ifdef ANDROID
156156

157157
folly::dynamic ParagraphProps::getDiffProps(const Props* prevProps) const {
158158
static const auto defaultProps = ParagraphProps();

packages/react-native/ReactCommon/react/renderer/components/text/ParagraphProps.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ class ParagraphProps : public ViewProps, public BaseTextProps {
5858
SharedDebugStringConvertibleList getDebugProps() const override;
5959
#endif
6060

61-
#ifdef RN_SERIALIZABLE_STATE
61+
#ifdef ANDROID
62+
6263
folly::dynamic getDiffProps(const Props* prevProps) const override;
64+
6365
#endif
6466
};
6567

packages/react-native/ReactCommon/react/renderer/components/text/RawTextProps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ SharedDebugStringConvertibleList RawTextProps::getDebugProps() const {
2828
}
2929
#endif
3030

31-
#ifdef RN_SERIALIZABLE_STATE
31+
#ifdef ANDROID
3232

3333
folly::dynamic RawTextProps::getDiffProps(const Props* prevProps) const {
3434
folly::dynamic result = folly::dynamic::object();

packages/react-native/ReactCommon/react/renderer/components/text/RawTextProps.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ class RawTextProps : public Props {
3737
SharedDebugStringConvertibleList getDebugProps() const override;
3838
#endif
3939

40-
#ifdef RN_SERIALIZABLE_STATE
40+
#ifdef ANDROID
41+
4142
folly::dynamic getDiffProps(const Props* prevProps) const override;
43+
4244
#endif
4345
};
4446

packages/react-native/ReactCommon/react/renderer/components/text/TextProps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ SharedDebugStringConvertibleList TextProps::getDebugProps() const {
3333
}
3434
#endif
3535

36-
#ifdef RN_SERIALIZABLE_STATE
36+
#ifdef ANDROID
3737

3838
folly::dynamic TextProps::getDiffProps(const Props* prevProps) const {
3939
folly::dynamic result = folly::dynamic::object();

packages/react-native/ReactCommon/react/renderer/components/text/TextProps.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ class TextProps : public Props, public BaseTextProps {
3535
SharedDebugStringConvertibleList getDebugProps() const override;
3636
#endif
3737

38-
#ifdef RN_SERIALIZABLE_STATE
38+
#ifdef ANDROID
39+
3940
folly::dynamic getDiffProps(const Props* prevProps) const override;
41+
4042
#endif
4143
};
4244

packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ ComponentName UnimplementedViewProps::getComponentName() const {
1717
return componentName_;
1818
}
1919

20-
#ifdef RN_SERIALIZABLE_STATE
21-
20+
#ifdef ANDROID
2221
folly::dynamic UnimplementedViewProps::getDiffProps(
2322
const Props* prevProps) const {
2423
static const auto defaultProps = UnimplementedViewProps();
@@ -35,7 +34,6 @@ folly::dynamic UnimplementedViewProps::getDiffProps(
3534

3635
return result;
3736
}
38-
3937
#endif
4038

4139
} // namespace facebook::react

packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ class UnimplementedViewProps final : public ViewProps {
2727
void setComponentName(ComponentName componentName);
2828
ComponentName getComponentName() const;
2929

30-
#ifdef RN_SERIALIZABLE_STATE
30+
#ifdef ANDROID
31+
3132
folly::dynamic getDiffProps(const Props* prevProps) const override;
33+
3234
#endif
3335

3436
private:

packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ SharedDebugStringConvertibleList HostPlatformViewProps::getDebugProps() const {
144144
}
145145
#endif
146146

147-
#ifdef RN_SERIALIZABLE_STATE
147+
#ifdef ANDROID
148148

149149
inline static void updateEventProp(
150150
folly::dynamic& result,

packages/react-native/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ class HostPlatformViewProps : public BaseViewProps {
5757
SharedDebugStringConvertibleList getDebugProps() const override;
5858
#endif
5959

60-
#ifdef RN_SERIALIZABLE_STATE
60+
#ifdef ANDROID
61+
6162
folly::dynamic getDiffProps(const Props* prevProps) const override;
63+
6264
#endif
6365
};
6466

packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class ConcreteComponentDescriptor : public ComponentDescriptor {
119119
// Note that we just check if `Props` has this flag set, no matter
120120
// the type of ShadowNode; it acts as the single global flag.
121121
if (ReactNativeFeatureFlags::enableCppPropsIteratorSetter()) {
122-
#ifdef RN_SERIALIZABLE_STATE
122+
#ifdef ANDROID
123123
const auto& dynamic = shadowNodeProps->rawProps;
124124
#else
125125
const auto& dynamic = static_cast<folly::dynamic>(rawProps);

packages/react-native/ReactCommon/react/renderer/core/Props.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void Props::initialize(
3232
nativeId = ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
3333
? sourceProps.nativeId
3434
: convertRawProp(context, rawProps, "nativeID", sourceProps.nativeId, {});
35-
#ifdef RN_SERIALIZABLE_STATE
35+
#ifdef ANDROID
3636
if (ReactNativeFeatureFlags::enableAccumulatedUpdatesInRawPropsAndroid()) {
3737
auto& oldRawProps = sourceProps.rawProps;
3838
auto newRawProps = rawProps.toDynamic(filterObjectKeys);

packages/react-native/ReactCommon/react/renderer/core/Props.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ class Props : public virtual Sealable, public virtual DebugStringConvertible {
6363

6464
std::string nativeId;
6565

66-
#ifdef RN_SERIALIZABLE_STATE
66+
#ifdef ANDROID
6767
folly::dynamic rawProps = folly::dynamic::object();
6868

6969
virtual folly::dynamic getDiffProps(const Props* prevProps) const {
7070
return folly::dynamic::object();
7171
}
72+
7273
#endif
7374

7475
#if RN_DEBUG_STRING_CONVERTIBLE

packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ShadowNode::SharedListOfShared ShadowNode::emptySharedShadowNodeSharedList() {
5050
Props::Shared ShadowNode::propsForClonedShadowNode(
5151
const ShadowNode& sourceShadowNode,
5252
const Props::Shared& props) {
53-
#ifdef RN_SERIALIZABLE_STATE
53+
#ifdef ANDROID
5454
bool hasBeenMounted = sourceShadowNode.hasBeenMounted_;
5555
bool sourceNodeHasRawProps = !sourceShadowNode.getProps()->rawProps.empty();
5656
if (!hasBeenMounted && sourceNodeHasRawProps && props) {

0 commit comments

Comments
 (0)