reactjs / reactjs/react.dev

[Typo]: React Compiler Vite installation docs with "vite-plugin-babel" cause sourcemap issues

Đang mở
#8,215 0 bình luận 3 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

type: typos
Ngôn ngữ chính
JavaScript
Star
11.8k
Fork
7.9k
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
11

Mô tả

Summary

When following the setup instructions for React Compiler on the current live docs site, if using a custom Vite Babel plugin + React SWC or React Router v7 framework mode, you will notice that if a component gets optimized by React Compiler, the sourcemaps appear to have some React Compiler-optimized code paths in them, making dev debugging more difficult.

Page

https://react.dev/learn/react-compiler/installation

Details

Please see reproduction repository for specific details: https://github.com/andrew-locklair-fs/react-vite-compiler-repro

Screenshot demonstrating sourcemaps appropriately added with default config:

Image

Screenshot demonstrating sourcemaps not added when using the custom vite-plugin-babel:

Image

Happy to dig into this more, but hoping that it's as simple as just turning the relevant sourcemaps option ON for the custom Vite Babel plugin. I ran into this converting a RRv7 framework mode repo to add React Compiler, and the instructions seem to leave out sourceMaps: true in babelConfig.

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

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với trang cài đặt React Compiler và repository react-vite-compiler-repro được liên kết. Kiểm tra thiết lập plugin Babel tùy chỉnh cho Vite và babelConfig của nó, sau đó xác minh liệu sourceMaps: true có giải quyết được khác biệt sourcemap đã được báo cáo hay không trước khi cập nhật hướng dẫn cài đặt nếu điều này được xác nhận.

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, vite
Lĩnh vực
documentation
Loại issue
Tài liệu
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
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
48/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.