Fork me on GitHub
#clojurescript
<
2017-08-02
>
mobileink00:08:11

the Closure compiler is not really a compiler, it’s an optimizer. with optimizations :none, it is not called. otoh, Clojurescript is a compiler, it translates cljs to js. so with no optimizations you get the latter but not the former.

mobileink00:08:23

at least that’s my understanding.

qqq00:08:30

that's kind of crazy then; I would expect a clojure "cljs -> js" translator to be slightly faster

mobileink00:08:37

Faster than what? The clojurescript compiler is cljs->js.

mobileink00:08:07

what’s crazy about it? makes perfect sense to me.

qqq00:08:11

I have a hard time seeing how translating 3000 lines of cljs into js should take 40 seconds

tbaldridge01:08:11

You keep saying that, but I've never seen compile times so slow with CLJS. I'd love to see what you're compiling sometime

tbaldridge01:08:35

most of my CLJS incremental compile times are around 1.5 seconds.

qqq06:08:35

@U07TDTQNL : that's not my incremehntla compile time, that's my "initial compile time"

qqq06:08:40

my incremental compiles are also < 2s

qqq06:08:12

"initial cmpoile time" as in how long "main.js" takes when boot starts up the first time

juhoteperi07:08:33

Is that number from Boot (`Elapsed time: xx sec`) or from ClojureScript compiler (`Compile sources, elapsed site:`)?

qqq11:08:54

2017-08-01 20:21:53.534:INFO::main: Logging initialized @4884ms
Starting reload server on 

Starting file watcher (CTRL-C to quit)...


Writing adzerk/boot_reload.cljs to connect to ...
Writing main.cljs.edn...
Compiling ClojureScript...
• main.js
Elapsed time: 36.705 sec

juhoteperi11:08:00

That time is from Boot and includes lots of other things besides just Cljs compilation

juhoteperi11:08:13

Clj compilation of boot-cljs, boot-reload namespaces, java logging initialization, writing files to Boot temp dirs etc.

juhoteperi11:08:43

Boot has some overhead over just using ClojureScript compiler alone, or over Lein-cljsbuild/figwheel, due to tmp-dirs and pods

juhoteperi11:08:31

You can enable :compiler-stats to check ClojureScript compiler timing: https://clojurescript.org/reference/compiler-options#compiler-stats

juhoteperi11:08:51

I think 15-20 sec from that is from ClojureScript compiler and rest is other tasks and overhead

qqq12:08:38

@juhoteperi :

2017-08-02 08:38:37.393:INFO::main: Logging initialized @4826ms
Starting reload server on 

Starting file watcher (CTRL-C to quit)...

Compiling main.css...
Writing adzerk/boot_reload.cljs to connect to ...
Writing main.cljs.edn...
Compiling ClojureScript...
• main.js
Compile sources, elapsed time: 27768.580548 msecs
Compile sources, elapsed time: 32.27119 msecs
Writing target dir(s)...
Elapsed time: 37.437 sec

tbaldridge12:08:27

why do you care about non-incremental compiles?

tbaldridge12:08:39

should only really need to be done once a day or so

juhoteperi12:08:55

That is true also

qqq12:08:57

it's mainly out of curiosity than actual need

juhoteperi12:08:17

But that does look like a bit more than it usually takes for me

qqq12:08:31

practically, it doesn't matter; intellectually, I'm just curious if I can tweak it somehow

juhoteperi12:08:38

❯ cloc --include-lang=Clojure,ClojureC,ClojureScript src
     179 text files.
     179 unique files.                                          
      39 files ignored.

 v 1.72  T=0.31 s (451.4 files/s, 65060.4 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Clojure                         70           1172            611           7387
ClojureScript                   51            890            198           7245
ClojureC                        19            373            152           2148
-------------------------------------------------------------------------------
SUM:                           140           2435            961          16780
Compile sources, elapsed time: 20190.453699 msecs

juhoteperi12:08:19

Recent releases have cut a few seconds from this already

qqq12:08:30

also, I recently got a deell power edge with 2 x 6 cores + 96 gb of ram; so I was hoping things would massively parallelize, and the 'initial startup compile/run time' would also decrease

qqq12:08:17

hmm, this current compile isn't even 3k loc, it's only 1.3kloc:

cloc src/
      18 text files.
      18 unique files.                              
       0 files ignored.

 v 1.72  T=0.05 s (334.8 files/s, 32398.5 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
ClojureC                        14            350             40           1152
Clojure                          1             22             10             90
ClojureScript                    3             20              0             58
-------------------------------------------------------------------------------
SUM:                            18            392             50           1300
-------------------------------------------------------------------------------

(I have a weird setup where directories get moved around alot for different projects)

juhoteperi12:08:49

Dependencies also matter, as those are also compiled

qqq12:08:32

is every dependency compiled from scratch on startujp ?

qqq12:08:55

ah; that's probably it; for some reason, I thought they were compiled once and cached

juhoteperi12:08:59

With Boot-cljs anyway, as it doesn't have persistent output-dir between runs

qqq12:08:21

(set-env!
 :source-paths #{"src"}
 :resource-paths #{"resources/client/"}
 :dependencies '[;; clojure core

                 [org.clojure/clojure "1.9.0-alpha17"]
                 [org.clojure/clojurescript "1.9.854"]
                 [org.clojure/core.async "0.3.441"]
                 [org.clojure/core.match "0.3.0-alpha4"]

                 [haslett "0.1.0"]

                 ;; client support
                 [adzerk/boot-cljs "1.7.228-2" :scope "test"]
                 [adzerk/boot-reload "0.5.1" :scope "test"]
                 [adzerk/boot-cljs-repl "0.3.3" :scope "test"]
                 [pandeiro/boot-http "0.8.3" :scope "test"]
                 ;; repl support
                 [com.cemerick/piggieback "0.2.1" :scope "test"]
                 [weasel "0.7.0" :scope "test"]
                 ;; [org.clojure/tools.nrepl "0.2.12" :scope "test"]
                 
                 ;; server
                 ;; [ring "1.6.0-RC1" :scope "test"]
                 ;; [ring-middleware-format "0.7.2" :scope "test"]
                 [com.cognitect/transit-cljs "0.8.239"]
                 [org.martinklepsch/boot-garden "1.3.2-0"]


                 [cljs-ajax "0.6.0"]
                 [binaryage/oops "0.5.5"]
                 [reagent "0.6.0"]
                 [reagent-utils "0.2.1"]

                 [ring/ring-core "1.5.0" :scope "test"]
                 [ring/ring-jetty-adapter "1.5.0" :scope "test"]])
that looks like it can easily take 40s

juhoteperi12:08:23

Lein-cljsbuild and others just keep the output-dir between runs so Cljs can use the compiler cache

qqq12:08:59

alright, I'm okay with the answer of "it's the dependencies"

qqq12:08:04

thanks for your time in helping me debug this

juhoteperi12:08:11

I COULD implement some kind of persistent cache for Boot-cljs, but improving startup time has not been a priority for me, and this would introduce some cases where the cache probably would need to be cleared manually

qqq12:08:51

it's fine as is; it's not a practical problem; just an intellectual curiosity

tbaldridge12:08:18

the other thing to mentions is that in lisps LOC is a less useful metric

tbaldridge12:08:30

A go block has way more lines of code than a when

tbaldridge12:08:44

even though they may look the same

qqq17:08:45

I have a minimal boot project:

(set-env!
 :source-paths #{"src"}
 :resource-paths #{"resources/client/"}
 :dependencies '[;; clojure core

                 [org.clojure/clojure "1.9.0-alpha17"]
                 [org.clojure/clojurescript "1.9.854"]

                 ;; client support
                 [adzerk/boot-cljs "1.7.228-2" :scope "test"]
                 [adzerk/boot-reload "0.5.1" :scope "test"] 

                 ;; repl support
                 [org.martinklepsch/boot-garden "1.3.2-0"]])

qqq17:08:02

merely starting up takes:

Starting reload server on 

Starting file watcher (CTRL-C to quit)...

Compiling main.css...
Wrote: /home/x/.boot/cache/tmp/home/x/build/client/hxf/-60q7oj/main.css
Writing adzerk/boot_reload.cljs to connect to ...
Writing main.cljs.edn...
Compiling ClojureScript...
• main.js
Compile sources, elapsed time: 2703.131897 msecs
Compile sources, elapsed time: 33.903338 msecs
Writing target dir(s)...
Elapsed time: 12.273 sec

juhoteperi17:08:14

That seems reasonable startup speed for empty project

qqq17:08:38

alright; I can 'build up' from here and see each thing that adds time

mobileink00:08:36

shrug. i guess it depends on which 3000 lines.

mobileink00:08:21

e.g. does your 3K loc contain 5K namespaces?

mrchance00:08:32

Is this not correct?

(ns foo
  (:refer-clojure :rename {map clj-map
                           filter clj-filter
                           or clj-or
                           if clj-if
                           reductions clj-reductions}))
I get replacement warnings in figwheel when I touch the ns 😞

mrchance00:08:39

Also: Is there a way to prevent all builtins from being included in an ns? The "differences from clojure" page says only :rename and :exclude are supported...

mfikes00:08:57

@mrchance I wonder if you can actually rename if, given that it is not a Var

mrchance00:08:59

@mfikes Good point, that might be the case. I think it still goes wrong for the other vars too though, will check

mrchance00:08:30

The funny thing is that it initially compiles without problems, but complains whenever I change something there

mfikes00:08:45

What complaints do you see?

mrchance00:08:04

map already refers to: cljs.core/map being replaced by: foo/map
filter already refers to: cljs.core/filter being replaced by: foo/filter at line 17, column 1 in file foo/core.cljs
reductions already refers to: cljs.core/reductions being replaced by: foo/reductions at line 20, column 1 in file foo/core.cljs

mrchance00:08:21

After removing the or and if

mfikes00:08:29

@mrchance That appears to be a bug in the ClojureScript compiler, surrounding the :rename feature

mfikes00:08:03

Specifically, map still resolves

mrchance00:08:17

Looks that way 😞

mrchance00:08:52

The :refer-clojure is recognized and parsed correctly at least, when I put a typo in there it doesn't compile anymore...

mrchance00:08:15

Maybe code using :refer-clojure isn't reloadable for some reason?

mrchance00:08:05

@mfikes Awesome, thanks! Gonna watch that bug now 🙂

mfikes01:08:38

Cool. :rename support is relatively new—still less than 1 year old at this point.

anmonteiro01:08:53

@mfikes hrm, I’m not sure if your assessment is correct

anmonteiro01:08:00

I think :exclude is needed, even in Clojure

anmonteiro01:08:46

2 different REPL sessions:

boot.user=> (refer-clojure :exclude [map] :rename '{map lol})
nil
boot.user=> map
#object[clojure.core$map 0x5e5b5265 "clojure.core$map@5e5b5265"]
boot.user=> lol
#object[clojure.core$map 0x5e5b5265 "clojure.core$map@5e5b5265"]
boot.user=> (defn map [])
WARNING: map already refers to: #'clojure.core/map in namespace: boot.user, being replaced by: #'boot.user/map
#'boot.user/map
boot.user=> (refer-clojure :rename '{map lol})
nil
boot.user=> map
#object[clojure.core$map 0x79ac87f2 "clojure.core$map@79ac87f2"]
boot.user=> lol
#object[clojure.core$map 0x79ac87f2 "clojure.core$map@79ac87f2"]
boot.user=> (defn map [])
WARNING: map already refers to: #'clojure.core/map in namespace: boot.user, being replaced by: #'boot.user/map
#'boot.user/map

mfikes01:08:36

@anmonteiro That's interesting. refer-clojure and (ns ... (:refer-clojure ...) have different behaviors in Clojure with respect to whether renamed symbols are still visible

mfikes01:08:12

@anmonteiro My guess in the above is that boot.user is already "tainted" with core symbols, and that's why (refer-clojure :exclude [map]) doesn't really do anything about the map that has already been referred. You can see the same in a fresh namespace.

(ns foo.bar (:refer-clojure :rename {map lol}))
renames map upon bringing it in. But if you first do
(ns foo.bar)
before the form with :refer-clojure, you have map, and then lol.

mfikes01:08:19

Yes, as Eric Norman aptly puts it, at it's core Clojure is a very mutative language 🙂

dehli03:08:35

anyone know how to interop cljs funtions as javascript functions?

dehli03:08:00

I know you can do (ClassName.) which is equivalent to new ClassName(), but I want to be able to get the actual value of ClassName (for prototype stuff)

dehli03:08:25

it looks like ClassName. is the same as ClassName

noisesmith03:08:42

the . indicates execution - just use ClassName without it

crteal04:08:21

i'm seeing an exception trying to start an isomorphic ClojureScript app (the Node server) with cljsjs/react-dom in 1.9.845. It breaks trying to require React as a Node module (e.g., require('react')). I've done some debugging, and in previous versions of ClojureScript, specifically 1.9.671, exports and module do not exist which triggers a different, successful code path at the start of react-dom.inc.js. Looking further it appears a change to CLOSURE_IMPORT_SCRIPT in goog/bootstrap/node.js to how files are required is the culprit (specifically the change to use require over nodeGlobalRequire, which happened in https://github.com/clojure/clojurescript/commit/fc0989f1b44b97547410a2d2c807f16430b47486). Does this sound familiar, has anybody else seen this behavior, is this a legitimate issue, or am I doing something I shouldn't be doing? Thanks for the help!

anmonteiro04:08:02

@crteal I don’t quite understand your problem, but is requiring react from node_modules not an option?

anmonteiro04:08:43

we did some changes around Node.js bootstrapping but all it should do is not allow you to require JS modules processed by Closure

crteal04:08:53

i was previously using cljsjs/react and cljsjs/react-dom in tandem with om-next

crteal04:08:20

i could probably use node_modules now, but i thought everything would "just work"

crteal04:08:31

from what i read about the release, and lurking a bit here (and elsewhere)

anmonteiro04:08:51

so if you’re using CLJSJS/React, where are you doing require('react')?

crteal04:08:03

i'm not, the unminified source from Facebook of react-dom.js is

anmonteiro04:08:35

I’ve ran into this before

anmonteiro04:08:39

just install react from NPM

crteal04:08:51

looks like it, thank you @anmonteiro!

richiardiandrea10:08:28

newbie question: are source maps supported by vanilla Node.js repl? I have source-map-support in node_modules but I see:

cljs.user=> (ffirst 1)
repl:13
throw e__7439__auto__;
^

Error: 1 is not ISeqable
    at Object.cljs$core$seq [as seq] (/home/arichiardi/git/logpoc/out/out/cljs/core.cljs:1209:20)
    at Object.cljs$core$first [as first] (/home/arichiardi/git/logpoc/out/out/cljs/core.cljs:1218:15)
    at cljs$core$ffirst (/home/arichiardi/git/logpoc/out/out/cljs/core.cljs:1730:10)
    at repl:1:34
    at repl:9:3
    at repl:14:4
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at Object.runInThisContext (vm.js:116:38)
    at Domain.<anonymous> ([stdin]:50:34)
    at Domain.run (domain.js:242:14)
Is this expected?

thheller11:08:37

it is source mapped no? I don’t think it supports showing the actual source excerpt but the stack looks mapped?

thheller11:08:04

does it show the correct source excerpt outside the repl?

richiardiandrea11:08:18

@thheller oh, well sorry, I tried before this and it was showing .js files in there, then apparently I did something and now they are mapped

richiardiandrea11:08:55

for the (lossy) records with no source-map-support it was:

ClojureScript Node.js REPL server listening on 56975
Watch compilation log available at: out/watch.log
To quit, type: :cljs/quit
cljs.user=> (ffirst 1)
repl:13
throw e__7439__auto__;
^

Error: 1 is not ISeqable
    at Object.cljs$core$seq [as seq] (/home/arichiardi/git/logpoc/out/out/cljs/core.js:4414:8)
    at Object.cljs$core$first [as first] (/home/arichiardi/git/logpoc/out/out/cljs/core.js:4433:19)
    at cljs$core$ffirst (/home/arichiardi/git/logpoc/out/out/cljs/core.js:5859:34)
    at repl:1:96
    at repl:9:3
    at repl:14:4
    at ContextifyScript.Script.runInThisContext (vm.js:44:33)
    at Object.runInThisContext (vm.js:116:38)
    at Domain.<anonymous> ([stdin]:50:34)
    at Domain.run (domain.js:242:14)

joshkh11:08:13

when calling get on a map in clojurescript 1.9.671 i get the following error and i'm stumped... any thoughts?

(get {:test "one"} :test)
Uncaught Error: No protocol method ICollection.-conj defined for type cljs.core/Keyword: :test

joshkh11:08:40

hmmm, a lein clean seems to have fixed it, nevermind 🙂

johnj12:08:00

re :optimizations :none closure still needs to be called for the namespace stuff I think

oskarth13:08:15

What's a good way of dealing with eval timeout errors? Both in terms of debugging and catching

oskarth13:08:47

I have an expression that works in Javascript using web3 and BigNumber but hangs in Clojurescript when significant digits are above a certain limit

dnolen13:08:42

@oskarth what do you mean - there’s not really a way to deal with that in JavaScript either - do you mean just at the REPL?

dnolen13:08:05

that’s a REPL specific feature - I don’t think there’s a general way to provide that

oskarth13:08:49

Specifically, this works: (.fromWei js/Web3.prototype 111122223333440000 "ether") but this hangs: (.fromWei js/Web3.prototype 111122223333444000 "ether") (treating numbers as strings causes the same behavior) whereas both equivalent forms work in a JS repl: web3.fromWei(111122223333440000, 'ether') web3.fromWei(111122223333444000, 'ether') - trying to figure out why or deal with it somehow

dnolen13:08:43

@oskarth I’m confused since the CLJS isn’t equivalent to the JS, why aren’t you just writing the same thing?

oskarth13:08:34

@dnolen how are they different you mean?

dnolen13:08:48

not how are they different

dnolen13:08:51

they are different

dnolen13:08:53

for what reason?

dnolen13:08:39

web3.fromWei(111122223333444000, 'ether') -> (.fromWei js/web3 111122223333444000 "ether")

oskarth14:08:40

right, sorry, looking into why js/web3 isn't available

noisesmith14:08:49

by your initial example it would be js/Web3

oskarth14:08:43

same there, in that case why .fromWei isn't

oskarth14:08:39

(looks like there's a version mismatch, but can't quite figure out which version is being called and why they differ)

oskarth14:08:30

Web3.prototype.fromWei(111122223333444000, "ether") works

juhoteperi14:08:06

@oskarth Web3.js docs show that you should initialize web3 using Web3 constructor yourself:

(def web3 (js/Web3. provider?))
(.fromWei web3 111122223333444000, "ether")

oskarth14:08:29

@juhoteperi tried that, hangs

oskarth14:08:22

as far as I can tell they are just aliased, the implementation for this specific function hasn't changed. With one less significant digit it works fine

lwhorton17:08:22

i’m curious wrt the new 1.9.854 changes in npm-deps and global exports for foreign libs - this doesn’t avoid the need of externs files, right?

qqq17:08:03

in reagent/react/om, we provide "trees", the system then diffs then and modifies the dom; are there libraries for modifying the dom directly?

qqq17:08:10

(most: dommy, domina, seems 2+ years old)

qqq17:08:21

are there any actively maintained ones ?

lwhorton17:08:07

@qqq i wouldnt be so afraid of “unmaintained” libs.. in a lot of use cases that’s actually a good sign. the dom access api doesnt change all that frequently, for example. so the fact that domina is 2+ years unchanged means it hasn’t had any issues serving its purpose

lwhorton17:08:29

it’s a strange feeling, I know. it took getting used to, coming from the js-ecosystem, where if something hasnt had changes in 2+ months feels like a “risky investment”

qqq17:08:11

@lwhorton : yeah, with node.js, if the new package isn't somehow incompatible with your existing packages, something's wrong

lwhorton17:08:29

i attribute this to the mature java ecosystem where people dont investigate a mvn dep and say “hey why hasnt com.goog.array been updated in 5 years?!“.. *and hopefully some of that is rubbing off on the js world

zackbleach17:08:43

has anyone had any luck with spinning up a docker container with lein fighweel && lein garden auto` concurrently running? Everything I’ve tried so far results in either a subprocess immediately failing or an out of memory error in the container.

qqq17:08:48

is there a thin cljs wraper over google closure? I was just looking at my dependencies, and it seems like google closure provides alot of them

thheller17:08:46

google closure is huge so there might be wrappers for some of it but probably not everything

qqq17:08:01

it's also auto included in every cljs project right?

thheller17:08:03

you can use most of the stuff directly too, so no wrapper needed really

qqq17:08:09

so if it's there, and it's good enough for goog, I might as well as use it

qqq17:08:04

I'm trying to simplify my cljs dependencies. Do I need weasel + piggieback if I don't need a cljs-repl ?

reefersleep19:08:08

What’s a good, free service for hosting hobby projects in Clojure/Clojurescript?

noisesmith19:08:10

heroku makes it pretty easy, or any free tier service that gives you enough RAM to run your project

petterik19:08:24

I've run my hobby projects on Heroku

noisesmith19:08:26

you can make a standalone project with lein uberjar and that should run on any host with a jvm and enough RAM

reefersleep19:08:50

I’ll give Heroku another go.

jeaye19:08:58

Yeah, +1 for heroku.

jeaye20:08:33

I've built a test JS file using lein cljsbuild once, and then I try to run it (using node), but I get import errors since a dep is using ES6, so I run it through babel with es2015 presets and then try to run it again. Now, I just see Cannot use 'in' operator to search for 'doo' in undefined

jeaye20:08:04

I have :target :nodejs, of course. What else might I be missing?

codefinger20:08:50

@reefersleep "another" makes it sound like you've already tried Heroku. Did you have problems or something I can help with?

jeaye20:08:35

If I comment out the require for that ES6 code and thus avoid all the babel business, I end up getting __DEV__ is not defined while running lein cljsbuild test. Seems like I hit a wall either way.

reefersleep20:08:10

@codefinger I didn't, I just never really put an effort into establishing a comfortable relationship with Heroku, and thought I'd ask around to see if there were other, possibly better options 🙂

reefersleep20:08:20

I have managed to get something up and running.

hmaurer21:08:04

@reefersleep Google Cloud offers 300$ of free credits (usable over 12 months)

hmaurer21:08:01

It’s not a PaaS like Heroku though, so you would have to get your hands dirty

hmaurer21:08:57

Heroku is great as a free option, and has amazing UX, but for hobby/non-profit projects that need more than their free dyno it’s prohibitively expensive. I am working on a couple of non-profit projects at the moment and I am experimenting with Kubernetes on Google Cloud. One of the neat things you can do is schedule some of your services on preemptible instances (which cost something like 30% of the full price, in exchange of the possiblity of them being shut down at any time)

hmaurer21:08:42

I have heard of https://deis.com/workflow/ but haven’t tried it yet

hmaurer21:08:01

There is also http://dokku.viewdocs.io/dokku/ ; it was too limited for my use-case but it might interest you

hmaurer21:08:54

Recently I also stumbled upon https://hyper.sh/ (no idea how reliable they are though)

hmaurer21:08:10

And https://zeit.co/now (which I found a bit dodgy but some people like it)

jeaye21:08:14

I've had a pretty bad experience with Clojure on GAE. From no Clojure tooling support to memory leaks in their infrastructure and dead end support for fixing existing issues.

hmaurer21:08:39

I haven’t tried GAE tbh

jeaye21:08:37

Heroku was a breath of fresh air, compared to App Engine.

noisesmith21:08:12

I prefer to set up a deployment where nothing on the server even needs to know you have clojure in your deploy - making an uberjar, with a shim to some runner lib if needed

jeaye21:08:18

In theory, sure. In practice, it's very nice to have a lein plugin for your hosting service so you can easily deploy, troubleshoot, etc.

noisesmith21:08:30

I never use lein on prod

noisesmith21:08:56

(this is with years of full time clojure dev)

hmaurer21:08:56

Use a CI pipeline to build the uberjar and push to your prod infra @jeaye

hmaurer21:08:28

For my current project I have a CI job which builds an uberjar, packages it in a Docker image and pushes that to a repository

hmaurer21:08:35

which is then pulled and ran in K8s (google container engine)

jeaye21:08:40

I don't think that changes anythying, @hmaurer, and I don't think anything I've said has implied such a CI pipeline isn't in place.

hmaurer21:08:00

I mean, you were mentioning “easy deployments”

jeaye21:08:02

The point is, deploying, from wherever can be quite simple with a lein plugin. Like how Heroku does it.

jeaye21:08:29

Painful deployments from a CI server are still painful.

hmaurer21:08:06

Why would deployments from a CI server be painful?

noisesmith21:08:08

@jeaye my rationale for not using any clojure tooling on my deploy target is to increase my choices and flexibility in deploy targets, it requires a bit of glue with CI and/or automated deploy tooling

noisesmith21:08:48

but then all I need is a jvm, which is an easy bar to reach

hmaurer21:08:47

I am a noob, but that’s one of the things I like the most about the JVM. I can just ship a jar to production and run java -jar ... with a few options. No need to worry about installing the correct dependencies etc

hmaurer21:08:58

I can even run that jar locally to check everything works

jeaye21:08:18

@hmaurer With App Engine, a deployment requires building an uberwar, exploding it, replacing some files, and using a supplied GAE script to repackage it.

jeaye21:08:32

If you haven't used App Engine, you wouldn't know it doesn't just use uberjars. 🙂

hmaurer21:08:46

@jeaye ah, that does sound painful. I haven’t used App Engine

hmaurer21:08:57

It seems more like a problem with App Engine though

dpsutton21:08:00

but its still just an artifact

jeaye21:08:23

I know because the most up-to-date documentation on getting Clojure working with App Engine is right here: https://blog.jeaye.com/2016/08/23/clojure-app-engine/

mobileink22:08:32

ahem. more recent is https://github.com/migae/boot-gae/blob/master/README.adoc (author here). needs some work but the principles are sound

jeaye21:08:58

It's a mess.

jeaye21:08:07

With heroku, it's lein do ring uberjar, heroku deploy

mobileink22:08:09

boot-gae: boot gae/build -p gae/target gae/deploy

bostonaholic22:08:08

or in a Procfile

web: java -server $JVM_OPTS -jar target/myapp-standalone.jar host 0.0.0.0 port $PORT

bostonaholic22:08:28

-server is optional and could even be provided in JVM_OPTS instead

bostonaholic22:08:41

that way, your CI/CD can handle deploys instead of manual deploys

bostonaholic22:08:54

which I prefer

jakemcc22:08:04

Recently ran into https://circleci.com/blog/deploying-clojure-applications-to-google-cloud/ which skips some of what you’ve done by leaning on Docker

mobileink22:08:09

boot-gae: boot gae/build -p gae/target gae/deploy

Oliver George22:08:01

It'd be interesting to have one of the Google Closure compiler developers to give a talk at a clojure event.

jeaye22:08:02

@jakemcc Relying on App Engine Flexible forfeits all of the benefits of App Engine's "serverless," automatic environments. It also forfeits the support that Google would be required to give you for the stability of that environment, since now you're running your own.

dealy22:08:20

Hi, as of today I'm no longer able to run lein uberjar for my app, it returns this error: NoSuchMethodError: com.google.common.base.CharMatcher.javaUpperCase()Lcom/google/common/base/CharMatcher; I gather this is a guava conflict (not sure why, didn't add any new dependencies). Any suggestions on how to troubleshoot this?

mrchance23:08:54

@dealy sounds like a case for lein deps :tree, googling where that method is supposed to come from, generous use of :exclusions and hope