cljs-dev

dnolen 2026-05-26T18:59:02.754379Z

@danie re: this :as-alias patch, I left comment on the JIRA issue about needing clarity as to why need to bump CLJ for the fix, if there's another way to get the fix w/o that change that would be desirable as that feels like unnecessary scope, https://clojure.atlassian.net/browse/CLJS-3475

dnolen 2026-05-26T19:08:01.184789Z

thinking about switching to append script instead of document.write to make ClojureScript morph friendly. A lot of JS tools use eval and I think shadow-cljs does as well - but I can't come up w/ any really good reasons for this for ClojureScript, especially since we punt the JS build problems to JS build tools. But there may be other subtle advantages I'm just not aware of.

dnolen 2026-05-27T14:51:52.394479Z

ah I see, thanks

thheller 2026-05-26T19:11:23.436979Z

eval mostly addresses the perf problems of loading many files, which may all be cljs output, so still relevant

thheller 2026-05-26T19:12:07.271879Z

could just be a single big file, but generating the source map for that kinda sucks

thheller 2026-05-26T19:13:25.467079Z

the :esm target in shadow-cljs just uses esm import, but even that sucks for development builds and people have asked to enable the eval loader for esm as well

thheller 2026-05-26T19:25:34.975289Z

fwiw http2 also helps, but not everyone has a dev server + ssl cert to make that work

dnolen 2026-05-26T20:21:03.948259Z

how does eval make :esm nicer?

dnolen 2026-05-27T00:14:41.431089Z

to clarify a bit, I am asking what do users get from the eval approach that they prefer over import approach during dev for :esm?

thheller 2026-05-27T04:56:32.247309Z

eval packs all files into one. so there is only one request made to fetch everything. making compression better. also typical http1 max N connections per server otherwise limits the time it takes to fetch all files. so a network constraint that even import has to live with. import does perform better than document.write/script tags, but eval is substantially faster for builds with a lot of files