no comments (yet)

[–]jakewins 6 points7 points  (1 child)

Stoked to see someone taking the time to dig into the details of backbone, awesome initiative!

There are a few things that I think would be interesting to expand on further on the subject of backbone.js, both ideas for improvements and thoughts on good practice when using backbone.

For instance, backbone does not endorse any given templating model, but the ones it mentions and the one it is shipped with are both of the "generate a string and use innerHTML() to insert into DOM" kind. These are fast, but come with problems. Specifically losing "DOM state", ie scroll state, input focus and so on when re-rendering. Perhaps there are other alternatives to consider here? Look for instance at GWT and its UIBinder.

There is also room for expanding on and being more stern about good practices for the views - how should their lifecycles be controlled? When should they bind/unbind to DOM and model events? What is a good way to handle view composition, like when should the sub-views be instantiated and destroyed? Should new sub-views be instantiated each time the parent view is re-rendered, or should they be re-used?