Did a folder named "live" change in phoenix 1.7?

I am following tutorials online for Phoenix Live and most of them have directories that use a folder named live.

“intro/pento/lib/pento_web/live/page_live.ex”

Notice the line assumes a directory named live

When I bootstrap the app I don’t see a live directory.
Did this change? If so how?

Thanks.

1 Like

Phoenix doesn’t bootstrap empty folders. It only generates folders once it wants to put something in those. But really folders don’t matter much for elixir files anyways.

2 Likes

To add a bit more context to what @LostKobrakai said, when you or a tutorial runs a mix task phoenix generator for live resources aka mix phx gen.live, it adds the following files which also creates a live directory if it doesn’t already exist for those last two files:

Overall, this generator will add the following files:

  • a context module in lib/app/accounts.ex for the accounts API
  • a schema in lib/app/accounts/user.ex, with a users table
  • a LiveView in lib/app_web/live/user_live/show.ex
  • a LiveView in lib/app_web/live/user_live/index.ex
  • a LiveComponent in lib/app_web/live/user_live/form_component.ex
  • a helpers module in lib/app_web/live/live_helpers.ex with a modal

source: mix phx.gen.live | Phoenix docs