Fork me on GitHub
#clojure-uk
<
2019-07-10
>
acron08:07:47

morning

👏 4
practicalli-johnny08:07:15

Wondering how many of us are using Clojure CLI tools / deps.edn for our projects. I have been experimenting for a while, but think I am ready to do start doing some new project with CLI tools rather than Leiningen.

mccraigmccraig08:07:04

been watching it... just ditched boot from our toolchain and switched our cljs build over to shadow-cljs. i think moving the lein stuff over to deps.edn might be next

acron08:07:43

what was boot not providing you that you needed?

mccraigmccraig09:07:05

@U052SB76M we were only using boot for cljs builds (with less, dev http server etc) , and the shadow-cljs boot integration didn't look great, so we dropped boot and went with gulp for driving shadow-cljs

mccraigmccraig09:07:43

turns out gulp is awesome - i'd love to be able to define gulp tasks in cljs with lumo or something

alexlynham09:07:21

I think we could probably use the node interop stuff like when you do cljs serverless builds on top of the underlying framework

mccraigmccraig09:07:28

yeah, probably... gulp tasks are just vanilla fns quite like ring handlers, so we could probably use gulp as a lib from a lumo script

dharrigan09:07:05

As newbie, I tried both, but fell in with the deps.edn crowd and loving it 🙂

dharrigan09:07:28

Took inspiration from juxt/edge and sean corfield dot repo

djtango09:07:00

most side-projects only use deps.edn now

djtango09:07:09

feels so much lighter than lein somehow

djtango09:07:28

and love that I can use local dirs and git repos as an alternative to maven

alexlynham09:07:25

the local dirs is a big win imo

practicalli-johnny10:07:38

Being able to use code straight from any git repository and specific commit would hopefully kill off any idea people have about creating mono-repos

👍 4
Olical10:07:07

Before you know it you're writing monorepos of tools to manage your monorepos.

practicalli-johnny11:07:26

The heat death of the universe jumps a lot closer every time someone creates a mono-repo

Olical11:07:32

We should write a satire program that manages infinite nested stacks of monomonomono...monomonorepos. Selling point is that you can put all of GitHub in that repo, then put all of GitHub, bitbucket and GitLab beside each other another level up.

Olical11:07:05

Although I don't think that snark would go down very well with many people 😅

practicalli-johnny11:07:35

It might not go down very well with certain JavaScript focused devs... it does seem to be they who love the mono-repo... I think everyone else would love it 🙂

Olical11:07:25

I wonder where that stems from, I guess the culture of breaking every single thing into it's own independent module. left-pad, I'm looking at you.

practicalli-johnny11:07:46

Yes, and I wonder how many people remember that pain... of if they have just buried their pain... in more mono-repos :rolling_on_the_floor_laughing:😂

mamapitufo13:07:56

as a JS dev I rather have all the stuff in a monorepo :P

mccraigmccraig13:07:14

i'm not a JS dev, but give me a sweet sweet monorepo every time

mamapitufo13:07:06

I spent way too much time opening n+1 PRs on different repos for the same feature, then cascading releases in CI, merging a few more PRs, releasing a few more things, etc. And in the end, I missed at least one dependency.

Olical13:07:52

different requirements I guess ¯\(ツ)

Olical13:07:01

All of my work happens in one repo

mamapitufo13:07:28

all of mine too ;)

mamapitufo13:07:26

I guess you could have a single project and a few build targets, and that's the same thing, you just offload that work to a different tool

mamapitufo13:07:46

but most of the JS build tools deal with a single target, so you need to have things like lerna

mamapitufo13:07:51

you could also have multiple "main" files and a "makefile" for each

seancorfield16:07:17

@jr0cket Why you hatin' on monorepos? We love our monorepo setup and CLI/`deps.edn` is perfect for that scenario.

seancorfield16:07:26

We started with Leiningen back in 2011 at work, switched completely to Boot in 2015, and switched completely to CLI/`deps.edn` at the end of 2018. We use Cognitect's test runner, my version of depstar and a few other small tools, plus a dedicated dev subproject for REPL/REBL setup.

practicalli-johnny18:07:58

Some of the issues around mono-repos are well define as there is a long history of this approach https://en.m.wikipedia.org/wiki/Monorepo

practicalli-johnny18:07:08

All the monorepos I have experienced over the years have been terrible to use. Maybe people are being more responsible in the way they are using them now, bit I have never had the pleasure to see this.

seancorfield18:07:36

I figure that if those companies use monorepos for their huge codebases, then monorepos can't be all that bad 🙂

dominicm19:07:18

The arguments against monorepos have never come across as strong to me. I have made extensive research on the topic in order to justify the Edge design. Nothing was particularly convincing. Most of the points made are often true whether you use non-mono or mono repos.

4
practicalli-johnny21:07:14

@U09LZR36F is edge designed to contain multiple different projects? For example if my company builds 10 different Clojure projects from various areas of the business they will all be from the one Edge repository?

dominicm10:07:29

@jr0cket They can be. I think a monorepo should serve a purpose though. If there are hard social/technical boundaries in your company e.g. you'd never know they were using clojure, then there's reduced purpose in a monorepo. If it's overlapping teams, with overlapping communications, then the monorepo is more valuable.

dominicm10:07:48

At JUXT we tend to end up with an Edge repo per major client project.

practicalli-johnny10:07:09

Thanks for sharing. Yes a repo per major project makes sense, especially in a consultancy situation. That is not really the monorepo as I have experienced them though, as they have had all the major projects in there 🙂

mccraigmccraig13:07:50

we're a product company with one app - each component of that app gets a module in a monorepo - life is much easier than when we had a repo per component

practicalli-johnny13:07:16

There is definitely different levels of scale when people talk about monorepos. If you had 10 different apps in the one repository, that would make me cry and need a lot of hugs 🙂

alexlynham13:07:01

monorepo per product is v different from company-wide monorepo

practicalli-johnny13:07:15

yes, I suspect the term has been used to mean different things in the discussion we have had. The wikipedia article does define a monorepo as more of a company wide repo, or major area of business in large enough corps. On that scale I have always found it difficult to get anything done and seen huge amounts of duplication, but I think that is as much the culture as the tooling.

alexlynham13:07:44

I tend to hear it used as a per-project thing e.g. for microservices - each service in a separate repo or all services in a ‘monorepo’

seancorfield17:07:11

Our monorepo has our OAuth2 server, our public API server, our Login server, and Billing apps and Chat apps and a few other bits and pieces. Essentially it's all our Clojure code. Our legacy CFML code lives in a separate repo (which had three apps, now only two).

dominicm10:07:25

it's also worth considering the company scale in that too. In smaller companies, I suspect a company-wide repo is fine, it will probably encourage code-sharing & common libs between you. In those situations it seems fine. Smaller is left intentionally ambiguous here, because I'm not sure where the threshold is. Eventually you would probably stabilize the common lib api and split it out into it's own repo & lifecycle. I definitely see monorepos as a bell-curve. Early days = monorepo, mid-size = multi-repo, max-size (google/twitter) = monorepo

alexlynham08:07:15

a lot of teams/business areas at the old place had monorepos and … the experience was mixed

alexlynham08:07:29

depends on your discipline within that repo on keeping things sensible and decoupled

dominicm19:07:36

I imagine this is the old peopleware curse: we blame technology, when the problems are sociological!

dominicm19:07:12

it's the same as microservices vs monoliths. It's mostly down to team discipline rather than some inherent advancement.

alexlynham08:07:45

the most disciplined teams tend to deliver better software more often, regardless of context

alexlynham08:07:00

seen that in big teams and small, big companies and small now

practicalli-johnny11:07:32

I love talking about Clojure in the morning...

Olical11:07:28

Wait, you mean it's possible to spend time not talking about Clojure? Uh oh.

Wes Hall15:07:23

I am using CLI tools for basically everything now, and think it's great. Lein was starting to feel a bit too much like maven. I like the lightweight. I am not convinced that all of the -R vs -C vs -O vs -M stuff isn't a bit over designed and I end up just using -A for everything, but as a sweet little bootstrapper, it's pretty... well... sweet.

otfrom15:07:00

I keep meaning to move over to clj, but stop every time I create a new project as I don't have the time to learn it. Is there a 30 second -> 5 minute guide out there about moving from lein to clj?

danielneal16:07:37

I snuck it in almost accidentally one time when I needed a clojure scratchpad with dependencies. Put a deps.edn in a folder with {:deps {cheshire {:mvn/version "5.8.0"}}} to pull in cheshire and cider-jacked-in and everything seemed to work.

otfrom08:07:06

ah, now that is something I'm glad to hear (as part of it for me has been understanding if I'd need to do anything to CIDER)

danielneal09:07:39

minimal

👍 4
seancorfield15:07:13

@wesley.hall I use -R vs -A when I need to pull in dependencies but not run code, for example with my aliases for REBL and a few other things. Also on CI, where I use clojure -R:bunch:of:aliases -Spath > /dev/null to bring in all the dependencies so they can be cached, and then in the "run" portion of the job I use -A and it adds all the (now cached) deps to the classpath and also runs tests etc.

seancorfield15:07:21

@otfrom If you stick my https://github.com/seancorfield/dot-clojure deps.edn in your ~/.clojure folder, then creating a new CLI project is just clj -A:new app otfrom/my-new-project and running tests in that project is just clj -A:test:runner

👍 4
Wes Hall15:07:39

@seancorfield Fair point that. Useful for building things like docker style images where you want all the deps loaded in, ready to go, at build time. I hadn't really thought of that. Perhaps I should rethink it 🙂.

seancorfield16:07:09

I don't use the difference very often, and it's pretty much with just -R, but it's a useful feature.

alexlynham16:07:26

imo having -<letter> is a pita but it’s a minor complaint

alexlynham16:07:46

I don’t want to have to type flags ideally for a command I type a lot

alexlynham16:07:04

(I know, I know, unix cmds, git etc etc)

seancorfield16:07:26

We started with Leiningen back in 2011 at work, switched completely to Boot in 2015, and switched completely to CLI/`deps.edn` at the end of 2018. We use Cognitect's test runner, my version of depstar and a few other small tools, plus a dedicated dev subproject for REPL/REBL setup.

Wes Hall16:07:47

@alex.lynham It wasn't so much about the -<letter> convention but the model of splitting profiles into parts where you can use different letters to include different parts of different configurations in different ways. It always struck me as quite a lot of cognitive load. When I create a profile, I don't really think about it as something I can just decide to, "include the dependencies but not the options or entry point", my fairly puny brain can't get past the simpler model where the profile is either fully switched on, or fully switched off, though @seancorfield's example of using -R to simply download deps without running anything maps in my brain quite nicely onto similar things in other tools, so that use-case does actually make sense to me.