Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe I'm missing something here, but JS modules do not require a build step.

* Note to non-JS hackers: JS module symbol scope is per-source file.



JS modules can't be imported with a plain script tag.


Script type=module doesn't work?


Not if you want to support the 0.2% market share that IE 11 has.


That's true, but also a trade-off that is a perfectly valid engineering choice for many or even most teams.


HTMX 2 stopped IE support, so that shouldn't be an issue.


we don't :)


we want to support the traditional script tag w/ a src attribute and nothing else


Why?


idk just like it better that way


Chiming in to say modules are awesome and you shouldn't be so scared.


I'm not scared, I just want people to be able to include htmx on their page the same way, for example, good ol'jQuery is included.

We generate esm and cjs modules for people who want to use htmx in that manner though:

https://github.com/bigskysoftware/htmx/tree/master/dist


you can define import maps in a separate <script> tag and reuse the module name elsewhere


sure, but I wanted the same experience of, say, jquery, where you just drop in a script tag w/ a src attribute and it just works

an aesthetic decision, I suppose


Depending on the import tree depth, it significantly increases latency.

(Which is why bundlers still exist.)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: