Fork me on GitHub
#ldnclj
<
2015-12-14
>
glenjamin07:12:59

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

glenjamin07:12:21

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

Pablo Fernandez08:12:51

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_geek09:12:01

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

Pablo Fernandez09:12:43

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_geek09:12:31

@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!

Pablo Fernandez09:12:49

Yay! I managed to build my own repo.

Pablo Fernandez09:12:22

benedek: oh! looks promising! simple_smile

agile_geek10:12:11

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)

Pablo Fernandez10:12:37

agile_geek: can you share the project.clj?

agile_geek10:12:49

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.

Pablo Fernandez10:12:17

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

agile_geek10:12:16

@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)

Pablo Fernandez10:12:05

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

agile_geek10:12:43

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

Pablo Fernandez10:12:36

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

agile_geek10:12:18

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

Pablo Fernandez10:12:56

You need to compile cljs with lein cljsbuild auto

Pablo Fernandez10:12:07

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

Pablo Fernandez10:12:29

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

agile_geek10:12:46

If I run lein figwheel I get this:

Figwheel: Starting server at 
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 #<SystemMap>}]}, :system #<SystemMap>}

Pablo Fernandez10:12:55

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

Pablo Fernandez10:12:29

component in cljs?

Pablo Fernandez10:12:38

Ah, no… my bad.

agile_geek10:12:39

It's in the server

agile_geek10:12:47

That's what's confusing me

agile_geek10:12:14

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

Pablo Fernandez10:12:29

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

Pablo Fernandez10:12:36

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

Pablo Fernandez10:12:51

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

agile_geek10:12:26

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

Pablo Fernandez10:12:52

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

agile_geek10:12:53

Have lein run serve page and figwheel reload

Pablo Fernandez10:12:55

Where is that

:figwheel-system
coming from, I wonder.

agile_geek10:12:30

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

Pablo Fernandez10:12:46

What template did you start from?

agile_geek10:12:54

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

Pablo Fernandez10:12:40

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.

Pablo Fernandez10:12:30

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_geek11:12:35

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

Pablo Fernandez11:12:40

@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

mccraigmccraig11:12:47

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

thomas11:12:12

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

thomas11:12:44

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

thomas11:12:05

no easy way to achieve that at the moment AFAIK

Pablo Fernandez11:12:12

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.

Pablo Fernandez11:12:53

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

Pablo Fernandez11:12:59

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.

thomas11:12:53

I'll have a look.

mccraigmccraig12:12:36

@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

thomas12:12:17

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

thomas12:12:25

not even sure if that is acutally possible.

mccraigmccraig12:12:06

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

mccraigmccraig12:12:33

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

Pablo Fernandez12:12:30

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.

mccraigmccraig12:12:05

@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_geek18:12:34

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_geek18:12:43

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.

minimal19:12:15

@agile_geek: i got it working, works great

agile_geek19:12:46

I've tried on two different projects and failed spectacularly

minimal19:12:55

i didn’t have to do much

minimal19:12:37

and added the emacs function from the wiki

agile_geek21:12:49

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