This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-24
Channels
- # announcements (10)
- # aws-lambda (9)
- # babashka (14)
- # beginners (166)
- # calva (63)
- # chlorine-clover (4)
- # cider (40)
- # cljs-dev (4)
- # clojure (182)
- # clojure-europe (18)
- # clojure-italy (5)
- # clojure-nl (5)
- # clojure-spec (17)
- # clojure-uk (55)
- # clojurescript (11)
- # core-async (12)
- # cursive (23)
- # datascript (5)
- # datomic (19)
- # emacs (4)
- # fulcro (46)
- # graalvm (2)
- # hoplon (2)
- # joker (3)
- # juxt (1)
- # keechma (2)
- # leiningen (20)
- # malli (1)
- # meander (7)
- # nrepl (1)
- # off-topic (72)
- # pedestal (6)
- # re-frame (15)
- # reitit (7)
- # shadow-cljs (34)
- # sql (14)
- # testing (14)
- # tools-deps (11)
- # tree-sitter (1)
- # vim (14)
- # xtdb (19)
- # yada (3)
I've seen this, https://gist.github.com/noprompt/9086232, but it doesn't make any sense to me, does it work?
in general @USWTQB9RU, yes the approach works - the file is read at compile time by the macro and substitutes a literal string for the value of project-clj
if you are using shadow then use shadow.resource/inline
instead, for a cache-compatible approach
I've also seen this question asked in several other places online, but none give me a straight forward answer
hello! 👋 i'm running into some strange behavior, trying to use tools.deps to compile clojurescript => javascript in an existing project that i'm working on migrating from boot to tools.deps it was previously working via boot-cljs, and now i'm basically trying to detangle things and understand what's going on so that i can compile my clojurescript app in a simple, easy to understand bash script my setup is probably a little bit unusual because 1) i'm converting an existing project based on boot-cljs, (which, as i understand it, takes some liberties with cljs compilation), and 2) this is a hoplon application so, hoplon expects to find cljsjs.jquery on the classpath, and we ended up needing to use a newer version of jquery than the latest cljsjs one, so we've vendored the version of jquery we need into the project, and we have a deps.cljs that provides it as cljsjs.jquery:
{:foreign-libs [{:file "vendors/jquery/jquery.min.js"
:file-min "vendors/jquery/jquery.min.js"
:provides ["cljsjs.jquery"]}
...]}
the strange behavior that i'm running into is that this compiles successfully (in fact, it won't compile if i leave out the foreign lib entry above), but when i open the app in a browser, i get a JS console error from bootstrap saying it requires jQuery. when i look at the compiled JS file, i see other foreign libs' source at the top, but the jquery source is nowhere to be found
i realize this is a lengthy and very specific problem, but does this happen to ring any bells for anyone here? any advice would be helpful
a couple of related questions:
1. is there a difference between having a deps.cljs on your classpath vs. using the compiler :foreign-libs
option? i couldn't find much documentation about deps.cljs, so i'm wondering if maybe i should be using the :foreign-libs
compiler option instead (although i tried that and still ran into the same problem)
2. my script compiles clojurescript => javascript by invoking cljs.main with --compile-opts, --optimizations, etc. is that advisable compared to using cljs.build.api?