5 ms·
I'm so excited for Phoenix 1.6. I think Phoenix was almost onto gold with LiveView when introduced, but it was still a little rough around the edges. But Phoeni
by losvedir 5y ago
I'm so excited for Phoenix 1.6. I think Phoenix was almost onto gold with LiveView when introduced, but it was still a little rough around the edges. But Phoenix 1.6 should sand away all the roughness, and we'll be in an awesome place.
Basically, the issue before, IMO, was kind of a tension between "live controllers" and (they call them "dead" but I prefer "static") static controllers. You couldn't necessarily interleave them super well, and factored templates had issues when used in one place or another. (I'm not an expert here, this was just from some testing and dabbling.)
But now (or well, soon), there's going to be a unified "heex" format which works in both. You write components almost like React components, their structure is parsed to some extent to catch simple typos and bugs, and can pass in "props" as arguments. And said components can be re-used in both live and static controllers.
Basically, channels were Phoenix's killer feature, LiveView sort of abused them to show a promising new way of developing web apps, and now I'm hopeful we're just about at a point where Phoenix can settle down into a new normal with function components on hex.pm and easy and pervasive LiveView pages and widgets, added in easily to your existing, standard Phoenix apps.
And, combined with the recent announcement of the removal of node+npm+webpack by default, in favor of esbuild, I think Phoenix 1.6 is going to be a no-brainer choice for any new web apps going forward.
- spiderice 5y agoWow, this is great news! I had not heard about that, but making live and static controllers work together has always been a pain point for me. Even with that pain point Phoenix has been my go to. But fixing that will be huge.
- mrdoops 5y agoThey're also separating out Phoenix.View so there will be less dependencies on using Phoenix view rendered templates for things like email or PDF generation outside of a web layer.
- jms55 5y agoThis is great news for me! Around 8 months ago I built a chess website using Phoenix (heavily using LiveView) and TailwindCSS. My two biggest complaints were exactly what you said: 1. LiveViews were kind of weird to fit in, as they were a separate format 2. Webpack was the bain of my existence, it was slow and hard to figure out as a first time webdev Glad to hear this is being fixed! Looks like I'm going to have to go back and update the site
- conradfr 5y agoI haven't use LiveView since the introduction of components, it'll be a good occasion to try it again. But to be honest about the "no-brainer" part, I'll probably stick to using Phoenix for apis and websockets because I'm personally firm on not using a framework that use the (IMHO) outdated layout->view model for displaying HTML.
- spiderice 5y ago> the (IMHO) outdated layout->view model for displaying HTML What is the modern model that you do use? Phoenix is very flexible and I'm wondering if it could easily be added manually.
- conradfr 5y agoTemplate inheritance with blocks, as they do in Django or Symfony. That way you don't have layouts anymore, but (usually) a base template that an action view overloads with its own content. I know Ruby on Rails doesn't work like that so I guess that's why it didn't take in Phoenix (yet?).
- sergiotapia 5y agoI created a new app with Phoenix 1.6 using esbuild and mount LiveView components just like they were react components. I'm done with client-side apps. I had no idea how SHIT the workflow was. I just got used to the stench. Good riddance to webpack too.
- therein 5y agoIt is going to be good being able to pass props to these LiveView's. I remember that wasn't possible and I needed all sorts of workarounds.
- louissm_it 5y agoHeex templates alone are going to be a game changer. I've been looking for 1.6 updates every day - can't wait for the release. I'm hoping the development of community libraries will pick up again. Coming from Rails, gems like Pagy, Ransack & Pundit are hard to live without.
- elcritch 5y agoDo you know if HEEX will support slots like in Surface? It really makes it easier to rewrite usable components.
- chrismccord 5y agoNot with LV 0.16, but slots is one of our top priorities after Phoenix 1.6 / LV 0.16 is out
- nickjj 5y agoIs there a slot-like alternative for the time being? Or maybe a gist'able module that can be added to get preliminary slot support into 1.6?
- porker 5y agoYes, community libraries are a key part of the overall experience of using a framework and being productive.