Fork me on GitHub
#clojurescript
<
2016-08-16
>
georgek00:08:21

I’ll find out!

georgek00:08:56

thanks tho!

georgek00:08:07

P.S. The below link suggests its non-trivial: https://github.com/zachallaun/datomic-cljs

georgek01:08:45

@danielcompton: After trolling through the om-datomic code and how they pass it up through the stack it seems like there’s no easy 1-1 way to do it without stuff that’s kinda intimating. I’m still reading and not in a rush so I’ll let u know if your curious.

talios05:08:07

so…. turns out I’m part of the 0.1.1% who just found a bug on http://clojurescript.org/guides/quick-start 🙂

danielcompton05:08:28

XML injection!

talios06:08:30

looks to be on all of the syntax highters except clojure oddly, as the JS ones inject javascript at the start

Alex Miller (Clojure team)06:08:42

I’ve pushed a fix for the majority of it, deploying now

Alex Miller (Clojure team)06:08:11

takes about 20 minutes to work through CI and edge cache invalidation

talios09:08:15

alex - ahh cheers 🙂

rmuslimov12:08:43

Can anybody suggest any good example of using cljsjs/react-bootstrap with Rum?

rmuslimov12:08:08

actually cannot found anything working in the web

rmuslimov12:08:22

fails with react.inc.js:18893 Uncaught Invariant Violation: Objects are not valid as a React child (found: :id). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons.

risto13:08:12

when/why would use you use s/fdef and s/instrument over using :pre and :post conditions?

Alex Miller (Clojure team)13:08:59

because they let you use stest/instrument and stest/check

risto14:08:00

@alexmiller: can you elaborate on that? sorry i'm new to specs 😅

risto14:08:18

oh i see, you can write generative tests with fdef

risto14:08:22

gotcha, thanks

lwhorton15:08:23

is there something fishy about cljs-time at the repl I should know about? virtually none of the functions are working as documented, and I wonder if I’m missing something … can anyone recommend a good cljs lib for dealing with iso 8601 and formatting, e.g. something like momentjs for js?

dnolen15:08:54

@lwhorton: cljs-time is just a wrapper around Google Closure - you can just use it directly

lwhorton15:08:36

good to know — i’ll check it out thanks @dnolen

pesterhazy15:08:34

as a rule, does clojurescript 1.x.y require clojure 1.x?

pesterhazy15:08:01

I saw that recent cljs versions require clojure.string/index-of

pesterhazy15:08:40

although that looks like it was added in 1.8

anmonteiro15:08:00

@pesterhazy: as a rule of thumb, that’s true. the exception being CLJS 1.9.x which works with Clojure 1.8, in which case you won’t get the benefits of clojure spec

sdegutis18:08:22

Can you recommend any library for easily getting (EDN) data from a backend-server from a Reagent app?

val_waeselynck18:08:00

@sdegutis: what part of getting are you missing ?

sdegutis18:08:42

@val_waeselynck: Currently all of it. I have a (Compojure) server running on 8080, and a Figwheel/Reagant front-end running on 3000, and I'm trying to figure out the best way to ask the back-end for data from the front-end.

sdegutis18:08:12

I only see https://github.com/JulianBirch/cljs-ajax which seems okay but I was wondering if that's basically it or if there are other options.

val_waeselynck18:08:31

@sdegutis: that's what I've used

val_waeselynck18:08:44

you could also use Sente

val_waeselynck18:08:13

but it's not especially more simple IMO

chris18:08:47

I’ve used cljs-ajax and cljs-http. it just depends on what you want. ajax works with callback handlers and http works with core.async channels

chris18:08:04

I think cljs-ajax is simple/works well so I’ve never really needed anything else

chris18:08:20

and if you need it specifically to be edn you can use transit

oahner18:08:53

cljs-ajax supports both edn and transit pretty seemlessly too

fenton18:08:39

i do this over a websocket, then you can just prn-str and read-string CLJ(S) data structures.

sdegutis18:08:18

Interesting approach.

fenton18:08:43

@sdegutis: prn-str and read-string will probably fall down with dates...not sure. In that case maybe transit is useful for that use-case.

fenton19:08:29

@sdegutis: forgot there are instance (time) literals: (java.util.Date.) -> #inst "2016-08-16T19:04:25.002-00:00"

sdegutis19:08:32

Yep, in EDN, just not JSON.

sdegutis19:08:18

Is this valid syntax these days? (js/console.log "etc")

sdegutis19:08:38

Thought we used to have to write (.log js/console "etc")

chris19:08:44

it works in planck at least

fenton19:08:47

@sdegutis: did u give it a try?

porglezomp20:08:16

sdegutis: As far as I knew the former has always been valid syntax, it’s just that people generally consider the latter more idiomatic.

porglezomp20:08:57

Is there a better way to handle hot-loading something with requestAnimationFrame than to do (js/requestAnimationFrame @fn-atom) and reset! the atom every time?

joshuanjordan20:08:45

Yet, in a project I'm currently working on, it works fine.

oahner20:08:54

@porglezomp: as far as I can tell, that's no less efficient than using raw js variables

porglezomp20:08:53

@oahner: I just don’t like the ~3 extra statements that I have to do to in order to set it up.

joshuanjordan20:08:38

no issues at all, the details show when switching in and out of views.

porglezomp20:08:01

@joshuanjordan: When you’re sharing that much code, put it in a snippet. Then it can be collapsed, and you’ll also get syntax highlighting.

oahner20:08:07

my entrypoint is a bit different

oahner20:08:07

this compiles down to the exact js you'd expect

porglezomp20:08:24

That makes sense, it offers a little bit more power than my way, I’ll probably switch to that.

shaunlebron21:08:09

@pesterhazy: > as a rule, does clojurescript 1.x.y require clojure 1.x? you can check the clojure versions that cljs uses here: http://cljs.github.io/versions

shaunlebron21:08:42

@sdegutis: > Is this valid syntax these days? (js/console.log "etc") yes, this is supported in cljs, not clojure. documented here: http://cljs.github.io/api/syntax/#dot

skeuomorf21:08:41

I am using cljs-http along with core.async to send a bunch of requests and retrieve their results, the problem is a bunch of (<!) from channels are coming up as nil, presumably because that's what cljs-http does when the channel is close, on the other hand, when I check my devtools, I find that the requests indeed succeeded, for context I am sending about 2200 GET requests

skeuomorf21:08:56

s/close/closed