Skip to content

Commit d94882e

Browse files
Dawid Małeckimeta-codesync[bot]
authored andcommitted
Make TextInput descriptors and prop conversion helpers private
Summary: Lower the following `react/renderer/components/textinput` headers from "for frameworks" to private: Platform component descriptors: - Android `androidtextinput/AndroidTextInputComponentDescriptor.h` - iOS and macOS `iostextinput/TextInputComponentDescriptor.h` All three classes are `final`, so they cannot be extended, and they are registered only by React Native's own platform glue (the Android core components registry and the iOS TextInput component view). The Android descriptor is additionally coupled to React Native's Java `FabricUIManager` (it reads theme padding over JNI in `getInitialState`). Prop conversion helpers: - `baseConversions.h` (conversions for the shared text input enums) - iOS and macOS `iostextinput/propsConversions.h` (iOS/macOS text input trait parsers) These are only included by the module's own props sources (`BaseTextInputProps.cpp` and the platform `TextInputProps.cpp` / `AndroidTextInputProps.cpp`). No header includes any of them. The TextInput shadow nodes, props, state and event emitters stay "for frameworks", since third-party text input libraries build on them directly. The iOS/macOS `conversions.h` also stays "for frameworks", as the iOS/macOS `TextInputProps.h` includes it. Changelog: [Internal] Differential Revision: D123643375
1 parent a4c421a commit d94882e

7 files changed

Lines changed: 4 additions & 22 deletions

File tree

‎packages/react-native/ReactCommon/react/renderer/components/textinput/baseConversions.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include <React/RendererCore.h>
1313
#include <react/renderer/components/textinput/basePrimitives.h>

‎packages/react-native/ReactCommon/react/renderer/components/textinput/platform/android/react/renderer/components/androidtextinput/AndroidTextInputComponentDescriptor.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include "AndroidTextInputShadowNode.h"
1313
#include "AndroidTextInputState.h"

‎packages/react-native/ReactCommon/react/renderer/components/textinput/platform/ios/react/renderer/components/iostextinput/TextInputComponentDescriptor.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include <React/RendererCore.h>
1313
#include <react/renderer/components/iostextinput/TextInputShadowNode.h>

‎packages/react-native/ReactCommon/react/renderer/components/textinput/platform/ios/react/renderer/components/iostextinput/propsConversions.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include <React/Debug.h>
1313
#include <React/RendererCore.h>

‎scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,6 @@ folly::dynamic facebook::react::toDynamic(const facebook::react::FilterFunction&
764764
folly::dynamic facebook::react::toDynamic(const facebook::react::ImageSource& imageSource);
765765
folly::dynamic facebook::react::toDynamic(const facebook::react::Point& point);
766766
folly::dynamic facebook::react::toDynamic(const facebook::react::SharedColor& sharedColor);
767-
folly::dynamic facebook::react::toDynamic(const facebook::react::SubmitBehavior& value);
768767
folly::dynamic facebook::react::toDynamic(const std::vector<bool>& arrayValue);
769768
folly::dynamic facebook::react::toDynamic(const std::vector<double>& arrayValue);
770769
folly::dynamic facebook::react::toDynamic(const std::vector<facebook::react::Float>& arrayValue);
@@ -937,7 +936,6 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c
937936
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::LineBreakMode& result);
938937
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Point& result);
939938
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result);
940-
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result);
941939
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result);
942940
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result);
943941
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result);
@@ -1159,12 +1157,6 @@ class facebook::react::AndroidSwitchProps : public facebook::react::HostPlatform
11591157
public virtual folly::dynamic getDiffProps(const facebook::react::Props* prevProps) const override;
11601158
}
11611159

1162-
class facebook::react::AndroidTextInputComponentDescriptor : public facebook::react::ConcreteComponentDescriptor<facebook::react::AndroidTextInputShadowNode> {
1163-
protected virtual void adopt(facebook::react::ShadowNode& shadowNode) const override;
1164-
public AndroidTextInputComponentDescriptor(const facebook::react::ComponentDescriptorParameters& parameters);
1165-
public virtual facebook::react::State::Shared createInitialState(const facebook::react::Props::Shared& props, const facebook::react::ShadowNodeFamily::Shared& family) const override;
1166-
}
1167-
11681160
class facebook::react::AndroidTextInputEventEmitter : public facebook::react::BaseViewEventEmitter {
11691161
}
11701162

‎scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,7 +3570,6 @@ float facebook::react::yogaFloatFromFloat(facebook::react::Float value);
35703570
folly::dynamic facebook::react::convertIdToFollyDynamic(id json);
35713571
folly::dynamic facebook::react::diffDynamicProps(const folly::dynamic& oldProps, const folly::dynamic& newProps);
35723572
folly::dynamic facebook::react::mergeDynamicProps(const folly::dynamic& source, const folly::dynamic& patch, facebook::react::NullValueStrategy nullValueStrategy);
3573-
folly::dynamic facebook::react::toDynamic(const facebook::react::SubmitBehavior& value);
35743573
id facebook::react::convertFollyDynamicToId(const folly::dynamic& dyn);
35753574
int facebook::react::toInt(const facebook::react::DisplayType& displayType);
35763575
int facebook::react::toInt(const facebook::react::LayoutDirection& layoutDirection);
@@ -3708,7 +3707,6 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext& co
37083707
void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::ScrollViewKeyboardDismissMode& result);
37093708
void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::ScrollViewMaintainVisibleContentPosition& result);
37103709
void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::ScrollViewSnapToAlignment& result);
3711-
void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::Selection& result);
37123710
void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::SharedColor& result);
37133711
void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::TextAlignment& result);
37143712
void facebook::react::fromRawValue(const facebook::react::PropsParserContext& context, const facebook::react::RawValue& value, facebook::react::TextBreakStrategy& result);
@@ -3740,7 +3738,6 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c
37403738
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::LineBreakMode& result);
37413739
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Point& result);
37423740
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result);
3743-
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result);
37443741
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result);
37453742
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result);
37463743
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result);
@@ -6186,11 +6183,6 @@ class facebook::react::TextAttributes : public facebook::react::DebugStringConve
61866183
public void apply(facebook::react::TextAttributes textAttributes);
61876184
}
61886185

6189-
class facebook::react::TextInputComponentDescriptor : public facebook::react::ConcreteComponentDescriptor<facebook::react::TextInputShadowNode> {
6190-
protected virtual void adopt(facebook::react::ShadowNode& shadowNode) const override;
6191-
public TextInputComponentDescriptor(const facebook::react::ComponentDescriptorParameters& parameters);
6192-
}
6193-
61946186
class facebook::react::TextInputEventEmitter : public facebook::react::BaseViewEventEmitter {
61956187
public void onBlur(const facebook::react::TextInputEventEmitter::Metrics& textInputMetrics) const;
61966188
public void onChange(const facebook::react::TextInputEventEmitter::Metrics& textInputMetrics) const;

‎scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ facebook::yoga::FloatOptional facebook::react::yogaOptionalFloatFromFloat(Float
347347
float facebook::react::yogaFloatFromFloat(Float value);
348348
folly::dynamic facebook::react::diffDynamicProps(const folly::dynamic& oldProps, const folly::dynamic& newProps);
349349
folly::dynamic facebook::react::mergeDynamicProps(const folly::dynamic& source, const folly::dynamic& patch, facebook::react::NullValueStrategy nullValueStrategy);
350-
folly::dynamic facebook::react::toDynamic(const facebook::react::SubmitBehavior& value);
351350
int facebook::react::toInt(const facebook::react::DisplayType& displayType);
352351
int facebook::react::toInt(const facebook::react::LayoutDirection& layoutDirection);
353352
size_t facebook::react::attributedStringFragmentHashDisplayWise(const facebook::react::AttributedString::Fragment& fragment);
@@ -503,7 +502,6 @@ void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, c
503502
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::LineBreakMode& result);
504503
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Point& result);
505504
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::Size& result);
506-
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::SubmitBehavior& result);
507505
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextAlignmentVertical& result);
508506
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::TextWidthMode& result);
509507
void facebook::react::fromRawValue(const facebook::react::PropsParserContext&, const facebook::react::RawValue& value, facebook::react::ValueUnit& result);

0 commit comments

Comments
 (0)