TwistingTwists
Watching Phoenix LiveView Talk by Chris McCord
I am in middle of watching this. I have to stop every minute and think over what Chris just said.
The amount of info he sends over that youtube video in one minute is more than a page of a book ![]()
Am i the only one who feels that way?
P.S. : I am 15 minutes past in this video and it’s been more than an hour looking at newly generated phoenix folder and understanding what he is trying to explain.
Most Liked
MobileDev360
JS.* is really nice feature! Because things like hide/show and over simple user interactions has required external javascript library like Alpine.js to work without server interactions, but now JS.* will do all of that
gdub01
This talk and tech is so incredibly awesome. Enjoyed every minute. Slots, JS, and navigating over websockets… super great! ty!!
Sebb
I’ve read that, but being lazy, I’d like a working demo-project.
Sebb
Just had a look at this. The demo is there and running but relies on some local files, here are the steps to get it running.
- clone and checkout
cm-js-cmdsbranch - in
/assets/js/app.js
- import {LiveSocket} from "./phoenix_live_view"
+ import {LiveSocket} from "phoenix_live_view"
- in
mix.exs
- {:phoenix_live_view, path: "~/oss/phoenix_live_view", override: true},
+ {:phoenix_live_view, "~> 0.17.0"},
- update deps, setup ecto
- demo is at
/posts(not on the overview page)
EDIT:
found one more thing to update:
--- a/lib/demo_web/live/post_live/show.html.heex
+++ b/lib/demo_web/live/post_live/show.html.heex
@@ -1,14 +1,16 @@
<h1>Show Post</h1>
<%= if @live_action in [:edit] do %>
- <%= live_modal DemoWeb.PostLive.FormComponent,
- id: @post.id,
- title: @page_title,
- action: @live_action,
- post: @post,
- return_to: Routes.post_show_path(@socket, :show, @post) %>
+ <.modal
+ component={DemoWeb.PostLive.FormComponent}
+ id={@post.id}
+ title={@page_title}
+ action={@live_action}
+ post={@post}
+ return_to={Routes.post_show_path(@socket, :show, @post)} />
<% end %>
Sebb
Great Talk, great new features!
Is the code for the LiveView.JS part (ElixirConf 2021 - Chris McCord - The Future of Full-stack - YouTube) available somewhere?
Or any other material about this?
I’m not sure what’s possible with the tools provided. E.g. can I do sth like this:
<button phx-click={JS.push("clicked", value: someCustomJavascriptFunction()}>







