-
Notifications
You must be signed in to change notification settings - Fork 23
Release compat #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Release compat #26
Conversation
This PR allows for running `mix release` as the LiveReload code is now guarded against if it is explicitly opted out of In addition, the `plug` option from `start/1` was moved into `start_link/1` so the Router can be overridden when using `start_link/1` directly
627ca3f
to
ecdd33a
Compare
{PhoenixPlayground, plug: plug, live_reload: false} | ||
] | ||
|
||
opts = [strategy: :one_for_one, name: __MODULE__] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__MODULE__
expands to nil
in scripts:
opts = [strategy: :one_for_one, name: __MODULE__] | |
opts = [strategy: :one_for_one] |
] | ||
|
||
opts = [strategy: :one_for_one, name: __MODULE__] | ||
Supervisor.start_link(children, opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supervisor.start_link(children, opts) | |
{:ok, _} = Supervisor.start_link(children, opts) |
|
||
opts = [strategy: :one_for_one, name: __MODULE__] | ||
Supervisor.start_link(children, opts) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.no_halt(true) |
plug :run_live_reload | ||
|
||
defp run_live_reload(conn, _options) do | ||
if Application.get_env(:phoenix_playground, :live_reload) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have a check if live_reload is enabled on line 22, I'm curious if you intentionally left this check here to allow changing the value at runtime somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll go through this, it was early on and I may have spiked this incorrectly.
WDYT about adding an |
@wojtekmach that makes sense, I can add those in this week. |
This PR allows for running
mix release
as the LiveReload code is now guarded against if it is explicitly opted out ofIn addition, the
plug
option fromstart/1
was moved intostart_link/1
so the Router can be overridden when usingstart_link/1
directlyAdded an example to run for using
start_link/1
in a Supervisor. This example stack traces prior to this PRAlso updated to latest
phoenix_live_view