davidjamesstone / superviews.js

Template engine targeting incremental-dom
http://davidjamesstone.github.io/superviews.js/playground/
246 stars 15 forks source link

Add support for skipNode #17

Open dak opened 8 years ago

dak commented 8 years ago

Add support for the skipNode method in addition to skip. See: https://github.com/google/incremental-dom/commit/ec0537be2a698f33c44565702fdb8b33b03ec724

This was only added a few weeks ago and has yet to even be rolled into a release yet, so this is a bit of a preemptive request for the time being.

Additional thought: Would it be useful to add support for skip and skipNode tags in addition to attributes?

davidjamesstone commented 8 years ago

Thanks for the heads up on skipNode. I'll look into what uses it brings as I'm unsure what it brings at the moment.

See this issue for a previous discussions on skip tag:

https://github.com/davidjamesstone/superviews.js/issues/10

It didn't seem to make much sense to have one.

dak commented 8 years ago

The most obvious use case I think I've seen so far is when an element is manipulated by a 3rd party or expensive script that you don't want patch to touch. For example, if you're using the Google Maps API and attach it to a DOM node. Without skipNode, patch will redraw the DOM as it was supposed to be (eg, an empty div), rather than how it should be after being manipulating by Google Maps.