Fork me on GitHub
#clojurescript
<
2015-12-20
>
jindrichm08:12:17

Can you share some cljbuild configuration across all builds instead of duplicating it?

jindrichm09:12:08

@darwin: Yes, with lein. Does cljsbuild merge configuration from profiles and builds based on shared ID?

darwin09:12:08

the trick is to use map form for :cljsbuild configuration, maps are merged automatically

darwin09:12:37

and vectors in their subtrees get concatenated

jindrichm09:12:47

Is the top-level :cljsbuild {:builds {}} necessary?

darwin09:12:00

it is not necessary, just reduces warnings when this project is used in checkouts of other project

jindrichm09:12:30

So you merge the profiles using custom aliases and with-profile?

darwin09:12:07

yes with with-profiles, aliases are just a sugar for command-line

jindrichm09:12:30

Cool, thanks for explaining.

darwin09:12:35

warning: unfortunately implicit rules for built-in leiningen profiles are quite complicated, so you should avoid naming your profiles the same way, it leads to unexpected behaviour

darwin09:12:24

also lein with-profiles … pprint is your friend when debugging your setup

spacepluk15:12:49

hi, is anybody using sourcemaps with nodejs? I can't get them to work

akiva16:12:05

There’s a #C09C8GRLY channel; you might have better luck there.

spacepluk16:12:40

@akiva, I'm using vim actually but anyways I think it's a problem with cljs

spacepluk16:12:53

it's only failing in some situations

spacepluk16:12:22

for example (merge a-map a-js-obj) throws and the error is not sourcemapped

akiva16:12:50

Oh. Hah. I totally misread you. Sorry about that.

dnolen18:12:34

@spacepluk: source maps work with fine Node.js I use them all the time

dnolen18:12:01

@spacepluk: “some situations” is vague, if you have minimal case share it so it can be examined

spacepluk18:12:20

@dnolen for now it seems to be only that case I mentioned, I'll setup a simple test case tomorrow.

dnolen18:12:49

@spacepluk: will definitely want to see a minimal case for this, in general case source maps work great

dnolen18:12:01

this is how I develop all my ClojureScript libraries

dnolen18:12:15

data only tests via Node.js REPL, ui stuff via devcards

spacepluk18:12:30

yeah for every other error I'm getting they are working great

spacepluk18:12:23

maybe I'm doing something wrong, I'll let you know asap

pat20:12:16

I am trying to port spit+slurp to node and cannot get with-open to work. I am trying to writing the macro in cljc so it can throw a js/error, but I cannot get it to work. https://gist.github.com/anonymous/4e7a7c13167f86d3c67a

pat20:12:30

I've tried requiring it a bunch of different ways. I think defmacro may work differently in cljc?

rhansen21:12:46

Question regarding om.next: How do people deal with read and mutation errors?

rhansen21:12:39

To clarify with an example, I'm creating a login dialog. Trying to log in runs a remote mutation. How do people handle the case when that mutation fails due to, for instance, a bad username/password combination?

rhansen21:12:23

Do you mutate a :login/error field in the state atom, or do you throw an alert box, or what?

rhansen21:12:02

I think om.next's way of dealing with state is good, I'm just confused on how to handle stuff like this. In reagent/re-frame I would normally perform the http request, and then mutate the app state based on the response, so this is new territory for me.

lfn321:12:14

@rhansen: you might want to try asking over in #C06DT2YSY. I don’t have an answer but I’d be interested to hear one.

rhansen21:12:40

ahh, didn't know of that channel. Thanks for the heads up simple_smile

mfikes23:12:41

@pat If you are working with macros in bootstrap mode, it may be worth trying with ClojureScript master