Fork me on GitHub
#shadow-cljs
<
2018-06-12
>
thheller05:06:22

@richiardiandrea you should only ever be loading one :node-library per node process (during development). if you need 2 use :npm-module

richiardiandrea14:06:11

Thanks will try that today and will also try to see if I can change :azure-fn.

henrik09:06:49

Should this theoretically reload a CSS file placed in ../public/css/main.css? (I’m not using the bundled server)

:builds {:client {:output-to "../public/js/main.js"
                   :output-dir "../public/js"
                   :target :browser
                   :asset-path "/js"
                   :modules {:main {:entries [landing-page.client.core]}}
                   :devtools {:watch-dir "../public"
                              :after-load landing-page.client.core/run}}}}

thheller09:06:21

if you are using /css/main.css in your html yes

thheller09:06:25

if you use css/main.css no

henrik10:06:17

Yup: [stylesheet "/css/main.css"]

henrik10:06:49

Though there is no index.html, it’s entirely generated. And served with firebase serve.

thheller10:06:38

hmm what does [stylesheet ..] emit?

henrik10:06:03

It’s just a small helper function:

(defn stylesheet
  "Particle for defining a stylesheet."
  [href]
  [:link {:href href
          :rel "stylesheet"}])

thheller10:06:24

hmm that should work

henrik10:06:29

<link href="/css/main.css" rel="stylesheet">

thheller10:06:39

yeah thats exactly what the code looks for

henrik10:06:18

OK, well, good to know that it should work, then it’s probably my fault somewhere

thheller10:06:26

oh. are you on windows by any chance?

henrik11:06:28

No macOS. I’ll rummage around a bit and see if I can get it to work. Otherwise I’ll try to produce a minimal case. The ../ shouldn’t make a difference, should it?

thheller11:06:11

it might. will check.

thheller11:06:51

../ indeed was the problem. fixed in 2.4.2

💥 4
👍 4
henrik11:06:51

Yep, works fine now. Thank you!

henrik11:06:53

The ../ is because I had to put src in a weird place to not make firebase-functions have a huge hissy fit.

thheller10:06:59

just noticed that it isn't working for me either when running windows

thheller10:06:11

the "update" message is {:type :asset-watch, :updates ["/css\\foo.css"]}

thheller10:06:17

so the path is invalid

thheller10:06:52

works when running in wsl but not windows

kurt-o-sys10:06:01

I have been able to import many npm libs already, but I seem to fail on this one: https://github.com/wwayne/react-tooltip it looks pretty straight forward, so I guess I must be overlooking something really stupid:

import ReactTooltip from 'react-tooltip'
<ReactTooltip />
in cljs (using shadow-cljs):
(:require ...
            ["react-tooltip" :default ReactTooltip])
[:> ReactTooltip>
However, ReactTooltip is undefined (when do (js/console.log ReactTooltip)). Why would ReactTooltip be undefined?

thheller10:06:43

@kurt-o-sys try :as ReactTooltip. sometimes the code is packaged as commonjs which doesn't have default exports.

kurt-o-sys10:06:47

oh right... you already told me before. I have to write it down somewhere 😛 Thx!

thheller10:06:59

actually I should write that down too 😉

mynomoto20:06:00

Is there a way to use jars from a private s3 from shadow-cljs with something like https://github.com/s3-wagon-private/s3-wagon-private?

thheller20:06:10

if you used :repositories config in project.clj the config is identical to that

thheller20:06:32

I have not used it myself but it seems to work

mynomoto20:06:05

Ok, I will try that, thanks!

thheller20:06:38

:repositories {"thing" {:url ... :username #shadow/env "AWS_ACCESS_KEY"}}

thheller20:06:01

#shadow/env looks up the env variable and uses that in the config

mynomoto21:06:06

re-frame-10x doesn't work after moving to lein. Is that a known problem? The required namespace "day8.re-frame-10x.preload" is not available.

danielcompton21:06:58

@mynomoto how are you adding s3 wagon to your build?

mynomoto21:06:14

I'm on commute ATM, I think I only be able to continue debugging tomorrow.

mynomoto22:06:05

I may have misunderstood how to use lein with shadow.

danielcompton22:06:20

I don't know if s3-wagon-private would work with Shadow cause it would need to be loading a JVM to download the dependencies

danielcompton22:06:28

as it hooks into Aether

danielcompton22:06:40

How does Shadow download dependencies? Just making the HTTP calls itself?