I am in the process of porting an old LiveView app to the newest version of Phoenix ( v1.6.5). Being new to the whole thing in general I was expecting to run mix phx.new web_interface --live --no-ecto and to the find a similar structure to what I had before:
no more assets/static, since You don’t use webpack, and no more copy-webpack-plugin
→ just put manually in priv/static
no live folder, until You use mix phx.gen.live
→ You can do it in a fresh Phoenix project, use mix phx.gen.live, and You’ll have a live folder
no need to pass live to phx.new, it is not needed anymore
→ It’s the default now, mix help phx.new will show You the available options
This app is an umbrella app. This is why I used the previously mentioned command. Was I wrong to use it?
Will this new structure play nice with umbrella projects? (Do I need to do any additional tweaks?)
Then I go inside the newly created folder and run mix phx.gen.live
And then in theory, I get a Phoenix LiveView app.
There is one problem though:
mix phx.gen.html, phx.gen.json, phx.gen.live, and phx.gen.context
expect a context module name, followed by singular and plural names
of the generated resource, ending with any number of attributes.
mix phx.gen.html Accounts User users name:string
mix phx.gen.json Accounts User users name:string
mix phx.gen.live Accounts User users name:string
mix phx.gen.context Accounts User users name:string
The context serves as the API boundary for the given resource.
Multiple resources may belong to a context and a resource may be
split over distinct contexts (such as Accounts.User and Payments.User).
None of this was needed when I first started the old version of the project. I have a feeling there has been a major shift in paradigm here. I don’t understand what I am being asked.
Do you recommend any resources that can walk me through the new version?
Does anyone know if this course is updated enough that the Phoenix part is uppar with 1.6.5?
@kokolegorille I apologize if my question was not well formulated. I understand the command needs parameters and that a live folder is created.
What I don’t understand is the semantic meaning of the parameters and their implications in the new app. For example, does this mean my new live view app needs to be divided into models or subjects? in the previous version my app was not divided into this schema.
This is also why I was hoping if you knew any good courses for the new version. At this point, simply copy-pasting my old app would not do, as it won’t fit the new format.