Fork me on GitHub
#clojurescript
<
2022-05-19
>
Jakub Zika04:05:01

Hi, do you know if there have ever been efforts to make clojurescript emmit human-readable javascript like rescript does for example? What prevents this from happening?

hiredman05:05:43

If I recall correctly one of the options for the closure compiler is pretty printed output

seancorfield05:05:32

:pretty-print
Determines whether the JavaScript output will be tabulated in a human-readable manner. Defaults to true.
☝️:skin-tone-2: Defaults to true. I guess you'd also need :optimizations :none to have comprehensible JS produced.

seancorfield05:05:37

And:

Defaults to :none.
for :optimizations. @zikajk Does that default behavior not do what you want?

augustl06:05:27

:pseudo-names is also really helpful, it makes the advanced compilation use names based on the source instead of random symbols

grahamcarlyle09:05:32

Is there a means of determining whether a clojurescript release in maven is an "official" release or not? I'm using liquidz/antq to detect and upgrade dependencies and it recently bumped clojurescript to the 1.11.50 release which I believe wasn't https://clojurians.slack.com/archives/C07UQ678E/p1652376126915619 as an official release. antq soon bumped to the subsequent official releases when they appeared but ideally i'd liked an automated means of keeping to the official releases. Or am I needlessly worrying and it would be fine to use any clojurescript release in maven?

henryw37404:05:17

not afaik. Clojurescript has not used RC or alpha/beta releases as long as I've been using it.

grahamcarlyle11:05:27

Aren't the releases that are not mentioned in the https://github.com/clojure/clojurescript/blob/master/changes.md a defacto beta-release?, as in they are not being recommended for use, though their presence in maven caused antq to automatically upgrade to them

henryw37411:05:11

yes that's my understanding

dnolen12:05:17

@zikajk as mentioned Closure can pretty print, but we've never been interested in generating human-readable JavaScript

dnolen12:05:36

ClojureScript is different enough from JavaScript that such a goal has very little value

dnolen12:05:54

you would never hand write the code we generate and that is intentional

dnolen12:05:56

Oops sorry!

Jakub Zika12:05:03

Thanks @dnolen @seancorfield @augustl I would like to check the result of optimization :none but I cant get the configuration right. I am following https://clojurescript.org/guides/quick-start and when I have :main as a string it will fail.

{:optimizations :none
 :main "cljs-kata.core"
 :output-dir "resources/public/js"
 :deps {org.clojure/clojurescript {:mvn/version "1.10.758"}}}
➜ clj -M -m cljs.main -c cljs-kata.core Execution error (FileNotFoundException) at .FileInputStream/open0 (FileInputStream.java:-2). c (No such file or directory)

Jakub Zika12:05:46

Changing it to

:main ["cljs-kata.core"]
leads to cljs-kata.core (No such file or directory)

dnolen13:05:02

the namespace is generally not a string

dnolen13:05:17

the guides don't ever refer to it as a string I'm pretty sure

dnolen13:05:28

:main cljs-kata.core

Jakub Zika13:05:03

I hope I’m not hallucinating :-)

dnolen13:05:28

that is a doc problem

dnolen12:05:35

where does cljs-kata.core live, it should probably be src/cljs_kata/core.cljs note the underscore

Jakub Zika13:05:17

../Code/Clojure/cljs-kata/src/cljs_kata/core.cljs

augustl13:05:05

can you have deps in the cljs build config file? :thinking_face:

dnolen13:05:10

right, it will have no effect

augustl13:05:47

maybe the issue is that it can't find cljs.main, not clear from the error message, as the dependency is added in the cljs build config instead of deps.edn

Jakub Zika13:05:38

@augustl On the contrary, I wrote everything you see in deps.edn. Just like I’m used to from the lein 🙂

Jakub Zika13:05:05

Google always refers me to shadow-cljs. Can anyone tell me how to do this in pure cljs? Thanks

dnolen13:05:03

the Quick Start covers this

dnolen13:05:46

I highly recommend following it exactly, and things will be clearer

👍 1
Jakub Zika13:05:28

Great, I get it. I was confused by the compiler documentation, which leads to the use of maps.

dnolen13:05:03

@zikajk some bad docs, I fixed these up, thanks for pointing those cases out

👍 1
emaun21:05:33

does anyone know why clojurescript change-logs skips over version 1.10.773 / where I can find those logs??

👀 1