Fork me on GitHub
#tools-deps
<
2018-06-13
>
hagmonk00:06:51

where's the cutting edge example for figwheel.main? I was just about to go looking for that

hagmonk00:06:24

I am thinking of adding it to http://github.com/hagmonk/depify, so that existing figwheel projects can be more easily converted over

bhauman00:06:55

@hagmonk working on a template right now

1
bhauman00:06:35

figwheel-main will be a tough conversion though

bhauman00:06:46

config names are different

bhauman00:06:40

but actually it should be pretty straightforward for most projects

hagmonk00:06:23

I'm sure there are some leiningen-isms that are not possible to bring across, or considered an anathema in the eyes of deps.edn, but I'd like to bootstrap people to the greatest extent possible

hagmonk00:06:46

I'm already generating Makefiles for my internal projects, so that particular pandora's box is open

bhauman00:06:11

Yeah just created a Makefile myself, I forgot how dang effective they are

👍 1
hagmonk00:06:59

Right?? Quick and painless … it had been at least 10 years since I wrote one

bhauman00:06:31

yeah and it can get pretty sophisticated with relatively little syntax

bhauman00:06:55

its like it was built for this particular job

hagmonk00:06:13

Just remember that literal $ signs need to be $$ to stop make from interpreting them :) Got caught by that one

bhauman00:06:20

I have noticed something interesting, if you use lein without plugins and only use the profiles and aliases, the performance is pretty similar

bhauman00:06:49

or significantly improved

hagmonk00:06:38

fascinating … perhaps plugin dependencies are in serial after everything else

bhauman00:06:52

they are dynamicly loaded

bhauman00:06:00

which is what causes the hit

hagmonk00:06:04

inherent to changing the classpath dynamically, or something specific with clojure like having to compile?

bhauman00:06:47

clojure needing to compile

hagmonk00:06:36

If the jar is in the classpath beforehand, is compilation skipped or just faster because the JVM gets to batch it all up at once?

bhauman00:06:45

lein is aot compiled

bhauman00:06:11

so... fast by itself

zentrope00:06:50

If someone made a super quick class-path-maveny thing in non-Java, make would sing.

alexmiller01:06:26

that would be very tedious

alexmiller01:06:39

however, you could graalvm the classpath maker

hagmonk02:06:43

hmm, @bhauman - java.lang.RuntimeException: No such var: cljs.repl/*repl-env*

bhauman03:06:52

@hagmonk that would happen if you were somehow getting an earlier version of CLJS than 1.10

bhauman03:06:09

we can talk about this in #figwheel-main

hagmonk03:06:55

ah, didn't know that existed :)

bhauman17:06:46

tools-deps does a silent failure when an alias doesn't exist

dominicm17:06:58

s/silent failure/ignores

alexmiller17:06:11

ticket welcome

alexmiller17:06:36

I thought I actually had a check for that, but maybe not

dominicm17:06:12

I don't know it's strictly a problem tbh

alexmiller17:06:32

seems like it’s more likely to be a typo than cleverness

hagmonk19:06:11

13th law of software development: itches are to be scratched by the one who itches.

alexmiller19:06:49

I’ve used the lein stuff for this a bit and it’s SUPER slow

alexmiller19:06:06

so slow that I just go use the equivalent web pages instead

alexmiller19:06:12

I have no idea why

alexmiller19:06:20

but maybe worth understanding

alexmiller19:06:19

some next level stuff would be to think about bridging the gap between ns and dep

dominicm19:06:35

@alexmiller what are the important features of the search? I've got a week of open source and JUXT are interested in deps.edn.

alexmiller19:06:03

lein search does approximately what I want, I just find it too slow to use

alexmiller19:06:32

I want google for deps

dominicm19:06:39

Startup or runtime? It will almost certainly be called find, because 4 letters.

alexmiller19:06:59

runtime is the part I’m referring to

dominicm19:06:22

But mavens is fast?

alexmiller19:06:25

I think there might be some giant index file that gets downloaded periodically?

alexmiller19:06:33

I don’t remember what maven has for this

alexmiller19:06:42

maybe I’m wrong that they do

alexmiller19:06:16

I just tried lein search again and it was pretty fast

alexmiller19:06:35

been a while

alexmiller19:06:19

how about this - I’d like to do lein search functionality without being tied to lein

dominicm19:06:40

Or tools.deps.alpha!

dominicm19:06:45

Just a main

alexmiller19:06:55

no reason it needs to be there

alexmiller19:06:24

I don’t think maven actually has apis for this - it’s site-specific functionality iirc

alexmiller19:06:32

(which also means they are different :)

dominicm19:06:55

Clojars has an index which mentions nexus.

alexmiller19:06:22

well, maybe they’re the same then, not sure

dominicm19:06:39

Maybe. No idea. Just a data point.

alexmiller19:06:53

the next level and far more interesting problem is how to connect namespaces and artifacts

dominicm19:06:17

I'm super interested in this.

dominicm19:06:27

Solving this makes writing plugins easier.

dominicm19:06:47

Both for different kinds of artefact, and for build tools.

alexmiller19:06:55

Rich and I have talked about it a lot but it’s a place where Maven doesn’t really help you much

dominicm19:06:33

What would a straw man solution look like? I'm struggling to picture something.

alexmiller19:06:33

I don’t have one :)

alexmiller19:06:56

sorry, other things I need to focus on atm

danielcompton22:06:05

Lein now uses the Clojars api iirc. It used to download some kind of massive index which was very slow

alexmiller00:06:30

Glad I’m not imagining that, and that it doesn’t now! It did seem plenty fast

bhauman23:06:48

@seancorfield trying to use clj-new with a locally installed lein template and not getting very far

seancorfield23:06:35

@bhauman Can you be a bit more specific?

seancorfield23:06:41

"locally installed"?

bhauman23:06:05

I did a lein install on a template I'm working on locally

bhauman23:06:00

should it be able to resolve it?

bhauman23:06:15

as it dies in clj_new.helpers$resolve_remote_template.invokeStatic(helpers.clj:64)

seancorfield23:06:53

Hmm, my normal process for testing templates is to install them locally and then try to use them via new...

bhauman23:06:13

here is the message

bhauman23:06:14

Exception in thread "main" clojure.lang.ExceptionInfo: Unable to locate Clojure's edn files {:exit 1, :out "Invalid option: -Sdescribe\n", :err ""}

seancorfield23:06:51

Ah, that's where it shells out (via tools.deps.alpha) to run clojure -Sdescribe...

seancorfield23:06:08

So the error is coming from tools.deps.alpha not being able to run that command.

bhauman23:06:38

and so there needs to be a deps.edn in the current dir?

seancorfield23:06:46

If you type clojure -Sdescribe in the folder where you are running clj-new what do you get?

seancorfield23:06:57

No, this isn't about deps.edn

bhauman23:06:14

invalid option

bhauman23:06:17

I have to update

seancorfield23:06:36

How old is your version of clojure?

seancorfield23:06:54

Here's what I see in a folder without deps.edn:

(! 665)-> clojure -Sdescribe
{:version "1.9.0.375"
 :config-files ["/usr/local/Cellar/clojure/1.9.0.375/deps.edn" "/Users/sean/.clojure/deps.edn" ]
 :install-dir "/usr/local/Cellar/clojure/1.9.0.375"
 :config-dir "/Users/sean/.clojure"
 :cache-dir "/Users/sean/.clojure/.cpcache"
 :force false
 :repro false
 :resolve-aliases ""
 :classpath-aliases ""
 :jvm-aliases ""
 :main-aliases ""
 :all-aliases ""}

seancorfield23:06:27

I thought -Sdescribe had been in there for ages... 👀

bhauman23:06:54

yeah its not in my help string

bhauman23:06:00

so upgrading

bhauman23:06:13

@seancorfield and you are enforcing that project names are multisegment and qualified?

bhauman23:06:23

shouldn't that be up to the template?

seancorfield23:06:20

By popular demand, I am disallowing single-segment project names, yes. You can either use a multi-segment name or a qualified name (or both).

seancorfield23:06:44

Some templates don't accept a qualified name -- which I consider a bug in those templates 🙂

bhauman23:06:54

@seancorfield it worked 🙂 but I'd like to be able to specify a single segement name like lein allows

seancorfield23:06:07

If they don't accept a qualified name, they should accept a multi-segment name.

bhauman23:06:53

the lein app template morphs a single segment name into a name.core

seancorfield23:06:09

Yes, which is a terrible idea.

seancorfield23:06:22

Even Phil says so.

seancorfield23:06:38

You can always do this:

(! 666)-> clj -A:new app bhauman.core
Generating a project called bhauman.core based on the 'app' template.

Wed Jun 13 16:43:52
(sean)-(jobs:0)-(~/clojure/scratch)
(! 667)-> tree bhauman.core/
|____
| |____.gitignore
| |____.hgignore
| |____CHANGELOG.md
| |____deps.edn
| |____doc
| | |____intro.md
| |____LICENSE
| |____README.md
| |____resources
| | |____.keep
| |____src
| | |____bhauman
| | | |____core.clj
| |____test
| | |____bhauman
| | | |____core_test.clj

gfredericks23:06:32

is (! 666)-> your bash prompt

gfredericks23:06:13

er; I guess the last of three lines of it

seancorfield23:06:45

Ah, yes, my crazy bash prompt... just a sec, I'll get the code for that...

seancorfield23:06:01

# 
PS1="\n\d \t\n\[\e[32;1m\](\[\e[37;1m\]\u\[\e[32;1m\])-(\[\e[37;1m\]jobs:\j\[\e[32;1m\])-(\[\e[37;1m\]\w\[\e[32;1m\])\n(\[\[\e[37;1m\]! \!\[\e[32;1m\])-> \[\e[0m\]"

bhauman23:06:02

@seancorfield OK well I don't see the disturbing problem with using a single segment when you are developing a webapp

bhauman23:06:30

thats going to be deployed to heroky

bhauman23:06:56

I should call it heroky from now on

seancorfield23:06:00

Then use <whatever>.core as your project name and you'll get what Leiningen does.

bhauman23:06:53

thanks I understand that, was just wanting to keep things familiar for folks who are used to doing lein new figwheel hello-world

bhauman23:06:35

but not a big deal

bhauman23:06:57

clj -Anew figwheel-main hello.core works

seancorfield23:06:49

See comments about ClojureScript in that thread, as well as Alex's comment.

bhauman23:06:10

you do realize I'm not advocating single segment namespaces?

seancorfield23:06:33

You seemed to be when you complained that clj-new disallowed them 🙂

bhauman23:06:34

a single segment argument atumatically gets a "core" segment appended

seancorfield23:06:40

I haven't -- yet -- disallowed them in boot-new but I may well propose that.

bhauman23:06:11

single segments don't work I get that

seancorfield23:06:44

Yes, and having thousands of projects with spurious .core namespaces, just because we were all too lazy to teach beginners to name things properly, is not a great situation to be in.

bhauman23:06:35

OK so I'm not asking for single-segment namespaces, and defaulting to core is a bad idea for an initial template