When you use a front-end framework like React, there are UI changes you can make that must hit the server for information and other UI changes that can be done locally without interacting with the server. LiveView really shines in cases where you’re hitting the server anyway, but JavaScript can be more efficient for client-side-only changes. So, if you want, you can combine LiveView and JavaScript to optimize your site for both types of UI changes. You don’t have to. You can use LiveView exclusively, but the choice to combine LiveView and JavaScript is there if you want it.
Personally, I think React is a bloated choice if you’re going to use both LiveView and JavaScript. In cases where I use both, I typically use a small framework like AlpineJS or vanilla JavaScript for client-side-only changes.
> Personally, I think React is a bloated choice if you’re going to use both LiveView and JavaScript. In cases where I use both, I typically use a small framework like AlpineJS or vanilla JavaScript for client-side-only changes.
Good to know! That's probably why this boilerplate generator only has a handful of (what I think are) smaller JS libs and not Vue/React?
No, the purpose of live view is to act as a "smart server-side caching layer" so you don't throw everything away and start from scratch each time you hit the server.
That’s really not what it is. Live View is a replacement for most of what you can do with JS, but isn’t great for everything. The browser connects to the server via web socket and a process is started to manage the DOM state. Diffs are sent to the browser in response to various events such as clicks on elements or PubSub broadcasts.
innocentoldguy|4 years ago
Personally, I think React is a bloated choice if you’re going to use both LiveView and JavaScript. In cases where I use both, I typically use a small framework like AlpineJS or vanilla JavaScript for client-side-only changes.
void_mint|4 years ago
Good to know! That's probably why this boilerplate generator only has a handful of (what I think are) smaller JS libs and not Vue/React?
dnautics|4 years ago
wrren|4 years ago
void_mint|4 years ago