I back to writing server side rendered templates with for-free reactivity. Give it a try it's very productive
I back to writing server side rendered templates with for-free reactivity. Give it a try it's very productive
As someone who knows js really well, I love liveview's hooks system. the js interop is the bees knees and lets me save my js chops for where I really need it. Also, I can emit js events that get picked up server side and vice versa. ie: no having to write any ajax calls. My frontend can react to server events with very little boilerplate. Thats a WAY better proposition than merely zero js.
PS: the frontend buildchain is esbuild so you get out of the box support for typescript.
You could rig something up in probably 2-3 days if that was super important for you.
I did manual typing at the edges and that sufficed for me.
Having to call tsc separately from my dev/watch process is not a good developer experience. Same as with ... dialyzer :)
But for sure, that would decimate esbuild performances.
My comment on value is mainly one of "all or nothing". I think a manual typing at the edge is probably sufficient for most people.
That said, you could implement all of your forms and events as structs or schemas and rig up a piece of the dev process to convert them into types. I think many in Elixir would view it as overkill so it hasn't been done afaik. But I also think it could be implemented very easily and then you'd have end to end typing.
High latency isn't an issue if you do it correctly by using the loading classes and what not so that the user knows they are waiting for some data to load. It's pretty much identical to a typical React SPA that has to show loading indicators while waiting for a JSON call to complete.
If you're talking about "slow" internet, then use Alpine JS to run truly client-side things in those very rare cases.
There are very few problems Live View isn't good for, and conversely, there are very few problems client-side single-page application are necessary for.
It handles crappy connections ok -- it will auto reconnect as needed.
As far as full offline -- it has interfaces to easily alert the user via UI that they are disconnected, however, just like 99.999% of non liveview apps when you are offline things start breaking (load just about any static page site and submit a form or navigate when offline).
You realize that js and java are the native languages for the web and Android, right?
JavaScript...I didn't mind how quirky it is when it was SSR + a little jQuery for interactivity. nodejs, asset pipelines like webpack, React make me want to barf. They haven't improved at all.
LiveView looks very interesting and I wish Phoenix/Elixir was an option for me.