You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be great to implement a DOM in Ruby and apply the VDOM-patches to the server side DOM, and then morph it kinda like morphdom does...
That way, less HTML would have to be updated each time, element reuse would be more efficient, because diffing would be done on element level and not on component level, so if different components return the same type of elements, their actual DOM nodes could be patched instead of replaced..
And if a visitor loses the connection somehow and is unable to resume the session, they could serialize the DOM and send it to the server, and the server could then render the app and make patches against the DOM that the user had at that moment... Right now with the "new" server, a full page reload is required when that happens...
It would just make everything more robust...
Could maybe even be of help to #18, because these DOM-subtrees could probably be hashed quite efficiently..
I might make an attempt at something like nanomorph and see where it goes..
It should probably be called SDOM... The VDOM updates the SDOM which then creates patches for the regular DOM... And the SDOM can be recreated from the browser DOM when resuming/reinitializing..
It would maybe actually be possible to use Nokogiri for this. I'm currently looking into how to use Nokogiri in tests
UPDATE: Been watching a few streams by SolidJS author Ryan Carniato. I'm trying to understand how signals and SolidJS work. Maybe could ditch the VDOM and just use a nokogiri-based DOM on the server.
UPDATE2: Been watching more videos and doing some experiments. Better use Ryans approach and do more granular updates instead. What I was thinking before would probably be less performant.
The text was updated successfully, but these errors were encountered:
aalin
changed the title
Implement a DOM-like VDOM to make more efficient updates
Implement a server side DOM to make more efficient updates
Oct 29, 2022
Would be great to implement a DOM in Ruby and apply the VDOM-patches to the server side DOM, and then morph it kinda like morphdom does...
That way, less HTML would have to be updated each time, element reuse would be more efficient, because diffing would be done on element level and not on component level, so if different components return the same type of elements, their actual DOM nodes could be patched instead of replaced..
And if a visitor loses the connection somehow and is unable to resume the session, they could serialize the DOM and send it to the server, and the server could then render the app and make patches against the DOM that the user had at that moment... Right now with the "new" server, a full page reload is required when that happens...
It would just make everything more robust...
Could maybe even be of help to #18, because these DOM-subtrees could probably be hashed quite efficiently..
These libraries look pretty interesting:
I might make an attempt at something like nanomorph and see where it goes..
It should probably be called SDOM... The VDOM updates the SDOM which then creates patches for the regular DOM... And the SDOM can be recreated from the browser DOM when resuming/reinitializing..
It would maybe actually be possible to use Nokogiri for this. I'm currently looking into how to use Nokogiri in tests
UPDATE: Been watching a few streams by SolidJS author Ryan Carniato. I'm trying to understand how signals and SolidJS work. Maybe could ditch the VDOM and just use a nokogiri-based DOM on the server.
UPDATE2: Been watching more videos and doing some experiments. Better use Ryans approach and do more granular updates instead. What I was thinking before would probably be less performant.
The text was updated successfully, but these errors were encountered: