This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-09
Channels
- # announcements (4)
- # aws (3)
- # babashka (86)
- # babashka-sci-dev (31)
- # beginners (171)
- # biff (15)
- # calva (3)
- # clerk (47)
- # cljdoc (11)
- # clojure (59)
- # clojure-dev (11)
- # clojure-europe (122)
- # clojure-losangeles (1)
- # clojure-nl (2)
- # clojure-norway (4)
- # clojure-uk (2)
- # clojurescript (40)
- # cursive (5)
- # data-science (3)
- # datahike (1)
- # datomic (5)
- # fulcro (9)
- # graalvm (8)
- # hyperfiddle (17)
- # introduce-yourself (1)
- # java (28)
- # jobs (1)
- # malli (11)
- # membrane (9)
- # missionary (1)
- # nbb (1)
- # off-topic (5)
- # other-languages (1)
- # pedestal (1)
- # re-frame (4)
- # reagent (16)
- # releases (3)
- # remote-jobs (3)
- # shadow-cljs (83)
- # spacemacs (1)
- # sql (5)
- # tools-deps (28)
- # xtdb (15)
anybody know why i can’t alias the reitit.frontend
namespace in my cljs repl?
cljs.user> (require '[reitit.frontend :as rf])
nil
cljs.user> rf/router
------ WARNING - :undeclared-ns ------------------------------------------------
Resource: <eval>:1:1
No such namespace: rf, could not locate rf.cljs, rf.cljc, or JavaScript source providing "rf"
--------------------------------------------------------------------------------
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:1
Use of undeclared Var rf/router
--------------------------------------------------------------------------------
nil
cljs.user>
i can access the full namespace just fine:
cljs.user> reitit.frontend/router
#object[reitit$frontend$router]
hmm no I guess not shadow-cljs, don't recognize the error message. should still work though :P
hmm in my emacs minibuffer i’m seeing [pending-cljs], although the shadow server is running and I can connect (this is with CIDER)
shadow version: 2.20.16
.
I think this might be a CIDER issue, but not sure how to dig further into this
the shadow server is started in a separate terminal and then I connect to the nrepl server with cider-connect-cljs
seems like it could be this: https://github.com/clojure-emacs/cider/issues/3246
the relevant debugging messages from nrepl:
(-->
id "8"
op "eval"
session "11c05907-8541-4d5a-819a-f7103a592597"
time-stamp "2023-03-09 10:44:47.940885000"
code "(do (require '[shadow.cljs.devtools.api :as shadow]) (shadow..."
ns "shadow.user"
)
(<--
id "8"
session "11c05907-8541-4d5a-819a-f7103a592597"
time-stamp "2023-03-09 10:44:48.039296000"
out "To quit, type: :cljs/quit
"
)
(<--
id "8"
session "11c05907-8541-4d5a-819a-f7103a592597"
time-stamp "2023-03-09 10:44:48.040727000"
ns "cljs.user"
value "[:selected :app]"
)
(<--
id "8"
session "11c05907-8541-4d5a-819a-f7103a592597"
time-stamp "2023-03-09 10:44:48.040932000"
status ("done")
)
i’m able to eval forms like (js/alert "…")
without issue, but evaluating forms from within a cljs buffer and other things like aliasing namespaces don’t work
I experience this only when I connect to an nrepl server started in a separate terminal, but not when i jack in and start up a new one directly from emacs
that all looks fine. can you try just running npx shadow-cljs cljs-repl your-build-id
and just trying the snippet from above?
Has anyone built anything with cljs for a WordPress site? Just saw ReactPress… https://wordpress.org/plugins/reactpress/.
Helping a friend with their wordpress site (sigh) but then they asked for the wordpress-impossible… and I thought… “yay! maybe I can get some cljs into the mix!.
maybe grab some data from the wp-api and spin up a cljs frontend that does something interesting with that data?
absolutely.
I don’t know anything about WP… I’ll look at the API.
They want a graphic that changes when one plays different sound samples arrayed around the image.
but, actually, a data viz would be cool to throw in there somewhere, too.
and you can consult the api ref to get a better idea of how to use it: https://developer.wordpress.org/rest-api/key-concepts/
So, nice… it sounds like you can stick anything into a WP site…
I’m not sure I even need API calls in this case (the not-data-viz example).
Which tools do people use for ClojureScript to check for security vulnerabilities and CVEs?
I don't know for ClojureScript libs, but for npm deps, I use npm audit
.
And GitHub also lets me know when an npm package has a security issue.
Curious to know what others use.
Not specific to ClojureScript, but this could be useful in addition to npm audit
:
https://github.com/rm-hull/nvd-clojure
@U0CLCL6T0, I use nvd-clojure on some Clojure projects. I'm not sure if it helps too much with ClojureScript vulnerabilities. @U45T93RA6, who generously maintains nvd-clojure, might be able to tell us more.
It's not expected to help with js/cljs dependencies. In fact nvd-clojure, by default, disables all analysis from other langs (.net, ruby, js, ...) for reducing false positives. Since nvd-clojure/DependencyCheck are classpath and .jar based, they won't analyze relevant .js files since nowadays most deps are expressed as npm dependencies which are rarely if ever in the classpath.
Like, if file internal.cljs
has a macro, but I want it to be brought in whenever frontend.cljs
is required, is there anyway I can do that.
I used to worry about that, then saw a clarification that "beginner" refers to the poster, not the question. That said, see you in #C053AK3F9!
I consider myself just slightly above beginner, but still tend to ask in #C053AK3F9. If it feels like my question is obscure, digging in the weeds of Clojure internals, or otherwise just simply "above the head" of what a beginner should be expected to either know or be learning about, then I bring it here to #C03S1KBA2. Personally, I think this falls under the "obscure" category, and I would have left it here. But that's just me. 🤷