Fork me on GitHub
#boot
<
2017-01-09
>
flyboarder02:01:25

@juhoteperi: @martinklepsch I'm using multiple builds for an app which runs both in the browser and in electron, also working on a ipfs electron version

bendy03:01:05

hey all, quick question: I'm setting up a new cljs project with boot, I've got everything loading. However, when I make changes to the source files, nothing happens, even though I'm using (watch)

bendy03:01:25

any tips on how to track down why that is not firing anything?

bendy03:01:20

nevermind - I had tacked on a (wait) call at the end, that seems to have stopped (watch) from doing anything

mitchelkuijpers13:01:47

@juhoteperi We also have multiple builds: devcards, main, admin, test

mitchelkuijpers13:01:39

Would love to fix this with modules somehow, because it is pretty annoying especially when compling for prod: main and admin can be pretty slow

borkdude15:01:31

Any idea why update-feeds doesn’t invoke aot when I call it and how could I refactor this correctly without writing two tasks?

(deftask update-feeds*
  []
  (…))

(deftask update-feeds []
  (comp (aot "-n" 'feeds.rss20-parser)
        (update-feeds*)))

borkdude15:01:34

Probably something with with-pre-wrap?

lwhorton15:01:06

[]‘A?[;/’]41203.Q23:

borkdude15:01:28

Found the issue

richiardiandrea16:01:15

@borkdude what is the name of your boot task for managing deps again? I should have bookmarked it 😄

borkdude16:01:10

thanks, but it doesn’t contain a task, only some functions 😉

richiardiandrea16:01:31

Probably it should still be there, or somewhere there for visibility

borkdude16:01:43

yes, it’s a library for boot

richiardiandrea16:01:11

Have you ever considered adding it to bootlaces ?

richiardiandrea16:01:35

Bootlaces feels like a good place for boot utilities (imho)

borkdude16:01:50

> Handy tasks and things for the boot Clojure build tool. Sounds like it 😉

richiardiandrea16:01:54

In any case, good job, the data approach is cool

juhoteperi16:01:12

> Handy tasks and things for the boot Clojure build tool. Is from Bootlaces task, not Bootlaces maven group

juhoteperi17:01:05

Bootlaces maven group is what we currently plan to use to deploy "the official" Boot tasks (boot-cljs, boot-reload, boot-cljs-devtools)

juhoteperi17:01:28

Ah no, the group name is powerlaces...

juhoteperi17:01:53

I'm not completely convinced about this naming yet, it is quite confusing

richiardiandrea17:01:54

Yeah powerlaces 😀😀😀

juhoteperi17:01:58

Also, if we powerlaces or something is going to be the place for "official tasks", I'd be quite strict about what tasks are going to be included there

juhoteperi17:01:23

I think I'll just release next Boot-cljs with current group id and namespace

Chris Bidler17:01:05

anyone here used boot-npm to install “local” NPM dependencies in a boot-cljs environment? I find that it works but then my node_modules dir ends up in target/ which means that my js/require or cljs.nodejs/require arguments change from imagemagick to ../target/node_modules/imagemagick/package.json, which is …gross

richiardiandrea17:01:30

@chris_johnson I haven't but you could use sift to filter them out if you don't want them in target

Chris Bidler17:01:55

well, ideally I’d want them above target, though to be honest at this point I’m strongly considering just giving them the old npm install -g and letting the Node resolver deal with it

Chris Bidler17:01:04

my use case is making Nervous Systems’ lein-cljs-lambda work in “idiomatic” Boot, and for right now the only modules I actually need are aws-sdk and imagemagick, which will be provided in the Node runtime in Lambda

richiardiandrea17:01:00

oh incidentally, I wanted to do that too 😄

Chris Bidler17:01:12

and in fact anything I need to include in later Lambda functions would have to go through a nice yak-shave because they’d need to be “built” against Amazon Linux, which you’ll be surprised to learn I don’t run as my workstation OS

Chris Bidler17:01:33

I’m considering writing up a blog post once I get it to work, which should be soon-ish.

Chris Bidler17:01:06

(NB: I’ve said that before, and my blog is still exactly one post about how I use org-mode -> Jekyll -> Github Pages to publish a blog)

richiardiandrea17:01:35

ah ah ah nice can't wait for that

richiardiandrea20:01:39

so @micha I am trying to sneak a dep in boot-shim.clj...If I call (pod/add-dependencies new-env) in there it should resolve and add the dep right? Did I understand right?

micha20:01:52

that's correct

richiardiandrea20:01:23

ok, I see the subsequent require failing

richiardiandrea20:01:41

Caused by: java.lang.ClassNotFoundException: lucid.core.inject

richiardiandrea20:01:13

which is weird, because the dep is there

richiardiandrea20:01:10

my attempt:

(require '[boot.core :as boot])
(require '[boot.pod :as pod])

(let [new-env (-> (boot/get-env)
                  (update :dependencies conj
                          '[im.chit/lucid.core.code "1.2.8"]
                          '[im.chit/lucid.core.debug "1.2.8"]
                          '[im.chit/lucid.core.inject "1.2.8"]
                          '[im.chit/lucid.mind "1.2.8"]))]
  (pod/add-dependencies new-env)

  (require '[lucid.core.inject :as inject])
  (inject/in

   clojure.core
   [lucid.mind .> .? .* .% .%> .& .>ns .>var]
   [lucid.core.debug dbg-> dbg->> ->doto ->>doto ->prn]

   [clojure.pprint pprint]
   [clojure.java.shell sh]))

richiardiandrea20:01:32

Caused by: java.lang.RuntimeException: No such namespace: inject

richiardiandrea20:01:45

Ok it looks like I cannot do it because I don't have boot.aether on the classpath

micha20:01:21

you don't have boot.core

richiardiandrea20:01:37

yep weird, shouldn't it be there already?

micha20:01:45

no, this runs before that

micha20:01:50

and in all pods

micha20:01:48

seems like maybe you want a nrepl middleware thing

richiardiandrea20:01:51

so I cannot use get-env

richiardiandrea20:01:36

but being a side effecty thing, I can just call add-dependencies with an empty env

adrien20:01:58

Hello I can't get boot to run on Circle CI I followed https://github.com/boot-clj/boot/wiki/Running-Boot-on-CI-systems but get boot: line 1: {error:Not Found}: command not found anything trivial I am missing?

adrien20:01:42

machine:
  java:
    version: oraclejdk8
  environment:
    _JAVA_OPTIONS: "-Xms512m -Xmx1024m"
dependencies:
  pre:
    - curl -L  -o boot
    - chmod +x ~/bin/boot
  override:
    - boot uberjar
  cache_directories:
    - "~/bin"
    - "~/.m2"
    - "~/.boot/cache/bin"
    - "~/.boot/cache/lib"
test:
  override:
    - echo 1

richiardiandrea20:01:30

@adrien it looks like you are saving the script in the wrong place with curl

adrien20:01:59

I do save it in ~/bin/boot

adrien20:01:38

(I was messing with it in the meantime)

richiardiandrea20:01:41

is it on the PATH by default

richiardiandrea20:01:48

yeah probably so

adrien21:01:10

I don't know, should I add it in my projects settings?

richiardiandrea21:01:26

try to echo $PATH just to be sure 😄

adrien21:01:17

😄

ubuntu@box3480:~$ which boot
ubuntu@box3480:~$ echo $PATH
/opt/circleci/nodejs/v4.2.6/bin:/opt/google-cloud-sdk/bin:/opt/ghc/8.0.1/bin:/opt/cabal/1.24/bin:/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:/home/ubuntu/.composer/vendor/bin:/opt/circleci/.phpenv/shims:/opt/circleci/.phpenv/bin:/opt/circleci/.rvm/gems/ruby-2.2.4/bin:/opt/circleci/.rvm/gems/ruby-2.2.4@global/bin:/opt/circleci/.rvm/rubies/ruby-2.2.4/bin:/home/ubuntu/.go_workspace/bin:/usr/local/go/bin:/opt/circleci/nodejs/v4.2.6/bin:/opt/circleci/.pyenv/shims:/opt/circleci/.pyenv/bin:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/android-sdk-linux/platform-tools:/usr/local/android-sdk-linux/tools:/usr/local/apache-maven/bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/gradle-1.10/bin:/opt/circleci/.rvm/bin:/opt/circleci/.rvm/bin

adrien21:01:43

it's in the path, but it's not found

adrien21:01:06

wait I messed up again

adrien21:01:37

ubuntu@box931:~$ which boot
/home/ubuntu/bin/boot
ubuntu@box931:~$ ls
bin  numerry-erp
ubuntu@box931:~$ cd numerry-erp/
ubuntu@box931:~/numerry-erp$ boot uberjar
/home/ubuntu/bin/boot: line 1: {error:Not Found}: command not found
ubuntu@box931:~/numerry-erp$ boot -u
/home/ubuntu/bin/boot: line 1: {error:Not Found}: command not found

adrien21:01:51

builds on my machine indeed

richiardiandrea21:01:26

weird, the first time it should download the dependencies to .m2 as well

adrien21:01:29

the boot script is wrong

adrien21:01:49

it contains {error:Not Found}

adrien21:01:07

I guess I downloaded a wrong version then

adrien21:01:23

and yes, you're right, it should first install itself

micha21:01:55

there is no 2.6.0 release of boot-bin

micha21:01:05

you want to use latest always

micha21:01:25

if you really want to pin it to a specific version

micha21:01:55

the boot.sh script will be compatible with any version of boot

micha21:01:03

so just use the latest one is what i would do

micha21:01:13

we very rarely release a new version of that

adrien21:01:15

yeah, that's also what I do locally

adrien21:01:31

I should have thought about it

micha21:01:33

maybe once a year

micha21:01:45

next release is to support breaking changes in java

adrien21:01:01

I installed it last week with the link to the latest one, worked like a charm

micha21:01:16

yeah the versions are not in sync

micha21:01:22

jvm version 1.9

micha21:01:46

that version of have has not been released yet

adrien21:01:11

let me know if yo need some help

micha21:01:44

i mean "that version of java" 🙂

adrien21:01:19

@richiardiandrea @micha it works! thanks a million!

micha21:01:34

👍 🚀

adrien21:01:19

that's really awesome, thanks for all the work, I'm really happy to start using boot

adrien21:01:37

yet another paradigm shift

micha21:01:59

having fun so far? 🙂

adrien21:01:16

it's really different

adrien21:01:32

and I get it to run cider out of the box

adrien21:01:45

no config, that's nice

micha21:01:00

whoa that's awesome

adrien21:01:18

so smooth I was almost shocked

richiardiandrea21:01:41

@adrien about that I have just pushed a change to cider to make it more robust if you feel like trying 😄

richiardiandrea21:01:41

it will be possible to inject "custom" middleware at some point

adrien21:01:46

okay, I give it a try

richiardiandrea21:01:00

no rush, just to validate that it works 😄

adrien21:01:16

sure, I get the instructions, shouldn't be long

adrien21:01:35

I don't see -i \"(require 'cider.tasks)\"

adrien21:01:44

but I can't see the whole command line

adrien21:01:09

how can I check it better?

adrien21:01:54

I cloned cider in my elpa dir, probably not the best idea

richiardiandrea22:01:10

and run lein install

adrien22:01:05

that's what I did, but I try again

adrien22:01:15

should be in my emacs folder as well?

richiardiandrea22:01:21

yeah, there are two moving parts, one is the emacs cider plugin

richiardiandrea22:01:34

the other one is the cider-nrepl artifact

richiardiandrea22:01:21

do you have a way to update (manually) cider packages? If not it might a hassle

adrien22:01:54

no I don't I just use elpa and melpa

richiardiandrea22:01:22

oh ok then you'd better wait that the merge it but thanks anyways 😉

richiardiandrea22:01:04

@micha surpringly the injection of doc clashes: WARNING: dir already refers to: #'clojure.core/dir in namespace: boot.tmpdir, being replaced by: #'boot.tmpdir/dir

richiardiandrea22:01:37

I will at some point use an nrepl middleware, but I have played enough with it for today 😄

micha22:01:58

what does clojure.core/dir do?

richiardiandrea22:01:21

lists the simbols in a namespace

micha22:01:32

clojure.core/dir does that?

richiardiandrea22:01:57

oh sorry look:

-------------------------
clojure.repl/dir
([nsname])
Macro
  Prints a sorted directory of public vars in a namespace
nil

micha22:01:24

oh right, you're creating clojure.core/dir

richiardiandrea22:01:26

probably I don't need it 😉

micha22:01:41

anyway you want the namespace to be able to override it

micha22:01:46

which it is doing

micha22:01:59

like boot.tmpdir namespace defines a dir itself

micha22:01:14

normally it would also do :refer-clojure :exclude [dir]

richiardiandrea22:01:19

in vyniasa/lucididy it uses the . namespace for injections

richiardiandrea22:01:28

I guess to avoid clashes

micha22:01:30

you could do that also

richiardiandrea22:01:28

anyways, thanks for bearing with me on my crazy experimentation 🙂

richiardiandrea22:01:14

for now I have settled for a simple:

(ns .)

(require 'clojure.repl)
;; macros
;; 
(intern '. (with-meta 'doc {:macro true}) @#'clojure.repl/doc)
(intern '. (with-meta 'dir {:macro true}) @#'clojure.repl/dir)
(intern '. (with-meta 'source {:macro true}) @#'clojure.repl/source)

;; fns
(intern '. 'apropos @#'clojure.repl/apropos)
(intern '. 'demunge @#'clojure.repl/demunge)
(intern '. 'find-doc @#'clojure.repl/find-doc)
(intern '. 'pst @#'clojure.repl/pst)
(intern '. 'root-cause @#'clojure.repl/root-cause)
(intern '. 'set-break-handler! @#'clojure.repl/set-break-handler!)
(intern '. 'stack-element-str @#'clojure.repl/stack-element-str)
(intern '. 'thread-stopper @#'clojure.repl/thread-stopper)

(require 'clojure.pprint)
(intern '. 'pprint @#'clojure.pprint/pprint)

(require 'clojure.java.shell)
(intern '. 'sh @#'clojure.java.shell/sh)

michael.heuberger22:01:12

hello folks - has anyone of you managed to add some browser feature detection and conditional polyfilling with boot yet?

michael.heuberger22:01:34

struggling here on how to conditionally load a polyfill here before loading the app code