This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-15
Channels
- # aws-lambda (3)
- # beginners (37)
- # boot (294)
- # carry (1)
- # cider (38)
- # cljs-dev (37)
- # cljsjs (88)
- # clojure (187)
- # clojure-android (2)
- # clojure-austin (1)
- # clojure-dusseldorf (9)
- # clojure-hk (3)
- # clojure-italy (12)
- # clojure-russia (36)
- # clojure-spec (55)
- # clojure-uk (27)
- # clojurescript (75)
- # community-development (5)
- # conf-proposals (2)
- # copenhagen-clojurians (3)
- # cursive (9)
- # datomic (54)
- # devcards (5)
- # devops (3)
- # dirac (69)
- # emacs (6)
- # ethereum (1)
- # euroclojure (1)
- # events (3)
- # funcool (1)
- # hoplon (20)
- # immutant (4)
- # luminus (14)
- # midje (4)
- # om (178)
- # om-next (2)
- # onyx (47)
- # pedestal (19)
- # protorepl (20)
- # re-frame (14)
- # reagent (54)
- # ring (2)
- # ring-swagger (7)
- # test-check (10)
- # uncomplicate (11)
- # untangled (9)
- # yada (9)
is there any way to log what’s added to a fileset and when? i can see the files produced by a task in the cache, and there are add-resource and commit! calls after they’re created, but sift gives the ever helpful
No implementation of method: :file of protocol: #'boot.tmpdir/ITmpFile found for class: nil
micha: https://gist.github.com/spieden/1f757b32b4f04d25e7d28e23e0f5c3bf#file-boot-clj-L50-L52
Sifting output files...
clojure.lang.ExceptionInfo: No implementation of method: :file of protocol: #'boot.tmpdir/ITmpFile found for class: nil
data: {:file
"/var/folders/3y/6pws2t7168l1c228pv16scvw0000gn/T/boot.user879892176421800489.clj",
:line 31}
java.lang.IllegalArgumentException: No implementation of method: :file of protocol: #'boot.tmpdir/ITmpFile found for class: nil
clojure.core/-cache-protocol-fn core_deftype.clj: 554
boot.tmpdir/fn/G tmpdir.clj: 25
boot.core/tmp-file core.clj: 381
cljsjs.boot-cljsjs.packaging/eval379/fn/fn/fn packaging.clj: 148
boot.task.built-in/fn/fn/fn/fn built_in.clj: 493
boot.user/eval470/fn/fn/fn boot.user879892176421800489.clj: 25
cljsjs.boot-cljsjs.packaging/eval178/fn/fn/fn packaging.clj: 40
cljsjs.boot-cljsjs.packaging/eval127/fn/fn/fn packaging.clj: 25
cljsjs.boot-cljsjs.packaging/eval290/fn/G/fn packaging.clj: 86
boot.core/run-tasks core.clj: 938
boot.core/boot/fn core.clj: 948
clojure.core/binding-conveyor-fn/fn core.clj: 1916
…
https://github.com/cljsjs/boot-cljsjs/blob/0.5.1/src/cljsjs/boot_cljsjs/packaging.clj#L148
@micha it was minify lines that whole time while I thought it was the sift ones 😬 should have read the trace but a nicer message wouldn't have hurt
im just looking into mattermost for our internal use. i remember there some conversations around where to move the clojurians team later, since slack didnt want to support open source communities or something like that. there was #braid-chat #clojurian-chat-app etc what was the conclusion? does anyone know/remember?
(i saw https://hackpad.com/collection/wnikaeBENEE in a topic message, so im looking into that now)
@onetom there’s also https://discordapp.com/
@anmonteiro so discord is not open source but then i also dont see any pricing page 😕
@onetom oh I probably didn’t realise you were looking for an open source thing
so the React community moved to Discord after their Slack grew beyond a certain point
for me the problem of Discord is that it still doesn’t have a search feature
but I think they’re working on that
@anmonteiro is there a clojurians ?server? on discord yet?
not that I know of
@onetom: There is also https://rocket.chat/
and the nerdier (distributed) https://matrix.org/ (Matrix protocol) which has a separate client: https://vector.im/
@vikeri all of these has been mentioned on https://hackpad.com/Home-YVTdpH47Vz4 with pros and cons and https://github.com/reactiflux/volunteers/issues/25 page has even more info on the topic
Hi, boot noob here. I ran lein new luminus +reframe +postgres +auth
, and then tried to convert to boot. Now it runs successfully, but returns a 404 page. Does anyone have any tips or an example of a simple boot configuration with both Clj and CLJS?
I also like this boot
project - it has Reagent and DevCards! https://github.com/jupl/closcri/tree/reagent
@coyotespike here’s a very simple project with a Boot config for client + server
But like Tenzing, it doesn't have a backend.
@anmonteiro Thank you!
Probably a dumb question: on line 59 of build.boot
, you have (system :sys #'dev-system :auto true :files ["server.clj" "parser.clj"])
. Is this where the whole "server hosts the html where ClojureScript lives" thing gets started?
@coyotespike oh right, probably not that a beginner-friendly project after alll
probably worth reading https://github.com/danielsz/system
well, depending on the beginner 😉
I was just about to ask about that
How do you like System? I haven't yet wrapped my head around it - it's for managing database, server, etc, right?
it’s mostly a reloaded integration for sierra’s Component library
I fought it for a while but now it’s the first thing I add to any project that has a server 🙂
no way
So it effectively replaces the project.clj
calls to yourapp.core to bootstrap the whole thing, among other tasks
Meaning if I try to translate directly from project.clj
, I am not being very Boot-y and should instead learn the System/Component way of running the whole shebang.
that would be one way to do it, yes
Well, if I learn that instead of trying to make it go the old way, that'll be much more productive. Thanks! 😎
It’s not immediately obvious from the documentation: does boot have the concept of a task that depends on other tasks. Like B depends on A, so if try to run B it will automatically run A first
@stathissideris Tasks are just functions. Task B can run Task A first.
@domkm ok, so it’s not explicit like in “make" for example
I mean Makefiles
@stathissideris i like to see it the otherway--it's very explicit because you just type them in order 🙂
thanks all, that’s very clear
I think it’s not time for boot yet for me 🙂
My experience is, for the most part, things I’ve struggled with for hours in lein have just worked in boot.
micha, it's interesting u wrote "just type them in order", because how they run depends on what the task do before and after calling the next task... i think it's a general drawback of the middleware pattern though...
@onetom the dependency order is strictly defined by the order in which you comp them though
what does "dependency order" mean though and why is it useful versus in what order will they run?
good example is the (serve)
task which i can just put at the beginning or the end and no practical difference
yup, i get that. the task has dependencies built into its definition explicitely in lein
what i mean is this:
(deftask t1-post []
(fn [next]
(fn [fs]
(let [fs* (next fs)]
(println "T1")
fs*))))
(deftask t1-pre []
(fn [next]
(fn [fs]
(println "T1")
(next fs))))
(deftask t2 []
(fn [next]
(fn [fs]
(println "T2")
(next fs))))
(deftask t-ok []
(comp (t1-pre) (t2)))
(deftask t-suprise []
(comp (t1-post) (t2)))
and there is no way to know if a task is doing it's job before or after calling the next handler
so do they depend on each other? ... isn't dependency something which should correlate with run order? ...
@micha I wonder, have you ever looked at interceptors?
I for the first time ever understood them when reading the latest re-frame docs and they seem kinda cool, dunno if there's much application for them with boot but figured I might bring it to your attention anyways 🙂
like the worker part could be a function that takes a fileset and returns a fileset after doing work
no clear "oh we'd get this" but one thing that came to mind is being able to inspect the task queue, which could be used to check show warnings if a cljs
task is used before a reload
task etc
probably you can also do evil things with that knowledge but ¯\(ツ)/¯
my approach to that is to make the tasks themselves well factored enough so that it's clear to the user how to order them
well putting speak first when the audible notification is after the build is something that's still counterintuitive
maybe a way to visualize how the message flows through the pipeline would be good there
but yeah I think I get what you mean, just thinking that it could perhaps improve error messages
@martinklepsch i think you're right about getting visibility into the pipeline
about that, an approach can be to have declarative data from which you build your tasks, kind of like re-frame is doing: a map will contain all the info you need in order to declare a task. It will also contain a symbol or var that points to the "worker"...everything is data right...I think Onyx took this approach for its distributed computations
nothing new I guess 😄
yep, the solution in Onyx is to include vars to functions
right but onyx and re-frame are also still pretty different in how they do it
like onyx has the ID "approach" vs. re-frame which has a map that has functions as values
yeah, different constraints,sure
yes different but similar
I find re-frame's data abstraction pretty light actually as in 99% of the functionality is still functions
just the way these are composed is based on data
also, re-frame already had the contraint to keep everything as an event system
so interceptors/middlewares are a natural fit there
imho 😄
separating the flow from the work will let you create your own kind of pipeline if you want, but can still be backward compatible
like you can take a fn that does the work and make a task like the ones we have now like this:
yeah I guess you need something like that if you want to visualize the pipeline...you need some way to connect the dots
also, when you connect the dots you can detect things that can be run in parallel
and use boot-in-boot automagically
computers trying to figure out how to optimize your build seems like it will add a lot of complexity
mmm yeah maybe yes
also, I noticed that with real codebases creating a pod is still something expensive so I don't really think we would gain something there
no well, use boot.parallel
for tasks that can run in parallel...the gain might not be as high as I expect...and in fact I am also wondering if I should switch from boot.test
to boot-alt-test
myself..the pod creation startup time is getting unberable while running tests in my middle-sized codebase
(meaning, not that big code base :D)
the pods are so you don't need to restart, but if it's slow it's like you're restarting all the time anyway
anyway, it's all good, just wondering if pod is the way to go for tests anyways 😄
I am starting to agree yes
I'm trying to change https://github.com/danielsz/holygrail to reagent
, and reading https://github.com/magomimmo/modern-cljs to help.
I'm pretty puzzled, as I'm following another project. It all builds, but nothing shows on the page.
Basically, after changing om
in core to your basic reagent/render
, shouldn't boot just compile the CLJS as before?
I also added index.cljs.edn
under resources, with:
{:require [holy-grail.core]
:init-fns [holy-grail.core/render]
:compiler-options {:asset-path "js/main.out"}}
but no love.
I'm trying to get project compiling but getting error like https://gist.github.com/YurySolovyov/77d8acc85a2ae4aee8b75f2ccb01416c
Project tree looks like this:
├── boot.properties
├── build.boot
├── LICENSE
├── project.clj
├── README.md
├── resources
│ ├── index.html
│ ├── main.cljs.edn
│ ├── package.json
│ └── renderer.cljs.edn
├── src
│ └── eion
│ ├── directories
│ │ └── core.cljs
│ ├── main
│ │ └── core.cljs
│ └── renderer
│ └── core.cljs
the content of the .cljs.edn
files might also be interesting
@coyotespike this needs a bit more info 🙂 ideally a repo with code but an error message or your namespace might also help
namespaces are mapped to dir structure
I can comment it out to try
new one: adzerk.boot_cljs.util.proxy$clojure.lang.ExceptionInfo$ff19274a: ERROR: No such namespace: eion.renderer.out.cljs.core.async.impl.timers
yup https://gist.github.com/YurySolovyov/77d8acc85a2ae4aee8b75f2ccb01416c#file-build-boot
@martinklepsch cool 🙂 I'll throw up a repo and come right back with a summary.
@yury.solovyov the IDs in dev-build are still wrong
should I add .core ?
they need to be just main
and renderer
and for cljs-repl
?
as I said in DM, the IDs are path to a .cljs.edn
file relative to your (in this case) resources/
directory
they all expect the same thing
build IDs have nothing to do with namespaces
On a similar note 😉 https://github.com/coyotespike/holygrailreagent/blob/master/build.boot
Actually the relevant dev
task looks like:
(deftask dev
"Run a restartable system in the Repl"
[]
(comp
(environ :env {:http-port "3000"})
(watch :verbose true)
(system :sys #'dev-system :auto true :files ["handler.clj"])
(reload)
(cljs :source-map true
:optimizations :none)
(sift :include #{#"\.cljs\.edn$"} :invert true)
(repl :server true)
(speak)))
So reload
comes before cljs
task.
If I just drop (js/alert "Hello")
at the bottom of the file core.cljs
, it fires off on the page. So the file is getting looked at, but I am not hooking the cljsbuild in correctly.
the only problem left is that it outputs to target/renderer.out
and target/main.out
, can I make it drop .out
thing?
@coyotespike so you add some code and it's evaluated in the browser, yes? what are you missing?
@yury.solovyov you can but really you don't want to
usually you don't even see this
@yury.solovyov when you build a single file (`:advanced`) the contents of these directories become irrelevant
Hmm... I'm missing my compiled ClojureScript - HTML and JS. So I I thought I hadn't directed Boot to the right init function.
@coyotespike ah, so you see a toplevel thing being executed but your app
function is not called
But (reagent/render [component] (.getElementByID js/document "container"))
by itself didn't do anything.
@coyotespike so actually your cljs.edn file looks correct
maybe the container element is missing?
sounds odd
The next thing I was going to bring up 🙂
And the cljs.edn
file is a default, right? I haven't specified it in my boot.build
yes, the cljs
task will pick it up automatically
@coyotespike just cloned your repo but when I go to localhost:3000
I get "Failed to load resource: the server responded with a status of 404 (Not Found)" (for loading main.js
)
can you push your current setup?
sorry, yes, one sec
@martinklepsch right, should be good now
@coyotespike still same problem 😄
I cloned into a new directory to run it, and it went
by which i mean, nothing on the page, but no 404 either
@coyotespike not even in the console?
dam you're right, it does show that in the console
well that's good to know
so the issue is you try to load main.js
but because you have index.cljs.edn
your output file will be named index.js
oh snap
Dude, thanks so much
I need to fix some reagent now but I can figure that out 🙂
I am trying to get my own little template set up with Boot, DevCards, System, buddy for auth, postgres....so first I need to learn me some Boot
@coyotespike glad we figured it out 🙂 For some reason the ReactDOM
related error you might be seeing right now is caused by the Om dependency
so once you remove that it should all work (tm)
I was wondering about that 🙂 goodbye Om 😎
is that ok that adzerk.boot-cljs-repl adzerk.boot-reload use document.write?
I mean renderer.js look like so
var CLOSURE_UNCOMPILED_DEFINES = null;
if(typeof goog == "undefined") document.write('<script src="renderer.out/goog/base.js"></script>');
document.write('<script src="renderer.out/cljs_deps.js"></script>');
document.write('<script>if (typeof goog == "undefined") console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?");</script>');
document.write('<script>goog.require("boot.cljs.main8477");</script>');
and document.write it 100% not the most proper way to add scripts
when you deploy to production you'll have at least whitespace optimizations on, and none of that will be there anymore
I wonder if it would be better to enable simple optimizations, but I'm not sure hot reloading would still work
ok then
btw, thanks for help with boot, it seems to work
@yury.solovyov also the biggest drawback of :simple
is that compile times are easily going to be 10 times higher than without optimizations
noticed that with lein
i tried to set up figwheel, but gave up
is there any way to have a boot repl
and watch
in the same pipeline with the repl being usable without separate client
(deftask devlocal
"Run a restartable system in the Repl"
[]
(comp
(environ :env {:http-port "3000"})
(watch :verbose true)
(system :sys #'dev-system :auto true :files ["systems.clj" "core.clj"])
(repl)))
I always forget you can run tasks from the REPL lol
boot.user=> (def p (future (boot (watch) ...)))
...
boot.user=> @p
;; now you can press ctrl-c to end the pipeline
seems like it works. I don’t use it often that way, since I tend to use repl via cursive.
what happens when you then do a second (boot ...)
thing?
that future approach seems cool — will use 👌
ha, that's what I guessed 😄
So now I'm trying to add DevCards. It's complaining No such namespace: devcards.out.cljs.core.async.impl.channels
. I think the error lies in devcards.cljs.edn
.
{:require [holy-grail.components.page-test]
:init-fns [devcards.core/start-devcard-ui!]}
I also tried it like:
{:require [holy-grail.components.page-test]
:init-fns [holy-grail.components.page-test/devcards]}
The devcards task is quite simple:
(deftask devcards []
(comp
(speak)
(sift :include #{#"^index"} :invert true)
(cljs :optimizations :advanced
:compiler-options {:devcards true})
(sift :include #{#"\.out" #"\.cljs\.edn$" #"^\." #"/\."} :invert true)))
That looks like what would happen if Cljs was trying to compile files in Cljs output-dir
1. Check that boot-cljs finds you .cljs.edn (it is not saying something like "Writing main.cljs.edn" 2. do you have e.g. lein cljsbuild output in your resources folder?
Thanks @juhoteperi, will do. That's what I thought it looked like too. I don't have any output in my resources
folder.
Aha, it's the first sift task, that removes your cljs.edn file
or no..
really?
I don't know. Maybe. That removes any files under index path.
What is the path of cljs.edn file?
just /resources/devcards.cljs.edn
And same for main.cljs.edn
, which is working
Hmm. That not the cause then-
When I remove both sift
s, the error's still there, so I think you're right.
However, this results in devcards.html
rendering, though without any cards:
(deftask dev
"Run a restartable system in the Repl"
[]
(comp
(environ :env {:http-port "3000"})
(watch :verbose true)
(system :sys #'dev-system :auto true :files ["handler.clj"])
(reload)
(cljs :source-map true
:optimizations :none)
(sift :include #{#"\.cljs\.edn$"} :invert true)
(repl :server true)
(speak)))