These are chat archives for tiagorg/marionette-vdom
hey @M3kH - the lib virtual-dom is using Saucelabs to provide a full chart of cross-browser testing -> https://github.com/Matt-Esch/virtual-dom
you are totally right, it would be very interesting to do something similar here. I will have a look on this tomorrow.
@tiagorg Yes I got, and I'm sorry to criticise this cool work!
My preoccupation start to the fact this would not be part of Marionette but just an add-on, since this is the approach; I see the limitations it brings.
For instance, I can clear see by the code that we do:
"string tmpl" -> _.template() -> template(data) -> string -- to -- dom --> diff and append;
Now has I was used to distribute compiled templates on my CI just to make sure to save one step to the browser; IMHO should be like this:
"string tmpl" -> _.template() + vdom -> template(data) -> diff and append
In this way templates can be optimised before.
IMHO this project should be or detached by Marionette it self and be one step before has replacement for string templates engs. Or embraced by Marionette has template engine. In this way we could really compare with new dom framework approach.
Then looking around I found really interesting this library https://github.com/gcanti/uvdom try to take a look at it, maybe can be inspiring.
I will try to do a prof of concept to implement mustache -> uvdom -> (your vdom engine) -> your tmpl();
pretty much, modify
_renderTemplate method to immediately VDOMize the template before applying the data
I just couldn't see how can this be done generically, before applying the data, let’s say a solution that would work for any templating engine - because I believe the way each templating engine binds its data would be particular to each engine