stefanchrobot

stefanchrobot

Anyone else excited for the upcoming changes in Phoenix 1.7? :fire:

Looks like phoenix_view is getting deprecated in favour of phoenix_template:

With Phoenix.LiveView, Phoenix.View has been replaced by Phoenix.Component. Phoenix.Component is capable of embedding templates on disk as functions components, using the embed_templates function. For example, in Phoenix v1.7+, the YourAppWeb.UserView above would be written as:

defmodule YourAppWeb.UserHTML do
  use YourAppWeb, :html

  embed_templates "users"
end

The benefit of Phoenix.Component is that it unifies the rendering of traditional request/response life cycles with the composable component model provided by LiveView.

Replace use MyApp, :view by use MyApp, :html and invoke embed_template “../templates/my”. Alternatively, you can move both the HTML file and its templates to the controllers directory, to align with Phoenix v1.7 conventions.

More details here.

Not sure what exactly are the 1.7 conventions, but I’m guessing this is the recurring idea of colocating controller, view and templates.

I have a non-trivial app that uses Phoenix views (“dead views”; non-live views). I’ve adopted the colocating approach and recently did full migration to Phoenix.Component-based views. My view macro is basically this:

  def view do
    quote do
      use Phoenix.View,
        root: "lib/myapp_web",
        namespace: MyAppWeb

      # x- prefix for Alpine.js
      use Phoenix.Component, global_prefixes: ["x-"]

      import MyAppWeb.Components
      import Heroicons.LiveView

      # ...
    end
  end

I believe that Phoenix is really pushing the boundaries of modern web apps, including traditional request-response ones. Amazing stuff :clap:

Showing Posts 1 to 10

sergio

sergio

I’m just excited for 1.7 - hope it drops soon! :slight_smile:

AstonJ

AstonJ

Me three! Maybe we should place our guesses on when we might see it? :lol:

knoebber

knoebber

Verified routes!

derpycoder

derpycoder

I have been eyeing Milestone, for Phoenix Framework, every day:

It’s currently at 79%!!


  • I am excited about StoryBook.
  • The new redesigned Tailwind CSS templates, that will get generated.
  • The live auth flow, that will come by default.
  • The new flash slot approach, for modern toast message.
  • Verified Routes.

I might end up listing every feature. :sweat_smile:

16
Post #4
cvkmohan

cvkmohan

Phoenix 1.7 and LiveView 0.18 ETA? - #6 by cvkmohan here I have predicted 2 weeks for both LiveView 0.18 and Phoenix 1.7. LiveView became a reality in two weeks - however, I got the date for Phoenix completely wrong.
Though we may never know the internal planned date by @chrismccord and @josevalim - my suspicion is they added more features to Phoenix as an afterthought into the current version - hence the delay.
In @chrismccord talk at elixir conf - he said merging/removing layouts as a roadmap item - but - it is getting delivered in this release.
Anyway, all excited to receive the new release.

PS: I initially wrote Phoenix is delayed - on re-reading I realized it is offensive. The problem is with my anticipation - not with the release date - because there was no commitment on any date.

knoebber

knoebber

its 100% now!

11
Post #6
sodapopcan

sodapopcan

On top of everything else, I’m really looking forward to phx_gen_auth generating live views. I’m prototyping a new project and was not looking forward to doing the conversion myself yet again. Many thanks and much appreciation to @bemesa21 for doing all that work.

cpgo

cpgo

I’m still not sure why the devs went with a sigil instead of a function/macro.
Something like r("some_route/:id", %{id: id}) to avoid manual string concatenations with the plus side of making it really easy to grep/search and replace.

In the end I cant say I will miss the router helpers as they are today :slight_smile:

LostKobrakai

LostKobrakai

With having the parameters separate you either can’t put in a map like this r("some_route/:id", map) or you won’t have compile time error messages around missed keys.

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
AstonJ
Since we have deprecated our Erlang sections (as we have dedicated Erlang Forums now) let’s add this thread for those who’d like to post ...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews