nbb

Aldo Solorzano 2024-11-20T14:42:31.362259Z

hello, I have some js code that runs in the browser and I would like to use cljs instead. I was able to migrate some node stuff and I'm wondering how to compile a .cljs file and then load it in the browser via <script> tag?

m3tti 2024-11-20T16:05:27.956349Z

You should use #squint for that imho

Chris McCormick 2024-11-20T17:38:53.097809Z

@aldosolorzanop you might want to ask about that in #beginners or #clojurescript since nbb is a utility specifically for running .cljs on node without a build step. The most common tools for doing what ask are: • https://shadow-cljs.github.io/docs/UsersGuide.html - provides comprehensive dev tooling for compiling cljs to js. This is probably the most popular option to do what you want. Requires Java. • the raw https://clojurescript.org/guides/quick-start compiler. Requires Java. • https://github.com/squint-cljs/squint that m3tti mentioned which is an alternative compiler with JS datastructures. • https://github.com/babashka/scittle/ which is like nbb in that there is no build step, you can just run your cljs from a script src tag like js is.

Aldo Solorzano 2024-11-20T17:41:09.071409Z

thank you very much for the guidance, I will take a look to the resources