This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-07
Channels
- # announcements (13)
- # atom-editor (3)
- # babashka (53)
- # beginners (28)
- # clojure (30)
- # clojure-australia (4)
- # clojure-europe (22)
- # clojure-germany (1)
- # clojure-italy (6)
- # clojure-nl (3)
- # clojure-norway (14)
- # clojure-spec (8)
- # clojure-uk (8)
- # clojurescript (19)
- # cursive (33)
- # datomic (4)
- # defnpodcast (6)
- # events (3)
- # fulcro (3)
- # graalvm (77)
- # jobs (2)
- # juxt (11)
- # podcasts-discuss (1)
- # reitit (1)
- # releases (2)
- # remote-jobs (2)
- # sci (1)
- # shadow-cljs (27)
- # sql (6)
- # testing (10)
- # tools-deps (36)
- # vim (4)
- # xtdb (15)
Hello, fine people! I get errors when trying to eval a custom macro in cljs, but the macro works just fine otherwise in cljs. And when I say "custom macro", I simply mean one that I've defined.
(ns peanuts.editor
(:require [cljs.js :refer [empty-state eval-str js-eval]]))
(defn evaluate
[s cb]
(eval-str
(empty-state)
(str "(do " s ")")
nil
{:eval js-eval
:source-map true
:context :expr}
cb))
=> (evaluate "(require-macros '[peanuts.core :refer [defnc]]) (defnc foo [a] a) (foo 1)" println)
{:error #error {:message ERROR, :data {:tag :cljs/analysis-error}, :cause #object[TypeError TypeError: cljs.user.defnc is undefined]}}
nil
I even tried setting the :ns
option on eval-str
to 'peanuts.core
and then trying to evaluate defnc
without the require
, but that yielded another error:
=> (evaluate "(defnc foo [a] a) (foo 1)" println)
{:error #error {:message ERROR, :data {:tag :cljs/analysis-error}, :cause #object[SyntaxError SyntaxError: expected expression, got '.']}}
nil
Is there a way to eval custom macros in cljs 
Hi Guys, quick cross-promotion. I've started a #show-and-tell channel. Share a screenshot and tell us about it. So far we've seen some interesting developer setups and side projects. Today I've shared a facilitaties management solution we developed using, among other things, #re-frame & #cljsrn.
And if broad-scope facilities management solutions don't inspire you... well, I can't imagine what will.
Any idea why I get this error when I attempt to start a shadow-cljs project I generated?
PS C:\Users\Jacob\clojure\my-app> shadow-cljs watch app
shadow-cljs - config: C:\Users\Jacob\clojure\my-app\shadow-cljs.edn
shadow-cljs - starting via "clojure"
clojure : The term 'clojure' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ clojure -m shadow.cljs.devtools.cli --npm watch app
+ ~~~~~~~
looks like the template uses deps.edn
to manage dependencies but you do not have tools.deps installed?
I'm using this npm package for context. https://github.com/jgoodhcg/create-expo-cljs-app I think what is happening is that the new :deps
option leads to code trying to launch a clojure repl using the keyword "Clojure"
Also, could anyone tell me what the :>
operator is in hiccup? E.g.
[:> rn/View ]
hi - can anyone point me to an example integrating Aero into a clojurescript project? Thanks!
What's aero and what does it do? looks like a lot of different things to give a live coding experience but i'm not sure what it does
It's probably https://github.com/juxt/aero, just a config library. @UV23GRRR7 What exactly do you expect to get from it in a CLJS app? What do you mean by "integrate" here?
I was wondering if there is any way my clojurescript app (in a mono repository) can share some config I use in the clojure backend
not precious about it being Aero - just thought it looked like a pretty good way to do things on the Clojure side