Skip to content

Feat/front hmr - #4

Merged
herefindalex merged 6 commits into
masterfrom
feat/front-hmr
Sep 18, 2026
Merged

herefindalex merged 6 commits into
masterfrom
feat/front-hmr

Conversation

@thomas-chu-30

@thomas-chu-30 thomas-chu-30 commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Enable local Admin and Public React HMR by running Vite as the browser front door and proxying to the Go process, so UI work no longer requires rebuilding embedded assets on every change.

  • Add vite.dev.config.ts and pnpm --dir web/ui dev to proxy Go HTML, rewrite it to Vite source entries, and inject the React Refresh preamble
  • Rewrite browser Origin / Referer from :5173 to the Go base_url origin so Admin POSTs are not rejected by EnforceHost with 403; rewrite Location back to the Vite origin
  • Add rewrite unit tests and README docs (EN / zh-TW) for the local HMR workflow
  • Ignore local prods.ini

Test plan

  • Terminal A: run ./prods (base_url e.g. http://127.0.0.1:3310)
  • Terminal B: pnpm --dir web/ui install --frozen-lockfile && pnpm --dir web/ui dev
  • Open http://127.0.0.1:5173/ and /admin; confirm pages load with HMR
  • Admin login POST succeeds (no 403)
  • Edit Admin / Public island components hot-update; Go template changes still need a full reload
  • Rewrite unit tests pass
  • Production path unchanged: pnpm --dir web/ui build + run the binary directly

@herefindalex
herefindalex merged commit c9c3b9e into master Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants