This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-31
Channels
- # beginners (9)
- # boot (38)
- # cider (7)
- # cljs-dev (181)
- # cljsrn (49)
- # clojure (136)
- # clojure-italy (44)
- # clojure-losangeles (1)
- # clojure-news (1)
- # clojure-russia (3)
- # clojure-sanfrancisco (1)
- # clojure-serbia (2)
- # clojure-spec (28)
- # clojure-uk (41)
- # clojure-ukraine (1)
- # clojurescript (103)
- # core-async (6)
- # core-logic (46)
- # cursive (5)
- # data-science (8)
- # datascript (6)
- # datomic (5)
- # emacs (35)
- # events (3)
- # jobs (2)
- # jobs-rus (2)
- # juxt (6)
- # lumo (7)
- # off-topic (101)
- # om (6)
- # onyx (6)
- # parinfer (38)
- # pedestal (5)
- # perun (1)
- # planck (4)
- # protorepl (4)
- # re-frame (62)
- # reagent (20)
- # remote-jobs (1)
- # ring-swagger (1)
- # spacemacs (16)
- # unrepl (43)
- # vim (13)
@dimovich make sure to use the newest boot-cljs
and if that still does not work you can open an issue, it is such a new feature that there might be some work to do there, Juho is always very responsive
I have tested :npm-deps
with Boot-cljs, it works
@dimovich If you want ClojureScript to automatically install the deps, you need to add :install-deps true
option also
ah ah great talking about responsiveness 😄
@richiardiandrea @juhoteperi Updated boot-cljs. Works now, thanks!
That sounds like a case where Closure just can't process some CommonJS files
How can I add a jar to the classpath with boot, it's a local file, not in the maven repository (I'm trying to create a program with plugin support, and for now I need boot to add it to the classpath)
@donyorm you can peek at this: https://github.com/boot-clj/boot-sources/blob/master/src/powerlaces/boot_sources.clj#L51
Does this not require the jar to already be on the classpath? The sift
task docs say that (and that task's code says it behaves similiarly to sift). What does "already resolved" me in this case?
already resolved means that you know already the path to .m2/repository
That didn't seem to work. I'm trying to implement this system: https://yogthos.net/posts/2015-01-15-A-Plugin-System-in-Clojure.html, but without specying the jars in the project dependencies (loading them once the app starts or through a launcher and getting all the jars in the specified directory). I don't see the added jars in the classpath, or in the program's output, even when running them through this task
boot
has boot.pod/add-dependencies
if you need to add dependency from vectors
actually https://github.com/boot-clj/boot/blob/2.6.0/boot/pod/src/boot/pod.clj#L65
that would add it to the main pod though, so it always depends on which classloader we are talking about 😄
Is using add-classpath suitable for production code? I was going to just use that at first but people advised against it.
well production code with runtime loading of classes in general feels a bit sketchy
but we are in Clojure so as long as you do it on start maybe it is ok
Yeah, it's not super-important production (a desktop application for worldbuilding, not anything life-threatening 🙂 ), so I might just try it. But would the proper way be to add the plugin jars to the classpath when starting the program?
(good job with the Luminous port btw)
thanks, I'm pretty happy with it, though I imagine it still has a few rough places to be smoothed out
Are there any examples / best practices of how to include Java source in a boot project (i.e. I'd like to (:import [myproject.helpers MyClass]) into my CLJ source)?
@tmarble usually as long as they are on the classpath you should be able to import them
@richiardiandrea do I add a javac task?
but I guess they need to be compiled
yeah, never tried that but it makes sense to add javac
gen-class
generates the JVM bytecode to "wrap" a Clojure namespace in real Java class so your Clojure code can participate in e.g. being the entrypoint of java -jar ./my-project-standalone.jar
Which seems to be the opposite of what you want, which is to compile Java sources and have them available to the Clojure runtime just like any library JAR you'd pull off Maven Central
But perhaps (even "likely") I misunderstand. :)
The last time I worked in a mixed Java/Clojure project was before Boot's time, but it definitely involved having a Leiningen javac
step to compile the Java sources and put their byte code on the project classpath
yep @chris_johnson I think you're correct
no yeah gen-class
does not feel the right choice here, you compile, then you load the bytecode in the classpath so that it is visible to Clojure