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

Exclude generation of app-defined components from RCTThirdPartyFabricComponentsProvider #47176

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,22 @@ function rootCodegenTargetNeedsThirdPartyComponentProvider(pkgJson, platform) {
return !pkgJsonIncludesGeneratedCode(pkgJson) && platform === 'ios';
}

function dependencyNeedsThirdPartyComponentProvider(schemaInfo, platform) {
function dependencyNeedsThirdPartyComponentProvider(
schemaInfo,
platform,
appCondegenConfigSpec,
) {
// Filter the react native core library out.
// In the future, core library and third party library should
// use the same way to generate/register the fabric components.
return !isReactNativeCoreLibrary(schemaInfo.library.config.name, platform);
// We also have to filter out the the components defined in the app
// because the RCTThirdPartyComponentProvider is generated inside Fabric,
// which lives in a different target from the app and it has no visibility over
// the symbols defined in the app.
return (
!isReactNativeCoreLibrary(schemaInfo.library.config.name, platform) &&
schemaInfo.library.config.name !== appCondegenConfigSpec
);
}

function mustGenerateNativeCode(includeLibraryPath, schemaInfo) {
Expand Down Expand Up @@ -732,8 +743,12 @@ function execute(projectRoot, targetPlatform, baseOutputPath) {
if (
rootCodegenTargetNeedsThirdPartyComponentProvider(pkgJson, platform)
) {
const filteredSchemas = schemaInfos.filter(
dependencyNeedsThirdPartyComponentProvider,
const filteredSchemas = schemaInfos.filter(schemaInfo =>
dependencyNeedsThirdPartyComponentProvider(
schemaInfo,
platform,
pkgJson.codegenConfig?.appCondegenConfigSpec,
),
);
const schemas = filteredSchemas.map(schemaInfo => schemaInfo.schema);
const supportedApplePlatforms = filteredSchemas.map(
Expand Down
Loading