Fork me on GitHub
#clojurescript
<
2015-10-15
>
jaen09:10:57

@dnolen: any particular reason you're doing keyword indexing instead of using cljs.js-deps/-provides / cljs.js-deps/-requires in places like https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L538 or https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/js_deps.cljc#L130? Is it just to avoid having to do a (when sth ...) around it to avoid a NPE when it's nil or is there more to it? It tripped me up where my IJavaScript implementation didn't have the required field but calculated the deps in the protocol method. Would it make sense to change that to use protocol methods with a when guard (since I guess getting nils there is expected)?

artemyarulin10:10:26

Does anybody know - is there anything to calculate test coverage?

danielcompton10:10:27

it’s good for eyeballing, but i wouldn’t break the build over it’s output

artemyarulin10:10:50

Does it support ClojureScript?

danielcompton10:10:32

don’t think so

artemyarulin10:10:20

yeah, I meant coverage for ClojureScript

martinklepsch12:10:38

@dnolen: thoughts on whether ReactDOM should just be part of cljsjs/react or separately? Don’t see any downsides packaging it separately

dnolen12:10:57

@martinklepsch: yeah I think no issues at all packaging it separately

dnolen12:10:38

@jaen there’s really no reason to rely on the protocol, all the protocol / defrecord stuff is a bit gratuitous and creates more complications than it’s worth.

dnolen12:10:06

@jaen but I’ve been loathe to refactor that stuff. I think there’s a couple cases where IJavaScript might legitimately be a map.

colin.yates12:10:15

@artemyarulin: Customers? (sorry - couldn’t resist :-))

artemyarulin12:10:49

@colin.yates: Yep, I’ll continue testing in production simple_smile

martinklepsch12:10:01

@dnolen: updated https://github.com/cljsjs/packages/issues/263 — looks like @juhoteperi already packaged it 5 days ago simple_smile

dnolen12:10:10

@martinklepsch: thanks! sorry I missed that.

martinklepsch12:10:29

np, wasn’t aware either simple_smile

jaen12:10:44

@dnolen: so if I understood you right you'd rather want a plain map with right keys assoc'd in on creation rather than implementing IJavaScript on a new record that does things inside its methods, right?

dnolen12:10:10

@jaen those methods really shouldn’t be doing anything anyway

dnolen12:10:31

the defrecord and protocols just encourage writing more complicated code than is necessary

dnolen12:10:26

they’ve also made evolving the keys that much more frustrating

dnolen12:10:51

the main reason I’ve avoided gratuitous refactoring is that inevitably introduces more bugs

jaen12:10:05

Right, then I'll just keep it a map with provides, requires and preprocessed source assoc'd in on creation.

dnolen13:10:54

just released Om 1.0.0-alpha2

keeds13:10:45

@dnolen: Ooh. I've missed this. The rapid pace of releases when you get your teeth stuck into something. Hold tight everybody!

dnolen13:10:09

the latest stuff has incremental normalization

dnolen13:10:33

which means you can set up some remote service and get seamless sync

dnolen13:10:53

Datomic, PostgreSQL whatever, just need to write a parser (aka router)

dnolen13:10:23

also means it’s trivial to overlay local state over the pure remote state (Relay does not have this feature)

bbss14:10:11

(defui Person
  static om/Ident
  (ident [this {:keys [name]}]
    [:person/by-name name])
  static om/IQuery
  (query [this]
    '[:name :points]))

(defui RootView
  static om/IQuery
  (query [this]
    (let [subquery (om/get-query Person)]
     `[{:list/one ~subquery} {:list/two ~subquery}])))
What does the ` do?

bensu14:10:46

@bbss It's called a syntax-quote

borkdude14:10:04

@bbss: Hey, a familiar face simple_smile

bbss14:10:18

Hey teach simple_smile

borkdude14:10:24

@bbss I'll send you a PM

juhoteperi14:10:44

In case someone needs to extend some Closure classes with ClojureScript here's an example which should work with advanced compilation: https://gist.github.com/Deraen/8fede09ce77859004537

thheller18:10:32

so, how do I teach cursive to correctly indent om.next/defui forms? 😛

mattly18:10:13

does anyone have a favorite clj/cljs library to help with localization?

mattly18:10:25

I couldn’t find an adaptation of gettext

mattly18:10:02

and would prefer to use something I can run on both client and server

jaen18:10:00

If you want both client and server is the first thing that comes to mind

dnolen18:10:47

and just released Om 1.0.0-alpha3, thanks to @thomasdeutsch for pointing out some query bugs

jakemcc18:10:54

@thheller if you get the light lightbulb to appear when on top of the form there is an indentation option

thheller18:10:23

@jakemcc I know that .. but it still won't indent (render [] ...) or any other methods correctly

jakemcc18:10:46

@thheller: ahh, ok. I didn’t both trying before saying. Many people don’t know about that way changing indentation

thheller18:10:36

@jakemcc yeah complex macros like defui are a challenge

dnolen18:10:38

@thheller: I just 2 space indent always in Cursive - I find any other rule frustrating

dnolen18:10:47

so that makes defui work for me

dnolen18:10:27

there’s a Clojure formatting style option for this

bensu18:10:50

@dnolen: me too, but it makes me mad when it comes to -> and ->>

dnolen18:10:12

@bensu, yeah but I don’t really care about those being aligned simple_smile

bensu18:10:53

great! stay safe from OCD simple_smile

dnolen18:10:20

haha, I waste a lot of time formatting actually, oh well … almost like hammock time 😛

thheller18:10:02

@dnolen ah thanks, didn't know you could set that globally

thheller18:10:04

much better

thheller18:10:52

@bensu seems to work if you set it only indent globally but then manually set -> ->> to 0

bensu18:10:36

@thheller: thanks but I don't use cursive (yet!)

thheller18:10:21

the (apply dom/div ...) in RootView/render is not needed

thheller18:10:26

looks ugly 😛

thheller18:10:52

while we are on the OCD subject

dnolen19:10:52

ah right, can’t remember why I did that, will fix later

jaen19:10:00

@dnolen: quick question re: this map in cljs.closure/add-dependencies - https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L661-L667 If I understand correctly you map required-js to wrap them into the JavaScriptFile record which is basically a convenience to have cljs.js-deps/-source implementation read the source from a file pointed by url, yes? So if I want my file to not be represented on disk (since I don't think it makes sense to spit the preprocessed file to the disk immediately when it's preprocessed) I would have to cond it and output a different record that does not do this, right? (at least that's how I did spiking it and it seemed to work) Or do you think I should do something else?

dnolen19:10:28

@jaen sorry my head space is not closure.clj today and won’t be until next at week at the soonest

jaen19:10:43

Ok, happens

jaen19:10:10

Then I'll do it as I did in the spike and if you have something against that when you can look at it, then it could be refactored, I suppose.

richiardiandrea23:10:30

hello guys, a newbie question, how to create from cljs a #error js object?

richiardiandrea23:10:06

ah ok found, it's

(ex-info "Bla" {:empty "map"})