Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a server side DOM to make more efficient updates #20

Closed
aalin opened this issue Oct 22, 2022 · 2 comments
Closed

Implement a server side DOM to make more efficient updates #20

aalin opened this issue Oct 22, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@aalin
Copy link
Contributor

aalin commented Oct 22, 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.

@aalin 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
@aalin aalin added the enhancement New feature or request label Nov 1, 2022
@aalin
Copy link
Contributor Author

aalin commented Mar 24, 2023

Better find a way to do granular updates.

@aalin
Copy link
Contributor Author

aalin commented May 9, 2023

Better do granular updates. :)

@aalin aalin closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant