Fast Refresh and Native Hot Reload
Browser Fast Refresh
The Hosanna Browser target is powered by Vite. When you run
npx hst run browser dev emulator, HST starts or reuses Vite, generator watch, and
debugger services. Generated struct files must remain current.
Device Fast Refresh
Native Apple and Android targets support an explicit JavaScript dev-server mode:
npx hst run ios dev sim --hot-reload
npx hst run apple-tv dev sim --hot-reload
npx hst run android dev sim --hot-reload
npx hst run android-tv dev sim --hot-reload
Without --hot-reload, native runs use the bundled JavaScript/assets path.
This is the release-like mode and the default.
Android Auto and Wear OS are bundled-only in this iteration. Their headless
Hermes runtimes do not yet implement the full reload/dispose/state reinstall
loop, so HST rejects --hot-reload instead of starting unused services.
For a physical iPhone, set HS_DEV_JS_URL to a Mac LAN URL the phone can
reach. Android normally detects a usable LAN host; set HS_DEV_HOST only when
that detection selects an unreachable address.
Roku does not load the TypeScript bundle from the native hot-reload server.
After a successful compiler build, --no-build can redeploy already-generated
output:
npx hst run roku dev device \
--no-build \
--source-root platforms/roku/src \
--device "Living Room Roku"
This does not include later TypeScript changes; rebuild when source changed. Packaged Tizen and webOS apps do not execute from Vite or inherit browser HMR. Rebuild and reinstall them with the HST device workflow; browser preview proves shared UI behavior but not native input, player, lifecycle, or audio guidance.
Tips for Rapid Debugging on Device
- Use browser HMR for most shared view/config changes.
- On Roku, use
npx hst run roku dev device --no-build --source-root platforms/roku/srcafter a successful build when you only need to redeploy the generated package. - On Apple and Android native targets, use
--hot-reloadonly for the development loop and rerun bundled mode before release. - Treat edits to generated
.brsas disposable diagnostics. Apply the real fix in TypeScript and rebuild. - Validate native services, packaging, lifecycle, input, and rendering on the actual target even when the browser result is correct.