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.
9 Likes
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
6 Likes
gdub01
October 19, 2021, 2:15pm
3
This talk and tech is so incredibly awesome. Enjoyed every minute. Slots, JS, and navigating over websockets… super great! ty!!
4 Likes
Sebb
November 8, 2021, 10:40pm
4
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()}>
1 Like
tmjoen
November 9, 2021, 1:27pm
5
Sebb
November 9, 2021, 2:29pm
6
I’ve read that, but being lazy, I’d like a working demo-project.
2 Likes
livebook-dev:main
← livebook-dev:jk-js-new-dir
opened 04:09PM - 03 Nov 21 UTC
Closes #574.
https://user-images.githubusercontent.com/17034772/140098515-c… bca3478-458f-45e6-9445-e865ad3ed887.mp4
This feels like a good starter for JS.
1 Like
I think that this commit contains the code that Chris used in his talk:
committed 02:29PM - 05 Oct 21 UTC
1 Like
Sebb
November 10, 2021, 5:57am
9
Nice, I checked there earlier, but it didnt find any JS
usage then. This repo is a real treasure trove, studying it is highly recommended.
Yes thats it, thank you.
Sebb
November 11, 2021, 5:46pm
10
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-cmds
branch
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 %>
2 Likes