Files
stemengine_old/FRONTEND_DEV_WORKFLOW.md
2026-04-16 15:52:46 +09:00

2.0 KiB

CRITICAL: Frontend Development Workflow

⚠️ IMPORTANT FOR ALL AGENTS ⚠️

All frontend changes MUST be served live immediately.

When making changes to any files in /home/translator/docker/appdata/stemengine/frontend/src/, the dev server will automatically hot-reload and serve changes without requiring:

  • npm run build
  • Manual browser refresh (in most cases)
  • Container restart

How this works

  • The frontend has a dev server running (Vite/dev server via Docker)
  • It watches for file changes in src/
  • Changes are automatically compiled and served to http://localhost:5173 (or the active dev server port)
  • Browser will auto-refresh on most changes

When you're done with frontend changes:

  1. Make the file edits directly to src/ files
  2. Verify changes appear in the browser within seconds
  3. Test the functionality immediately
  4. Move on — no build step needed

The prod/dev distinction

  • Dev mode (current): Hot reload, live serving
  • Prod mode (future): May require build step
  • For now: Everything is dev, everything is live

Verification

After making frontend changes, you should see:

  1. The browser automatically refresh (or prompt to do so)
  2. Changes visible within 1-3 seconds
  3. Console may show "Updated in X ms" or similar

If changes don't appear:

  1. Wait 5 seconds (compilation takes a moment)
  2. Hard refresh: Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac)
  3. Check if dev server is running: docker-compose ps should show frontend service running
  4. Check browser console for errors

Do NOT do these things:

  • ❌ Tell users "changes will appear after rebuild"
  • ❌ Run npm run build (waste of time in dev mode)
  • ❌ Ask users to clear cache and restart
  • ❌ Suggest changes need "deployment"

Example workflow:

1. Edit src/pages/SearchPage.tsx
2. Save file (1-2 second delay)
3. Browser refreshes automatically
4. Changes are live
5. Done

Last Updated: April 16, 2026
Set by: Frontend development team