Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/6639.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added the `REFLEX_HOT_RELOAD_OVERRIDE_PATHS` environment variable, a colon-separated list of paths that, when set, fully replaces the paths watched for hot reload in dev mode — taking precedence over the config-derived defaults as well as `REFLEX_HOT_RELOAD_INCLUDE_PATHS` and `REFLEX_HOT_RELOAD_EXCLUDE_PATHS`.
1 change: 1 addition & 0 deletions packages/reflex-base/news/6639.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added the `REFLEX_HOT_RELOAD_OVERRIDE_PATHS` environment variable, a colon-separated list of paths that, when set, fully replaces the paths watched for hot reload in dev mode.
3 changes: 3 additions & 0 deletions packages/reflex-base/src/reflex_base/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,9 @@ class EnvironmentVariables:
# Paths to exclude from the hot reload. Takes precedence over include paths. Separated by a colon.
REFLEX_HOT_RELOAD_EXCLUDE_PATHS: EnvVar[list[Path]] = env_var([])

# Paths to override in the hot reload. Takes precedence over include and exclude paths. Separated by a colon.
REFLEX_HOT_RELOAD_OVERRIDE_PATHS: EnvVar[list[Path]] = env_var([])

# Enables different behavior for when the backend would do a cold start if it was inactive.
REFLEX_DOES_BACKEND_COLD_START: EnvVar[bool] = env_var(False)

Expand Down
8 changes: 8 additions & 0 deletions reflex/utils/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,14 @@ def get_reload_paths() -> Sequence[Path]:
Raises:
RuntimeError: If the `__init__.py` file is found in the app root directory.
"""
override_dirs = tuple(
map(Path.absolute, environment.REFLEX_HOT_RELOAD_OVERRIDE_PATHS.get())
)

if override_dirs:
console.debug(f"Reload paths (override): {list(map(str, override_dirs))}")
return override_dirs
Comment thread
greptile-apps[bot] marked this conversation as resolved.

config = get_config()
reload_paths = [Path.cwd()]
app_module = config.module
Expand Down
Loading