Right now, the newContent argument passed to the main morph function can be a dizzying array of types:
- Element
- Node
- HTMLCollection
- Array<Node>
- string
- null
Also, for the first 4 types, newContent may or may not be already attached to the DOM, which opens the possibility of additional complications. It could conceivably have hidden state, or have siblings that we don't want to morph, etc.
Can we pare this possibility space down at all, and safely support less use-cases?
@MichaelWest22 has already done some exploration about this in branches:
https://github.com/MichaelWest22/idiomorph/tree/fix-outer-normalize
https://github.com/MichaelWest22/idiomorph/tree/fix-outer-normalize2
Right now, the
newContentargument passed to the main morph function can be a dizzying array of types:Also, for the first 4 types,
newContentmay or may not be already attached to the DOM, which opens the possibility of additional complications. It could conceivably have hidden state, or have siblings that we don't want to morph, etc.Can we pare this possibility space down at all, and safely support less use-cases?
@MichaelWest22 has already done some exploration about this in branches:
https://github.com/MichaelWest22/idiomorph/tree/fix-outer-normalize
https://github.com/MichaelWest22/idiomorph/tree/fix-outer-normalize2