daun / swup-morph-plugin

A swup plugin for morphing DOM nodes in place
MIT License
18 stars 2 forks source link

Consider switching to Idiomorph #14

Open hirasso opened 1 year ago

hirasso commented 1 year ago

Morphdom has a few known limitations if it comes to id-less parent elements. That's why the creator of HTMX has developed an alternative library called Idiomorph. The improvements are being presented quite nicely in the library's readme.

Maybe it would be worth a thought for morph plugin to consider switching to Idiodom?

daun commented 1 year ago

Thanks for calling my attention to idiomorph, it certainly looks interesting. I'll need to check it out and see about backward compatibility. The options and callbacks look like they follow their own naming conventions, unfortunately.

This might be a good fit for the head plugin as well? Not sure if it understands the order of style tags, but probably worth giving it a go.

hirasso commented 1 year ago

I haven't used head plugin yet, so I can't tell if Idiomorph would be a good fit for that plugin as well. But I think it's good to be aware that it exists and especially of the limitations of Morphdom

daun commented 1 year ago

Note to self: idiomorph still looks very interesting but currently has two major flaws: it doesn't support returning false from callbacks to prevent replacing or removing nodes, and it's distributed as AMD only. There's PRs for both of these in the pipeline, but nothing released yet.