Source attribute injection breaks JSX elements with generic type arguments
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 2 h 48 min
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de usabl-dev/usabl
-
area: engine bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Stop hook allows a stop on an unknown verdict, and the self-check prints IDLE for a null verdictAbiertoarea: assistants bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
area: engine bug security
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Overlay: browser context failures are counted per plugin, not per browser, and close is not sharedAbiertoarea: overlay bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
area: engine enhancement performance
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Todos los issues de usabl-dev/usabl
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chaitin/MonkeyCode#1437 ·
Los mantenedores suelen responder en 1 día
-
rtdb-info-connected-order test: unhandled 'connection is closed' rejection fails the CLI suiteAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
carbon-design-system/carbon-ai-chat#2615 ·
Los mantenedores suelen responder en 1 día
-
e2e-failure ready-to-code
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlinePosiblemente ocupada @r2jaff la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ComposioHQ/composio#5054 ·
Los mantenedores suelen responder en 1 día