Remix.run Logo
crimsonnoodle58 16 hours ago

So SSR is 50ms and LiveView is 10ms, what test was being performed to achieve these timings? Rendering a sample page or rendering doom?

Also LiveView is described as "Build rich, dynamic user experiences with server-rendered HTML without writing a single line of JavaScript." and their example uses django templating to render the HTML that is returned.

So what are we really measuring here? The speed up seems to solely come from WebSockets, and maybe skipping some Django middleware. Anyone care to elaborate?

aeonfox 16 hours ago | parent [-]

I assume Django LiveView is directly inspired by Phoenix LiveView. It's essentially diffing template expansion on the backend and sending patches to the frontend via websockets where JS then applies the patches. Clicks and other interactions are also transmitted to the backend where state for the socket is updated and the template is reevaluated, hence completing the loop.

andros 16 hours ago | parent [-]

The concept is correct, but it's a bit simpler Its architecture is explained in the documentation, that's why it's so fast!

zie 15 hours ago | parent [-]

I looked(admittedly briefly) and couldn't find the architecture explanation in the docs here: https://django-liveview.andros.dev/docs/

andros 13 hours ago | parent [-]

I apologize, I assumed the architecture would be understandable from the examples. I'll keep that in mind!

aeonfox 4 hours ago | parent [-]

The docs lead to a 403, but I'd be curious to know how it is simpler. I believe the Phoenix version uses Erlang iolists and immutability to make diffing more efficient, and perhaps the Django version has something similar?

zie 3 hours ago | parent [-]

sorry, try this: https://django-liveview.andros.dev/docs/install/

Though it doesn't answer your question, the link at least works :)