Documentation for adding LiveView to an existing (older Phoenix) project?

Hi all – I’ve an existing Phoenix project that was generated before LiveView was stable and integrated. I upgraded the dependency, but this doesn’t update the source code to reflect the latest update to various modules.

I’m currently getting an error for live_component/0 is undefined or private, from use FoobarWeb, :live_component. This macro isn’t defined in foobar_web.ex.

I have an idea about where to add it, but I would likely miss something. Are there/were there upgrade guides at all? If so, can someone point me to them to adjust my existing project? I would greatly appreciate it!

This should list all the needed steps.


One trick I like to use as well is to create a new project the same way you created your first project. Commit this in a new got repo.
Then delete the content and create the project again with the exact same parameters and with LiveView added.

And git diff shows you all you need to know.
You can do it without the repo too of course in 2 different folders and then diff the 2 folders

1 Like