اضافه شدن stream به Phoenix LiveView

با درود خدمت همکاران محترم.
در چند روز اخیر جامعه elixir خبر های خیلی خوبی از به روز رسانی برخی از کتابخانه ها و همینطور فریم ورک های محبوب الیکسیر شنیده است. یکی از این خبر ها Phoenix نسخه ۱.۷ منتشر شد می باشد که در پستش در موردش صحبت کردیم

مقاله زیر به دست سازنده خود Phoenix نوشته و منتشر شده است که در مورد stream در Phoenix LiveView می باشد

لینک مقاله:

اگر در مورد این کتابخانه اطلاعات ندارید می توانید لینک زیر رو مطالعه کنید

https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html

توضیح انگلیسی اون

LiveView provides rich, real-time user experiences with server-rendered HTML.

The LiveView programming model is declarative: instead of saying “once event X happens, change Y on the page”, events in LiveView are regular messages which may cause changes to its state. Once the state changes, LiveView will re-render the relevant parts of its HTML template and push it to the browser, which updates itself in the most efficient manner. This means developers write LiveView templates as any other server-rendered HTML and LiveView does the hard work of tracking changes and sending the relevant diffs to the browser.

A LiveView is just a process that receives events as messages and updates its state. The state itself is nothing more than functional and immutable Elixir data structures. The events are either internal application messages (usually emitted by Phoenix.PubSub) or sent by the client/browser.

LiveView is first rendered statically as part of regular HTTP requests, which provides quick times for “First Meaningful Paint”, in addition to helping search and indexing engines. Then a persistent connection is established between client and server. This allows LiveView applications to react faster to user events as there is less work to be done and less data to be sent compared to stateless requests that have to authenticate, decode, load, and encode data on every request. The flipside is that LiveView uses more memory on the server compared to stateless requests.