Commit aa400f6
authored
feat: disable RNTA temporarily (#658)
<!-- Please provide enough information so that others can review your
pull request. -->
<!-- Keep pull requests small and focused on a single change. -->
### Summary
1. Disables the RNTA temporarily
2. Mentions you need to add `package.json` to your exports in the docs
3. Automatically adds `package.json` with bob if you don't have
`includesGeneratedCode: true`.
4. Closes #637
### Why the changes?
Currently, there are two approaches with React Native Codegen.
#### 1. Pregenerate
If you have `includesGeneratedCode: true` in your `codegenConfig`, you
can generate the Codegen specs in the build time and ship them with your
library. This is the recommended way.
#### 2. Let the app generate
If you don't have `includesGeneratedCode: true`, when the application
builds, the React Native Codegen is invoked and goes through all the
dependencies of the app and generates the codegen specs. However, if you
have ESModule exports and if you haven't added your `package.json` to
the exports property, then the Codegen __silently__ skips your library.
---
Because Codegen silently fails when you don't have `package.json` in the
exports or don't build Codegen specs at the build time, people might
have big problems figuring out this on their own. So we're temporarily
disabling RNTA until we enable build time spec generation for it.
### Test plan
#### CRNL
1. Generate a library using crnl
2. Make sure the RNTA isn't an option there
#### Bob
1. Do `bob init` on a library
2. Make sure `package.json` is added to the exports field.1 parent 389c023 commit aa400f6
3 files changed
+60
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
125 | 129 | | |
126 | 130 | | |
127 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
128 | 153 | | |
129 | 154 | | |
130 | 155 | | |
| |||
157 | 182 | | |
158 | 183 | | |
159 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
160 | 191 | | |
161 | 192 | | |
162 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
298 | 303 | | |
299 | 304 | | |
300 | | - | |
| 305 | + | |
301 | 306 | | |
302 | 307 | | |
303 | 308 | | |
| |||
312 | 317 | | |
313 | 318 | | |
314 | 319 | | |
315 | | - | |
| 320 | + | |
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
| |||
0 commit comments