So far in this tutorial we have put all the template code into a single file:
/lib/live_view_todo_web/live/page_live.html.heex
That is "OK" in a mini project like this, but it will quickly become unmaintainable in a larger LiveView codebase.
We are therefore going to proactively migrate the templates to using PhoenixLiveComponents`.
So far in this tutorial we have put all the template code into a single file:
/lib/live_view_todo_web/live/page_live.html.heex
That is "OK" in a mini project like this, but it will quickly become unmaintainable in a largerLiveView
codebase. We are therefore going to proactively migrate the templates to usingPhoenix
LiveComponents`.see https://hexdocs.pm/phoenix_live_view/Phoenix.LiveComponent.html
Check the heex file https://github.com/dwyl/phoenix-liveview-todo-list-tutorial/blob/main/lib/live_view_todo_web/live/page_live.html.heex to see which parts can be extracted to its own component.
This heex file is not big, however creating a component will be used as an example on how to do it for bigger files.