This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-12
Channels
- # announcements (2)
- # aws-lambda (2)
- # beginners (402)
- # berlin (2)
- # calva (21)
- # cider (8)
- # clj-kondo (31)
- # cljdoc (1)
- # cljsrn (42)
- # clojure (43)
- # clojure-berlin (2)
- # clojure-dev (21)
- # clojure-europe (4)
- # clojure-hamburg (1)
- # clojure-italy (37)
- # clojure-nl (7)
- # clojure-spec (50)
- # clojure-uk (121)
- # clojurescript (46)
- # component (49)
- # data-science (1)
- # datomic (60)
- # emacs (29)
- # fulcro (43)
- # hoplon (5)
- # jackdaw (7)
- # joker (19)
- # luminus (5)
- # off-topic (28)
- # om (2)
- # re-frame (27)
- # reitit (7)
- # remote-jobs (15)
- # rewrite-clj (17)
- # shadow-cljs (95)
- # spacemacs (34)
- # sql (9)
- # tools-deps (17)
- # xtdb (70)
Also why I was hoping for suggestions on things to look for or places to explore. It's a react component. And if I copy the code out of node_modules and into my source (require '["/name.js" :as n :refer (Component)])
gives me the same result. Their code comes in both es and cjs versions, the cjs seems to load, but shadow throws an exception when I try to require the es version directly.
if it’s just not there, I don’t know. I’d have to look at the code. there might be some other documentation they have on how to import that might be more illuminating
e.g. it might be in some submodule "basicchart/BasicChart"
or if it’s using the ES module it might be behind a default
key
Yea, I tried the console.dir and looked, the component isn't there. I tried their example code. It was JSX, so I put it through babe and added that code into my project. No dice there either.
I wasn't sure if maybe their code didn't get along with the closure compiler, or if there was something with that exception shadow was throwing.
The shadow exception is just Exception in thread "async-thread-macro-9" java.lang.RuntimeException: java.lang.Exception: Not supported: class clojure.lang.ExceptionInfo
Only when compiling the es version of their package code placed directly into my source path.
i’m not sure how shadow-cljs treats JS files on the classpath tbh. I think it might do some special things for node_modules that it might not do for normal JS on the classpath
Thanks for trying to help @lilactown, I appreciate you taking the time.
@grant do you have the full exception trace? ... 20 more
seems top be cutting of the relevant parts?
as for the JS object see https://shadow-cljs.github.io/docs/UsersGuide.html#_about_default_exports
(js/console.dir x)
is probably the most useful thing. I've seen JS packages that only have one default
export and add properties onto that
so if the object has a default
property you might find what you are looking for there
I have extra-dependencies specified in a deps.edn alias that I only want pulled in for a :dev build, how can this be done?
oh okay, would you consider a feature request for such a mapping to be specified in the shadow-cljs.edn file?
oh.. why not? From what I understood builds can be used as a way to pull in dev dependencies and additional source paths/compiler optimizations
so if you run 2 builds and both would like different dependencies that wouldn't work
@thheller I am trying to figure out a good way to get the full stack trace. I am seeing it on the console output of the terminal running npx shadow-cljs server
. I'm triggering it by doing the (require ...)
in the browser based repl that server provides.
try with shadow-cljs browser-repl
instead, the web interface might not route some output properly maybe
Hi, can I point to different lein configurations in different builds, for example in test build I want to include more dependancies
The actual problem is not being able to use test check generators when connecting to nrepl started by shadow watch test
getting the following error:
(gen/generate (s/gen ::open?))
Error: Var clojure.test.check.generators/simple-type-printable does not exist, clojure.test.check.generators never required
Hi! I’m having some trouble getting my dev setup going - I’m trying to use httpkit and compojure on the server side and shadow-cljs for all the javascript. Thanks to help from @isak yesterday, I got changes to my reagent components live-reloading in the browser. However I can’t seem to get changes to the .css file to reload.
I do have
:devtools {:after-load alexandria.core/mount-root
:http-root "/"
}
in my shadow-cljsshadow-cljs is compiling to /public/js/ in my project dir, that seems to reload well
and the css file is in public/css/foo.css
with your css file included in the HTML via <link rel="stylesheet" href="/css/foo.css">
?
[email protected]: ~/dev/terrapin/alexandria $> ls public/css
total 8
drwxr-xr-x 3 rodfrey staff 96B Jun 11 16:11 .
drwxr-xr-x 5 rodfrey staff 160B Jun 11 16:16 ..
-rw-r--r-- 1 rodfrey staff 74B Jun 12 08:43 alexandria.min.css
<html>
<head>
<script src="/js/main.js"></script>
<script src=""></script>
<link rel="stylesheet" type="text/css" href=""></link>
<link rel="stylesheet" type="text/css" href="/css/alexandria.min.css"></link>
<meta charset="utf8" />
<title>Alexandria</title>
</head>
<body>
<div id="app">Hello from Alexandria dsf</div>
<script>alexandria.core.init()</script>
</body>
</html>
{:source-paths ["src/cljs"]
:dependencies [[bidi "2.1.6"]
[cider/cider-nrepl "0.22.0-beta1"]
[cljs-ajax "0.8.0"]
[com.andrewmcveigh/cljs-time "0.5.2"]
[kibu/pushy "0.3.8"]
[re-frame "0.10.6"]
[reagent-utils "0.3.3"]
[day8.re-frame/http-fx "0.1.6"]
[refactor-nrepl "2.4.0"]
[reagent "0.8.1"]]
:builds {:alexandria {:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:main {:entries [alexandria.core]}}
:devtools {:after-load alexandria.core/mount-root
:watch-dir "public"
}
}}
:nrepl { :port 8777 }
By the way, I love this system. I’ve actually been able to build up my shadow-cljs.edn and deps.edn from scratch and understand it all. I was never able to do that with lein or figwheel. Thanks for your work.