Enabling React Compiler breaks JSX pragma handling

オープン
#1,224 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
react, typescript
領域
frontend, tooling

調査の方向性

まずリンクされた StackBlitz の再現を実行し、その後 plugin-react の React Compiler 統合と JSX pragma の処理を確認してください。React Compiler を有効にしても JSX pragma の動作が維持され、カスタム JSX または Emotion css prop の使用も含めて、再現が失敗しなくなれば、問題は解決です。

索引モデルが issue の本文から書いたものです。

説明

bug: upstream plugin: react
Related plugins
Describe the bug

React Compiler integration, as documented by the plugin, is not compatible with JSX pragma usage (e.g Emotion css prop).

React Compiler adds an import statement at the top of the file (playground).

This causes Oxc to skip the pragma (playground).

Interestingly, Babel handles this case fine (playground), while TypeScript matches Oxc's behavior (playground).

Reproduction

https://stackblitz.com/edit/vitejs-vite-9eantx6h

Steps to reproduce

No response

System Info
System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 22.22.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: ^6.0.1 => 6.0.1 
    vite: ^8.0.12 => 8.0.12
Used Package Manager

npm

Logs

No response

Validations
主要言語
TypeScript
スター
1.2k
フォーク
287
平均マージ
1日 17時間
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vitejs/vite-plugin-react のほかの issue

vitejs/vite-plugin-react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。