3 ms·
A word of caution on import maps. My app, Easel, previously relied on import maps for running user and AI-authored code in an iframe and it caused many many iss
by seanw265 1y ago
A word of caution on import maps. My app, Easel, previously relied on import maps for running user and AI-authored code in an iframe and it caused many many issues for us.
Import maps combined with ESM CDNs (like jsDelivr, jspm, or ESM.sh) can work in ideal conditions. But in practice, a lot can go wrong. Many packages don’t compile cleanly to ESM, ad blockers can interfere with individual scripts (the innocuous Lucide "fingerprint" icon [1] is a common casualty), and a package might work on one CDN but not another (intercompatibility is shaky at best). Worse, any failures happen at runtime, and a single missing or broken script can snowball into a full app breakdown.
If it’s working for you, great. Just make sure your versions are pinned. But if you’re building anything dynamic, it’s worth knowing that the ecosystem is still quite brittle.
I'll probably author a blog post about this one day.
[1]: https://lucide.dev/icons/fingerprint https://lucide.dev/icons/fingerprint