-
Notifications
You must be signed in to change notification settings - Fork 194
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
fix: skip compiling fabric view as react native freaks out #720
Conversation
// Let React Native preset handle the commonjs transform | ||
// Otherwise this causes issues with `@react-native/babel-plugin-codegen` | ||
supportsStaticESM: true, |
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.
what's the problem here?
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.
@jbroma codegen generates export
in invalid position after the file is transformed to commonjs, which causes a syntax error when running the code
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.
the CJS transform comes from @babel/preset-env
and codegen runs as a plugin and the order of execution should be plugins -> presets, this shouldnt be a problem 🤔
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.
the codegen plugin runs as part of the react native preset and presets run in the reverse order iirc, which means codegen plugin will run after preset-env
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.
the codegen plugin runs as part of the react native preset and presets run in the reverse order iirc, which means codegen plugin will run after preset-env
but we don't use the RN preset here? and codegen plugin shouldn't run twice since we strip the types here
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.
@jbroma it is used in ...defaultConfig
where example app passes the RN preset. codegen only runs as part of the RN preset.
fac2fe2
to
a45b237
Compare
a45b237
to
f6ec3f9
Compare
f6ec3f9
to
1f871ad
Compare
)" This reverts commit 2ec645b.
fixes #719