Fork me on GitHub
#clojurescript
<
2019-09-01
>
Leon15:09:12

i'm currently trying to set up a clojurescript project with all related tooling and such (planning to use reagent) My biggest problem currently is that its extremely unclear what tooling to use where, and how to combine all things... i've pretty much decided I like to use atom with protoREPL as my editor, as i've liked it for JVM Clojure projects in the past. Figwheel seems to be a hot-reloading solution, which sounds great! my current attempt at setting everything up somewhat works (my code compiles and is working in the browser), but trying to use inline evaluation from protoREPL or even just use the REPL to try out clojurescript specific stuff seems to fail, as it doesn't seem to recognize any of the dependencies and such that i have imported. (i.e: getting CompilerException' java.lang.RuntimeException: no such namespace: js) after some googling i found some stuff about there being a different repl environment for regular nREPL (hosted by figwheel, using the :nrepl-port option in my project.clj and the actual environment the site is running in... but i have no idea how to fix this. could anyone give (/ link to) a simple guide or introduction to clojurescript-related tooling, different approaches and gotchas? any help would be really appreciated, as all of this is heavily overwhelming for me as a beginner

alpox15:09:19

@lkowarschick I can only chime in with different approaches. I use (very happily) shadow-cljs instead of figwheel. The difference is that I do not use shadow with leiningen or boot toolings but standalone. What shadow-cljs gives you is full access to the npm registry with very easy interop access where with fighweel you have to go through what the cljsjs registry provides you. Adding JS dependencies through npm is as easy as npm install --save xyz. In addition, shadow-cljs has a great REPL experience and hot reload as figwheel. How and if protoREPL of Atom supports shadow-cljs is unknown to me as I use VSCode with Calva (And previously Cider on Emacs)

Leon15:09:17

okay thanks, ill try out shadow-cljs ;D maybe it's less of a mindbender to set up haha

alpox15:09:58

Figwheel actually gave me the cramps when I tried to set it up. When I tried shadow-cljs it was more like: Drop it in. Oh how smooth this runs!

Leon16:09:47

okay im using shadow-cljs now, and it really is a lot easier to set up, thanks!

alpox16:09:32

@lkowarschick You're welcome! 🙂 Glad it works out

Leon16:09:50

yea ;D it's still somewhat janky, but better than nothing ;D

Leon16:09:19

on a sidenode, how do i check if a list contains some element in clojureScript? on the jvm i can use the java .contains but that doesn't exist in cljs. what do i use here?

dpsutton16:09:01

(some #{thing-you're-looking-for} the-list)

Leon16:09:03

ahhhh okay thanks haha

dpsutton17:09:09

but often the answer to this question is to use a datastructure that gives a proper contains check without a linear scan

zhuxun220:09:14

Hi all, is there a schema for shadow-cljs's edn file?

zhuxun220:09:32

For example, where can I find all the options for a module?