TLDR: Early access to our Phoenix LiveView course is now open… and it’s free! The first 7 videos (75 minutes) are available, along with exercises and notes. And with that foundation in place, we’ll incrementally release new videos and more advanced LiveView examples as they’re ready in upcoming weeks.
I realize a lot of you on this forum are already deep into LiveView. But you may have friends who are trying to figure out what makes it unique. So the first video answers the question “What Is LiveView?” in just 4 minutes:
Then in the second video we build a basic LiveView step-by-step as an introduction to LiveView’s simple (and fun!) programming model:
But as we all know, even with a simple example there’s a lot going on behind the scenes. And to use LiveView effectively, it’s vital to have a good mental model of the lifecyle and what’s on the wire. Plus, the optimizations are just really clever! So that’s the focus of the third video:
In subsequent videos we build more LiveView examples with increasing complexity. We hope after watching these videos you’ll be inspired to build amazing and useful things with LiveView!
This course is our way of saying “Thanks!” to the Elixir/Phoenix community. @josevalim, @chrismccord, and contributors to LiveView have done an incredible job creating a library that is both really fun to use and really powerful.
Just finished the available modules and came here to talk about that.
Great content and presentation. Videos are very focused and each one of them explains some cool details about what’s being transmitted back and forth on the websocket.
One question though: is Pragmatic Studio in any way affiliated to the Pragmatic Bookshelf? Asking because the site having the same logo font and similar name made me think it belongs to the same entity, so I initially tried to login with my PragProg account but it did not work. I changed my PragProg password after that, but felt a bit weird.
EDIT: I see that Pragmatic Studio and Pragmatic Bookshelf are separate entities. Sorry, I was just being a little paranoid as I have quite some value accumulated in my PragProg account…
This is a really great set of videos! I haven’t spent any time with LiveView yet, but after watching the videos, I feel pretty confident about getting my hands dirty soon. Thanks!
First, thank you to Mike and Nicole for putting this together. Extremely generous of you to spend the time, and very helpful.
In the first example (Porch Light), I noticed that the up/down buttons can exceed the expected range (negative numbers, numbers above 100). I know this isn’t the focus of the course, but what is the most idiomatic way to constrain them? Elixir wouldn’t let me use socket.assigns.brightness inside a guard clause. I eventually came up with this:
def handle_event("up", _unsigned_params, socket) do
case socket.assigns.brightness do
100 -> {:noreply, socket}
_ -> {:noreply, update(socket, :brightness, &(&1 + 10))}
end
end
def handle_event("down", _unsigned_params, socket) do
case socket.assigns.brightness do
0 -> {:noreply, socket}
_ -> {:noreply, update(socket, :brightness, &(&1 - 10))}
end
end