Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse custom NativeState in Flow #34753

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ReactAndroid/cmake-utils/ReactNative-application.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ set(CMAKE_VERBOSE_MAKEFILE on)

include(${REACT_ANDROID_DIR}/cmake-utils/Android-prebuilt.cmake)

file(GLOB input_SRC CONFIGURE_DEPENDS
file(GLOB input_SRC CONFIGURE_DEPENDS
*.cpp
${PROJECT_BUILD_DIR}/generated/rncli/src/main/jni/*.cpp)

add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC})

target_include_directories(${CMAKE_PROJECT_NAME}
PUBLIC
target_include_directories(${CMAKE_PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_BUILD_DIR}/generated/rncli/src/main/jni)

Expand All @@ -45,6 +45,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
react_render_core
react_render_debug
react_render_graphics
react_render_mapbuffer
rrc_view
runtimeexecutor
turbomodulejsijni
Expand Down
19 changes: 19 additions & 0 deletions packages/react-native-codegen/DEFS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ def rn_codegen_components(
generate_event_emitter_h_name = "generate_event_emitter_h-{}".format(name)
generate_props_cpp_name = "generate_props_cpp-{}".format(name)
generate_props_h_name = "generated_props_h-{}".format(name)
generate_state_cpp_name = "generate_state_cpp-{}".format(name)
generate_state_h_name = "generated_state_h-{}".format(name)
generate_tests_cpp_name = "generate_tests_cpp-{}".format(name)
generate_shadow_node_cpp_name = "generated_shadow_node_cpp-{}".format(name)
generate_shadow_node_h_name = "generated_shadow_node_h-{}".format(name)
Expand Down Expand Up @@ -314,6 +316,13 @@ def rn_codegen_components(
labels = ["codegen_rule"],
)

fb_native.genrule(
name = generate_state_cpp_name,
cmd = "cp $(location :{})/States.cpp $OUT".format(generate_fixtures_rule_name),
out = "States.cpp",
labels = ["codegen_rule"],
)

fb_native.genrule(
name = generate_tests_cpp_name,
cmd = "cp $(location :{})/Tests.cpp $OUT".format(generate_fixtures_rule_name),
Expand All @@ -328,6 +337,13 @@ def rn_codegen_components(
labels = ["codegen_rule"],
)

fb_native.genrule(
name = generate_state_h_name,
cmd = "cp $(location :{})/States.h $OUT".format(generate_fixtures_rule_name),
out = "States.h",
labels = ["codegen_rule"],
)

fb_native.genrule(
name = copy_generated_java_files,
# TODO: support different package name internally.
Expand Down Expand Up @@ -388,12 +404,14 @@ def rn_codegen_components(
srcs = [
":{}".format(generate_event_emitter_cpp_name),
":{}".format(generate_props_cpp_name),
":{}".format(generate_state_cpp_name),
":{}".format(generate_shadow_node_cpp_name),
],
headers = [
":{}".format(generate_component_descriptor_h_name),
":{}".format(generate_event_emitter_h_name),
":{}".format(generate_props_h_name),
":{}".format(generate_state_h_name),
":{}".format(generate_shadow_node_h_name),
],
header_namespace = "react/renderer/components/{}".format(name),
Expand All @@ -403,6 +421,7 @@ def rn_codegen_components(
"Props.h": ":{}".format(generate_props_h_name),
"RCTComponentViewHelpers.h": ":{}".format(generate_component_hobjcpp_name),
"ShadowNodes.h": ":{}".format(generate_shadow_node_h_name),
"States.h": ":{}".format(generate_state_h_name),
},
fbobjc_compiler_flags = get_apple_compiler_flags(),
fbobjc_preprocessor_flags = get_preprocessor_flags_for_build_mode() + get_apple_inspector_flags(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT ArrayPropsNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -46,7 +53,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT BooleanPropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -73,7 +87,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT ColorPropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -100,7 +121,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT EdgeInsetsPropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -127,7 +155,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT EnumPropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand Down Expand Up @@ -281,7 +316,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT FloatPropsNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -308,7 +350,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT ImagePropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -335,7 +384,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT IntegerPropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand Down Expand Up @@ -398,7 +454,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT MultiNativePropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -425,7 +488,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT NoPropsNoEventsNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -452,7 +522,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT ObjectPropsNativeComponentEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -479,7 +556,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT PointPropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand All @@ -506,7 +590,14 @@ Object {
namespace facebook {
namespace react {

class JSI_EXPORT StringPropNativeComponentViewEventEmitter : public ViewEventEmitter {
public:
using ViewEventEmitter::ViewEventEmitter;




};

} // namespace react
} // namespace facebook
Expand Down
Loading