Open atlj opened 1 week ago
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?
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.
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.