Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Move generated live_reload patterns to runtime config#6722

Open
jechol wants to merge 1 commit into
phoenixframework:mainfrom
jechol:move-live-reload-to-runtime-config
Open

Move generated live_reload patterns to runtime config#6722
jechol wants to merge 1 commit into
phoenixframework:mainfrom
jechol:move-live-reload-to-runtime-config

Conversation

@jechol

@jechol jechol commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

phx.new currently generates live_reload patterns in config/dev.exs.

Those patterns are runtime-only endpoint configuration, read by Phoenix.LiveReloader from the endpoint config when the live reload socket joins. They do not need to be part of compile-time configuration.

Keeping them in compile config can lead to unnecessary recompilation because Mix stores compile config in the Elixir compiler manifest, and equivalent regex literals are not term-equal across evaluations:

~r/foo/ == ~r/foo/
#=> false

If a config file is touched, Mix may re-check compile config and see the newly evaluated regex values as changed even when the config source did not meaningfully change.

This moves the generated live_reload config to runtime.exs under the development environment, preserving behavior while avoiding unstable regex terms in compile config.

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.

1 participant