Skip to content

Commit

Permalink
docs: mention we dont handle codegen automatically yet
Browse files Browse the repository at this point in the history
  • Loading branch information
atlj committed Oct 26, 2024
1 parent dfb84d9 commit b73b7c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/pages/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ npx react-native-builder-bob@latest init

This will ask you a few questions and add the required configuration and scripts for building the code. The code will be compiled automatically when the package is published.

> Note: the `init` command doesn't add the `codegen` target yet. You can either add it manually or create a new library with `create-react-native-library`.
You can find details on what exactly it adds in the [Manual configuration](#manual-configuration) section.

## Manual configuration
Expand Down Expand Up @@ -116,6 +118,8 @@ yarn add --dev react-native-builder-bob

It's also recommended to ship your Codegen generated scaffold code with your library since it has numerous benefits. To see the benefits and implement this behavior, you can see the [Official Codegen Shipping Guide](https://reactnative.dev/docs/the-new-architecture/codegen-cli#including-generated-code-into-libraries).

> Note: If you enable Codegen generated code shipping, React Native won't build the scaffold code automatically when you build your test app. You need to rebuild the codegen scaffold code manually each time you make changes to your spec. If you want to automate this process, you can create a new project with `create-react-native-library` and inspect the example app.
##### Opting out of Codegen shipping __(not recommended)__

If you have a reason to not ship Codegen generated scaffold code with your library, you need to remove the [codegen target](#codegen) and add `package.json` to your `exports` field. Otherwise, React Native Codegen will skip spec generation for your library when your library is consumed as an NPM library. You can find the related issue [here](https://github.com/callstack/react-native-builder-bob/issues/637).
Expand Down

0 comments on commit b73b7c3

Please sign in to comment.