This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-26
Channels
- # announcements (5)
- # architecture (1)
- # bangalore-clj (4)
- # beginners (45)
- # boot (4)
- # cider (19)
- # clojure (56)
- # clojure-austin (1)
- # clojure-canada (1)
- # clojure-finland (1)
- # clojure-russia (67)
- # clojure-uk (2)
- # clojurescript (57)
- # clojutre (1)
- # cursive (15)
- # datomic (3)
- # emacs (2)
- # figwheel-main (71)
- # fulcro (117)
- # hoplon (33)
- # java (5)
- # off-topic (52)
- # pedestal (7)
- # remote-jobs (1)
- # shadow-cljs (134)
- # slack-help (9)
- # specter (1)
- # tools-deps (17)
- # vim (2)
@dottedmag Cursive currently uses Tern’s builtins but I’m planning to switch that to Google Closure’s at some point soon, which are more complete.
Not too sure whether here is better, so: https://clojurians.slack.com/archives/C1AC4BU2K/p1535265926000100
These are "Java with tooling" distributions, not the JDK itself. And while I'm sure there's lots of enterprises which use those to enhance their end user (as in office worker) experience, generally you don't see these distributions in the wild.
That said, I've been looking into OpenJDK as I don't really use the fancypants features of HotSpot.
I'd argue, judging by how Oracle has played with pricing for other products, that this is just their testing the water
silly problem probably but I can't figure it out, I have semi-spa app (so the home rendered completely server side and another page rendered with Re-frame)
the re-frame part works fine if it's uses as index, but if I move to a different route then this [:script {:src (cache-buster "js/compiled/app.js")}]
doesn't work anymore, because it prepends the current path it's on
if instead I write it as [:script {:src (cache-buster "/js/compiled/app.js")}]
it finds that fie, but not the other files needed (like base.js
and co)
I think i've had this issue before. You might need to change the :asset-path
option in the clojurescript compiler
I'm using these options
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
for now I solved in horrible way just by using query arguments instead of the routing I wanted to use
but would be nice to fix it properly
mm no it still prefixes the current url
What would be the best way to traverse a Hiccup vector-of-all-kinds-of-stuff-like data structure and transforming keywords based on some condition?
@henrik update-in
might be enough?
@andrea.crotti Doesn’t update-in
presume that I know the exact path to the keywords? I need something that goes deep into an (almost) arbitrarily nested vector-of-vectors-keywords-strings-and-maps, and does stuff depending on a predicate.
I’ve solved this temporarily with a self-referential function, but I presume it to be inefficient and potentially build up a giant heap/stack.
tree-seq
& co might help with the traversal?
you could first extract the paths and do the updates as separate steps maybe @henrik?
Yeah exactly
Maybe the first bit is a job for Specter: https://github.com/nathanmarz/specter
Sure it can surely help
nice 👍
@andrea.crotti It works fine with a small modification
I moved some code from core.clj
to other-namespace.cljc
and changed all the various imports, and the settings in project.clj
are already:
:source-paths ["src/cljc" "src/clj"]
:test-paths ["test/clj"]
but it now fails to compile, it can't find the cljc namespace
any idea what could be missing, I've done it before in other projects and it just worked
Does the filename have a -
instead of a _
?
mm no it doesn't have either
if I build the uberjar it gets packaged in
but lein test
or anything that triggers the compilation fails
api.clj
can't find that namespace it requires
if it hasn't been mentioned yet, be sure to clean out old compilations, the left over artifacts might be confusing the compiler. so delete js/compiled and try re-running it
mm that was it, I always forget that sometimes I have to do a lein clean
, thanks @benzap
I wonder also if there is a way to write the tests in cljc
files as well
and running the same tests both with Clojure and Clojurescript
is anyone doing that?
I've read of someone, can't remember who, who put as much as possible in cljc to be able to test it in clojure. Haven't any cljs test experience myself.
I tried in a project to do exactly this, but it's better said than done. There are differences in :require
from CLJ and CLJS, and it's not that easy to make reader conditionals to require things correctly. There are some semantic differences too, but it's doable - just not simple.
For the couple of namespaces I try it works quite well
But sure it's probably only worth if you are actually calling those functions from both clojure and Clojurescript
@andrea.crotti yep, most of my tests in my libraries are running in both clojure and clojurescript. I use the doo
library for the clojurescript side, which compiles down and runs a node instance for my tests