Fork me on GitHub
#shadow-cljs
<
2021-07-19
>
borkdude11:07:49

Does shadow perhaps add support for js/NodeList as seqable by default?

(seq (.getElementsByClassName js/document "terminal"))
It seems to just work in a project compiled with shadow, so I wondered about this.

jkxyz12:07:17

It seems like NodeList had an iterator property added in 2016 which is the same as NodeList#values - so it satisfies cljs.core/js-iterable?

thheller16:07:46

yeah thats it. shadow doesn't add anything special to anything on the JS side

borkdude11:07:18

Hmm, no it seems to work with newer vanilla CLJS as well

Drew Verlee16:07:44

I'm trying to follow these instructions here: https://shadow-cljs.github.io/docs/UsersGuide.html#cljsjs Would this shimmed file reside in my project or in the project that was using cljsjs? e.g myapp --- pulls in deps from ---> a_lib which has the (:require .... [cljssjs...]) and deps.edn with :deps cljsjs.... my first thought was that it would need to be the lib which uses it, but the docs imply shadow-cljsjs is fixing it at the application level.

thheller16:07:03

@drewverlee anywhere on the classpath. doesn't matter really, just put it in your project

Drew Verlee16:07:50

Thanks! So ns/deps farther up the tree win? I feel like I should know this.

thheller16:07:21

the classpath wins

thheller16:07:29

no such thing as a tree there