AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including.
What is Phoenix LiveView?
As described by @darinwilson “Phoenix LiveView allows developers to add dynamic, client-side interactions to web pages, using code that runs in Elixir on the server”. This mean you could kiss goodbye to front end frameworks like React and the JS-hell that so many of us have been finding ourselves in these past few years! As you might imagine, the community is very excited about this!
For a more in-depth explanation, check out Darin’s excellent blog post on the topic.
Official URL: GitHub - phoenixframework/phoenix_live_view: Rich, real-time user experiences with server-rendered HTML · GitHub
Original announcement: Chris McCord’s ElixirConf 2018 Keynote
Threads of interest:
- Discussion thread surrounding Chris McCord’s Keynote
- Phoenix LiveView blog posts
- LiveView has gone… Live!
- LiveView demos, examples, and sample apps thread! - #19
- All threads tagged with Phoenix LiveView
- LiveView demos, examples, and sample apps thread!
Screencasts & Talks:
- Getting Started with Phoenix LiveView
- Coding LiveView talk with Bruce Tate
- Chris McCord ElixirConfEU Keynote: Phoenix LiveView - Interactive, Real TIme Apps - No need to write Javascript
Podcasts of interest:
- https://devchat.tv/elixir-mix/emx-020-phoenix-and-liveview-with-chris-mccord/
- SoundCloud - Hear the world’s sounds
When can you get your hands on it?
Chris has said “soon after Phoenix 1.4 comes out” (and 1.4 is due out soon!). Edit: Now! Here: GitHub - phoenixframework/phoenix_live_view: Rich, real-time user experiences with server-rendered HTML · GitHub
Has there been anything like it previously? Has the idea been tried and tested at all?
We’ve put both of these questions together because the answer is yes and yes! There is a similar library in the Phoenix world called Drab, which has proven to be very popular in the community. LiveView tackles the same sort of problem but from a different angle - so if Drab is anything to go by, LiveView is going to be a huge hit ![]()
There is also another similar library that was announced at ElixirConf 2018, called Texas.
There’s now another new library, called Morphling… and… another called Whistle ![]()
Where can I get more details?
Chris McCord’s keynote is currently the best place to get details, followed by the blog posts on the topic as well as Chris and José’s comments in the numerous threads that have cropped up here on the forum.
Demos
-
Chris’s ElixirConf talk
-
Tweet from Chris on Nov 5 2018:
https://twitter.com/chris_mccord/status/1059273315666350080?s=20
- Blog post and another demo:
Trending in Wikis
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 31 to 40- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
chrismccord
debouncing will be part of the initial release for the delay/throttling of events
English3000
@chrismccord, 2 questions:
Any plans for a
LiveViewlinter (so that not everything appears green)? Would be nice to have.One place where React struggles is when one wants an event in a child component to “bubble up” to its parent. Basically, one needs to pass an action function (with a captured reference to the parent’s state).
Alternatively, one can use Phoenix Channels (using channel events for actions–instead of REST–and setting channel event listeners throughout one’s component hierarchy, which can each modify their respective state in a unique way).
Now with Phoenix
LiveView, a new possibility is introduced: component message-passing.Because each component’s state is really just a process with some event handlers, if something happens in one component, just as it can send itself an event (as in your blog post’s examples), it could send an event to another component’s state process.
In order to make these processes accessible, it would be easiest to register each with a name.
Is that possible, and WDYT of this potential design pattern?
chrismccord
Do you mean for syntax highlighting? That would be editor dependent. Here’s my emacs highlighting with mmm-mode:
generic html.leex files are also supported like any other html.eex file.
wrt to messaging passing, you can use registry with the view’s unique ID to messaging b/w parent and children views. We don’t register them by default, but it would be a couple LOC to do it yourself. We’re going to wait a bit with messaging since it’s not clear what the best approach is. For example, ad-hoc messaging b/w react components is known to scale poorly architecture wise, but LiveView’s will likely be less complex so it may be fine.
cnck1387
Do you know of any open source examples that use Unpoly? It’s a pretty big library, but there’s really not too many tutorials written on their official site.
I wonder if there’s a way to only pull in a tiny aspect of it, although going by their docs, I’m not even sure what aspect I would use to pull in ajax content. I guess ajax.accel, but it’s also tagged as experimental.
vans163
I started working on a lightweight lib to do what LiveView does except without a dependency on Pheonix, because simply cannot wait for LiveView code to be posted to github, if anyone interested check it out GitHub - vans163/morphling: Server driven DOM morphing library. Never write Javascript again. · GitHub (forum thread)
ATM I wanna ask how LiveView does the DOM diffing on the server side? Its actually quite challenging to figure out how to send the differential between 2 binaries.
OvermindDL1
What tutorials are you needing? Unpoly.js is very piecemeal, only use what you need, and all the features have great documentation. If any of the documentation is lacking then I’d assume telling them on their github repo would be best, but I’ve never had an issue with the documentation as it seems quite comprehensive?
It’s an older style library sadly, not built using modern modules, though it looks like they are slowly moving that way.
zachgarwood
I can’t find any information on the ~L sigil used here. Is this LiveView-specific? Where does it come from and what does it do?
cnck1387
Right, I wouldn’t want to bring in a 109kb library (the minified unpoly JS size on github) just for a few ajax calls since I imagine most of my other things (like video progress tracking, search autocomplete, etc.) could be done with liveview?
OvermindDL1
Sounds like you are a usecase to make PR’s to them. ^.^
cnck1387
Probably not haha. Unpoly is a massive ball of coffeescript and I already hate JS enough as it is.
I will have to use something though because liveview isn’t looking like a good fit to transmit 10kb+ of html between browsing tabs.