8 ms·
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.
by everybodyknows 2y ago
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.
- recursivedoubts 2y agoJS modules can't be imported with a plain script tag.
- throw5959 2y agoScript type=module doesn't work?
- rob 2y agoNot if you want to support the 0.2% market share that IE 11 has.
- danpalmer 2y agoThat's true, but also a trade-off that is a perfectly valid engineering choice for many or even most teams.
- cryptos 2y agoHTMX 2 stopped IE support, so that shouldn't be an issue.
- knowitnone 2y agowe don't :)
- recursivedoubts 2y agowe want to support the traditional script tag w/ a src attribute and nothing else
- throw5959 2y agoWhy?
- recursivedoubts 2y agoidk just like it better that way
- Andrex 2y agoChiming in to say modules are awesome and you shouldn't be so scared.
- recursivedoubts 2y agoI'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 https://github.com/bigskysoftware/htmx/tree/master/dist
- seumars 2y agoyou can define import maps in a separate <script> tag and reuse the module name elsewhere
- recursivedoubts 2y agosure, 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
- paulddraper 2y agoDepending on the import tree depth, it significantly increases latency. (Which is why bundlers still exist.)