From cf5ab03d4324b7e3fce38f9eacc96da82b11b68a Mon Sep 17 00:00:00 2001 From: Eli White Date: Fri, 10 Jan 2025 14:38:57 -0800 Subject: [PATCH] Include cxx modules in codegen schema (#48581) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48581 Previously the CXX only modules were not being inclued in the schema for these apps, and therefore weren't being caught by the compat check. Reviewed By: cipolleschi Differential Revision: D68000360 fbshipit-source-id: 5d56bc840bd220f3b8b814e5d90eb49d9a2beb0b --- .../src/cli/combine/combine-schemas-cli.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 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 3a36f6777dcdd0..ce8334b199f23f 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 @@ -71,11 +71,18 @@ for (const file of schemaFiles) { ); } - if ( - module.excludedPlatforms && - module.excludedPlatforms.indexOf(platform) >= 0 - ) { - continue; + const excludedPlatforms = module.excludedPlatforms?.map( + excludedPlatform => excludedPlatform.toLowerCase(), + ); + + if (excludedPlatforms != null) { + const cxxOnlyModule = + excludedPlatforms.includes('ios') && + excludedPlatforms.includes('android'); + + if (!cxxOnlyModule && excludedPlatforms.includes(platform)) { + continue; + } } modules[specName] = module;