Vite migration (1/3): Go HTML and asset contract
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- go, vite
- Área
- backend, build-system, frontend
Línea de trabajo
Comienza con internal/controller/template_controller.go y ui/template/header.html; después, inspecciona el nuevo TestGetStyleResolvesBuiltAssets en relación con la compilación integrada. Ejecuta la compilación de desarrollo del frontend, seguida de go build ./..., go vet ./... y la prueba de assets. El trabajo estará terminado cuando las etiquetas de assets analizadas se resuelvan independientemente del orden de los atributos, se rendericen varias rutas de hojas de estilo y las páginas servidas conserven una hoja de estilo y scripts clásicos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Part of #1578. First step of the series; can land while Create React App still builds.
Problem. internal/controller/template_controller.go GetStyle() scrapes the script and stylesheet paths out of the built ui/build/index.html with regexes that require classic scripts with defer first and stylesheet links with href before rel, and it returns a single stylesheet path. Every server-rendered page reuses those paths through ui/template/header.html. Any other tag shape returns nothing, and the pages load with no JavaScript and no stylesheet while every build step still reports success. Nothing in the tree asserts the contract.
Change. Read the tags from the parsed document (golang.org/x/net/html), so attribute order, attribute set and quoting no longer matter. Return cssPath as a list, mirroring how script paths are already collected and prefixed, and range over it in header.html. Add TestGetStyleResolvesBuiltAssets, which calls the real GetStyle() against the real embedded build and skips when no build is embedded. Keep the classic <script defer="defer" src=...> tag in header.html; the module switch belongs to step 2.
Done when. dev with only this change builds the frontend with the current toolchain, go build ./... and go vet ./... pass, the test passes against that build, and the served pages are unchanged (one stylesheet, classic scripts).
- Lenguaje dominante
- Go
- Estrellas
- 15.7k
- Forks
- 1.4k
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 6
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 apache/answer
-
List button click not working Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Gravatar hash is computed from the un-lowercased email, so mixed-case accounts render an identicon Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Todos los issues de apache/answer
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
bug group: validation priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
codecheckers/chekhov#51 ·
-
Creating worktree from an existing remote branch with a slash in it, has unexpected behaviour Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100