- The main goal is to improve the solution to be less scenario-specific and more reusable, playing with foundational methods and event handling
- Switched the virtual el setup from
initialize
tosetElement
.
- The main goal is to prove the concept of Virtual DOM over Backbone Views as it was suggested on a Marionette.js thread
- Based on virtual-dom
- Each view's render will compare to its previous state and only diff to it.
- I was able to verify it does really work by comparing DevTools output for 2 scenarios, virtual vs non-virtual:
Notice the increasing number of Nodes, from 628 to 629 in 10s. The Used JS Heap is pretty high and increasing.
Notice the number of Nodes stays on 403 over the same 10s. There is also plenty of more JS happening (2nd image) but the Used JS Heap is much lower.
- The code is not very neat, it is making certain assumptions about the Backbone.View's
el
as it is appending the internal virtual element into it. We want to avoid that by working withsetElement
method from Backbone.View. - As far for Marionette.js: @samccone and @jmeas suggested using Marionette.View as a base class and from there see if we can get event registration and UI working. Also, strive for supporting a
itemView
replacement. We should fork this project for Marionette.js specific code. - Yet another alternative to vdom would be going with HTMLBars. We should learn up until which point is it worth to continue playing with VDOM.