Source attribute injection breaks JSX elements with generic type arguments
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- tooling
調査の方向性
The issue identifies the Vite plugin injector and four failing TSX files, including platform/settings/SubscriptionWizard.tsx at line 101. Read the injector and its existing tests first, then reproduce the failure with a generic JSX element and nested generics. Done means the injected attributes follow the type arguments and both cases pass; the issue also calls for considering a source injection opt-out and updating the installer draft.
索引モデルが issue の本文から書いたものです。
説明
What
The Vite plugin injects data-source-file and data-source-line attributes into JSX elements so findings can point at a source line. The plugin runs with enforce: 'pre', so it sees raw TSX before the React transform. A component used with a generic type argument, such as <PageWizard<SubscriptionWizardData> ...>, gets the attributes inserted inside the type argument and the file no longer parses. The dev server returns 500 for every module that imports it, and the application renders nothing.
Evidence
Measured on a real product UI the night before the freeze: platform/settings/SubscriptionWizard.tsx:101, platform/access/api-tokens/ApiTokenForm.tsx:157, platform/settings/runtime-feature-flags/FeatureFlagsPage.tsx:96, platform/settings/ui-flags/UIFlagsPage.tsx:30 all fail with Unexpected token at the position of the generic argument. The small demo application never showed it because it has no generic components. Moving the plugin later in the plugins array does not help because of enforce: 'pre'.
Direction
Make the injector skip a generic type argument list when it finds the tag name: treat <Name<...> as the element Name and insert the attributes after the closing > of the type arguments. Add a test with a generic element and one with nested generics. Until then, document in the installer's draft that applications using generic JSX elements should pass an option that disables source injection, if one exists, and add such an option if it does not.
- 主要言語
- TypeScript
- スター
- 0
- フォーク
- 0
- 平均マージ
- 2時間 48分
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
usabl-dev/usabl のほかの issue
-
area: engine bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
Stop hook allows a stop on an unknown verdict, and the self-check prints IDLE for a null verdictオープンarea: assistants bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
area: engine bug security
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Overlay: browser context failures are counted per plugin, not per browser, and close is not sharedオープンarea: overlay bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
area: engine enhancement performance
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
usabl-dev/usabl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
chaitin/MonkeyCode#1437 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
carbon-design-system/carbon-ai-chat#2615 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offline対応中かも @r2jaff が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ComposioHQ/composio#5054 ·
メンテナーはふだん 1 日以内に返信