This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-27
Channels
- # announcements (2)
- # babashka (60)
- # beginners (73)
- # calva (23)
- # cider (2)
- # clj-kondo (19)
- # cljs-dev (31)
- # clojure (29)
- # clojure-berlin (1)
- # clojure-europe (6)
- # clojure-nl (17)
- # clojure-spec (21)
- # clojure-uk (15)
- # clojurescript (54)
- # core-async (48)
- # cursive (35)
- # datomic (12)
- # emacs (12)
- # fulcro (66)
- # graalvm (3)
- # graphql (16)
- # jackdaw (1)
- # malli (1)
- # off-topic (11)
- # pedestal (4)
- # re-frame (10)
- # reitit (1)
- # rewrite-clj (8)
- # ring-swagger (8)
- # shadow-cljs (14)
- # spacemacs (2)
- # vim (5)
Do I have any regex experts in here? I have a thing in our Clojure lexing/tokenizing that I want to fix. I almost succeed, but to the price that other things break...
I'm trying to use Calva with shadow-cljs, read quite a bit, and did a lot of experimentation, but can't get the workflow right. I'm trying to evaluate code in the context of a running :app which has a browser as the target.
Should the localhost be open before I jack-in? Should I connect to the (cljs) :app repl or the browser repl?
I get the "no application..." message, and no hot code reload.
Any help would be greatly appreciated! 🙂
At the moment my workflow is - Jack-in Selecting :app at the prompt. I wait until the build has been configured and the compilation is done. I select :app (or browser repl, I tried both) at the second prompt. I get a "no application..." prompt whether the localhost is open in the browser or not. What am I missing?
The cider dependancy is present in the config.edn file. My shadow-cljs.edn file is: {:source-paths ["src"] :dependencies [[datascript "0.18.5"] [org.clojure/core.async "0.4.500"] [rum "0.11.3"] [net.ofnir/antizer "3.23.4-0"]] ; [antizer "0.3.1"] ;; Only used when developing using VS-Code with Calva: ;; [cider/cider-nrepl "0.22.4"] :builds {:app {:target :browser ; May come in handy, for a production release. ; :compiler-options {:infer-externs :auto} :output-dir "public/js" :asset-path "/js" :modules {:main ;; <- becomes public/js/main.js {:entries [my-aaplication.core]}} ;; start a development http server on http://localhost:8020 :devtools {:http-root "public" :http-port 8020}}}}
My goal is to be able to evaluate datascript queries at the repl, and have the code reloaded properly after each compilation.
That should work. Just, you'll need to access the app in the browser before Calva can connect to its REPL.
My CLJS repl says: REPL connected. user =>
But I can't seem to use vars from my app, even if I explicitly load the namespace and/or evaluate the current file.
Plus, the browser says, at the console, it reloads the namespaces after re-compilation, but I have to reload each time to see any changes. I think something is wrong with my setup, but I can't figure out what...
Unfortunately Calva's REPL prompt lies about being connected sometimes, especially with shadow-cljs.
The hot reload issue seems very strange though. If you can make a public project reproducing the problem, I can have a look.
Cool, Thanks! I'll fiddle with it a bit more, and if I can't get it to work I'll try to reproduce the problem. Thank you!
Ohh, one last thing (for now). The project used to include a deps.edn file, which was removed. Could it be an after-effect? is there a way to clean house for the configuration?
One more thing, though, @consistent1, this:
;; Only used when developing using VS-Code with Calva:
;; [cider/cider-nrepl "0.22.4"]
Good to know. Another thing I noticed is that after the browser reloads my core.js file Calve complains: "shadow-cljs: reloading code but no :after-load hooks are configured!" May provide a hint... I'll do some more reading and try to minimize the project to see if I can get better results.