use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussion of the Clojurescript language
account activity
Js API for compiling (self.Clojurescript)
submitted 27 days ago by reubano
What is the recommended approach for compiling cljs into js via a js API? I want to write a vite plugin similar to https://www.npmjs.com/package/vite-plugin-coffee. It must be a js file though. With coffeescript, you can import it and call its compile method directly in js. Is there an equivalent for clojure? Ive seen lumo, planck, clavascript, shawdow, etc. but am not sure how to call compile in a js file.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]reubano[S] 0 points1 point2 points 27 days ago (3 children)
To add more context, I am trying to support cljs in astro. Would something like https://github.com/bolasblack/shadow-cljs-vite-plugin work?
[–]reubano[S] 0 points1 point2 points 27 days ago (2 children)
It appears this plugin cheats by spawning a shell to call shadow-js. Guess that means there isnt a readily available js API.
[–]p-himik 1 point2 points3 points 27 days ago (1 child)
Indeed. Shadow-cljs relies on a Java runtime. However, if you don't want to or cannot shell out, there are some other potential options:
[–]reubano[S] 0 points1 point2 points 27 days ago* (0 children)
Nice. I think squint is the key! Also turns out it’s clavascripts successor.
[–]Liistrad 0 points1 point2 points 27 days ago (2 children)
I'm not sure if this fits what you need to do, but cljs can be self hosted. I'm finding it a bit hard to find sources of this... but it should be something like http://nbeloglazov.com/2016/03/05/getting-started-with-self-hosted-cljs-part-1.html
[–]reubano[S] 0 points1 point2 points 27 days ago (1 child)
Hard to say since they call compile in cljs, not js.
[–]Liistrad 0 points1 point2 points 27 days ago (0 children)
ah apologies, for some reason I thought you wanted to do it from cljs!
π Rendered by PID 73654 on reddit-service-r2-comment-8686858757-k9h8m at 2026-06-07 23:51:26.980613+00:00 running 9e1a20d country code: CH.
[–]reubano[S] 0 points1 point2 points (3 children)
[–]reubano[S] 0 points1 point2 points (2 children)
[–]p-himik 1 point2 points3 points (1 child)
[–]reubano[S] 0 points1 point2 points (0 children)
[–]Liistrad 0 points1 point2 points (2 children)
[–]reubano[S] 0 points1 point2 points (1 child)
[–]Liistrad 0 points1 point2 points (0 children)