squint

avocade 2025-12-17T10:38:55.442909Z

@borkdude hey, just wanted to quickly ask if this was in the realm of possibility at all: using ES modules and import maps (ie the "modern way" that Rails uses since a few years), also for us in Clojurescript-land? 🙂

borkdude 2026-01-12T21:19:48.591659Z

there is a branch, but nothing finished yet

👀 1
🙏 1
pez 2026-01-12T21:21:50.132689Z

I love Squint so much!

❤️ 1
➕ 1
avocade 2025-12-17T10:39:15.355689Z

DHH's article, and his Rails talk, which inspired me some time ago: https://world.hey.com/dhh/hey-is-running-its-javascript-off-import-maps-2abcf203

avocade 2025-12-17T10:39:56.803369Z

We're using shadow-cljs (I guess like most others), and the google closure step is not only extremely time consuming, but the monolithic JS file (~25MB for our app) is getting to be a real burden 🙂

borkdude 2025-12-17T10:40:05.998519Z

yes, sure. squint just compiles to JS so at that point you can use everything JS supports. no magic there

👀 1
avocade 2025-12-17T10:40:29.162459Z

Would be awesome to have separate JS files in the end, since most of our branches/deploys only end up changing a small amount of our many namespaces.

borkdude 2025-12-17T10:41:02.571179Z

squint does support that use case. but note that squint isn't fully compatible with all of CLJS :)

avocade 2025-12-17T10:41:14.735169Z

just so i don't miss any technical reasons why cljs just can't work this way, due to how everything is compiled or whatever 😄

borkdude 2025-12-17T10:41:16.111959Z

so it would require rewriting some of your stuff probably

borkdude 2025-12-17T10:41:41.029009Z

shadow-cljs does support a per-file output with ESM as well. but I'm pretty sure it recompiles your whole app every time you restart it

avocade 2025-12-17T10:41:45.010959Z

right, I noted that it's not production-ready. but is this the goal eventually, to be fully compatible and be a drop-in replacement for shadow-cljs?

borkdude 2025-12-17T10:42:23.947009Z

I'm not sure about a drop-in replacement for shadow-cljs

avocade 2025-12-17T10:42:25.805429Z

> shadow-cljs does support a per-file output with ESM as well. but I'm pretty sure it recompiles your whole app every time yeah, but it seems only useful for keeping external JS modules separate, meanwhile cljs still compiles to just one big fugly blog hehe

borkdude 2025-12-17T10:42:57.846719Z

there is :target :esm-file or something

avocade 2025-12-17T10:43:01.126829Z

> I'm not sure about a drop-in replacement for shadow-cljs sure not completely, I get that. but for the most common use cases.

avocade 2025-12-17T10:43:28.921399Z

squint does live-code compile/reload like shadow as well, right?

borkdude 2025-12-17T10:44:23.113419Z

squint itself doesn't but most people use vite for that. squint is just a transpiler from CLJS to JS basically. it does have a file watcher to recompile sources that changed, but "reloading" stuff happens through other tools (so far)

avocade 2025-12-17T10:44:24.590729Z

btw maybe I'm just talking about the wrong abstraction level: I probably mean cherry, which is built atop squint, yes? 😂

borkdude 2025-12-17T10:44:59.912339Z

cherry is more or less the same thing indeed, mostly the data structures change

avocade 2025-12-17T10:45:46.356749Z

so cherry is more targeted to being used in production, for larger cljs web apps?

borkdude 2025-12-17T10:50:12.688619Z

cherry and squint are equally (non-)production ready but squint is more suitable for smaller builds since it doesn't bring in the immutable data structure machinery

avocade 2025-12-17T10:50:53.686709Z

do you have an idea of a timeframe for it to be viable? feels like a really exciting prospect to modernize the cljs stack.

borkdude 2025-12-17T10:52:30.211279Z

I deem it production ready in the sense that most stuff already works, but tooling-wise it could be better. In 2026 I want to focus more on bringing nREPL to the browser for squint and cherry. Another thing currently missing is source maps, those are the two big ones. But if you can do without it, you can already use squint and cherry in production and I'm fixing bugs actively.

avocade 2025-12-17T10:53:07.634409Z

cool, sounds like 2026 will bring some important stuff. source maps feels very important for debugging in prod 👍

pez 2026-01-11T16:21:12.937759Z

> In 2026 I want to focus more on bringing nREPL to the browser for squint and cherry I take this as that there is no browser nrepl for squint yet? Please just interpret that as a question. 😃 I just want to know If I am missing something when searching for it.

wcohen 2025-12-23T12:43:26.515459Z

A project using cherry — and which depends on another project using cherry — happily running off an import map and JSDelivr: https://willcohen.github.io/clj-proj/ https://github.com/willcohen/clj-proj/blob/main/docs/index.html

👀 1
🎉 1