HMR Validation Checklist
Follow these steps after touching the frontend hot-update pipeline.
Automated Smoke
- Run
bun run --filter @webstir-io/webstir-frontend build. - Run
bun run --filter @webstir-io/webstir-frontend test. - Start
webstir watchin a clean frontend-capable workspace and confirm the dev loop boots without errors.
JavaScript/Edit Loop
- Launch
webstir watch --workspace "$PWD/examples/demos/spa" --hmr-verbose. - Modify
examples/demos/spa/src/frontend/pages/home/index.ts(for example, change a string). - Verify the browser console logs:
Applied hot update…message with module/style counts.Totals — applied: <n>, fallbacks: <m>increments without forcing a reload.
- Repeat with additional JS edits to observe counters climbing without page refreshes.
CSS Refresh
- Edit
examples/demos/spa/src/frontend/pages/home/index.css. - Confirm the DOM injects a fresh stylesheet and console totals increment.
Fallback Scenario
- From the browser console run
window.__webstirAccept = () => false;. - Edit the page script again.
- Confirm:
- Console warning announces fallback with reasons and totals.
- SSE status switches to
hmr-fallback, followed by a full reload. - Watch logs show
frontend.watch.pipeline.hmrfallback.
HTML/Manifest Change
- Modify
examples/demos/spa/src/frontend/app/app.html. - Observe the watch loop logging a reload requirement and the browser performing a full refresh.
Performance Spot Check
- Capture the emitted watch diagnostics and ensure hot updates complete quickly on the demo workspace you used for validation.
Document any deviations (especially fallback rates above 10%) before shipping.