Hot reload
Save a file; every attached target — simulator and devices — reloads in well under two seconds, usually much less. This page explains exactly what happens so the behavior never surprises you.
What a reload does
kog devrecompiles incrementally (typically < 300 ms) and broadcasts the new bundle over WebSocket (Wi-Fi) or serial.- The target tears down the current app: effects are disposed, JS-held hardware claims (pins, buses, PWM channels) are released, and the current screen's widgets are deleted.
- The new bundle is evaluated from RAM (the installed app in flash is untouched) and the app remounts.
- Navigation state is preserved — you land back on the screen you were editing, with the same route params.
What is and isn't preserved
| Preserved across reload | |
|---|---|
| Current route + params | ✅ |
useStorage values (device KV storage) | ✅ (they're persistent by nature) |
useState / in-memory state | ❌ — remounts fresh in v1 |
| Hardware claims | ❌ — released and re-claimed by the new code (this is what you want) |
State-preserving Fast Refresh (keeping useState values across reloads) is designed into the runtime's architecture and planned post-v1.
Errors during development
- Compile errors never reach the device: they render as an overlay in the simulator and in your terminal, with the file/line and a web-developer-readable message.
- Runtime errors show a compact error screen on the target and a full source-mapped stack in the terminal.
console.log/warn/errorfrom every target streams to thekog devterminal, labeled and source-mapped. Console calls are stripped from--releasebuilds.