Fork me on GitHub
#clojurescript
<
2018-04-07
>
justinlee02:04:04

@steveb8n you can’t have more than one react since they will fight over control of the dom. typically, libraries specify a minimum version of react, not a specific version

justinlee02:04:39

cljsjs is annoying precisely because of the shared dependency problem.

justinlee02:04:30

if you plan on using a number of react libraries, I personally will direct you to one of two techniques: (1) bundle all your js with webpack or (2) use shadow-cljs

steveb8n02:04:33

so npm-deps is the way to go? with an explicit react version in lein?

steveb8n02:04:59

ok, thx. I’ll look at shadow, have heard good things

justinlee02:04:14

I would urge against npm-deps, which tries to do closure optimization and is an experimental feature with lots of limitations and unhelpful error reporting

steveb8n02:04:34

much appreciated, this could save me a lot of time

justinlee02:04:38

this is my view on the whole thing with some background to help you choose: https://gist.github.com/jmlsf/f41b46c43a31224f46a41b361356f04d

justinlee02:04:50

hop into #shadow-cljs if you have trouble

sonnyto10:04:54

can anybody answer this question https://groups.google.com/forum/#!topic/clojurescript/E7H1cuZQpys ? how to extract metadata of foreign-lib dependencies in self-hosted cljs

mfikes12:04:50

@sonnyto I posted some links to some code you can look at in the mailing list

👍 4
sonnyto16:04:22

@mfikes thanks! you're awesome

kurt-o-sys17:04:01

I'm using transit, but I'm running into problems when I want to use it together with [cljs-time.core :as time]

kurt-o-sys17:04:36

> (t/write (t/writer :json) (time/hours 1))
#object[Error Error: Cannot write ]
   cognitect$transit$write (jar:file:/home/storage/mvn/repository/com/cognitect/transit-cljs/0.8.256/transit-cljs-0.8.256.jar!/cognitect/transit.cljs:278:11)
nil
> 

kurt-o-sys17:04:01

> (time/hours 1)
{:years nil,
 :months nil,
 :weeks nil,
 :days nil, 
 :hours 1, 
 :minutes nil, 
 :seconds nil, 
 :millis nil}

kurt-o-sys17:04:49

what am I missing? Why does transit has problems with serializing cljs-time.core/Period?

orestis17:04:09

I’ve no idea about transit, should write return a string? How do you specify where to write?

kurt-o-sys17:04:55

write should return a json string, right.

orestis17:04:12

Something about numbers perhaps?

orestis17:04:55

I see on the Readme that it uses (t/integer 1), presumably to maintain precision?

kurt-o-sys17:04:02

it seems it has to do something with types.

kurt-o-sys17:04:08

numbers etc don't seem to be a problem

kurt-o-sys17:04:25

but (time/hours 1) returns a cljs-time.core/Period-type.

kurt-o-sys17:04:17

Right... makes sense. thx.