This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-17
Channels
- # admin-announcements (9)
- # beginners (96)
- # boot (77)
- # cljs-dev (23)
- # cljsrn (18)
- # clojure (206)
- # clojure-austin (7)
- # clojure-conj (5)
- # clojure-japan (7)
- # clojure-poland (13)
- # clojure-russia (130)
- # clojure-taiwan (1)
- # clojurescript (125)
- # cursive (13)
- # data-science (2)
- # datascript (3)
- # datomic (2)
- # hoplon (24)
- # immutant (5)
- # jobs (4)
- # ldnclj (3)
- # ldnproclodo (2)
- # off-topic (2)
- # om (70)
- # onyx (12)
- # re-frame (6)
- # vim (2)
so It seems i have been able to get the app deployed to heroku!! needed to build uberjar but now jetty is giving a 404
@micha what was the design decision around boot always pulling deps?
boot always goes through the process of pulling deps for a project (or at least checking for them) whenever it’s run
is there a way to disable this?
im not so much having an issue as it’s a huge ammount of time spent pulling deps for a container every time I want to test a change in build.boot
ok i thought it already cached those
see here https://github.com/adzerk-oss/boot-clj-docker-image#cache-maven-artifacts-at-build-time
yeah i moved all of my compiling to the task that the container runs
the compiled uberjar is throwing a 404 but I can run it in dev?
@micha got the uberjar working (cant quote the ns)
hmm... im not getting any messages from the reload ring middleware when it's reloading namespaces. it's annoying because i can't even see compilation errors either. i was expecting to see them via castra at least but they dont appear there either
i checked the example in the lein new hoplon-castra x
generated project but that doesnt have any special setup, just uses (serve :reload true)
@onetom: can you post the boot task
(deftask dev
"Build backends for development."
[]
(let [nrepl-port 9999]
(spit ".nrepl-port" nrepl-port)
(comp (serve :port 3001
:reload true
:handler 'appboard.api/ring-handler
:nrepl {:port nrepl-port})
(wait))))
(def ring-handler
(->
(site #'routes)
(wrap-defaults api-defaults)
(wrap-castra
'our.api 'some-more.api ...)
(wrap-utf-8)
(wrap-session
(node-mongo-session (config :db) "sessions" "xxxxx"))
(wrap-cors (re-pattern (str "^" (config :frontend-url) "/?$"))
(re-pattern (str "^" (config :homepage-url) "/?$"))
(re-pattern (str "^" (config :cockpit-url) "/?$")))))
hmm actually im not seeing any difference when i change :reload
to false
https://github.com/ring-clojure/ring/blob/master/ring-devel/src/ring/middleware/reload.clj#L19-L22
we have actually looked into the patches and i saw u touched something around the reload
When I do require inside a deftask
body I get a class not loaded error, when I do it outside everything works. Is that expected?
@jaen https://github.com/boot-clj/boot/wiki/Run-time-requires-%28within-task-definitions%29
@jaen: not sure if this is what you’re looking for but came to mind reading your question
Well, I haven't read this wiki page, but I'm doing exactly that. Maybe something else is wrong then.
(deftask dev
"Starts the development environment."
[]
(require 'scrabble.backend.core)
(let [system-var (resolve 'scrabble.backend.core/dev-system)]
(comp
...)))
Ok, nevermind, I thought I substituted the var quote for resolved var in the body of the task, which I didn't.
@pandeiro: we have a split frontend/backend setup, so
a, we use [jumblerg/ring.middleware.cors "1.0.1"]
as shown above
b, as your readme suggests, we just use wait
instead of watch
, unlike the hoplon-castra template shows
as a result im just seeing errors, like:
POST
XMLHttpRequest cannot load . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access. The response had HTTP status code 500.
so the backend error is not visible on the line of POST
and i assume because of the lack of watch, i don't see the compilation error on the terminal either.it seems that the response with the error message doesnt have the CORS headers, but im not sure at which level is it stripped off i might try to debug it tomorrow with print-foo's middleware support maybe...
@onetom I don't think wait/watch should matter. Are you sure you whitelist all the headers your using with the cors request? That's one possible gotcha.
Has anyone experienced obscenely slow tests using boot-test? My tests run in a fraction of a second via CIDER but take almost a minute when part of a task pipeline with boot-test.
@micha: Yeah, testing from the repl is what I meant by cider. That's basically instantaneous. The pipeline is (watch) (speak) (test) (repl :server true)
Hmm doesn't boot-test run the tests on a fresh pod each time?
It will be really slow when compared to just reloading one ns and running the tests
Or even when compared to reloading the changed ns (via c.t.n or ns-tracker)
@juhoteperi: Even specifying that tests should be run on specific namespaces is awfully slow
Yeah it will reload all the namespaces where the specific namespace depends on
or not reload, but just load
because boot-test uses completely empty pod each time
Is it this slow for everyone could there be something pathologic with my system? I don't think anyone would use boot-test if this was the norm.
I don't use boot-test for development, only for CI
Well, that doesn't sound normal
Used boot test recently with watch and it was super snappy
Does the test namespace require any slow to compile namespaces?
fixtures: It's a datomic in-memory test. Only a single conn is created and all tests are run using with
so I doubt that is a major time hog.
@micha: Understood. However the fixture loads instantaneous by my perception (so a few hundred ms at most) and is only run once per ns. It might contribute a few seconds in total to the test time but I don't think it accounts for the total time. I'm trying to start a repl to test recompiling dependent namespaces but am having network issues. Will check back later when I get it working.