callstack / callstack/react-native-builder-bob

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

Đang mở
#678 2 bình luận 6 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
JavaScript
Star
3.2k
Fork
228
Merge trung bình
7 ngày 12 giờ
Pull request đã merge (30 ngày)
3

Mô tả

### 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

-

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với babel-preset và bản tái hiện được liên kết, sau đó so sánh hành vi của nó với tsconfig compilerOptions.jsx được đặt thành react-native hoặc preserve. Xác nhận rằng các thiết lập đó ngăn không cho JSX transform plugins được áp dụng; được xem là hoàn tất khi build giữ nguyên đầu ra JSX đã cấu hình thay vì luôn tạo ra react-jsx.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
babel, javascript, react-native, typescript
Lĩnh vực
build-system, mobile
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.