bigskysoftware / idiomorph

A DOM-merging algorithm
BSD 2-Clause "Simplified" License
631 stars 31 forks source link

idiomorph-ext.js is not bundler-compatible #39

Open pbowyer opened 4 months ago

pbowyer commented 4 months ago

Thanks for adding idiomorph.esm.js to the repository! However when using with htmx the idiomorph-ext.js version isn't able to be imported and make Idiomorph accessible in the script. The workarounds in https://github.com/bigskysoftware/htmx/issues/1690 don't work for this script.

As a workaround I imported the ESM version and then copied the extra function at the end into my script.

I think my favourite outcome would be to change idiomorph-ext.js to be only this bit of code, and then using HTMX with Idiomorph (without a bundler) would require 3 imports:

htmx.js
idiomorph.js
idiomorph-ext.js