Fork me on GitHub
#clojurescript
<
2015-12-15
>
virmundi03:12:24

Does anyone have an example project that reads an HTML file, converts it to a dommy tree and then run tests against that? I'm trying to pull out micro-data from various websites. Presently It takes around 10 seconds for me to know if I've made the right move in my Chrome extension. I'm just found that the recommended way to test is with cljs.test. I'm not really sure where clojure ends and clojurescript begins.

hkjels07:12:15

When I compile my projects there’s generated a directory called dev-resources. There’s no reference to such a directory in my code and I haven’t been able to find any documentation for it. Can I prevent it?

borkdude13:12:20

just got bitten by 'startsWith' that does not exist in older JS versions again 😄

dnolen13:12:12

@borkdude: another reason to just use Google Closure when dealing with strings simple_smile

borkdude13:12:38

@dnolen: yeah... this was in a jquery-based project though simple_smile

borkdude13:12:12

(from back when the web was simple)

dnolen13:12:17

lol, the fictional past that never existed

jaen13:12:59

https://github.com/funcool/cuerdas is pretty cool for strings, though I find trim not removing newlines a bit confusing.

borkdude13:12:12

I just copy-pasted a function from Stackoverflow, which suits the rest of the project better

borkdude15:12:38

@dnolen: cool, a cognicast featuring you. looking forward to listening it.

eyelidlessness16:12:00

is there a good/popular linter for clj/cljc/cljs?

angusiguess16:12:41

@eyelidlessness: Kibit is apparently cljs compatible. It's pretty lightweight and focuses mostly on making forms a little more idiomatic.

eyelidlessness16:12:51

i'm looking at kibit, thx. i'm hackily trying to shove an XML reporter into it to see if i can use it in CI (and then i may offer a PR for a proper formatter)

angusiguess16:12:15

Which CI do you use?

erik_price18:12:11

any good reason why my record might be printing to the console as [object Object] ?

jaen18:12:55

@erik_price: I dunno about why, but this is pretty cool for printing out Cljs values to the Console - https://github.com/binaryage/cljs-devtools

jaen18:12:01

(if you use Chrome)

erik_price18:12:46

I guess “why” is the wrong question – what I should ask is, “is that expected”?

jaen18:12:42

I suppose it makes sense, it's probably toString'd.

jaen18:12:11

How do you print it, with println?

erik_price18:12:42

Doh. Thanks jaen but it turned out to be a PEBKAC

jaen18:12:58

You might want to call (enable-console-print!) so println uses console.log

erik_price18:12:35

I had a function that i thought was returning a channel at the end of the function body, but the channel was inside of a go block, so it was returning the go block channel, which delivered the actual channel i wanted to send (instead of the record)

jaen18:12:55

Hm, that makes sense.

jaen18:12:12

I still wholeheartedly endorse cljs-devtools; it really makes life easier.

erik_price18:12:41

i’ll check that out, too

mfikes22:12:39

@borkdude: clojure.string/starts-with? is based on gstring