ldnclj

Find us on #clojure-uk
pupeno 2015-12-14T07:17:18.000528Z

Good morning.

glenjamin 2015-12-14T07:58:59.000529Z

@agile_geek: fancy doing that talk in Sheffield at some point?

glenjamin 2015-12-14T07:59:21.000530Z

I've been wanting a talk like that, but not gotten around to writing it 😁

pupeno 2015-12-14T08:46:51.000531Z

Argh… I need to test my library in production and it seems the only way is to release a half-finished version to Clojars. Lein really needs to start pulling things from Git repos.

agile_geek 2015-12-14T09:01:01.000532Z

@pupeno can't you just build locally and release the uberjar or war?

pupeno 2015-12-14T09:01:43.000533Z

That’s not how releasing with Heroku works. You build the uberjar on the server. It follows the style of “your sources should just work”.

agile_geek 2015-12-14T09:02:31.000534Z

@glenjamin I'm open to the idea. Let's see how it goes up here as I think it may need some work. You might get the polished version!

pupeno 2015-12-14T09:18:49.000535Z

Yay! I managed to build my own repo.

benedek 2015-12-14T09:51:07.000536Z

@pupeno: this could help https://github.com/tobyhede/lein-git-deps

pupeno 2015-12-14T09:51:22.000538Z

benedek: oh! looks promising! :simple_smile:

agile_geek 2015-12-14T10:39:11.000539Z

Guys, I am struggling to understand how to build a mixed Clojure and ClojureScript project? I seem to get conflicts between the main: in the cljsbuild: and the main: in the body of the defproject (using lein BTW)

pupeno 2015-12-14T10:39:37.000540Z

agile_geek: can you share the project.clj?

pupeno 2015-12-14T10:40:26.000541Z

@agile_geek: I have two examples of that, a very involved one: https://github.com/carouselapps/ninjatools/blob/master/project.clj and a simple one: https://github.com/carouselapps/free-form-examples/blob/master/project.clj

agile_geek 2015-12-14T10:40:49.000543Z

Give me a few minutes and I'll push the repo to github and let you look at whole lot. Be aware it's very naive and part finished.

pupeno 2015-12-14T10:41:17.000544Z

free-form-examples is the minimum thing I managed to do to build a clj cljs project.

agile_geek 2015-12-14T10:45:16.000545Z

@pupeno: I'll take a look. In meantime here is the attempt so far - https://github.com/ldnclj/meetdown/tree/add-cljs (it's in add-cljs branch)

pupeno 2015-12-14T10:46:05.000547Z

:source-paths (root) shouldn’t have src-cljs unless you expect it to contain clj or cljc code. I think.

agile_geek 2015-12-14T10:46:53.000549Z

OK

pupeno 2015-12-14T10:47:08.000550Z

You’ll need this for the uberjar to contain your cljs code: https://github.com/carouselapps/free-form-examples/blob/master/project.clj#L57-L62

agile_geek 2015-12-14T10:47:43.000552Z

Note I'm note using ring-handler as I'm starting server side using core and Components.

pupeno 2015-12-14T10:48:36.000553Z

I have yet to build a project like that. What’s the symptom you are experiencing?

agile_geek 2015-12-14T10:49:18.000554Z

At this point I'm just trying to figure out how to run this with lein run so not worrying about uberjar jsut yet.

pupeno 2015-12-14T10:49:32.000555Z

OK.

pupeno 2015-12-14T10:49:56.000556Z

You need to compile cljs with lein cljsbuild auto

pupeno 2015-12-14T10:50:07.000557Z

That will keep on watching the files and recompiling as necessary.

pupeno 2015-12-14T10:50:29.000558Z

figwheel does it automatically, but if you want lein run to work, you need lein cljsbuild auto running indenpendently.

agile_geek 2015-12-14T10:50:46.000559Z

If I run lein figwheel I get this:

Figwheel: Starting server at <http://localhost:3449>
Figwheel: Watching build - app
Compiling "resources/public/js/app.js" from ["src-cljs"]...
nil
clojure.lang.ExceptionInfo: Error in component :figwheel-system in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start {:reason :com.stuartsierra.component/component-function-threw-exception, :function #'com.stuartsierra.component/start, :system-key :figwheel-system, :component #figwheel_sidecar.system.FigwheelSystem{:system #object[clojure.lang.Atom 0x47096141 {:status :ready, :val #&lt;SystemMap&gt;}]}, :system #&lt;SystemMap&gt;}

pupeno 2015-12-14T10:50:55.000560Z

Unless this is with Duct, which has some sort of embedded figwheel

pupeno 2015-12-14T10:51:29.000562Z

component in cljs?

agile_geek 2015-12-14T10:51:34.000563Z

Nope

pupeno 2015-12-14T10:51:38.000564Z

Ah, no… my bad.

agile_geek 2015-12-14T10:51:39.000565Z

It's in the server

agile_geek 2015-12-14T10:51:47.000566Z

That's what's confusing me

agile_geek 2015-12-14T10:52:14.000567Z

I don't think I really understand what figwheel is doing here

pupeno 2015-12-14T10:52:29.000568Z

figwheel starts its own web server to server your js, html, etc unless you specify:

pupeno 2015-12-14T10:52:31.000569Z

`

pupeno 2015-12-14T10:52:36.000570Z

:figwheel {:css-dirs     ["resources/public/css"]
             :ring-handler free-form-examples.core/app}

pupeno 2015-12-14T10:52:51.000571Z

But you said you don’t have a plain ring handler to use.

agile_geek 2015-12-14T10:53:26.000572Z

Exactly. I want to run the server from lein run and figwheel at same time

pupeno 2015-12-14T10:53:52.000573Z

That is possible. I do that with my Luminus project, ninjatools.

agile_geek 2015-12-14T10:53:53.000574Z

Have lein run serve page and figwheel reload

pupeno 2015-12-14T10:54:55.000575Z

Where is that

:figwheel-system
coming from, I wonder.

agile_geek 2015-12-14T10:56:30.000578Z

Component system map? I didn't put it there.

pupeno 2015-12-14T10:56:46.000579Z

What template did you start from?

agile_geek 2015-12-14T10:57:54.000580Z

I didn't. I constructed that project.clj manually based on two projects.

pupeno 2015-12-14T10:58:40.000581Z

I’m not very good at plugging all the pieces together. I tried a couple of times but for me, this is very non-trivial.

thomas 2015-12-14T10:58:58.000582Z

morning

agile_geek 2015-12-14T10:59:20.000583Z

@pupeno: I know!

pupeno 2015-12-14T10:59:30.000585Z

Adding the clojure side to a figwheel plain project took me 2 or 3 hours. I should have started with Duct or Luminus instead and focus on my domain.

agile_geek 2015-12-14T11:00:35.000586Z

I think I need more time to read around it and understand the context of figwheel. Although I've read it 3 or 4 times already. This is exactly the kind of thing we need more support around in the community

pupeno 2015-12-14T11:01:40.000587Z

@agile_geek: can I be annoyingly repetitive and point out that the support is starting to exist in the form of templates like Duct and Luminus? :simple_smile:

agile_geek 2015-12-14T11:01:56.000588Z

:simple_smile:

mccraigmccraig 2015-12-14T11:30:47.000589Z

https://github.com/martinklepsch/tenzing is another nice cljs app template - based on boot rather than lein

thomas 2015-12-14T11:36:12.000591Z

my problem is that the templates are not composable...

thomas 2015-12-14T11:36:44.000592Z

ie. I want the compojure, figwheel, and the xxx template all at once.

thomas 2015-12-14T11:37:05.000593Z

no easy way to achieve that at the moment AFAIK

pupeno 2015-12-14T11:43:12.000594Z

thomas: we are sort of abusing templates. I think we should have less templates, many should be only for documentation purposes. If you want compojure, figwheel, then: lein new luminus whatevs +cljs or lein new duct whatevs +cljs. In Duct, we’ll have generators that allow you to generate more code after you created the template, such as lein gen endpoint posts. It is impossible to have fully composable templates unless we agree on certain conventions which will only happen under one structure.

pupeno 2015-12-14T11:43:53.000595Z

And choosing a bare minimum, such as lein new whatevs doesn’t help with composability anyway.

pupeno 2015-12-14T11:44:59.000596Z

I created an example project for my form library, Free-form, and deployed to Heroku: http://free-form-examples.carouselapps.com/ What do you think? The library is still quite incomplete, but I’m trying to make it more approachable.

thomas 2015-12-14T11:47:53.000597Z

I'll have a look.

mccraigmccraig 2015-12-14T12:03:36.000598Z

@thomas: not composable, and once you've run 'em you can't re-run 'em to take advantages of any updates without stomping over changes you have made... deeply dissatisfying, but better than nowt

thomas 2015-12-14T12:04:17.000599Z

I know... I was just wondering if it would be possible to make some thing better...

thomas 2015-12-14T12:04:25.000600Z

not even sure if that is acutally possible.

mccraigmccraig 2015-12-14T12:08:06.000601Z

you could perhaps arrange your template such that everything it generates stays separate from any changes you might make, either through separate files or, if absolutely necessary, some sort of comment-markup

mccraigmccraig 2015-12-14T12:08:33.000602Z

which addresses the re-run issue, but not the composability issue

pupeno 2015-12-14T12:12:30.000603Z

mccraigmccraig: that’s why I think templates should attempt to be as minimalistic as possible, moving things away into libraries. This is why I’m excited about Duct, it has a supporting library, unlike Luminus.

mccraigmccraig 2015-12-14T12:15:05.000604Z

@pupeno: i bought the boot kool-aid, at least for client-side stuff... but yeah, i agree about the templates being as minimalistic as possible

agile_geek 2015-12-14T18:44:34.000605Z

Anyone manage to start figwheel with nrepl from emacs the new way? https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl

agile_geek 2015-12-14T18:46:43.000609Z

After calling (start-figwheel!) I just see a dump of a massive map that seems to list every cljs function compiled and the repl hangs.

minimal 2015-12-14T19:00:15.000611Z

@agile_geek: i got it working, works great

agile_geek 2015-12-14T19:03:46.000612Z

I've tried on two different projects and failed spectacularly

minimal 2015-12-14T19:05:55.000613Z

i didn’t have to do much

minimal 2015-12-14T19:06:39.000614Z

roughly

minimal 2015-12-14T19:07:37.000616Z

and added the emacs function from the wiki

agile_geek 2015-12-14T21:14:49.000618Z

More proof that I really am thick...just doesn't work for me!