compiler rc.18: SSR template validation rejects SVG <image> outside an <svg>-rooted template
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 53/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript, typescript
Línea de trabajo
The report identifies SSR template validation as the failing path but names no source or test files. Start by comparing how DOM and SSR validation establish SVG context, then reproduce with the four supplied cases using transform with generate: 'ssr' and validate: true. Done means all four compile for SSR as they do for DOM, with the validation tests covering SVG roots, fragments, control flow, and nested SVG context.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
@solidjs/[email protected] (#4238, "validate SSR templates for malformed HTML") rejects an SVG <image> in an SSR template unless the template itself is rooted at <svg>. The DOM compile of the same source passes, so the SSR validator does not apply the SVG context the DOM validator does: it parses <image> as HTML, where the parser turns it into <img>.
This breaks any SSR'd component that puts an <image> under control flow (<Show>, <For>), in a fragment, or under a <g> template root, even when it is inside an <svg> in the parent template.
Reproduction
const { transform } = require('@solidjs/compiler') // 2.0.0-rc.18
const cases = {
showInSvg: "import {Show} from 'solid-js'; export const A = (p) => <svg><Show when={p.on}><image href='a.png' /></Show></svg>",
gRoot: "export const B = () => <g><image href='a.png' /></g>",
fragment: "export const C = () => <><clipPath id='c'><circle r={1} /></clipPath><image href='a.png' /></>",
svgRoot: "export const D = () => <svg><image href='a.png' /></svg>",
}
for (const [name, code] of Object.entries(cases))
for (const generate of ['dom', 'ssr'])
try { transform(code, { filename: 'x.tsx', generate, hydratable: true, validate: true }); console.log(name, generate, 'ok') }
catch (e) { console.log(name, generate, 'ERR', String(e.message).split('\n')[0]) }
Output:
showInSvg dom ok
showInSvg ssr ERR The HTML provided is malformed and will yield unexpected output when evaluated by a browser. (1:79)
gRoot dom ok / gRoot ssr ERR ...
fragment dom ok / fragment ssr ERR ...
svgRoot dom ok / svgRoot ssr ok
User HTML: <image></image>
Browser HTML: <img>
Expected
The SSR validator treats a template as SVG under the same rules as the DOM validator (an SVG element name at the template root, or a template inside an <svg> element's subtree), so the four cases compile for ssr exactly as they do for dom.
Environment
solid-js / @solidjs/web / @solidjs/compiler 2.0.0-rc.18, @solidjs/vite-plugin 3.0.0-next.51. Found while qualifying rc.18 for celados/glaze (its SSR gate renders a block whose crest is an SVG <image> under <Show>).
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.2k
- Forks
- 1.1k
- Merge medio
- 11 h 5 min
- PR fusionados (30 d)
- 353
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la 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 solidjs/solid
-
`lazy()`: remounting an already-loaded component renders empty (or the Suspense fallback) since 1.9.14Posiblemente ocupada @itisrmk la tomó hace 10 días. Abierto1.x
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Errored fallback with an async hole is dropped inside a pending outer Loading (SSR streaming)Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 1-2 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
`createRoot`'s dispose function keeps `fn` alive, so `<For>`/`<Index>` rows retain removed list itemsPosiblemente ocupada @boombang la tomó hace 12 días. Abierto1.x
Dificultad 4/5 1-2 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
keptinventory/kept#336 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
hemi-earn
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
vetro-protocol/vetro-monorepo#1013 ·
Los mantenedores suelen responder en 1 día