model garbage collection on bound node deletion/removal

27 views
Skip to first unread message

Jon Rose

unread,
Aug 9, 2013, 8:54:51 PM8/9/13
to polym...@googlegroups.com
Is there any information or consideration being given to managing model objects of nodes which have removed from the DOM? It seems like when a node is deleted/removed it might make sense to garbage collect the model object to it doesn't linger for large web applications. I haven't dug into ChangeSummary, or I should say ObserveJS now, but I would imagine this would be doable. 



Thanks for any info



Jon

Steve Orvell

unread,
Aug 9, 2013, 9:02:00 PM8/9/13
to Jon Rose, polym...@googlegroups.com
Polymer-elements automatically unbind when they are removed from the document. This is done asynchronously such that the bindings are preserved if the element is stuck back into the document before end of microtask. Its also possible to call this.cancelUnbindAll() to prevent unbinding in the leftDocument callback.

In addition the Template-instantiation library automatically unbinds template instances that are removed due to changes in the model of a template that is set to repeat.


Follow us on Google+ : plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Eric Bidelman

unread,
Aug 9, 2013, 9:14:12 PM8/9/13
to Steve Orvell, Jon Rose, polym...@googlegroups.com
We don't have proper docs on this stuff yet, but there's a blurb explanation

Jon Rose

unread,
Aug 9, 2013, 9:28:23 PM8/9/13
to polym...@googlegroups.com, Steve Orvell, Jon Rose
Thanks for quick responses.

Steve's response and the changelog help clarify things a bit. Is this functionality only supported by polymer.js and not by platform.js and the MDV polyfill?

I am attempting to use these libraries from Clojurescript which is preventing me from using the mustache syntax for data binding due to how cljs renders html forms. I am hoping to not have to recreate functionality that is already there in Polymer but I am not sure if there is a way around it which is why I am trying things out via MDV initially

Jon Rose

unread,
Aug 9, 2013, 9:30:10 PM8/9/13
to polym...@googlegroups.com, Steve Orvell, Jon Rose
also, FYI the MDV Expression Syntax link is dead on github ;)

Eric Bidelman

unread,
Aug 9, 2013, 10:17:43 PM8/9/13
to Jon Rose, polymer-dev, Steve Orvell
There was some repo changes today. Raf broke out the separate pieces of MDV and created a  repo for each.

Expression Syntax is now "PolymerExpression":
Reply all
Reply to author
Forward
0 new messages