by brightball · 7y ago · 0 comments
Nerves, which is already being heavily used for embedded systems and only getting stronger thanks to the likes of Scenic.
And Phoenix LiveView (not released yet), which I personally think pulls the strengths of Phoenix together in a way that can truly disrupt web development. It’s very difficult to do what LiveView is doing on other tech stacks.
The combination of those two will likely fuel things long term.
LiveView still needs more work to be really ergonomic, wouldn't work for all use cases, but I'm personally holding my breath here in excitement to adopt it in my Elixir projects.
Still, I find it ironic that the next server side web technology leap, after the famous Rails demo referenced in the article, comes from another Ruby-inspired language.
It’s not at all the same thing as Ruby on Beam though - it’s a very different language, but it does borrow a lot of good ideas from the Ruby ecosystem while improving on them in many ways.
https://docs.microsoft.com/en-us/aspnet/core/blazor/?view=as...
While it sounds expensive at first, the template engine has been extended to support delta tracking and the process model that Elixir inherits fits well for a heavily interactive system with thousands or millions of users. The end result is that it's a very lightweight client setup and outside of using the template system properly, there are no gotchas with learning which code runs where.
I didn't use Blazor yet, but that's what I understand from the documentation.
I’ve interviewed plenty of people who cut their teeth on Rails and fall apart as soon as you present them, say, Sinatra. Or a gem that provides an API client. Once it comes to writing non-Rails code (with all the helpers and the magic), it’s as good as learning a new language that happens to look exactly the same.
LiveView cannot avoid latency. When I've experimented it's great for something running on my local network; less good when it's in a datacentre in another country. It's laggy.
And unless you replicate to many locations, or can deploy it to edge compute nodes (no idea) then this will always be a problem compared to 'true' client-side development.
I want it to work but I don't see how it can beat the laws of physics.
If you built a traditional SPA, aren't you still making loads of calls to your server?
I don't see how LiveView would be more laggy than that. In both cases you're making network calls from the user's machine, to your server, getting a response from the server and then rendering output on the client when it's received.
Of course you can cheat and do optimistic rendering on the client (like outputting what you wrote instantly in some DOM element instead of waiting for a response and validating it after the fact) but I believe that enhancement could be done with both techs.
The only place where LiveView falls short is a true offline / fully client side app, but those are such a rare breed and way out of the norm for a typical web app. In 20 years of web dev as a freelancer, I've been asked 0 times to build an offline / client side JS app.
For data loading, yes. But here's a few random thoughts:
* I can pre-emptively load data in a SPA (think: 3 screens-worth of a datagrid) and keep fetching in advance, so the user rarely feels the lag.
* Much of my investigation has been around adaptive forms, wizards, validation and keeping logic in a single place. Having to define models and logic once, rather than client-side and server-side would save so much time.
My testing suggested that client-side validation still gave better results, because it was instant. Moving forward & back through a wizard was better if client-side rather than each screen rendered server-side.
I experimented early May so am a little hazy on details (and can't find which PIM I put my notes in, sigh) and look forward to seeing other people's experiments. Particularly when not run on their local machine.
In some cases yes, but I don't think you can get away with client side validation for a lot of things because they depend on the state of your database to return the correct result.
For example, how would you validate an email or username on the client when the availability of the name depends on you making a database call to see if a user exists already? You have to make a network call, get the result and then update your validation errors on the client based on that server side result.
But for validating something like a phone number or twitter handle, sure, client side works all the way but I don't think having even 200ms of delay for that validation is going to make for a bad user experience. 200ms is a lot too. That's about what it takes to ping a server in Tokyo from New York.
Your other points are valid tho. I guess we'll see where LiveView ends up going.
It’s not going to fail to ‘work’ because of this. It just has a niche and isn’t a general purpose web framework.
I’m looking forward to building some admin tools with it, reducing the complexity required when having to deal with server and client separately.
All our tools are now hosted in the cloud - we don't run any servers on the local network. With a 20-30ms RTT perhaps it will feel smooth - or the micro-delays will be noticeable.
.optional {
display: none;
}
input:checked ~ .optional {
display: inherit;
}1. unpoly to handle common JS behaviours (such as show this div when this checkbox is selected)
2. Web components to handle more complex pieces of UI while maintaining compatibility with LiveView: rendering a functional jQuery carousel via LiveView/Websockets is much harder than just pushing a <carousel> element through the socket. Admittedly I haven't tested if the DOM diffing library LiveView uses plays nice with web components.