This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-02
Channels
- # aleph (6)
- # beginners (37)
- # boot (415)
- # cider (17)
- # cljs-dev (79)
- # cljsjs (3)
- # cljsrn (18)
- # clojars (3)
- # clojure (34)
- # clojure-france (6)
- # clojure-italy (1)
- # clojure-korea (1)
- # clojure-russia (22)
- # clojure-spec (64)
- # clojure-uk (47)
- # clojurebridge (6)
- # clojurescript (61)
- # clojurex (1)
- # cloverage (11)
- # component (6)
- # cursive (73)
- # data-science (6)
- # datascript (4)
- # datomic (38)
- # editors (1)
- # emacs (4)
- # events (16)
- # funcool (5)
- # garden (3)
- # hoplon (17)
- # jobs (2)
- # klipse (74)
- # off-topic (3)
- # om (81)
- # onyx (35)
- # parinfer (4)
- # pedestal (1)
- # perun (20)
- # planck (9)
- # proton (1)
- # re-frame (17)
- # reagent (3)
- # ring-swagger (1)
- # rum (7)
- # untangled (63)
- # vim (8)
@chooie try to use boot.core/boot
or boot
from the boot.user
namespace, as in (boot (notify))
@richiardiandrea Thanks! All sorted
@micha I have two things I am completely stuck on. 1. I can't seem to figure out how to serve up image assets. 2. I'm not sure how to properly set up devcards. I think it's best in a separate folder so when I finally render the static site it's easy to ignore it. I'd like the option to serve it up with the normal dev task and or separate. I'm not 100% sure whats the best workflow. I've just thrown the code up on github so you can take a look. https://github.com/CommonCreative/vbn-redesign
Currently I have everything in the app.cljs and just use commenting to switch from dev to devcards etc
btw, who was asking about upload just a few days ago? i can't find it in the archives by googling https://www.google.com.hk/search?client=safari&rls=en&q=upload+progress+site%3Aclojurians-log.clojureverse.org+boot+2016-10&oq=upload+progress+site%3Aclojurians-log.clojureverse.org+boot+2016-10
im curious how much could i help with the snippets i shared because it works with static credentials but not with dynamic ones u can obtain on an ec2 instance
as @danielcompton pointed out, there is a pull request which upgrades s3-beam
to use AWS v4 signatures
im gonna try to upgrade to that; i hope that solves the issue of using dynamic credentials
https://github.com/martinklepsch/s3-beam/pull/36/files
maybe a silly question but - I’d like to use 1.9.0-alpha14 in a new project, but “boot repl” invariably fails retrieving this from https://repo1.maven.org/maven2/ … Now I know that probably means the obvious, that this maven repo doesn’t carry that version of clojure. What I’m not having much luck turning up is how to actually get it, then. So far, I’ve also made a “boot.properties” file in the same project dir as “build.boot”, both mentioning clojure 1.9.0-alpha14 in hopes of not basing dependencies on the clojure version mentioned in my global boot.properties file
(Digging around, it’s actually there — https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha14/ .. Still, boot won’t fetch it, though.. shifting through boot docs)
Hi. I am trying to use boot-http
but I cannot find how I can bind it to address different than localhost(e.g. 127.0.0.3). Can anybody help?
Hi @pseud - I just tested and if I set both boot properties and build.boot to point to 1.9.0-alpha14, it seems to work for me. Here’s my project in case it helps for reference: https://github.com/upgradingdave/cljs
@upgradingdave hey 🙂 Yes I finally noticed that I made a simple error. Didn’t update because I didn’t want to spam the channel (more than I had). But thanks none the less 🙂
is boot similar to lein
in that whenever you change the dependencies and/or resource-paths, you need to restart the repl?
@naomarik the :user
property indicates whether the contents of the directory originated in one of the user's project dirs
@naomarik for example, dirs with :user true
are :source-paths
or :resource-paths
or :asset-paths
internally boot needs to know this because the files in those temp dirs are synced asynchronously in real time
vs the other dirs in the fileset that are populated only as a result of tasks creating files
the ones with :user true
are also temp dirs, the files in there are copied form the user's project dirs
you can add their contents to the fileset of course with (add-resource some-fileset your-temp-dir)
for example
it's just useful to have a way to create an anonymous directory that will be cleaned up by boot's garbage collection when it's no longer referenced by a build
so in a new fileset, with all the :user nil
things in it, how does something typically get put in one of those dirs?
so one of the interesting things about the boot environment is that you can, for example, remove directories from the classpath
this is normally not possible because URLClassLoader
does not allow the removal of URLs once they have been added
I’m trying to figure out the difference between :resource-paths
, :source-paths
and :asset-paths
? I guess resource-paths could be files that your program needs at runtime, like html, or css , for example. :source-paths
is source code .cljs
files, that you need to compile the program, but you ultimately don’t need in a jar (since you’ll have .class
files). Is this correct? and what would :asset-paths
be used for? stuff like meta data?
there’s a lot going on with your simple implementation, how long did it take you to plan this stuff out?
and those dirs are never removed from the classpath, and no new dirs are ever added to the classpath
when you add or remove :source-paths or whatever, it just changes the directories that will be synced to the internal fileset dirs
so while the URLs in the classloader are always the same, the files in those directories changes according to the :source-paths :resource-paths etc settings
man it’s a phenomenal tool, just now taking the time to learn it properly so i’m not so dependent on examples
@tmtwd there are all the details about :resource-paths
, :source-paths
, etc. here: https://github.com/boot-clj/boot/wiki/Filesets#definitions
files with the input role can be obtained from a fileset via (output-files the-filesset)
so files in directories in :resource-paths
, for example, have both input
and output
roles
in retrospect i think maybe using names like "source" and "resource" instead of just exposing the roles directly may have been a mistake
what's the right way to add a single file in the root of the project (e.g. Dockerfile) to the fileset as an asset
I suppose I could move it to a folder
but just curious 🙂
@christianromney there is the add-repo
task
it's kind of an anomaly, it's in there because of docker stuff i was doing and somehow ended up in boot's built-in tasks
@micha what you mean by this: > in retrospect i think maybe using names like "source" and "resource" instead of just exposing the roles directly may have been a mistake?
@micha thanks. i thought about using that but figured it'd be more work to sift out all the READMEs and cruft.
but i have no java background and very small clue about what was going on in the build process in both lein and boot up till recently
having the role names though lets people know what happens when you do things like boot.core/add-resource
my build.boot contains an error, but boot traceback sucks, is there any way to force boot to show the problematic line number at least ?
the documentation is explains it well but could definitely benefit from some blog post tautology to help different minds
@lxsameer boot -b
prints the script that's actually run
hmm ok I have one more q for you @micha sorry bud. i'm also getting this issue: https://github.com/adzerk-oss/boot-beanstalk/issues/5 is there a known workaround?
@christianromney ah i haven't used boot-beanstalk for a while
gotcha. i'm going to dig a little maybe i can contribute a patch if i locate the issue. seems like the issue is finding the :file in output-files
makes sense
eb tool is super simple
definitely will take a PR if you can fix it, but otherwise we should probably deprecate that thing as we no longer use it ourselves for anything
i don't mind adhering to the defaults for this little proj.
heheh easy now pard 😛
ok baby steps are cool
i'll still likely submit a PR for review before having greater audacity/ambition
you guys have really built a fantastic tool here btw. i know i said that yesterday, but srsly.
for your review, gentlemen @micha @alandipert https://github.com/adzerk-oss/boot-beanstalk/pull/6
@lxsameer yes, aka 'transitive dependencies'
@christianromney looks good - there was another PR with the exact fix
doh! I should have looked first
np - 0.7.3
is pushed
{:require [garm.core]
:compiler-options {:asset-path "js/compiled/out"
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:parallel-build true
:source-map-timestamp true
:preloads [devtools.preload]
:external-config {:devtools/config {:features-to-install [:formatters :hints :async]}}}}
WARNING: Replacing ClojureScript compiler option :output-dir with automatically set value.
WARNING: Replacing ClojureScript compiler option :output-to with automatically set value.
There are perfectly fine options, like parallel-build and preloads
But output-to and output-dir are automatically set by boot-cljs
Another reason besides helping the user, is that writing to resources directory would not make sense in Boot
@juhoteperi can you please explain a little more ?
Is there any way to use github instead of clojars as a source boot dependency(like in npm)?
you can also have travis-ci automate building your jar and pushing to clojars if you like
So how I can replace for example boot-http package to its fork? And use it as dep to my project after that?
@micha @juhoteperi @naomarik I removed the compiler options and compiled my cljs files. there is no error now, but i don't have any compiled js file in my source tree
or you can modify it and deploy it to your local maven repo under the same group id and artifact id
if I wanted to incorporate a 3rd party (non-cljs) language like npm/react/babel or coffeescript or elm, would it be recommended and/or possible to incorporate that transpilation into boot or just leave it on its own with its own compilation/build tools etc. (webpack or whatever)?
@micha https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html like this? I am nearly absolute noob in java ecosystem.
in the boot-http repo dir you can do boot build-jar
to build the jar and install it locally
but in that specific project the build-jar
task both builds the jar and installs it in your local ~/.m2 maven cache
the clojure compiler will actually warn you if you make a var with earmuffs that isn't dynamic
by the way figwheel on my machine compiles in half the time (not a big source base but a lot of assets), I wonder what makes boot-cljs
slower
I need to dig into it
hey guys… I meant to ask this for sometime: what is this warning? should I try to fix it:
Warning: version conflict detected: org.clojure/clojure version changes from 1.2.0 to 1.8.0
it means that the underlying Maven machinery made a decision about which version of clojure to use that might cause you pain
this mostly happens when you depend on libraries that themselves depend on different versions of clojure
the best fix is to set the version of clj you want to use in your own project
e.g. bring it in explicitly as a dependency. it works because the way the Maven stuff works, the most direct dependencies "win"
@alandipert thanks for the thorough explanation. I have [org.clojure/clojure “1.8.0”]
listed in .boot file
@ag np. if nothing is broken, i think the warning is informational
my guess is one of your dependencies wants to bring in clojure 1.2 but 1.8 is coming in instead because of your dep.
you could make the warning go away by specifying an :exclude
to the dependency bringing in 1.2, which you can find by doing boot show -p
anyone who’s using Emacs. have you seen this? basically anytime I edit .boot file Emacs creates .#build.boot temp file and then boot doesn’t want to do anything in repl, until .boot file is saved
Man, emacs, those were the days. I'm developing on a surface book with vscode and an ubuntu subsystem.
I can't install postgresql in the ubuntu subsystem due to broken system calls but otherwise it's fine.
emacs creates and deletes files really fast while you're editing, which confuses the filesystem watchers
@ag you can also configure emacs to put the temp files elsewhere
hmm… you know what… you’re right… something wrong in the task… even adding .#build.boot
to .bootignore didn’t help
hmm, @flyboarder has a boot task for npm stuff
Ahhhhh node 7 --harmony async/await <333333 https://github.com/Raynes/intime/blob/master/src/main.js
as far as I can see it just installs npm modules… that’s not the problem I still need to include ./node_modules
as resource to “target"
@ag my task moves the whole node modules folder to target 😉
@flyboarder oh… cool I didn’t know that
@raynes yeah but we already had core.async
🙂
or promesa
, also very nice
oh man, I am sorry 😄 😄 😄
there are improvements for sure
My last two years has been scala, python, node (so much node), 4 SQL dialects, one Go project and fury
@ag the way it currently does it, it creates a temporary folder installs the modules to node_modules then adds that folder to the fileset as a resource so they are also moved to target
I don’t want to start a flamewar… but every time I need to review or look into .js code I feel like “why???”. Clojurescript is not just better. It just makes sense. I’ve tried almost every possible way to transpile into javascript (except elm and purescript).
@ag I also feel this way that's why I use cljs
In my opinion cljs is so much closer to where programming should be
same here, maybe only python
for certain tasks can be worth it....but....well...no, still, I can use Clojure
@richiardiandrea: yeah just use boot and script it
@raynes what do you mean? EVERYONE transpiles to javascript today. only exception - if you’re a building a library
@raynes the market, it is definitely a good point
Clojure projects are out there, but not as many as Scala/Python/Node.js for sure
@raynes I made a balsy/insane move a few months ago. I quit my extremely well paid job (which also was 10 minutes away from home). And I found Clojure/script job the next day
@ag nice!
I started my startup because of clojurescript, so much faster to develop and prototype
I have a two bedroom apartment in West LA, too many friends to leave, and I love this city. And so much I'd have to relocate.
Me too, I am looking for a short contract actually...for long term, I saw http://www.staples-sparx.com/ @raynes
@ag that's too bad, way more comfortable when you can work from home
I'm literally insane from being stuck in my apartment half the time so I'm not sure I can even do a remote job without going utterly out of my mind. Already on the ledge
oh hey, i'm in LA now too
ah ah, I work from home just fine 😄 Because I co-organize the Clojure meetup I guess and can every week talk geek there
and of course here on #boot 🙂
@raynes what's the tech center of LA in your opinion?
last i looked all the startup type things were around santa monica
@flyboarder what’s the right way of calling npm
task? tried (boot (comp (npm) (target))
- not seeing things in ./target
@ag You also need to tell the npm task what to install
@flyboarder doesn’t it read package.json?
So like (npm :install {:jquery "master"})
Or something like that, it doesn't read package.json because that's outside the fileset
It will in the future, I didn't implement it yet
But really you don't want those kinds of things in your root
Again since they are outside the fileset
you could read package.json yourself in your build.boot and convert that to the EDN the npm
task uses in the option
@flyboarder what’s the idea behind ./target/./package.json
and ./target/package.json
. any specific reason I should let them be there?
No they are temporary files
You can remove them but they are useful for debugging
what’s the best way of removing them? sorry I know I’m annoying, but you’re guys so nice, I am just too tempted 😉 tried this:
(deftask npm-install []
(with-pre-wrap fileset
(npm :install npm-deps)
(-> fileset
(rm (ls fileset (by-re [#"package\.json"])))))
something not quite right(deftask npm-install []
(comp
(npm :install npm-deps)
(with-pre-wrap fileset
(-> fileset ...))))
you want to run the npm
task, then your own task directly after to do some kind of cleaning up or moving around of files, right?
the with-pre-wrap
macro makes a task, which you can compose with the other task using comp
Hey guys I’m hoping to get some feedback on this: https://hub.docker.com/r/adamkowalski/clojure/
Then you can use the sift task to filter files from the fileset
I have tried to make a really light weight docker image that has clojure 1.9 and java 8
You can even get it on windows, all you need to is install docker
type: docker run -it —rm adamkowalski/clojure
and then when it loads type boot repl
it takes like 1 minute
with the OS (alpine linux) its still under 200mb
when would you use with-post-wrap
? this level higher-higher order function middleware ideology is new to me and wondering an example where this particular form would be useful
as i understand it, this particular macro doesn’t affect a fileset through the middleware right?
right, if tasks were to modify the fileset on the "return path" of the pipeline that would introduce a lot of confusing behavior
so it’s more for tasks that examine the fileset and do something with it but don’t commit anything back to it?
like consider for example a task that will notify you of errors that happened elsewhere in the pipeline
like imagine tasks could add metadata to the fileset with info about errors or warnings etc
well if the pipeline has something like the watch
task you would want to put it after that
the middleware stuff is weird to visualize, i’ve been using it blindly for awhile and just recently saw how things really get evaluated and in what order
the image here https://github.com/boot-clj/boot/wiki/Tasks#overview is maybe a good one
that’s a good pic. i had this notion completely grasped 2 days ago but haven’t hammered it into my head quite yet. will need to write some experiment examples for self
as a consumer of any middleware API it’s super obvious to see what’s going on, but to really understand what’s going on and being passed around as a newbie is strange
Lol interesting choice yes 😉 this diagram is easier to understand than the one on the page I think, I wish I had this back in the days when I was studying it myself 😄 maybe you can label forward arrows with with-pre-wrap
and back with with-post-wrap
?
mmm and actually with-pre-wrap
and with-post-wrap
can both be in the same task
for function call maybe a classic (fn)
?
no dunno if it's clear
Both return a fileset so you can comp them
@flyboarder yep this is already in the wiki: https://github.com/boot-clj/boot/wiki/Tasks#pre-post-decomposition
to visualize that though it's another story 😄
Yeah that part doesn't explain it well enough because nowhere does it say I cannot manipulate the fileset when it's passed back up the pipeline
You have to look at the post wrap code
I’ve gotten to the part where I need to migrate lein uberjar
piece to boot. Can’t find anything related on the wiki.
yeah the macro in this case hides a lot of what is going on, I usually never use with-post-wrap
directly because of my brain limitation 🙂 I prefer to explicitely see the (next-handler...)
call
@ag an example of how to build uberjars can be found here: https://github.com/Lambda-X/lambdax-web/blob/devel/build.boot#L123
note that the last line is explicitely copying it to the target
folder
this can be something you might or might not want to do (you can delegate that decision to the command line)
my brain keeps telling me to go to hackernews or reddit when it feels stupid… need to stop that
Ms paint 😛
ahahah
i need to make some more examples of this maybe using an animal creator middleware that just assocs animal parts into a map
it’s slightly difficult to conceptualize everything when too many abstractions are going around
the API is clear and can see how to use and write the tasks, but to make a similar system from scratch is what kinda knowledge i’m aiming for