Skip to content

Commit 935b952

Browse files
javachemeta-codesync[bot]
authored andcommitted
Move CoreComponentsRegistry to newarchdefaults (#59220)
Summary: Pull Request resolved: #59220 `CoreComponentsRegistry` pulls every built-in component implementation into `fabric:jni`, preventing those components from depending on Fabric JNI without a cycle. Move the registry header and implementation into `newarchdefaults:jni`, which already owns default component registration, while preserving both public include paths. Point the registry’s other native consumers at the same shared target. Changelog: [Internal] landed-with-radar-review Reviewed By: lenaic Differential Revision: D126315162 fbshipit-source-id: 43d7e10703d6967544f5c3ebfdfbe080c3a8d089
1 parent c99c491 commit 935b952

5 files changed

Lines changed: 21 additions & 7 deletions

File tree

‎packages/react-native/ReactAndroid/build.gradle.kts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ val preparePrefab by
9595
Pair("../ReactCommon/hermes/inspector-modern/", "hermes/inspector-modern/"),
9696
// fabricjni
9797
Pair("src/main/jni/react/fabric", "react/fabric/"),
98+
Pair(
99+
"src/main/jni/react/newarchdefaults/CoreComponentsRegistry.h",
100+
"react/fabric/",
101+
),
98102
// uimanagerjni
99103
Pair("src/main/jni/react/uimanager", "react/uimanager/"),
100104
// glog

‎packages/react-native/ReactAndroid/src/main/jni/react/fabric/CMakeLists.txt‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,8 @@ target_link_libraries(
5151
rrc_legacyviewmanagerinterop
5252
react_utils
5353
reactnativejni
54-
rrc_image
55-
rrc_modal
56-
rrc_progressbar
5754
rrc_root
58-
rrc_safeareaview
5955
rrc_scrollview
60-
rrc_switch
61-
rrc_text
62-
rrc_textinput
6356
rrc_unimplementedview
6457
rrc_view
6558
yoga

‎packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/CMakeLists.txt‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ target_link_libraries(react_newarchdefaults
2929
react_nativemodule_featureflags
3030
react_nativemodule_microtasks
3131
react_nativemodule_idlecallbacks
32+
react_renderer_attributedstring
33+
react_renderer_componentregistry
34+
react_renderer_textlayoutmanager
35+
rrc_image
36+
rrc_modal
37+
rrc_progressbar
38+
rrc_safeareaview
39+
rrc_scrollview
40+
rrc_switch
41+
rrc_text
42+
rrc_textinput
43+
rrc_unimplementedview
44+
rrc_view
3245
jsi)
3346

3447
target_compile_reactnative_options(react_newarchdefaults PRIVATE)

packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp renamed to packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/CoreComponentsRegistry.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ sharedProviderRegistry() {
3838
void addCoreComponents(
3939
std::shared_ptr<const ComponentDescriptorProviderRegistry>
4040
providerRegistry) {
41+
if (providerRegistry == nullptr) {
42+
return;
43+
}
44+
4145
providerRegistry->add(
4246
concreteComponentDescriptorProvider<
4347
AndroidProgressBarComponentDescriptor>());

packages/react-native/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.h renamed to packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/CoreComponentsRegistry.h

File renamed without changes.

0 commit comments

Comments
 (0)