You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@answer.apache.org by "xantorres (via GitHub)" <gi...@apache.org> on 2026/08/22 06:46:30 UTC
[I] Vite migration (1/3): Go HTML and asset contract [answer]
xantorres opened a new issue, #1579:
URL: https://github.com/apache/answer/issues/1579
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).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [I] Vite migration (1/3): Go HTML and asset contract [answer]
Posted by "xantorres (via GitHub)" <gi...@apache.org>.
xantorres commented on issue #1579:
URL: https://github.com/apache/answer/issues/1579#issuecomment-5977957624
Completed by #1582, merged into `dev` on 2026-09-15 and now also on `main`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org
Re: [I] Vite migration (1/3): Go HTML and asset contract [answer]
Posted by "xantorres (via GitHub)" <gi...@apache.org>.
xantorres closed issue #1579: Vite migration (1/3): Go HTML and asset contract
URL: https://github.com/apache/answer/issues/1579
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org