Hi all,
I am trying to convince my team to use liveview over the current react. What are some of the points where one should consider using liveview instead of react?
To start off:
Using one language to code frontend and back saves us from context switching
Arguably easier to do as there will no need for data serialising and de-seriialising or REST
I am new to liveview, familiar with elm, rescript-react, angular, and various ssr solutions before SPA’s came around.
I am trying to figure out if there are operational downsides to using liveview, since it sounds like liveview changes you from running a mostly stateless backend to a stateful backend? Do you have to put more effort into horizontal scaling and thinking about node fail over?
That’s a pretty long article, but there’s probably 1000 words on phoenix liveview performance, maintainability, etc… but at the end of the day it really depends on your application.
For me the biggest advantage is keeping all data management in one place. With a react front end, you basically have 2 applications, and each requires its own set of patterns, tests, etc to deal with state. In comparison with just react (it is of course possible, arguably necessary, to leverage other libs to help) live view is a lot more equipped to do this in a robust, reliable way.
In my experience, unless you have absolute top of the line expert react devs, you are looking at 3 or 4 or even more times as much dev time.
I guess this falls under “no need for API” but i feel that formulation drastically undersells the advantage.
I have found that this is actually a great selling point for LiveView. A sizable minority of developers cannot stand writing anything in JS and choose LiveView for that reason.
Another thing is testing. LiveView tests are relatively painless to write. You can bolster this by pointing out that many developers are allergic to testing or documenting anything, and LiveView makes it considerably easier to coax your devs into doing so.
In my experience, LiveView is faster than React (resulting in a better user experience), is truly multi-threaded rather than using an event loop, is easier to debug, requires a lot less code, and is easier to manage state. The fact that it isn’t JavaScript is also a big win, in my opinion.