Fork me on GitHub
#shadow-cljs
<
2018-11-18
>
kenran_14:11:45

I think I don't understand the testing workflow with shadow-cljs yet. I'm used to figwheel-main where I start it up and automatically get two pages I can check: one for the actual app, one for a test hosting page (similar to what I accomplished with shadow-cljs and the :browser-test target).

kenran_14:11:00

I can shadow-cljs watch browser-test to get this, but then I don't have the app running as well. Do I need 2 watch processes? Can I combine them somehow? Or should I just use the :node-test target?

thheller14:11:27

shadow-cljs watch browser-test your-app runs 2 watches

kenran_14:11:01

Oh wow, how could that escape me! Let me try

thheller14:11:24

you can as many builds as you want in parallel

thheller14:11:02

also as separate watch if you prefer to split the terminals and not have all output in one

kenran_14:11:58

I repeat myself, but: wow!

kenran_14:11:48

Thanks a lot for all the work. I don't regret giving it a try one bit so far. The best thing compared to what I used before is how blazingly fast the hot reloading is.

kenran_14:11:51

Is there a (default) way to get notifications about the test results in the second browser tab? That is, maybe change the icon or show a popup once something breaks?

thheller14:11:42

currently that is very minimal and has no notifications or anything

thheller14:11:11

I'm planning to hook up https://github.com/bhauman/cljs-test-display but didn't get to that yet

thheller14:11:51

you can do it yourself with a custom runner but should really be the default

kenran_14:11:51

Ah yes, that's the one that's default in figwheel-main (same author). It looks pretty, but that's not really necessary for me. It's just a convenience.

eoliphant18:11:47

Hey @thheller, have a barcode lib that’s not behaving https://serratus.github.io/quaggaJS/

(require '["quagga" :default Quagga]) ; default export is nil, as it looks like what's in node_modules, doesn't have a nice index.js, etc

(require '["quagga/dist/quagga" :default Quagga])

; blows up with
failed to resolve: ./config.node.js from /Users/erichkoliphant/Dropbox/projects/jv-consumer/node_modules/quagga/dist/quagga.js
{:relative-to #object[java.io.File 0x400fd1fa "/Users/erichkoliphant/Dropbox/projects/jv-consumer/node_modules/quagga/dist/quagga.js"], :entry "./config.node.js"}
ExceptionInfo: failed to resolve: ./config.node.js from /Users/erichkoliphant/Dropbox/projects/jv-consumer/node_modules/quagga/dist/quagga.js
	clojure.core/ex-info (core.clj:4739)
	clojure.core/ex-info (core.clj:4739)
	shadow.build.npm/find-relative (npm.clj:268)

; it works on node and in the browser, guessing that there's something going on with the conditional stuff?

thheller21:11:46

@eoliphant AFACIT (require '["quagga" :as Quagga]) seems to work fine. not sure why it has a default property in node

thheller21:11:49

the files in dist are not for build consumption and look like standalone builds that you'd include directly via <script>

eoliphant21:11:21

taht’s what i ended up doing in the meantime

eoliphant21:11:43

now messing around with react-webcam, similar fun

thheller21:11:08

I'm not sure why the :default isn't available. it seems to be available on node

eoliphant21:11:09

as doensn’t seem to work for it either 😞

thheller21:11:09

hmm odd it is actually using the dist file

eoliphant21:11:15

but yeah thanks, :as works just fine for quagga

eoliphant21:11:21

JS is such a s-show

thheller21:11:32

ah "browser": "dist/quagga.min.js",

thheller21:11:09

if (false) {
    config = require('./config.dev.js');
} else if (true) {
    config = __webpack_require__(58);
} else {
    config = require('./config.prod.js');
}

thheller21:11:21

gotta love the crap they put into their builds

thheller21:11:08

yeah conditional requires are tricky

thheller21:11:32

yeah the browser build is just different and doesn't have a default export

eoliphant21:11:05

hey while your’e around, I saw some of your expo experiments from a while back. is that still experimental?