Skip to content

Skip schema parsing for libraries that include generated code - #60359

Open
lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-60358-skip-included-generated-code
Open

lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-60358-skip-included-generated-code

Conversation

@lazerg

@lazerg lazerg commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary:

App codegen parses the jsSrcsDir of every codegen-enabled library and only afterwards drops the ones whose codegenConfig sets includesGeneratedCode: true. So for a library that ships its own generated code, the app still logs Processing <name>, and if that folder has no spec files it prints "No modules to process in combine-js-to-schema-cli" (or fails on a spec it can't parse, as in #48621). This filters the libraries with mustGenerateNativeCode before generateSchemaInfos, so their sources are never read. The schema infos are only used by generateNativeCode, so nothing else changes.

Fixes #60358

Changelog:

[GENERAL] [FIXED] - App codegen no longer parses the JS specs of libraries with includesGeneratedCode: true

Test Plan:

Added a test to generate-artifacts-executor-test.js that runs execute with one regular library and one with includesGeneratedCode: true. On main it fails because combineSchemasInFileList is called for both; with this change it is only called for the regular one, which is also the only one passed to generateNativeCode. yarn jest packages/react-native/scripts/codegen, eslint, prettier and flow pass.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 28, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App codegen reads the jsSrcsDir of a library with includesGeneratedCode: true and prints "No modules to process" for it

1 participant