cljs-dev

thheller 2024-12-27T08:01:30.295179Z

ah thought I had yesterday was to lean in on strings a bit more, i.e. (:require ["global:foo" :as x]). I already have (:require ["esm:/foo.js" ...]) for :target :esm in shadow-cljs, which signals the compiler to emit a import ... from "/foo.js"; into the final code and not try to bundle it, i.e. let it load at runtime. also supports (:require ["http://..." ...]) for the same thing. https://clojureverse.org/t/generating-es-modules-browser-deno/6116

thheller 2024-12-27T08:01:55.971759Z

but then I realized this doesn't need strings at all. global:foo is a perfectly fine symbol that would work in any context, i.e. doesn't break any specs. I find that a bit more visually clear than cljs.host.* but it is the same concept in practice

dnolen 2024-12-27T10:21:59.839669Z

I can add that to the spreadsheet

borkdude 2024-12-27T12:51:12.147439Z

There is also prior art to that notation in the node ecosystem: import * as fs from 'node:fs'

thheller 2024-12-27T13:25:45.055239Z

its just URIs basically

👍 2