Closed brechtcs closed 6 years ago
Hmmmmm, I've got feelings about this. So far in Choo we've tried real hard to only use DOM builtins. For everything. The nanommorph
library could in theory be used as the basis of a web spec. So I'm a little reluctant to add non-standard attributes, as they kinda go against that. Does that make sense?
IMO the isSameNode
method is sufficient.
ping @brechtpm; you okay if we would close this? Want to make sure you won't be stuck; if there's some functionality we aren't covering, we probably should take care of it.
Nope I'm not stuck. At the moment I'm just experimenting with some other ways to implement server-side rendering and rehydration, and I anticipate something like this could become useful at some point.
I'll try open a new issue when I have a more concrete use case, and then we move on from there.
This PR makes it possible to control
isSameNode
behaviour through adata-same-node
attribute in the element markup. I think this results in a slightly more idiomatic syntax when using this inchoo
, for example:If you're interested in merging this, I'll add some documentation to the "Caching DOM elements" section.