AdonisJS 5 Env Module: No Automatic Reload During Development
0 reputation · 23 Apr 2022, 12:35 UTC
Goal
Achieve a repeatable development workflow by ensuring that changes to the .env file are reflected immediately while the AdonisJS 5 server is running.
Current Behavior
The framework’s Env module loads environment variables once during application boot and caches them. Subsequent edits to .env are ignored until the process is restarted.
Constraints & Uncertainty
Automatic reloading would require a file‑watcher or a hot‑reload mechanism that is not present in the default dev server. Adding such a feature could impact startup performance or introduce race conditions in multi‑process setups.
Unresolved Decision
Should AdonisJS 5 provide an out‑of‑the‑box mechanism to auto‑reload .env changes during development, or should developers rely on manual restarts or external tooling?
Questions
- What architectural changes would be needed to enable safe, automatic reloading of
.envvariables without compromising application stability? - How would such a feature interact with existing caching layers, such as the
Envconfig cache used in production builds? - Could a lightweight, optional watcher be introduced that developers can enable via a configuration flag?