This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-06
Channels
- # adventofcode (71)
- # aleph (1)
- # announcements (6)
- # aws (1)
- # babashka (27)
- # beginners (60)
- # biff (7)
- # calva (3)
- # clj-kondo (3)
- # clj-yaml (1)
- # clojure (60)
- # clojure-europe (43)
- # clojure-nl (3)
- # clojure-norway (75)
- # clojurescript (16)
- # code-reviews (7)
- # css (4)
- # cursive (47)
- # datascript (4)
- # events (5)
- # fulcro (37)
- # gratitude (5)
- # hyperfiddle (4)
- # introduce-yourself (4)
- # joyride (23)
- # juxt (4)
- # malli (4)
- # membrane (64)
- # nbb (8)
- # off-topic (12)
- # other-languages (6)
- # pathom (6)
- # polylith (9)
- # random (3)
- # rdf (66)
- # reitit (3)
- # releases (2)
- # shadow-cljs (18)
- # tree-sitter (10)
this is my first clojurescirpt with shadow-cljs :
;; shadow-cljs configuration
{:source-paths
["src/dev"
"src/main"
"src/test"]
:deps false
:dependencies
[]
:dev-http {4000 "target/"}
:builds
{:app {:output-dir "target/"
:asset-path "."
:target :browser
:modules {:main {:init-fn }}
:devtools {:after-load }}}}
app.cljs:
(def value-a 1)
(defonce value-b 2)
(defn reload! []
(println "Code upddd.")
(println "Trying values:" value-a value-b)
(js/console.log "code reload"))
(defn ^:export main! []
(println "App loaded!")
(js/console.log "hello"))
(tap> "hffffI")
run:
npx shadow-cljs watch :app
in Chorme show error:
No such namespace:js Why?
In emacs I use M-x cider-connect also show error
so I use npx shadow-cljs -d cider/cider-nrepl:0.28.5 watch :app
It doesn't workI have no clue about that particular window or Cider but that error by itself makes me think that you're trying to run CLJS code in a CLJ REPL.
emacs works. you just need to switch to cljs repl by (shadow/repl :app)
open a browser and it'll go away
Would this be the right channel to ask about styling (if one is just getting to grips with clojurescript?)
By styling, you mean CSS? Unless it's CSS-in-CLJS, I'd say no. We have #C06DTLT5X though.
Ah, I'll jump to there, thank you! I knew I would be directed somewhere more appropriate 🙂
We have a lot of channels. :) Most of the time, I don't even use the channel search function - I just start typing #
followed by something relevant, and there it is.
Does cljs have a port of resources in some fashion? As in
?
I wanted my library to load the full contents of a text file by name. It’s currently a clj lib, so it just includes the text file as a resource in the jar and loads it up when needed. Wondering if there’s a way to do something similar in cljs.
You can define a macro (which runs in Clojure and can access such resources) that evaluates to a string literal that you can use in your cljs.
If you're using shadow-cljs you can require [shadow.resource :as rc]
and do (rc/inline "...")
with the file path.
I am! Thanks so much both of you.