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

Migrate codegen to shared build setup, remove package build pre-step from RNTester #47552

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

huntie
Copy link
Member

@huntie huntie commented Nov 11, 2024

Summary:
NOTE: Resubmission of D49370200.

This simplifies the use of Codegen when creating dev builds of rn-tester in the monorepo. It now runs from source for this internal scenario, and this package is now built using the shared monorepo build setup.

Changes:

  • Migrate packages/react-native-codegen to the shared yarn build setup.
    • Update package to use "exports" field and wrap entry point modules with babel-register (NOTE: This is only required for each entry point internally used in the monorepo).
  • Remove BuildCodegenCLITask task from Android build.
  • Remove Codegen build.sh call from iOS build, use require.resolve for combine-js-to-schema-cli.js entry point.

Externally significant FYIs:

  • react-native/codegen is converted to use the "exports" field — it should export all .js files, as before.
  • codegenPath is now ignored and marked as deprecated on ReactExtensions.kt.

NOTE: TypeScript auto-generation is not yet enabled on this package, since it uses CommonJS module.exports syntax (unsupported by flow-api-translator).

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D51465053

@facebook-github-bot facebook-github-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 11, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51465053

huntie added a commit to huntie/react-native that referenced this pull request Nov 11, 2024
…from RNTester (facebook#47552)

Summary:

NOTE: Resubmission of D49370200.

This simplifies the use of Codegen when creating dev builds of `rn-tester` in the monorepo. It now runs from source for this internal scenario, and this package is now built using the shared monorepo build setup.

Changes:
- Migrate `packages/react-native-codegen` to the shared `yarn build` setup.
    - Update package to use `"exports"` field and wrap entry point modules with `babel-register` (NOTE: This is only required for each entry point internally used in the monorepo).
- Remove `BuildCodegenCLITask` task from Android build.
- Remove Codegen `build.sh` call from iOS build, use `require.resolve` for `combine-js-to-schema-cli.js` entry point.

Externally significant FYIs:
- `react-native/codegen` is converted to use the `"exports"` field — it should export all `.js` files, as before.
- `codegenPath` is now ignored and marked as deprecated on `ReactExtensions.kt`.

NOTE: TypeScript auto-generation is not yet enabled on this package, since it uses CommonJS `module.exports` syntax (unsupported by `flow-api-translator`).

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D51465053
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51465053

huntie added a commit to huntie/react-native that referenced this pull request Nov 11, 2024
…from RNTester (facebook#47552)

Summary:

NOTE: Resubmission of D49370200.

This simplifies the use of Codegen when creating dev builds of `rn-tester` in the monorepo. It now runs from source for this internal scenario, and this package is now built using the shared monorepo build setup.

Changes:
- Migrate `packages/react-native-codegen` to the shared `yarn build` setup.
    - Update package to use `"exports"` field and wrap entry point modules with `babel-register` (NOTE: This is only required for each entry point internally used in the monorepo).
- Remove `BuildCodegenCLITask` task from Android build.
- Remove Codegen `build.sh` call from iOS build, use `require.resolve` for `combine-js-to-schema-cli.js` entry point.

Externally significant FYIs:
- `react-native/codegen` is converted to use the `"exports"` field — it should export all `.js` files, as before.
- `codegenPath` is now ignored and marked as deprecated on `ReactExtensions.kt`.

NOTE: TypeScript auto-generation is not yet enabled on this package, since it uses CommonJS `module.exports` syntax (unsupported by `flow-api-translator`).

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D51465053
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51465053

huntie added a commit to huntie/react-native that referenced this pull request Nov 12, 2024
…from RNTester (facebook#47552)

Summary:

NOTE: Resubmission of D49370200.

This simplifies the use of Codegen when creating dev builds of `rn-tester` in the monorepo. It now runs from source for this internal scenario, and this package is now built using the shared monorepo build setup.

Changes:
- Migrate `packages/react-native-codegen` to the shared `yarn build` setup.
    - Update package to use `"exports"` field and wrap entry point modules with `babel-register` (NOTE: This is only required for each entry point internally used in the monorepo).
- Remove `BuildCodegenCLITask` task from Android build.
- Remove Codegen `build.sh` call from iOS build, use `require.resolve` for `combine-js-to-schema-cli.js` entry point.

Externally significant FYIs:
- `react-native/codegen` is converted to use the `"exports"` field — it should export all `.js` files, as before.
- `codegenPath` is now ignored and marked as deprecated on `ReactExtensions.kt`.

NOTE: TypeScript auto-generation is not yet enabled on this package, since it uses CommonJS `module.exports` syntax (unsupported by `flow-api-translator`).

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D51465053
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51465053

Alex Hunt and others added 2 commits November 19, 2024 02:51
Summary:
Update shared monorepo build script:
- Refactor entry point discovery and file iteration
- Add support for "exports" subpath patterns (skip considering as entry point with warning)

This is required for the incoming migration of `react-native-codegen` to this build setup (D51465053).

Changelog: [Internal]

Differential Revision: D66121262
…from RNTester (facebook#47552)

Summary:
Pull Request resolved: facebook#47552

NOTE: Resubmission of D49370200.

This simplifies the use of Codegen when creating dev builds of `rn-tester` in the monorepo. It now runs from source for this internal scenario, and this package is now built using the shared monorepo build setup.

Changes:
- Migrate `packages/react-native-codegen` to the shared `yarn build` setup.
    - Update package to use `"exports"` field and wrap entry point modules with `babel-register` (NOTE: This is only required for each entry point internally used in the monorepo).
- Remove `BuildCodegenCLITask` task from Android build.
- Remove Codegen `build.sh` call from iOS build, use `require.resolve` for `combine-js-to-schema-cli.js` entry point.

Externally significant FYIs:
- `react-native/codegen` is converted to use the `"exports"` field — it should export all `.js` files, as before.
- `codegenPath` is now ignored and marked as deprecated on `ReactExtensions.kt`.

NOTE: TypeScript auto-generation is not yet enabled on this package, since it uses CommonJS `module.exports` syntax (unsupported by `flow-api-translator`).

Changelog: [Internal]

Reviewed By: dmytrorykun

Differential Revision: D51465053
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D51465053

facebook-github-bot pushed a commit that referenced this pull request Dec 2, 2024
Summary:
building RN tester with 0.77 rc-0 doesn't work now because of `java.io.IOException:  No such file or directory` on line 48.

`buildDirectory` is a Gradle property representing a file

#47552 removes this file altogether so feel free to close if that one is the "right one"

## Changelog:

[ANDROID] [FIXED] - fix IOException in `BuildCodegenCLITask`

Pull Request resolved: #48008

Test Plan: After this change, building RN tester works.

Reviewed By: cortinico

Differential Revision: D66650038

Pulled By: robhogan

fbshipit-source-id: 11cd83493fa118c6b79d11c9113228dd3971a803
robhogan pushed a commit that referenced this pull request Dec 2, 2024
Summary:
building RN tester with 0.77 rc-0 doesn't work now because of `java.io.IOException:  No such file or directory` on line 48.

`buildDirectory` is a Gradle property representing a file

#47552 removes this file altogether so feel free to close if that one is the "right one"

## Changelog:

[ANDROID] [FIXED] - fix IOException in `BuildCodegenCLITask`

Pull Request resolved: #48008

Test Plan: After this change, building RN tester works.

Reviewed By: cortinico

Differential Revision: D66650038

Pulled By: robhogan

fbshipit-source-id: 11cd83493fa118c6b79d11c9113228dd3971a803
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. fb-exported p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants