crysalead-js / dom-layer

Virtual DOM implementation.
MIT License
30 stars 1 forks source link

calling mount twice etc. #33

Closed ghost closed 9 years ago

ghost commented 9 years ago

I just notice before if you called mount twice on same DOM element, you had an unmount to deal with it. Now it is possible to mount twice, or more. Shouldn't you just check if mounted, and don't re.mount again if mounted?

And it's faster processing a number then a string, so why not validate if the mount id is a number? And have a fast quick up for backing out if the node is something like a window, document, or text node, none of which support attributes or a .getAttribute method? Just to gain better performance?

ghost commented 9 years ago

React fails to unmount a tree inside a event handler, is this a issue with dom-layer? https://github.com/facebook/react/issues/3298

ghost commented 9 years ago

Also check if this is a issue for dom-layer: https://github.com/facebook/react/issues/3799

jails commented 9 years ago

I reenabled the "auto unmount" feature https://github.com/crysalead-js/dom-layer/commit/e6f65c210b88a0fa3d2f84b5dbf0c134890cd673

Otherwise I don't think we have the same issues as React in general. And attributes and properties are manged in a separate way. So all updating an attribute would just work fine.