clojurescript

ClojureScript, a dialect of Clojure that compiles to JavaScript http://clojurescript.org | Currently at 1.10.879
takis_ 2021-02-27T20:21:45.109100Z

hello what build tool to use for Clojurescript nodejs?i am new i used lein-cljsbuild , i want to pack my clojurescript project as npm(so nodejs code can use it) , and use npm dependancies

p-himik 2021-02-27T20:26:55.111900Z

I would recommend shadow-cljs: https://shadow-cljs.github.io/docs/UsersGuide.html#target-node-library

takis_ 2021-02-27T20:27:36.112200Z

good thank you , i was about to read that,i just wasnt sure

takis_ 2021-02-27T20:27:58.112400Z

if shadow is good for node also

p-himik 2021-02-27T20:28:47.112600Z

I haven't tried it myself but that particular use case seems to be well documented at the very least.

takis_ 2021-02-27T20:29:00.112800Z

thank you : )

1👍
cassiel 2021-02-27T20:47:49.113100Z

I have a figwheel-main setup for targetting nodejs, but shadow looks like a more serious build tool. Any concrete pros/cons one way or the other?

takis_ 2021-02-27T20:58:49.115400Z

i am new i cant help really, but i heard that people like shadow-cljs, and by searching online i saw that shadow-cljs is good with npm , but i cant compare tools

teodorlu 2021-02-27T20:59:56.116100Z

Beginner question. Is it possible to set javascript object properties by providing the property name as a string? Not: (set! (.-age person) 81), but something like (assoc person "age" 81)? I'm aware of https://cljs.info/cheatsheet/, curious if it's possible without pulling in a dependency.

teodorlu 2021-02-27T21:02:03.116400Z

In javascript, i'd do person["age"] = 81.

teodorlu 2021-02-27T21:05:00.116600Z

goog.object.set looks promising.

2👍
p-himik 2021-02-27T21:06:58.116800Z

People use both. A few years ago I made a switch from figwheel to shadow-cljs back when it had the best support for NPM modules. I've seen people say that nowadays figwheel-main supports NPM modules just as well but I cannot vouch for that in any way.

cassiel 2021-02-27T21:15:10.117Z

I’ve not yet got Figwheel set up so that it can crank out a production build rather than an NREPL-equipped dev environment - everything I’ve been doing is essentially live-coded dev. Maybe I’ll look into shadow for addressing that.

teodorlu 2021-02-27T21:39:45.117300Z

goog.object.set was what I needed. 🦆