-
Notifications
You must be signed in to change notification settings - Fork 191
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
feat: disable RNTA temporarily #658
Conversation
Hey @atlj, I'm just trying to understand how RNTA leads to this bug and what we can do to forward fix it instead of disabling it. Afaics, isn't this a bug in core? |
@@ -295,9 +295,14 @@ yargs | |||
}, | |||
}; | |||
|
|||
if (pkg.codegenConfig && !pkg.codegenConfig.includesGeneratedCode) { | |||
// @ts-expect-error The exports is not strictly types therefore it doesn't know about the package.json property | |||
exportsField['./package.json'] = './package.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field should always be present, imo. There are tools, like linters, that reads package.json
for various reasons.
Hey @tido64 thanks for jumping in, we don't have any problems with RNTA itself right now. The root problem is that we haven't implemented the precompiled codegen spec shipping feature for RNTA yet, which is currently causing some fragmentations. The plan is to disable the RNTA option temporarily and bring it back with full precompiled codegen spec shipping. If you're curious about what we need to implement in CRNL for this, you can take a look at #566 where we implemented this feature for vanilla example apps. |
6e6ab63
to
dfb84d9
Compare
value: 'test-app', | ||
description: "app's native code is abstracted away", | ||
}, | ||
// The test app is disabled for now until proper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add env var to enable this
@@ -108,6 +112,25 @@ yarn add --dev react-native-builder-bob | |||
|
|||
> If you're building TypeScript definition files, also make sure that the `types` field points to a correct path. Depending on the project configuration, the path can be different for you than the example snippet (e.g. `lib/typescript/index.d.ts` if you have only the `src` directory and `rootDir` is not set). | |||
|
|||
1. Configure [React Native Codegen](https://reactnative.dev/docs/the-new-architecture/what-is-codegen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to bottom
@@ -108,6 +112,25 @@ yarn add --dev react-native-builder-bob | |||
|
|||
> If you're building TypeScript definition files, also make sure that the `types` field points to a correct path. Depending on the project configuration, the path can be different for you than the example snippet (e.g. `lib/typescript/index.d.ts` if you have only the `src` directory and `rootDir` is not set). | |||
|
|||
1. Configure [React Native Codegen](https://reactnative.dev/docs/the-new-architecture/what-is-codegen) | |||
|
|||
You can follow the [Official Codegen Setup Guide](https://reactnative.dev/docs/the-new-architecture/using-codegen) to enable Codegen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mention when you need to configure codegen
b73b7c3
to
56d467c
Compare
Summary
package.json
to your exports in the docspackage.json
with bob if you don't haveincludesGeneratedCode: true
.Why the changes?
Currently, there are two approaches with React Native Codegen.
1. Pregenerate
If you have
includesGeneratedCode: true
in yourcodegenConfig
, 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 yourpackage.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
Bob
bob init
on a librarypackage.json
is added to the exports field.