reflex icon indicating copy to clipboard operation
reflex copied to clipboard

reflex run --frontend-only should support hot reload

Open jackie-pc opened this issue 2 years ago β€’ 2 comments

Describe the bug When running reflex run --frontend-only (this is dev mode), hot reload only works for changes made to assets/ folder. We should make it work in general - i.e. if page definitions change (from python files), recompile should occur and dev site updated on the fly.

To Reproduce reflex run --frontend-only, change something in the application (python code). Running dev server will not pick up this change.

Expected behavior Running dev server should pick up this change. An obvious bar is to matchreflex run behavior (dev mode, backend and frontend up).

jackie-pc avatar Dec 14 '23 17:12 jackie-pc

There should be a warning in the docs on reflex run --frontend-only that hot reload won't work this way

larsblumberg avatar May 26 '25 19:05 larsblumberg

Hot reload is actually handled by the backend (feature of granian/uvicorn).

This code explicitly skips front end compilation when --backend-only is passed: https://github.com/reflex-dev/reflex/blob/fb19fb42968c4ee6ffa12245736724995c8c2243/reflex/reflex.py#L161-L162

TheLandolorien avatar Oct 18 '25 02:10 TheLandolorien