Fork me on GitHub
#ring
<
2017-02-10
>
weavejester15:02:34

@thomas: I believe there’s a “prep-task” or something like that that allows you to add your JS compile to your build. The uberjar might run a clean, so if your JS compilation isn’t included in your build, it might get wiped.

thomas15:02:18

I've added a :auto-clean false to my project.clj and that did the trick

weavejester15:02:38

@sineer: If you’re still having that error, the cause might be because you’ve put something like (:require ‘clojure.pprint) instead of (:require clojure.pprint).

weavejester15:02:17

@thomas: Ah good 🙂. :prep-tasks [[”cljsbuild” “once”] “javac” “compile”] might also work, so you add your CLJS building to your build.

thomas15:02:57

@weavejester that looks very useful indeed. I might add that

weavejester15:02:55

@thomas I generally have that, but in my :repl profile I turn it off with :profiles {:repl {:prep-tasks ^:replace [”javac” “compile”]}} because I’m typically using Figwheel during REPL development.

ikitommi17:02:20

are there any helpers in creating async-ring handlers & mw out of sync-ring counterparts? Should there be?

ikitommi17:02:03

with sync, you return something of throw, a wrapper with try woudn't cause a perf impact.

weavejester20:02:35

@ikitommi You can convert a sync handler into an async handler fairly easily:

(fn [handler]
  (fn [request respond raise]
    (respond (handler request))))

weavejester20:02:09

You can’t really do the same with middleware without resorting to blocking, so a sync middleware would negate the advantages of an async handler.

weavejester20:02:53

Essentially everything under a sync handler is synchronous, so it’s a one-way conversion.