This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-31
Channels
- # aws (1)
- # beginners (70)
- # boot (12)
- # calva (45)
- # cider (45)
- # clara (1)
- # cljdoc (10)
- # cljs-dev (133)
- # clojure (315)
- # clojure-dev (2)
- # clojure-europe (2)
- # clojure-italy (16)
- # clojure-nl (1)
- # clojure-spec (23)
- # clojure-uk (19)
- # clojurescript (48)
- # cursive (11)
- # data-science (5)
- # datomic (18)
- # figwheel-main (3)
- # fulcro (18)
- # graphql (14)
- # jackdaw (1)
- # juxt (1)
- # kaocha (1)
- # off-topic (10)
- # other-languages (3)
- # pathom (2)
- # pedestal (7)
- # re-frame (23)
- # reagent (1)
- # reitit (4)
- # ring-swagger (12)
- # rum (4)
- # shadow-cljs (26)
- # specter (6)
- # speculative (12)
- # tools-deps (44)
- # vim (8)
- # yada (2)
I just updated my .clojure/deps.edn
file on GitHub to add REBL support etc https://github.com/seancorfield/dot-clojure/commit/66f2b8fe1d1fd44ba42c79cd9489e7ac620e5fef
is it possible to access environment variables in deps.edn like $HOME
? probably not..
Is it a transient thing for working on a local copy of a library? clj -Sdeps "...$HOME..."
?
hi all... so I've been attempting to transition over to the deps.edn
-- first of all, is there a name for this style of build tools? aka lein
vs boot
vs ... what... deps
?. In general it's great but there seems to be "something else going on". I'm seeing blog posts about a build.clj
file but I don't see anything official on it. Can anyone explain what that's all about or have a good reference for it?
@goomba leiningen and boot are fully-featured toolbelts for doing things like fetching and loading dependencies, building uber jars, running tests, etc.
tools.deps is only about fetching and dependencies and building a classpath to run your JVM program. it doesn't handle any of the other things
okay, maybe I'm in the wrong place? is the clj
tool not part of this and deps.edn
?
clj is about two things: making classpaths from transitive deps, and launching programs
deps.edn describes the deps and ways to modify the making of classpaths
all other tasks are programs, so you launch a program to do the task
so far it's been great at those π
is that where these build.clj
files I'm seeing come in?
^^ some tools
no one idea what build.clj is
but itβs not deps.edn / clj
because clj
doesn't do all those other things, some people have decided to write their own script for e.g. building a JAR file, or bundling the CLJS code. instead of using a leiningen feature or plugin
here's the only example I can find
https://github.com/clojure/clojurescript/blob/master/samples/string-requires-npm-deps/build.clj
okay so that stuff is essentially home-rolled scripting that some decide to call build.clj
interesting. That is the one area in which I'm hurting right now -- I've been running lein in parallel with clj because I can't find a reliable way to do uberjars
mhm. Are uberjars not really a thing for clojure? I assumed that was the defacto standard for deployment
they are very common. there are at least 3 tools in that tools page above that build them
indeed. Just trying to consolidate methodologies as much as possible.
thanks everyone for fielding questions π
I think some people are moving away from them for Clojure, since there's not a ton of benefit you get other than improved startup time in most cases
they are certainly convenient as a unit of deployment
what do they otherwise deploy with then? clj -m mything.core
?
ah I was also conflating it with AOT. but currently I throw it all in a docker container because I already have infrastructure for that Β―\(γ)/Β―
@goomba FWIW, at work we use (my fork of) depstar
to build all-source uberjars for pure convenience of shipping an "artifact" to a server; to run those we do java -cp path/to/the.jar clojure.main -m entry.point ...
where entry.point
is the namespace containing the -main
we wish to run (our artifacts often contain several, related -main
functions in different namespaces).
All of our dev/test process uses clojure
(the core of clj
) wrapped in a small bash script to simplify handling of command line options.
gotcha (worth a lot, as always!)
We do not AOT anything.
It's also worth mentioning, as background, that we started with lein
back in 2011 (ish -- that was when we first took Clojure to production), and we switched completely to boot
at the end of 2015 (I think, I'd have to go consult my blog to be sure), and then we switched completely to clj
/`deps.edn` last year.