Skip to content

Instantly share code, notes, and snippets.

@josevalim
Last active August 29, 2023 07:06
Show Gist options
  • Save josevalim/132f9ddeb1c32d1a097afcf3d4523d48 to your computer and use it in GitHub Desktop.
Save josevalim/132f9ddeb1c32d1a097afcf3d4523d48 to your computer and use it in GitHub Desktop.

Reference table with how the defaults changed from Phoenix v1.6 to v1.7. This was done to unify the developer experience between regular Phoenix and LiveView.

Feature Phoenix v1.6 Phoenix v1.7
MyController.action/2 renders MyView.render("action.html", assigns) MyHTML.action(assigns)
Define views at lib/my_app/views/my_view.ex lib/my_app/controllers/my_html.ex
At the top of your views use MyAppWeb, :view use MyAppWeb, :html
Default template language EEx (.eex extension) HEEx (.heex extension)
To embed templates from disk use Phoenix.View use Phoenix.Component (+ embed_templates)
HTML helpers (forms, links, etc) use Phoenix.HTML use Phoenix.Component

PS: Phoenix v1.7 is backwards compatible with v1.6 if you want to keep with the old style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment