sounds very interesting! I've been playing with the idea of having virtual/shadow DOM in non-webbrowser languages too. It's great to see that somebody already did that and that it works!
Dne 03.02.2018 v 16:38 Ivo Herweijer napsal(a):
Yes, I know this is a Ruby mailing list and this post is about webdevelopment. But I promise there is a happy Ruby ending to this story.
I have been tinkering with the idea to take this last approach a step further. To skip html altogether and only define the desired structure of an application in code. So let's use Ruby for this and let's call this structure of the application the Ruby Object Model (ROM). Add the needed components of the webapplication to the ROM, a header, an article, a menu, etcetera. And add logic to ROM objects, so when for instance a button is clicked some code is executed belonging to that object. Immediate advantage of this approach is that, apart from specifying CSS rules, we can focus all our attention on one piece of Ruby code.
Now to prove that I'm not just some evil mad scientist and this idea could actually work I have created a gem called Ferro . It can translate the ROM state to the webbrowsers DOM state. It relies on Opal  to run in the webbrowser.
Love to hear what you think about Ferro.
 GitHub - easydatawarehousing/opal-ferro: Ferro is a small Ruby library on top of Opal that enables an object-oriented programming style for creating code that runs in the webbrowser. No more distractions like HTML and searching for DOM elements, just beautiful and simple Ruby code. See the Ferro website for background information and examples.
* **Ferro - No more Html with Opal-Ferro*
 GitHub - easydatawarehousing/ferro: This repo holds the source of the Ferro website. Ferro is demonstration of the abilities and use of the opal-ferro ruby gem.