shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
2020-10-30T05:58:33.211400Z

ah ok, many thanks again

Jakub Holý 2020-10-30T13:01:19.213200Z

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.

thheller 2020-10-30T13:03:00.213500Z

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

thheller 2020-10-30T13:03:10.213700Z

besides that not a clue

thheller 2020-10-30T13:03:35.213900Z

maybe you need to fix you deps.edn issues

thheller 2020-10-30T13:05:08.214300Z

maybe try running just clj with whatever aliases you might need

thheller 2020-10-30T13:05:25.214700Z

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

Jakub Holý 2020-10-30T13:19:40.215200Z

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

Sam Ritchie 2020-10-30T14:02:57.216Z

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 Ritchie 2020-10-30T14:03:42.217Z

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

thheller 2020-10-30T14:05:41.217400Z

I don't understand the question

thheller 2020-10-30T14:06:18.218100Z

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

Sam Ritchie 2020-10-30T14:09:19.218500Z

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

Sam Ritchie 2020-10-30T14:10:13.219500Z

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

thheller 2020-10-30T14:11:50.220600Z

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?

thheller 2020-10-30T14:12:12.221100Z

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

Sam Ritchie 2020-10-30T14:12:51.222Z

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

thheller 2020-10-30T14:13:04.222200Z

they don't

thheller 2020-10-30T14:13:26.222700Z

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 Ritchie 2020-10-30T14:14:14.222900Z

👍 thank you!

Sam Ritchie 2020-10-30T14:15:06.223700Z

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

Sam Ritchie 2020-10-30T14:15:11.223900Z

which is unrelated to shadow, as you say

thheller 2020-10-30T14:17:07.225400Z

yes, deps.edn is its own thing.

borkdude 2020-10-30T15:46:00.226Z

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

thheller 2020-10-30T16:19:46.226500Z

odd indeed. looks like the reported location is incorrect

thheller 2020-10-30T16:21:35.227700Z

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

thheller 2020-10-30T16:21:53.228100Z

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

thheller 2020-10-30T16:22:41.228700Z

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

thheller 2020-10-30T16:23:42.229200Z

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

thheller 2020-10-30T16:23:55.229400Z

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

thheller 2020-10-30T16:24:57.230Z

@borkdude ^

borkdude 2020-10-30T16:26:29.230200Z

aha, thanks!

fabrao 2020-10-30T23:53:13.233Z

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