Good morning.
@agile_geek: fancy doing that talk in Sheffield at some point?
I've been wanting a talk like that, but not gotten around to writing it đ
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.
@pupeno can't you just build locally and release the uberjar or war?
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â.
@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!
Yay! I managed to build my own repo.
@pupeno: this could help https://github.com/tobyhede/lein-git-deps
benedek: oh! looks promising! :simple_smile:
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)
agile_geek: can you share the project.clj?
@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
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.
free-form-examples is the minimum thing I managed to do to build a clj cljs project.
@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)
:source-paths (root) shouldnât have src-cljs unless you expect it to contain clj or cljc code. I think.
OK
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
Note I'm note using ring-handler as I'm starting server side using core and Components.
I have yet to build a project like that. Whatâs the symptom you are experiencing?
At this point I'm just trying to figure out how to run this with lein run
so not worrying about uberjar jsut yet.
OK.
You need to compile cljs with lein cljsbuild auto
That will keep on watching the files and recompiling as necessary.
figwheel does it automatically, but if you want lein run to work, you need lein cljsbuild auto running indenpendently.
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 #<SystemMap>}]}, :system #<SystemMap>}
Unless this is with Duct, which has some sort of embedded figwheel
component in cljs?
Nope
Ah, no⌠my bad.
It's in the server
That's what's confusing me
I don't think I really understand what figwheel is doing here
figwheel starts its own web server to server your js, html, etc unless you specify:
`
:figwheel {:css-dirs ["resources/public/css"]
:ring-handler free-form-examples.core/app}
But you said you donât have a plain ring handler to use.
Exactly. I want to run the server from lein run
and figwheel at same time
That is possible. I do that with my Luminus project, ninjatools.
Have lein run
serve page and figwheel
reload
Where is that
:figwheel-system
coming from, I wonder.Does https://github.com/bhauman/lein-figwheel/tree/master/sidecar#the-figwheelsystem-component ring any bells?
Component system map? I didn't put it there.
What template did you start from?
I didn't. I constructed that project.clj manually based on two projects.
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.
morning
@pupeno: I know!
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.
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
@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:
:simple_smile:
https://github.com/martinklepsch/tenzing is another nice cljs app template - based on boot rather than lein
my problem is that the templates are not composable...
ie. I want the compojure, figwheel, and the xxx template all at once.
no easy way to achieve that at the moment AFAIK
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.
And choosing a bare minimum, such as lein new whatevs
doesnât help with composability anyway.
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.
I'll have a look.
@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
I know... I was just wondering if it would be possible to make some thing better...
not even sure if that is acutally possible.
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
which addresses the re-run issue, but not the composability issue
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.
@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
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
When I follow the instructions here :https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#start-figwheel-repl-within-nrepl
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.
@agile_geek: i got it working, works great
I've tried on two different projects and failed spectacularly
i didnât have to do much
roughly
and added the emacs function from the wiki
More proof that I really am thick...just doesn't work for me!