Skip to content

Feat/front end hmr - #3

Closed
thomas-chu-30 wants to merge 6 commits into
masterfrom
feat/front-end-hmr
Closed

thomas-chu-30 wants to merge 6 commits into
masterfrom
feat/front-end-hmr

Conversation

@thomas-chu-30

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 previously approved these changes Sep 18, 2026

@herefindalex herefindalex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@herefindalex herefindalex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@herefindalex herefindalex left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@thomas-chu-30 thomas-chu-30 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@thomas-chu-30 thomas-chu-30 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (Looks Good To Me)

@thomas-chu-30 thomas-chu-30 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approved the latest commits

@herefindalex
herefindalex deleted the feat/front-end-hmr branch October 14, 2026 05:12
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