callstack / callstack/react-native-builder-bob

TypeScript builds ignore tsconfig compilerOptions.jsx. Output is always 'react-jsx'

Ouverte
#678 2 commentaires 6 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
JavaScript
Étoiles
3.2k
Forks
228
Merge moyen
7 j 12 h
PR mergées (30 j)
3

Description

### Description

Libraries built with `react-native-builder-bob` do not respect the `tsconfig.config#compilerOptions.jsx` setting, and force the output to be `react-jsx`. This is a problem for React Native libraries which normally publish as `jsx: 'react-native' or 'preserve'`.

Libraries such as `@emotion/native` and `NativeWind` both rely on setting a custom `jsxImportSource`, which only works when a library has been published with persevered JSX. This means libraries built with `react-native-builder-bob` will stop working with these libraries.

The cause of this issue is the babel-preset, which should conditionally turn off `'@babel/plugin-transform-react-jsx'` / `'@babel/plugin-transform-react-jsx-development'` when `jsx` is set to `react-native` or `preserve`.

### Packages

- [ ] create-react-native-library
- [x] react-native-builder-bob

### Selected options

-

### Link to repro

https://github.com/marklawlor/react-native-builder-bob-jsx

### Environment

-

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start with the babel-preset and the linked reproduction, then compare its behavior with tsconfig compilerOptions.jsx set to react-native or preserve. Confirm that those settings prevent the JSX transform plugins from being applied; done means the build preserves the configured JSX output instead of always producing react-jsx.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
babel, javascript, react-native, typescript
Domaine
build-system, mobile
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.