clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
Alex 2021-01-18T03:26:46.053100Z

Restarting the shadow-cljs watch process is the a surefire way to install missing dependencies. There are also tools which can add missing deps/libraries to your active REPL (see https://github.com/teknql/wing/blob/master/src/wing/repl.clj#L21-L39 as an example). I recall hearing that a new version of Clojure tools has this capability as well, but I'm not familiar with it I believe :refer :all is forbidden in CLJs. In general, it's rare that you need to actually require everything from the namespace and it may make your code harder to read (not knowing where functions are coming from). This is a personal preference though Your anecdote about only being able to use some data.xml functions in CLJs. This is probably why: https://github.com/clojure/data.xml/blob/5b13e2b2e8cb5445ac6c5f6926f3591b10eba66d/src/main/clojure/clojure/data/xml.cljs Note there's both a xml.clj and xml.cljs, and they contain different functions & implementations i.e. indent-str does not exist in xml.cljs

Alex 2021-01-18T03:27:28.053500Z

https://groups.google.com/g/clojurescript/c/SzYK08Oduxo/m/p0bWhM5lftUJ?pli=1 mentions some of the reasons behind disabling :refer :all in Cljs

ingesol 2021-01-18T10:39:48.054200Z

Don't know if it's relevant, but you can set :pretty-print and `:pseudo-names` to true in compiler options, that will give you a much more readable and debuggable advanced build.

andrewboltachev 2021-01-18T12:42:19.055Z

yes thanks!

Michael Nardell 2021-01-18T15:44:50.055600Z

Thanks - I appreciate the guidance on how / where to look in the source code when these kinds of questions come up.

Piotr Brzeziński 2021-01-18T18:38:48.058500Z

Hi. I’ll allow myself to repost a question I posted in #beginners early today and didn’t get an answer, maybe somebody over here will be able to help me out cause it made me stuck with my learning. Thanks in advance!

Following the "Living Clojure" I've ran into another issue that I'm unable to resolve. I am setting up clojurescript in my project and I was asked to run lein trampoline cljsbuild repl-rhino in my project root. It downloaded bunch of things and then failed when trying to build (I suppose?)

Exception in thread "main" Syntax error compiling at (cljsbuild/repl/rhino.clj:1:1).
.....
Caused by: java.io.FileNotFoundException: Could not locate cljs/repl/rhino__init.class, cljs/repl/rhino.clj or cljs/repl/rhino.cljc on classpath.
does rhino have to be added as one of dependencies/plugins? My deps look like that

:dependencies [[org.clojure/clojure "1.10.0"]
                   [compojure "1.6.1"]
                   [ring/ring-defaults "0.3.2"]
                   [ring/ring-json "0.5.0"]
                   [org.clojure/clojurescript "1.10.764"]]

Piotr Brzeziński 2021-01-18T18:39:54.059200Z

My lein version is 2.9.1 on java 13.0.2

thheller 2021-01-18T18:39:57.059300Z

the rhino repl doesn't exist anymore. maybe try using an older clojurescript version.

Piotr Brzeziński 2021-01-18T18:40:08.059600Z

ohhh, that makes a lot of sense, haha

Piotr Brzeziński 2021-01-18T18:40:26.060Z

What (simple?) alternative should I be using then?

thheller 2021-01-18T18:42:28.060600Z

depends on what "simple" means to you and what you want to do 🙂

Piotr Brzeziński 2021-01-18T18:43:20.061600Z

I’m not yet sure what I want to be able to do. Rhino was suggested as a “simple” repl (whatever they had in mind) in the book I’m following. I suppose I just need to be able to run execute some simple forms.

thheller 2021-01-18T18:43:37.062Z

if you have node/npm installed npx create-cljs-project foo then cd foo npx shadow-cljs node-repl

Piotr Brzeziński 2021-01-18T18:44:10.062500Z

Is there something I can use with lein-generated project?

thheller 2021-01-18T18:44:19.062700Z

or try https://clojurescript.org/guides/quick-start

Piotr Brzeziński 2021-01-18T18:44:28.063200Z

Gotcha. Thank you 🙂.

Piotr Brzeziński 2021-01-18T18:47:17.063700Z

Oh, I was able to get what I need with lein trampoline cljsbuild repl-listen . Good stuff, thank you 🙂