From 258104abd12e77cf3af70092e25f18f2fa817e33 Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Thu, 5 Jun 2025 17:12:48 -0700 Subject: [PATCH 1/2] Extract out UnimplementedNativeViewComponentDescriptor from auto-generated registry (#51830) Summary: In order to avoid duplicates, extracting out the UnimplementedNativeViewComponentDescriptor from the auto-generated registry of FAC i.e. ComponentDescriptors.cpp All of the existing FAC apps already get it via DefaultComponentsRegistry **Changelog**: [Android] [Fixed] - Extract out `UnimplementedNativeViewComponentDescriptor` from auto-generated registry for FAC Reviewed By: RSNara Differential Revision: D76013507 --- .../src/cli/combine/combine-schemas-cli.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js b/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js index ce8334b199f2..16b3ed8e2f2b 100644 --- a/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js +++ b/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js @@ -32,12 +32,17 @@ const argv = yargs .option('s', { alias: 'schema-query', }) + .option('e', { + alias: 'exclude', + }) .parseSync(); const platform: string = argv.platform.toLowerCase(); const output: string = argv.output; const schemaQuery: string = argv.s; +const exclude: string = argv.e; + if (!['ios', 'android'].includes(platform)) { throw new Error(`Invalid platform ${platform}`); } @@ -85,10 +90,11 @@ for (const file of schemaFiles) { } } - modules[specName] = module; - specNameToFile[specName] = file; + if (!(exclude && exclude === specName)) { + modules[specName] = module; + specNameToFile[specName] = file; + } } } } - fs.writeFileSync(output, JSON.stringify({modules})); From 7b0dba9df1619ea102c0f1156c6d1d24c02c1e13 Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Thu, 5 Jun 2025 17:12:48 -0700 Subject: [PATCH 2/2] Extract out core components from auto-generated registry Summary: In order to avoid duplicates, extracting out the core components from the auto-generated registry of FAC i.e. ComponentDescriptors.cpp All of the existing FAC apps already get it via DefaultComponentsRegistry -> CoreComponentsRegistry **Changelog**: [Android] [Fixed] - Extract out core components from auto-generated registry for FAC Differential Revision: D76078460 --- .../src/cli/combine/combine-schemas-cli.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js b/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js index 16b3ed8e2f2b..ea9828b3d634 100644 --- a/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js +++ b/packages/react-native-codegen/src/cli/combine/combine-schemas-cli.js @@ -35,6 +35,9 @@ const argv = yargs .option('e', { alias: 'exclude', }) + .option('f', { + alias: 'filter', + }) .parseSync(); const platform: string = argv.platform.toLowerCase(); @@ -42,6 +45,7 @@ const output: string = argv.output; const schemaQuery: string = argv.s; const exclude: string = argv.e; +const filter: ?Array = argv.filter; if (!['ios', 'android'].includes(platform)) { throw new Error(`Invalid platform ${platform}`); @@ -91,6 +95,9 @@ for (const file of schemaFiles) { } if (!(exclude && exclude === specName)) { + if (module.type === 'Component' && filter?.includes(specName)) { + continue; + } modules[specName] = module; specNameToFile[specName] = file; }