choojs / nanomorph

🚅 - Hyper fast diffing algorithm for real DOM nodes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

idea: abstract-dom-morph

yoshuawuyts opened this issue · comments

commented

If this library becomes a thing we would probably want to keep parity with the nanomorph diffing algorithm or (yo-yo if they're not keen). It would be cool if we could create a shared testing library that defines all behavior we expect from a diffing library so we can make sure our implementations adhere to this. I would imagine the API would be along the lines of:

const abstract = require('abstract-dom-morph/test')
const nanomorph = require('nanomorph')

abstract(nanomorph)

This could help with a possible migration of choo to a tinier diffing implementation and help foster the creation of new DOM-only diffing algorithms. Thoughts?

cc/ @kristoferjoseph

See Also

commented

That is a great idea!
I actually looked at porting the morphdom tests here using the same line of thinking. Unfortunately the tests are too specific to the morphdom implementation.

In general it seems like a really useful approach to have an abstract to outline the general expectations of a library and how to test it. 👍💯