Skip to content

Commit 88e16b2

Browse files
authored
Merge branch 'main' into react-native-config.js
2 parents 5d17cf8 + f822763 commit 88e16b2

File tree

17 files changed

+301
-178
lines changed

17 files changed

+301
-178
lines changed

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [0.3.0](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.3.0) (2024-11-08)
7+
8+
### Features
9+
10+
* disable RNTA temporarily ([#658](https://github.com/callstack/react-native-builder-bob/issues/658)) ([aa400f6](https://github.com/callstack/react-native-builder-bob/commit/aa400f622d6953ff949bd749d7bc4c9af397f486)), closes [#637](https://github.com/callstack/react-native-builder-bob/issues/637) - by @atlj
11+
612
## [0.2.1](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.2.1) (2024-08-12)
713

814
**Note:** Version bump only for package docs

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docs",
3-
"version": "0.2.1",
3+
"version": "0.3.0",
44
"private": true,
55
"description": "Documentation for react-native-builder-bob",
66
"scripts": {

docs/pages/build.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Supported targets are:
88
- ES modules build for bundlers such as [webpack](https://webpack.js.org)
99
- [TypeScript](https://www.typescriptlang.org/) definitions
1010
- Flow definitions (copies .js files to .flow files)
11+
- [Codegen](https://reactnative.dev/docs/the-new-architecture/what-is-codegen) generated scaffold code
1112

1213
If you created a project with [`create-react-native-library`](./create.md), `react-native-builder-bob` is **already pre-configured to build your project**. You don't need to configure it again.
1314

@@ -23,6 +24,8 @@ npx react-native-builder-bob@latest init
2324

2425
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.
2526

27+
> 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`.
28+
2629
You can find details on what exactly it adds in the [Manual configuration](#manual-configuration) section.
2730

2831
## Manual configuration
@@ -42,6 +45,7 @@ yarn add --dev react-native-builder-bob
4245
"source": "src",
4346
"output": "lib",
4447
"targets": [
48+
"codegen",
4549
["commonjs", { "esm": true }],
4650
["module", { "esm": true }],
4751
["typescript", { "esm": true }]
@@ -125,6 +129,27 @@ yarn add --dev react-native-builder-bob
125129

126130
This makes sure that Jest doesn't try to run the tests in the generated files.
127131

132+
1. Configure [React Native Codegen](https://reactnative.dev/docs/the-new-architecture/what-is-codegen)
133+
134+
If your library is supporting the [New React Native Architecture](https://reactnative.dev/architecture/landing-page), you should also configure Codegen. This is not required for libraries that are only supporting the old architecture.
135+
136+
You can follow the [Official Codegen Setup Guide](https://reactnative.dev/docs/the-new-architecture/using-codegen) to enable Codegen.
137+
138+
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).
139+
140+
> 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.
141+
142+
##### Opting out of Codegen shipping __(not recommended)__
143+
144+
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).
145+
146+
```json
147+
"exports": {
148+
// ...
149+
"./package.json": "./package.json"
150+
},
151+
```
152+
128153
And we're done 🎉
129154

130155
## Options
@@ -157,6 +182,12 @@ Example:
157182

158183
Various targets to build for. The available targets are:
159184

185+
#### `codegen`
186+
187+
Generates the [React Native Codegen](https://reactnative.dev/docs/the-new-architecture/what-is-codegen) scaffold code, which is used with the New React Native Architecture.
188+
189+
You can ensure your Codegen generated scaffold code is stable through different React Native versions by shipping it with your library. You can find more in the [React Native Official Docs](https://reactnative.dev/docs/the-new-architecture/codegen-cli#including-generated-code-into-libraries).
190+
160191
#### `commonjs`
161192

162193
Enable compiling source files with Babel and use CommonJS module system.

packages/create-react-native-library/CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,34 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.44.1](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.44.1) (2024-11-15)
7+
8+
### Bug Fixes
9+
10+
* single answer questions dont get stored with metadata ([#633](https://github.com/callstack/react-native-builder-bob/issues/633)) ([c1d8ab1](https://github.com/callstack/react-native-builder-bob/commit/c1d8ab11f31552720c2f4b735842e83b17bb804d)) - by @atlj
11+
12+
# [0.44.0](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.44.0) (2024-11-15)
13+
14+
### Bug Fixes
15+
16+
* correct the paths for codegen generated header files on views ([#680](https://github.com/callstack/react-native-builder-bob/issues/680)) ([6069721](https://github.com/callstack/react-native-builder-bob/commit/606972160c18117d4dc466c87652498119322a87)), closes [#669](https://github.com/callstack/react-native-builder-bob/issues/669) [ios#2](https://github.com/ios/issues/2) - by @atlj
17+
* every created example app is testing app ([#684](https://github.com/callstack/react-native-builder-bob/issues/684)) ([4a3d2a1](https://github.com/callstack/react-native-builder-bob/commit/4a3d2a120466b95058f4fe3d08eed165582c99ad)) - by @atlj
18+
* expo app doesn't have index.js ([#686](https://github.com/callstack/react-native-builder-bob/issues/686)) ([f08ab08](https://github.com/callstack/react-native-builder-bob/commit/f08ab088fdefe33389843e02ae600236746393cd)), closes [#682](https://github.com/callstack/react-native-builder-bob/issues/682) - by @atlj
19+
20+
### Features
21+
22+
* don't add a XCode prebuild action to invoke codegen anymore ([#679](https://github.com/callstack/react-native-builder-bob/issues/679)) ([8fc684a](https://github.com/callstack/react-native-builder-bob/commit/8fc684a4a2c90cfa10e005da112e2836c86cf316)) - by @atlj
23+
24+
# [0.43.0](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.43.0) (2024-11-08)
25+
26+
### Features
27+
28+
* disable RNTA temporarily ([#658](https://github.com/callstack/react-native-builder-bob/issues/658)) ([aa400f6](https://github.com/callstack/react-native-builder-bob/commit/aa400f622d6953ff949bd749d7bc4c9af397f486)), closes [#637](https://github.com/callstack/react-native-builder-bob/issues/637) - by @atlj
29+
30+
## [0.42.3](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.42.3) (2024-11-08)
31+
32+
**Note:** Version bump only for package create-react-native-library
33+
634
## [0.42.2](https://github.com/callstack/react-native-builder-bob/compare/[email protected]@0.42.2) (2024-10-26)
735

836
### Bug Fixes

packages/create-react-native-library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-react-native-library",
3-
"version": "0.42.2",
3+
"version": "0.44.1",
44
"description": "CLI to scaffold React Native libraries",
55
"keywords": [
66
"react-native",

0 commit comments

Comments
 (0)