Fork me on GitHub
#shadow-cljs
<
2020-01-18
>
Aleed16:01:01

is this object notation allowed in shadow? (foo.bar.baz) cljs docs says its supported (https://cljs.github.io/api/syntax/dot), but not sure why i'm receiving use of unresolved var

Aleed16:01:13

specifically the require looks like this [lib.core :refer [comp]] and i'm trying to use it like this (comp.view (comp.text "Hello World"))

thheller17:01:06

that is not valid syntax no

thheller17:01:04

it is not valid for refer etc. pretty much only for global symbols

dpsutton17:01:41

i'm looking at adding a bit more support to clojure-lsp for shadow. The base for this is knowing the classpath for a project. I see that you can run shadow-cljs classpath and get the classpath but it unfortunately prints out some info that is unnecessary like config, node version, etc. Is there a way to get just the classpath info without any of this extra information?

thheller17:01:41

@dpsutton the "extra" info is printed to stderr. the classpath info should be the only thing on stdout

dpsutton17:01:56

awesome. thanks

dpsutton17:01:30

indeed. thanks!

jmckitrick17:01:35

I’m coming back to clojure and CLJS after a hiatus, and I’m curious how shadow-cljs compares to figwheel-main. Last I checked, shadow-cljs was superior for integrating nodejs libraries.

thheller17:01:27

shadow-cljs still does way more than figwheel and still has better npm interop 😉

sogaiu17:01:31

@dpsutton on a slightly related note, if invoking shadow-cljs via npx or yarn, those have flags to be more quiet in the output. for npx it's --quiet and for yarn it's --silent.

dpsutton17:01:53

are you saying that npx shadow-cljs classpath will put the stderr onto std out?

sogaiu18:01:55

i also used shadow-cljs classpath in a project and found that without the --quite and/or --silent flags was seeing extra output (if using yarn/npx). at least that was my recollection. i don't recall exactly what happens without them, but i found that using the flags seemed to help 🙂

sogaiu18:01:26

npx --help says:

--quiet, -q            Suppress output from npx itself. Subcommands will not
                         be affected.                                  [boolean]

dpsutton18:01:32

Awesome. Thanks for the pointer. I bet that’s truly awful to figure out in the wild :)

sogaiu18:01:13

lol, wasn't fun for sure 🙂

jmckitrick17:01:15

@thheller Ah, ok. It’s nice to be back. 🙂 What about rebel readline? I guess that doesn’t matter with cider, correct? Do you have feature list for comparison? I’m sure you hear this question all the time

thheller17:01:47

I can't do comparisons since I have never used figwheel or figwheel-main. rebel-readline is not supported but that doesn't matter with cider. cider has good support for shadow-cljs nowadays (I think, I use Cursive)

dpsutton18:01:18

it does 🙂 rebel readline is a terminal client and not necessary if you are using an integrated editor

jmckitrick18:01:23

So really, then, is there any reason I’d use figwheel-main? 😉

mauricio.szabo00:01:21

Not for me 🙂

mauricio.szabo00:01:04

Seriously, Shqadow does integrate better with any target I've tried. It is better on generating node (I'm using it currently on some devops projects and did some experiments with proton-native), node libraries (Chlorine is one of these, I also made a hubot script with it), browser (it can live-reload jQuery 😄) and so on

jmckitrick18:01:26

I have a side question, as well. I recently spoke with a CTO who says the Google Closure compiler is really not that great. That’s the first time I’d ever heard that, and he’s been working with CLJS for quite some time. Have you found that to be the case? Just curious.

jmckitrick18:01:49

I’d been singing praises of Closure over the usual (more common) JS ecosystem, but I don’t want to repeat misinformation.

sogaiu18:01:40

it would be interesting to hear more specifics regarding "really not that great" 🙂

jmckitrick18:01:54

Yes, I wish I had more to offer, but it was a brief conversation.

thheller18:01:04

it is "not that great" if you point it at random javascript from npm

thheller18:01:28

if you use it with code that is written for it (CLJS, Closure Library) it is absolutely fantastic with nothing else coming even remotely close in the JS world currently

skroth19:01:24

has anyone seen this error before? I get it when i do shadow-cljs release app

tbrooke19:01:00

I am trying to add the following as a dependency in my shadow-cljs.edn file and I get “bad artifact coordinates” error - obviously bad formatting:

[metosin/malli {:git/url ""
               :sha     "1a1038d2473c6de784252b6ad42a6cc1e764ebcc"}]
How do I do this?

thheller20:01:17

@slack1490 that is caused by a dependency conflict. likely because you are using deps.edn or project.clj. you should have these versions

[com.google.javascript/closure-compiler-unshaded "v20191027"]

   [org.clojure/google-closure-library "0.0-20191016-6ae1f72f"]
   [org.clojure/google-closure-library-third-party "0.0-20191016-6ae1f72f"]

skroth20:01:13

thanks! I'll look into it

skroth20:01:54

awesome, got it going. thanks again

👍 4
thheller20:01:41

@tbrooke git deps are only supported if you manage dependencies via deps.edn. shadow-cljs.edn does not currently support them directly.

thheller20:01:47

Some people expressed interest in the web framework I'm working on. I wrote down some notes and started porting the shadow-cljs UI in case anyone is still interested. finally no more react 🙂 https://github.com/thheller/shadow-experiments https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/ui/main.cljs

👍 36
mauricio.szabo00:01:02

Wow, great! How does it compare, for example, with reagent/react/vue? Does it uses some kind of "virtual DOM", does it listens to changes on atoms?

thheller11:01:27

there is no full virtual DOM no. it can listen to changes on atoms yes

thheller11:01:06

I'll write more about this if I decide to make this an actual framework at some point 😛

thheller20:01:06

nowhere near ready for public use but I can setup a basic example app if someone feels like experimenting

thheller20:01:25

the next shadow-cljs release will include UI built on top of it so you'll see it in action there 😉