Fork me on GitHub
#shadow-cljs
<
2020-10-30
>
Jakub Holý (HolyJak)13:10:19

Any tips for troubleshooting when shadow-cljs (2.11.1) gets stuck? I run

$ node_modules/.bin/shadow-cljs watch :main
shadow-cljs - config: /Users/holyjak/Work/customersupport-app/shadow-cljs.edn
shadow-cljs - starting via "clojure"
DEPRECATED: Libs must be qualified, change refactor-nrepl => refactor-nrepl/refactor-nrepl (/Users/holyjak/.clojure/deps.edn)
DEPRECATED: Libs must be qualified, change mount => mount/mount (deps.edn)
DEPRECATED: Libs must be qualified, change hiccup => hiccup/hiccup (deps.edn)

# now it printed nothing more for minutes...
server has the same issue.

thheller13:10:00

first guess would be that you have a user.clj that does stuff on load?

thheller13:10:10

besides that not a clue

thheller13:10:35

maybe you need to fix you deps.edn issues

thheller13:10:08

maybe try running just clj with whatever aliases you might need

thheller13:10:25

and then (require '[shadow.cljs.devtools.server :as srv]) and (srv/start!)

Jakub Holý (HolyJak)13:10:40

Thank you! Running clj and starting it manually from there worked just fine! 🎉

Sam Ritchie14:10:57

Hey all... I THINK this is a simple process but just wanted to check in to be sure. I'm moving toward release for https://github.com/littleredcomputer/sicmutils, and want to add a shadow-cljs.edn before I do this

Sam Ritchie14:10:42

Am I right in thinking that... maybe this actually has nothing to do with library release, and more / all with developer experience?

thheller14:10:41

I don't understand the question

thheller14:10:18

a library does not need a shadow-cljs.edn at all and in fact would have no effect whatsoever

Sam Ritchie14:10:19

that's the reassurance I was looking for! just trying to find my feet

Sam Ritchie14:10:13

I hacked up a test profile months ago with lein-doo https://github.com/littleredcomputer/sicmutils/blob/master/project.clj#L71 and I suspect that the testing experience would be way better with shadow-cljs... also I'm finally at a phase where I can start developing UI components off of this work, so it's time to switch. just wanted to make sure I wasn't missing any pieces wrt library

thheller14:10:50

just to understand what you are talking about here. you want to bundle everything up as a regular library that people will add to their :dependencies and require in their ns?

thheller14:10:12

CLJS libs are not compiled at all when doing that. you just include the source files.

Sam Ritchie14:10:51

yes, I didn't know if, for example, there were some other path these days for dependencies, like direct git deps, that needed a shadow-cljs.edn for clojurescript

thheller14:10:26

the only place where someone needs a shadow-cljs.edn is in their project. that is the only relevant one. all others have no effect.

Sam Ritchie14:10:14

👍 thank you!

Sam Ritchie14:10:06

probably what I should do if I want to enable git deps is move this build to tools.edn

Sam Ritchie14:10:11

which is unrelated to shadow, as you say

thheller14:10:07

yes, deps.edn is its own thing.

borkdude15:10:00

I'm getting a warning I don't understand:

------ WARNING #1 - :undeclared-var --------------------------------------------
 File: /Users/borkdude/.gitlibs/libs/borkdude/sci/971614de14a6fd00e6991d1afd6c0ce9fbda104c/src/sci/impl/fns.cljc:51:32
--------------------------------------------------------------------------------
  48 |                           (throw-arity fn-name macro? args))
  49 |                         ret)))
  50 |                   ctx #?(:clj (.assoc ctx :bindings bindings)
  51 |                          :cljs (-assoc ctx :bindings bindings))
--------------------------------------^-----------------------------------------
 Use of undeclared Var sci.impl.fns/clojure

thheller16:10:46

odd indeed. looks like the reported location is incorrect

thheller16:10:35

this can happen if you have any fully-qualified names in CLJC code that ends up in a CLJS branch

thheller16:10:53

eg. clojure.lang.ExceptionInfo or anything clojure.lang.* really

thheller16:10:41

you can maybe look at the generated code looking for clojure. maybe that provides a better clue

thheller16:10:42

I see a few references that would confuse CLJS. eg ^clojure.lang.Associative ctx so thats most likely it

thheller16:10:55

(.get ^java.util.Map ctx :bindings)

borkdude16:10:29

aha, thanks!

fabrao23:10:13

Hello all, is that possible to use shadow-cljs to compile to typescript?