Fork me on GitHub
#shadow-cljs
<
2022-09-13
>
Chris McCormick13:09:32

Hello, does anybody have a good example of a GitHub action that runs tests in a shadow-cljs project? I have a :target like this:

{:target :node-test
 :output-to "tests.js"
 :ns-regexp "sitefox.*$"
 :autorun true}
And an npm script that looks like this for running it:
shadow-cljs compile test && node tests.js
I'd like to be able to do this on each push/PR on Linux and Mac.

Chris McCormick02:09:24

(got it working)

zimablue14:09:18

is there a macro-accessible variable or anything to know from the macro-expand-time/runtime whether the build was produced by "compile" vs "release"?

thheller15:09:55

@zimablue (:shadow.build/mode &env) in the macro. :release for release builds, otherwise :dev

Ivan Fedorov20:09:16

Hi Thomas, just notifying you, that Closure seems to also not support ResizeObserver API. Added a couple more externs manually. Which leads me to think, what other APIs aren’t supported.

thheller20:09:14

there is like 3 functions in that API? what would be missing?

thheller20:09:47

(included by default)

Ivan Fedorov20:09:15

Hmmm, should I somehow notify Closure that I’m using this API in my JS file?

thheller20:09:23

nope, should just work out of the box

Ivan Fedorov20:09:53

This is my js file head

thheller20:09:54

be careful with type info, if its incorrect that may lead to bugs

Ivan Fedorov20:09:09

It’s part of the library. Then I lein install this lib, and use it in a different project. The latter project only started to work properly after I supplied borderBoxSize, inlineSize, blockSize to its externs/app.txt

Ivan Fedorov20:09:27

maybe an old shadow-cljs / clojurescript version?

thheller20:09:27

you tell me? 😛 the resizeobserver externs are fairly new

Ivan Fedorov20:09:33

shadow version 2.15.3

thheller20:09:21

2.15.3 - 2021-08-08

thheller20:09:39

no idea when the externs where added

Ivan Fedorov20:09:12

ok, thanks! will check hmm, but the same thing was with SVG

Ivan Fedorov20:09:15

maybe I should try removing all type annotations

thheller20:09:08

well, does it work with the newer version?

👍 1
Ivan Fedorov21:09:42

hmm, yes, seems to