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
I would recommend shadow-cljs: https://shadow-cljs.github.io/docs/UsersGuide.html#target-node-library
good thank you , i was about to read that,i just wasnt sure
if shadow is good for node also
I haven't tried it myself but that particular use case seems to be well documented at the very least.
thank you : )
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?
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
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.
In javascript, i'd do person["age"] = 81
.
goog.object.set
looks promising.
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.
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.
goog.object.set
was what I needed. 🦆