Fork me on GitHub
#reagent
<
2015-07-15
>
Petrus Theron13:07:40

I guess I could compile re-com with the patch myself, but I've never included a dependency that didn't come from Clojars before.

mikethompson14:07:43

I don't know much about boot, but I assume you can: 1. Download the re-com repo 2. change what you need to (version of clj-time) 3. lein install to put a copy into your local maven repo (~/.m2) 4. use it.

mikethompson14:07:05

Can I suggest asking this question on boot channel

mikethompson14:07:35

Perhaps @sooheon is more there, than here

sooheon14:07:36

Just saw my mention, looking back at the problem petrus is having

sooheon14:07:08

So iirc, simply adding [com.andrewmcveigh/cljs-time "0.3.10"] as a dependency above re-com

sooheon14:07:12

Should work

sooheon14:07:02

Try adding that dependency, running boot show -p and checking to see the latest version is being used

Petrus Theron14:07:17

sweeeeet it builds now

shaun-mahood21:07:45

@mikethompson: Have you run into any problems with programs trying to dispatch handlers before they are registered? I'm getting it happening off and on during my first load, but subsequent reloads in figwheel work fine. My initial load is being fired by goog.events so I think that's the culprit.

mikethompson21:07:56

You probably have a require for handler.cljs in your core.cljs?

mikethompson21:07:24

So the dependency loading mechanism (provided by google closure) which "orders" the loading of the js at runtime, will see only that handlers.cljs has to come in before core.cljs.

mikethompson21:07:23

So ... the trick is to get handlers.cljs loaded BEFORE you do your first dispatch.

mikethompson21:07:42

One brute force method (which might be ugly) is to find where you are dispatching, and up the top of that namespace, require in handlers.cljs @shaun-mahood: ^^^^

shaun-mahood22:07:06

@mikethompson: Ok, I'll try that - should be pretty easy in this case, since all the dispatches are being done in one place. Thanks

shaun-mahood22:07:02

Assuming I don't run into it again I'll do up a quick wiki entry for it

mikethompson22:07:41

The biggest trap is not requiring handlers.cljs at all

mikethompson22:07:03

And then the namespace doesn't get loaded at all

mikethompson22:07:12

And every dispatch fails

shaun-mahood22:07:25

I'm rebuilding my first re-frame app from scratch with re-com, amazing how much more it makes sense and better it works once I had some time playing with it

mikethompson22:07:32

Always the way. Learning is just layers of the union. simple_smile I'd recommend re-reading my (overly long) readme too.

shaun-mahood22:07:39

The other thing I ran into was with namespaced handlers, I had to dispatch them with the full namespace rather than the short form in my require statement. Confused the heck out of me for a bit.

mikethompson22:07:54

require statement? Did you mean dispatch?

mikethompson22:07:15

Hmm. No. I can't parse that last sentence

shaun-mahood22:07:03

Ok, I'll elaborate and make it make sense.

shaun-mahood22:07:26

Does that make sense?

mikethompson22:07:25

These days, I don't use "real" namespaces in my id keywords. I use synthetic namespaces (ones without a real matching .cljs file)

mikethompson22:07:47

So i use something like this; :panel1/add-thing

mikethompson22:07:05

Even though there isn't really a panel1.cljs

roberto22:07:06

oh, nice. I had been wondering about how to add ns

shaun-mahood22:07:08

I've just stopped aliasing my require statements and it's consistent and understandable. Considered using synthetic namespaces but figured I'd keep it consistent with my other calls as well

shaun-mahood22:07:48

Either way, namespacing handlers, subs and render functions has made it a lot easier for me to componentize things

shaun-mahood22:07:09

@roberto to use the synthetic namespaces, just call (register-handler :panel1/add-thing) instead of (register-handler ::add-thing)

shaun-mahood22:07:40

I'll try and write something up about namespaces on the wiki as well, and I think I have a good and consistent setup for using secretary that is working nicely with figwheel to add once I get it sorted out a bit better

gadfly36122:07:20

@shaun-mahood a write up would be great! I have been interested in how people were going about this too.

shaun-mahood22:07:55

@gadfly361: Yeah, about half the time I feel like I must be doing something wrong because it is so different from how I'm used to organizing things. I feel so free though, it's an amazing breath of fresh air compared to all the rigid frameworks I've used over the years. It's fun to feel like an idiot because I'm missing something fundamental, rather than feel like an idiot because I ran into another poorly specified or undocumented "feature" that I have to skim 3 textbooks to find, or because the I updated the framework to a new version with no breaking changes that breaks everything.

mikethompson22:07:13

When I started with ClojureScript, I can remember rocking back in my chair when I realised the compiler was only about 900 lines of code ... and I could understand most of it (with effort). For the first time in a long while, the tech i was using didn't feel infinitely deep. Mind you, working in a browser takes away that feeling pretty quickly simple_smile

gadfly36123:07:02

@shaun-mahood definitely a freeing feeling