Good Morning Clojurians, If I start shadow-cljs like so:
p1~> npx shadow-cljs server
shadow-cljs - config: /home/sporty/clojure/fulcro/app1/shadow-cljs.edn
shadow-cljs - starting via "clojure"
shadow-cljs - HTTP server available at <http://localhost:8000>
shadow-cljs - server version: 2.11.8 running at <http://localhost:9630>
shadow-cljs - nREPL server started on port 9000
How do you start REPL to the nREPL on the port 9000?you use your editor to connect?
I do connect with the editor, but it does not give me just a REPL.
I use vim-iced, but I would like to have just a regular terminal REPL to quickly explore.
@timofey.sitnikov You can use lein repl :connect
to connect to an nREPL server. I'm not sure if that works for ClojureScript, but why not, it's just nREPL after all?
Thank you @borkdude, I did some more research on your recommendation, and it led me to: https://nrepl.org/nrepl/usage/clients.html#command-line-clients. I try to avoid using lein
.
Well, you don't have to use lein as a dep manager, but it works just fine as an nREPL client. it has REPL-y built in. Up to you. Good luck.
$ clojure -Sdeps '{:deps {reply/reply {:mvn/version "0.4.4"}}}' -M -m reply.main --attach localhost:43851
seems to work fine for my current JVM nREPL :)@borkdude, one more question for you, what is the best place to read how to resolve the fulcro defsc
Unresolved Symbol error by clj-kondo? I followed the setup instructions, created the .clj-kondo
and ran linting on the namespace to create the cache but still get that error.
@timofey.sitnikov the config project has a config for specifically that one: https://github.com/clj-kondo/config/blob/master/resources/clj-kondo.exports/clj-kondo/fulcro/config.edn There's work going on in #clj-kondo to come up with more advanced config to cover more of fulcro.
Perfect, thank you ...
Having issues with doing advanced compilation with trying wrap an npm dependency with webpack bundler.
Bundling command failed
[webpack-cli] Compilation finished
assets by status 1.16 MiB [cached] 1 asset
runtime modules 889 bytes 4 modules
cacheable modules 1.18 MiB
./target/public/cljs/dev/main.js 1.08 MiB [built] [code generated]
./node_modules/@auth0/auth0-spa-js/dist/auth0-spa-js.production.esm.js 101 KiB [built] [code generated]
ERROR in ./target/public/cljs/dev/main.js 57:95-111
Module not found: Error: Can't resolve 'react' in '/Users/jvillahermosa/code/clj/self-service-ui/target/public/cljs/dev'
ERROR in ./target/public/cljs/dev/main.js 983:791-831
Module not found: Error: Can't resolve 'xmlhttprequest' in '/Users/jvillahermosa/code/clj/self-service-ui/target/public/cljs/dev'
webpack 5.9.0 compiled with 2 errors in 12628 ms
just use shadow-cljs node-repl
or shadow-cljs browser-repl
then
Hello Everyone, I am new to Clojure (I am js Dev), this question might sound silly. I want to change the value of a boolean variable to the opposite of its value. For example, if the value of a variable is true I want to change to false, vice versa. Since the only way to change the variable value is to use the atom and that’s what I used. I don’t know why I am getting this error.
Example:
cljs.user=> (def isclicked (atom true))
#'cljs.user/isclicked
cljs.user=> @isclicked
true
cljs.user=> (swap! isclicked (not isclicked))
ERROR - db.call is not a function
(swap! is-clicked not)
swap takes an atom and a function to run on the value. (not isclicked)
would return false as isclicked
is an atom and therefore truthy (not false or nil) and negating that returns false. (swap! isclicked false)
will call false with the argument of true (the current value of the isclicked atom) and blow up