Why was the Live View demo removed from the home page for the new Phoenix 1.6 apps?

When trying out Phoenix 1.6 I noticed it doesn’t have any more the --live flag for mix phx.new myapp and the docs says that LiveView is now included by default and I can confirm in the code that we have it there if we want to use it, but the home page doesn’t have any more a demo for it.

So, I am just curious about the reason it was removed from a default app?

Before Phoenix 1.6:

Now with Phoenix 1.6:

Or am I missing something when generating a new Phoenix 1.6 app?

You can use mix phx.gen.live

See here: The "—live" option (phoenix 1.6.0.rc) does not seem to work properly - #2 by mcrumm

1 Like

Thanks for the tip :slight_smile:

In my opinion it’s confusing, at least it was for me and I am not new in Phoenix, that in an example app they include LiveView without a working example. I wasted some minutes wondering what I may be doing wrong, but after a quick inspection to the generated code it was clear to me that it had been removed.

The LiveView example should also be generated because as it works now it will create a lot of confusion with people trying to use Phoenix for the first time and looking to try the awesomeness of LiveView :slight_smile:

The home page has been replaced by a dead view in 1.6 :slight_smile:

1 Like

Before we generated such page because —live was opt-in. Now it is opt-out so nothing specific to it is generated until you run mix phx.gen.live.

It is the same approach we take for JSON rendering, Ecto, the mailer, etc. They are all in the app but we don’t generate functionality for it unless you run their specific generators. People who want to try out LiveView can run the gen.live generator (which we will get used to).

4 Likes