This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-10
Channels
- # admin-announcements (4)
- # beginners (21)
- # boot (85)
- # cider (31)
- # clojure (45)
- # clojure-australia (1)
- # clojure-berlin (2)
- # clojure-dev (7)
- # clojure-italy (10)
- # clojure-japan (17)
- # clojure-norway (8)
- # clojure-russia (2)
- # clojure-uk (15)
- # clojurebridge (1)
- # clojurescript (115)
- # code-reviews (13)
- # core-async (1)
- # editors (17)
- # euroclojure (5)
- # jobs (1)
- # ldnclj (9)
- # off-topic (5)
- # om (18)
- # re-frame (15)
- # reagent (25)
- # sydney (1)
In porting a figwheel cljs app to use boot, I am getting a long stream of these errors when I run boot dev
: 2015-07-10 11:51 java[5941] (CarbonCore.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
Having a hard time with Boot. It's complaining when I run boot dev
:
clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: Could not locate cljs/env__init.class or cljs/env.clj on classpath: , compiling:(cemerick/piggieback.clj:1:1)
java.io.FileNotFoundException: Could not locate cljs/env__init.class or cljs/env.clj on classpath: ...
So I have placed an env.clj and env.cljs in my ~/src/cljs folder - didn't help. Then I searched for all references to env in my project and commented out offending code to see if I can get rid of the error, but still no luck.@petrus using clojure 1.7 and recent clojurescript version?
Let me check. I think the register_with_server
error was caused by memory issues (I was running a lot of boot watchers)
@crisptrutski: here is my build.boot set-env! call:
clojure version is set by boot, not your build.boot
can check with boot -V
, and can pin it with BOOT_CLOJURE_VERSION=1.7.0 boot -V > boot.properties
awesome! thanks guys. I got it working š
hi all - any one fancy helping me out getting compiled javascript into resources/public - banging my head against the wall with boot-cljs
I have tried: - putting main.cljs.edn in resources/public, src/cljs/resources/public, neither worked. Also tried passing the output-dir and output-to to compiler-options but that didnāt work. The closest I have come is for the compiled js to be in target/resources/public š
@colin.yates: i think (set-env! :target-path āresources/publicā)
boot as a system, rather than boot-cljs as a task (which handles the cljs.edn files), handles writing outputs from the fileset back to the project directory
there are some fileset sync functions to use in your own task if you want separate js / jar target paths i guess (havenāt used them)
@crisptrutski: - ah I see - thanks. I donāt see how to construct my build.boot so only JS goes into resources/public - I guess that is the fileset sync functions you mentionedā¦.
There shouldn't be a reason to have boot write the files to resources folder (instead of target folder)
I'm guessing you are trying to do this because you are serving static files from resources/public folder?
yes, the javascript and CSS etc.
Instead of serving them as files, serve them as resources from classpath
e.g. compojure.route/resources
so cljs->js ends up in target but I have a compojure route serving the target/js/main.js?
pretty much only time you should do anything with files in target/ is when you copy the .jar file from there
if you put cljs.edn in e.g. src/cljs/public/main.cljs.edn the compiled file should be in path "public/main.js", and you don't really need to care what the filepath is, because boot-cljs will add the resulting files to classpath so they are accessible using e.g. (io/resource "public/main.js")
Check this project: https://github.com/Deraen/saapas/blob/master/src/clj/saapas/server.clj#L13-L14
ah OK - I am not using āserveā, I am using http-kit
It's not serve thing, it's ring thing in general
is the resources path ādynamicā - ie if a separate process update the js in /target
, will an existing ring server start serving the new content?
@crisptrutski: Nothing is updating anything in /target, they are updating stuff in fileset (theye
the tasks edit classpath dynamically
well, separate processes wouldnāt share a fileset, no?
do you mean separate boot proceses?
They can't really communicate using target folder
the state of target folder is indeterminate when boot is running
@micha could probably explain this better
ok, so for arguments sake - if a server was being run with lein ring, and cljs was being compiled with boot (eg. an app busy migrating)
thanks both - @juhoteperi I will have a look at that snippet. I donāt get how boot and ring are communicating so I need to do some more reading I think. Specifically how uberjar works in this context etc.
@juhoteperi - That whole project might just be the template I need - thanks
@crisptrutski: I'm not sure what would be proper way do that, the right way is to run both ring and cljs in boot (same process, same classpath)
@juhoteperi - let me repeat - thanks, really, this project is exactly what I needed - thanks for your efforts
Boot core concept pages in boot wiki are good read, especially the fileset article should be very useful even when not writing boot tasks
thanks from me also - was just trying to understand jvm resource paths more, not question the wisdom
Yeah it takes some time to get used to, I also used to serve files from filesystem instead of classpath when using Lein
Though nowadays I use classpath with Lein too, takes just a bit more magical configuration there but makes the code simpler
(and more portable, I think)
@juhoteperi, I was just starting to respect you but then I noticed vim - really! (Oh, I didnāt just go there! :))
I'm thinking @micha is also vim user š
om/reagent, vim/emacs, cursive/counterclockwise - too many religious wars to fight š
some cool tricks in this repo - the way you put the system + boot stuff together, and the ā.no-reloadā idea are new to me
I really appreciate these types of projects which tie these things together. Very helpful
heyho everyone
With Component it would probably be useful to use reloaded-repl, I might update Saapas to show that
hey @martinklepsch - you back in fernsentrum land now? (ps do those stickers even ship )
Back in Fernsehturmland, yes. Crazy tired š
Maybe they do. I havenāt hold one in my hands myself yet haha
getting weird behaviour - application is running and loading the latest JS (thanks @juhoteperi), however not all CLJS changes are being pushed. For example, I have a ārun-renderā fn which (js/console.log) and then (reagent/render). If I change that js/console.log I see the new text appear - great, however if I change any of the reagent component fns I see the run-render being executed (with the updated js/console.log) but not the updated reagent...
this all used to work in lein figwheel so I donāt think I have any muppet mistakes (but open to the notion that I have)
any ideas?
@colin.yates: I'm wondering if you are suffering a version of this: https://github.com/reagent-project/reagent/issues/153#issuecomment-118449228
@mikethompson: Thanks Mike, however when I used figwheel it was all working, I am sure I have muffed something in boot. I will check that issue more thoroughly though
Hello, Newbie here. I'm trying to create a node cljs project and use boot. Any recommendations on declaring npm dependencies in boot?
s/declaring/getting
one thing i can recommend is to look for a lein plugin that does it (i think there is one)
you can use the functions underneath the plugin from your boot task pretty easily usually
just load the dependency via set-env!
in the repl, require the namespace, and play around
ok. Thanks. It may turn out that I don't need it because I can just specify them in node package.json. I might look into the lein approach though. Thanks very much for your help!
ok. Will do
no. I just did a google search
ok. Thanks again for your help!