[Typo]: React Compiler Vite installation docs with "vite-plugin-babel" cause sourcemap issues
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 11.8k
- 分支
- 7.9k
- 平均合併
- 1 天 11 小時
- 30 天內合併 PR
- 11
描述
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:
Screenshot demonstrating sourcemaps not added when using the custom vite-plugin-babel:
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.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 React Compiler 安裝頁面和連結的 react-vite-compiler-repro 儲存庫開始。檢查自訂 Vite Babel 外掛程式的設定及其 babelConfig,然後驗證 sourceMaps: true 是否能解決回報的 sourcemap 差異;如果確認可以,再更新安裝說明。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- babel, javascript, react, vite
- 領域
- documentation
- Issue 類型
- 文件
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100