Skip to content

feat: add REFLEX_HOT_RELOAD_OVERRIDE_PATHS to fully override reload paths#6639

Merged
amsraman merged 3 commits into
mainfrom
khaleel/eng-9752-add-reflex_hot_reload_override_paths-env-var-to-fully
Jun 10, 2026
Merged

feat: add REFLEX_HOT_RELOAD_OVERRIDE_PATHS to fully override reload paths#6639
amsraman merged 3 commits into
mainfrom
khaleel/eng-9752-add-reflex_hot_reload_override_paths-env-var-to-fully

Conversation

@adhami3310

Copy link
Copy Markdown
Member

Summary

Adds a REFLEX_HOT_RELOAD_OVERRIDE_PATHS environment variable (colon-separated list of paths). When set, get_reload_paths() returns these paths directly, taking precedence over REFLEX_HOT_RELOAD_INCLUDE_PATHS, REFLEX_HOT_RELOAD_EXCLUDE_PATHS, and the config-derived defaults.

This gives embedders full control over what the dev-mode file watcher observes — e.g. pointing it at a dedicated control directory instead of relying on the app's project layout.

Linear: ENG-9752

…aths

When set, get_reload_paths() returns these paths directly, taking
precedence over include/exclude paths and the config-derived defaults.
@adhami3310 adhami3310 requested a review from a team as a code owner June 10, 2026 00:09
@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

ENG-9752

@greptile-apps

greptile-apps Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a REFLEX_HOT_RELOAD_OVERRIDE_PATHS environment variable that, when set, causes get_reload_paths() to return those paths directly, bypassing all config-derived defaults, include paths, and exclude paths.

  • Adds the new EnvVar[list[Path]] field to EnvironmentVariables in environment.py, following the same pattern as the existing REFLEX_HOT_RELOAD_INCLUDE_PATHS and REFLEX_HOT_RELOAD_EXCLUDE_PATHS variables.
  • Inserts an early-return guard at the top of get_reload_paths() in exec.py that resolves the override paths to absolute paths, emits a debug log, and returns immediately — leaving all existing logic untouched when the variable is unset.

Confidence Score: 5/5

Safe to merge — the change is an additive opt-in feature with no effect when the env var is unset.

The override guard is an isolated early-return that is inert by default (empty list is falsy). The implementation mirrors the existing include/exclude path handling exactly: same Path.absolute conversion, same EnvVar[list[Path]] typing, same debug log pattern. No existing behavior is modified.

No files require special attention.

Important Files Changed

Filename Overview
reflex/utils/exec.py Adds override-path early-return at the top of get_reload_paths() with a debug log; falls through to existing logic when env var is unset. Logic is correct and consistent with include/exclude handling.
packages/reflex-base/src/reflex_base/environment.py Adds REFLEX_HOT_RELOAD_OVERRIDE_PATHS env var as EnvVar[list[Path]] with default [], consistent with the existing include/exclude path variables.
news/6639.feature.md Changelog entry for the new env var; accurate and complete.
packages/reflex-base/news/6639.feature.md Secondary changelog entry for the reflex-base package; accurate and concise.

Reviews (3): Last reviewed commit: "add changelog fragments" | Re-trigger Greptile

Comment thread reflex/utils/exec.py
@codspeed-hq

codspeed-hq Bot commented Jun 10, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing khaleel/eng-9752-add-reflex_hot_reload_override_paths-env-var-to-fully (faf949f) with main (d486e9b)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@amsraman amsraman merged commit fdb00db into main Jun 10, 2026
105 of 106 checks passed
@amsraman amsraman deleted the khaleel/eng-9752-add-reflex_hot_reload_override_paths-env-var-to-fully branch June 10, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants