HMR Validation Checklist
Follow these steps after touching the frontend hot-update pipeline.
Automated Smoke
- Run
./utilities/scripts/format-build.sh(invokes TypeScript build + node tests). - Start
webstir watchin a clean workspace and confirm the daemon boots without errors.
JavaScript/Edit Loop
- Launch
webstir watchwithWEBSTIR_FRONTEND_HMR_VERBOSE=1. - Modify
Engine/Resources/src/frontend/pages/home/index.ts(e.g., 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
Engine/Resources/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. - Daemon logs show
Hot update totals — …andfrontend.watch.pipeline.hmrfallback.
HTML/Manifest Change
- Modify
Engine/Resources/src/frontend/app/app.html. - Observe the daemon logging a reload requirement and the browser performing a full refresh.
Performance Spot Check
- Capture
frontend.watch.javascript.build.statsandfrontend.watch.hmr.summarytimings; ensure hot updates complete in under 200 ms for the seed project.
Document any deviations (especially fallback rates above 10%) before shipping.