This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-12
Channels
- # bangalore-clj (4)
- # beginners (40)
- # boot (53)
- # cider (34)
- # cljs-dev (9)
- # cljsrn (11)
- # clojure (113)
- # clojure-boston (5)
- # clojure-dev (9)
- # clojure-dusseldorf (4)
- # clojure-russia (8)
- # clojure-spec (11)
- # clojure-uk (12)
- # clojurescript (88)
- # cloverage (17)
- # conf-proposals (4)
- # core-async (30)
- # cursive (9)
- # datomic (107)
- # euroclojure (5)
- # hoplon (196)
- # luminus (10)
- # off-topic (20)
- # om (24)
- # om-next (1)
- # onyx (80)
- # parinfer (3)
- # pedestal (16)
- # planck (44)
- # proton (8)
- # protorepl (1)
- # re-frame (19)
- # reagent (7)
- # spacemacs (2)
- # untangled (29)
- # yada (25)
Has anyone here used https://jarkeeper.com/ ? For some reason, some repos work, some just redirect you to the front page. E.g. caesium (my crypto lib) works fine, but cloverage just redirects me to the front page, e.g.: https://jarkeeper.com/lvh/caesium https://jarkeeper.com/lshift/cloverage
I have a weird case of exception disappearing in my Clojure code: it looks like I need a setDefaultUncaughtExceptionHandler
but the problem is that it is already there...the Exception itself is a compiler exception (I use a seq instead of a map) is executing inside a Runnable
. I can catch it with a try
no problem but I wonder why it was not going through the setDefaultUncaughtExceptionHandler
, has anybody had the same issue?
It is maybe one of these things that need a repro project, I will try to create one
@richiardiandrea: is this relevant? http://stackoverflow.com/questions/3875739/exception-handling-in-threadpools
http://stackoverflow.com/questions/2248131/handling-exceptions-from-java-executorservice-tasks
Thanks @danielcompton for the links I'll check them out
@danielcompton: it turns out it might be a manifold executor service issue
@richiardiandrea: futures also swallow exceptions
I don't think that's accurate. Rather they cause a failure in a background thread without a handler
The default uncaught exception handler should be able to trap those
And if you override the send-off executor you can catch set the thread handler
@alexmiller: what I meant was that if you run (do (future (assert false)) nil)
(i.e. you don't deref the future), the exception will never be shown, regardless of default exception handlers
oh right, it does capture it and emits on deref
but again, I’d say that’s not “swallowing” which implies to me “throwing away"
@alexmiller: didn't mean to imply that 🙂
though it's true that just using (future ...)
to do something in the background is a common idiom in clojure, but a dangerous one
@asolovyov: currently, no (you might want to use Throwable rather than Exception in the :clj branch btw)
I've come across an Om/Transit server encoding issue when using
the Stuart Sierra's Reloaded workflow, Pedestal, and Figwheel.
When Figwheel compiles the (client) code, and I reload the server
code via (reset)
, the om.transit writer no longer encodes the
#om/id
tagged literal. I've set up a test case with instructions
on how to replicate it as a git repo: https://github.com/grzm/bad-om-transit
My theory is that the client code compilation pollutes the code that's
reloaded by (reset)
. But I've reached my current limits on how to
further reduce the test case. Any thoughts?
can you move your client code out of the server-side classpath?
@robert-stuttaford: Good idea. How would I do that?
well, you can confirm your hypo by deleting the client code, restarting your jvm and doing a reset, and seeing that it still works. i had a similar issue, where reset couldn't find cljs macros
i ended up putting the cljs deps in the :dev profile of our backend project so it could 😊
If I don't compile the client code (i.e., don't run Figwheel), I don't have the problem.
I'd like to keep the client code and the backend code in the same project to keep them in sync.
yeah. so the trick is figuring out how to exclude your compiled js from your classpath while still keeping it somewhere that your web server can serve it from
or, maybe reset
can be given a list of exclusions ?
you totally can
but... are you using the om dep on the backend?
actually, profiles won't help
the root cause is that the compiled cljs in your public folder is on the classpath, and tools.namespace is loading it
that's what needs to be prevented
i actually needed the same thing, but i managed to bullet-time myself around it 🙂
no, in my case, the issue was that t.n.r/reset found cljs project macros in the classpath, and the required nses within were missing, because i had not included the dependencies in the project. all i had to do was add them to the :dev profile
one way you could hack it (and it IS a hack) is to have cljsbuild put your compiled stuff somewhere eg ./out and then update your template to serve from another service e.g. localhost:8000/my.js, and then run e.g. python -m SimpleHTTPServer
from within your out
folder
essentially run another webserver and update your js paths
good hunting!
@pesterhazy: I was aware of that and I have the uncaught handlers in place, what happens is that manifold actually swallows them, see repro case here: https://github.com/arichiardi/uncaught-ex/blob/master/src/uncaught_ex/core.clj It looks like the reason is that the manifold/dirigiste executor service collects stats and (understandably) you don't want it to crash. In any case I opened an issue and Zach will brilliantly advise :)
so what's the currently recommended way to make mobile apps with clojure/clojurescript?
@robert-stuttaford: Here's my fix:
(defn refresh-dirs
"Remove `resource` path from refresh-dirs"
([] (refresh-dirs repl/refresh-dirs))
([dirs]
(let [resources-path (-> "public" resource .getPath File. .getParent)
exclusions #{resources-path}
ds (or (seq dirs) (cp/classpath-directories))]
(remove #(contains? exclusions (.getPath %)) ds))))
(defn reset
"Destroys, initializes, and starts the current development system"
[]
(stop)
(apply repl/set-refresh-dirs (refresh-dirs))
(repl/refresh :after 'user/go))
Getting the path to the resource directory feels a bit hacky (what if I have multiple resource paths?) but that's a problem to solve another day.
Anyone know who maintains http://clojurians-log.clojureverse.org?
I'd love to figure out a way to include anchor fragments for individual messages to make it easier to reference a particular point in a conversation.
Thanks @shaun-mahood . Do you think that would be useful?
Yeah, I think that would help - I actually would have used it a couple times this week.
@plexus: hi! Is @shaun-mahood correct? Are you the one I can credit with maintaining the clojurians-log?
Yeah I've been wanting that for some time myself, just not high enough on the list so far
I'd be happy to look into it. I was just looking at your github repos to see if the code were there 🙂
here's the current version, I had to hack in some changes to make the GFM rendering work. https://github.com/plexus/slack-archivist
I'll take a look this weekend. Might be good to get my head out of the code I'm currently working on.
@plexus: How does the pipeline work from generating the log files to hosting them on clojureverse? Do you think it would be possible to put in a clojure step that modifies the files for the final output?
would love to replace some or all of it with clojure, it works in two steps, a bot collects the messages, a cron job turns them into static HTML
would make it easier/more fun for me to improve it as well, but like I said not something I can spend a lot of time on right now
Is the message format that comes out of step 1 reasonable to work with?
{"text": "ah right", "ts": "1470864853.000602", "user": "U050B88UR", "team": "T03RZGPFR", "type": "message", "channel": "C07UQ678E"}
it needs to resolve to those channel id's, can't remember now if it caches those or what
here are some notes how I set things up, might be useful to get it going locally https://gist.github.com/plexus/c4ec0335f43e7d27c65da94741069e8d
@plexus: Do you have the set of existing JSON stored somewhere still, or does it consume it as it goes? I'm thinking it could be a fun and useful future project to replace the interface, but probably not for a few months unless it becomes a good project to test other ideas with.
the logs are in a private github repo and are all kept, so it's always possible to regenerate with new templates or even build a complete new front-end
Ok awesome. Can you send me over a couple sample logs as well?
it's debatable whether those need to be private since you can scrape it all from the site but that's how it is now
Slack archival bots are against the ToS for Slack, sooo that's probably why they're kept private. 😬
my resource/public/index.html
has a <script src="js/app.js"></script>
which points to compiled cljs code inside the resource. but when I try it out i always get 404 on the app.js resource. this thing is running on a compojure
And can you directly load http://localhost/js/app.js in the browser?
I can confirm that there is a file in the folder but I cannot access the file via browser
@bur: Did you start with a specific template?
I started from the heroku clojure example and expanded it slowly from there. https://github.com/heroku/clojure-getting-started
but hacking away on clojure has been fun so far. started out today and already did some fiddlements with redis 🙂
I think this is the Solution but i am already in bed http://stackoverflow.com/questions/21722598/troubleshooting-clojure-web-app-connecting-html-and-css-for-heroku-deployment