5 ms·
I think there is one pattern missing here. I've been working on a framework that has a server side virtual DOM, so all rendering happens on the server and updat
by quechimba 4y ago
I think there is one pattern missing here. I've been working on a framework that has a server side virtual DOM, so all rendering happens on the server and updates are streamed to the browser. Kinda feels like React, but it's 100% server side. https://github.com/mayu-live/framework https://github.com/mayu-live/framework
- culi 4y agoLike hotwire? https://hotwired.dev/ https://hotwired.dev/ If it's just component rendering then how does it differ from Streaming SSR?
- quechimba 4y agoStreaming SSR, as I understand it, does not keep a session alive on the server, so if you make interactive components they will still run in the browser. So I think it's more like Hotwired, because it keeps a session alive on the server, but it's declarative like React, so you just return whatever you want rendered and the VDOM will generate patches for the browser.
- tiberriver256 4y agoInstead of transferring entire components it transfers only the content that has changed since the last render. So if you have a like button with the number of likes totalling 3, and someone were to hit the like button to increase the count to 4 the only content transferred would literally be a string value of '4'
- irrational 4y agoIf it literally only transfers “4”, how does it know where to put it?
- dmitriid 4y agoMore like Phoenix LiveView: https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html
- wizofaus 4y agoIsn't that more or less what ASP tries/tried to do? What format are the updates in?
- quechimba 4y agoThe format of the updates is a basic structure that represents a DOM-operation and an ID and some data, which is packed with MessagePack and streamed over HTTP/2. I never used ASP, but someone told me that my framework reminded them of JSF (JavaServer Faces).
- wizofaus 4y agoASP sends actual HTML! And definitely not http/2.
- pjmlp 4y agoYou're forgetting that ASP has many versions, unless you're speaking about the original one. For example, Blazor definitely is capable of http/2.
- wizofaus 4y agoYeah, haven't used it seriously in many many years, which is why I hedged my bets with the past tense option!
- quechimba 4y agoBlazor Server looks pretty interesting, I had never heard about it! It sounds more or less like what I'm trying to do. Gonna read the documentation, maybe I can find some inspiration. I've mostly looked at JavaScript frameworks and libraries until now. I really liked working with Vite+React+TypeScript because of the feedback loop and fast updates, and I thought it would be nice to have the same thing in Ruby.
- sebazzz 4y agoSo which works like Blazor Server?
- eurasiantiger 4y agoWon’t you need the server to store state for all clients?
- quechimba 4y agoYes, the state is stored in memory, with async tasks and everything. There is a mechanism so that before a server shuts down, the state for each client will be serialized, compressed, encrypted and sent to the client, so they can send the state to the next server when they reconnect and resume the session.