This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-30
Channels
- # aws (2)
- # beginners (139)
- # boot (9)
- # cider (1)
- # clara (2)
- # cljs-dev (35)
- # cljsrn (3)
- # clojure (112)
- # clojure-dusseldorf (9)
- # clojure-greece (6)
- # clojure-italy (13)
- # clojure-russia (160)
- # clojure-seattle-old (1)
- # clojure-uk (79)
- # clojurescript (85)
- # clojutre (1)
- # community-development (11)
- # core-async (32)
- # cryogen (2)
- # cursive (5)
- # data-science (16)
- # datomic (2)
- # events (1)
- # fulcro (29)
- # funcool (1)
- # graphql (4)
- # immutant (5)
- # instaparse (20)
- # jobs (2)
- # juxt (6)
- # leiningen (11)
- # luminus (21)
- # lumo (1)
- # off-topic (7)
- # onyx (20)
- # parinfer (33)
- # pedestal (4)
- # re-frame (41)
- # reagent (34)
- # ring-swagger (14)
- # rum (5)
- # spacemacs (9)
- # specter (11)
- # sql (14)
- # test-check (3)
- # yada (20)
hello, all. I’ve been developing an app using lein and figwheel pretty seamlessly, but now I’m trying to make a non figwheel build and can’t seem to get goog/base.js, cljs_deps.js into the ;asset-path, it is always empty after I run “lein cljsbuild once target”… is there another command i should run to get those built/copied?
@brthrjon Would it be possible to share the build configurations? (cljsbuild+figwheel)
From my experience lein cljsbuild once ... would copy stuff in the asset path so suspecting something with the configuration
@iku000888 here is the target i’m invoking, thanks… is this enough?
{:id “qa” :source-paths [“src/cljs”] :compiler {:main viime.core :foreign-libs [ {:file “src/easyrtc/socket.io.js” :provides [“socket.io.js”]}, {:file “src/easyrtc/easyrtc.js” :provides [“easyrtc.js”] :requires [“socket.io.js”]} ] :output-dir “resources/public/js/compiled/qa” :asset-path “js/compiled/qa” :output-to “resources/public/js/compiled/app.js” :optimizations :none}}
@brthrjon I was fixing issues like this in my code for the last couple of days. Eyeballing this against mine, I think you just need to add out
to your :asset-path
. Here’s mine:
:output-to "../../public/build/app.js"
:output-dir "../../public/build/compiled/out"
:asset-path "js/compiled/out"
@dnolen I was watching one of your talks for last year, you mentioned that in ViennaJS meetup there was a talk about a team moving away from js to elm to Clojurescript
@lxsameer that was me 😉 there you go https://www.youtube.com/watch?v=Q6Q5D6mI-34&t=168s
@philippmarkovics great talk man kudos
@philippmarkovics did you guys moved to om next ?
nope, we stayed with reagent and re-frame (and looking at re-posh)
we tried it for a smaller app, also for an ios app together with re-natal
really like how it works but for the nextjournal usecase, re-frame might be better suited
sorry to take your time. I used only re-frame and I really like to know about your experience with om next
@philippmarkovics are you applications open source ?
re-frame vs. om next: re-frame is easy to get started and has great documentation. om next has quite a learning curve and didn’t have much documentation when we evaluated it.
maybe docs are better now
in terms of design i really liked om next better but it seems more geared towards graphql-like backends which we don’t use
that’s where it shines
workflow is similar
we’re also at a point now where we have so much re-frame code that it would be quite the investment to switch to something else
we wanna have datalog queries for querying state but you can have that with re-posh
re opensourcing the nextjournal frontend: we’re probably going to do that but only after we feel it’s stable enough
so this will take some time
Is there a slideshow/presentation lib that is popular for clojure? Something like revealjs
asked on IRC, but perhaps this is a better venue: I have a question about advanced optimisation w/ reagent - am running into trouble with google closure's renaming - I've narrowed it down to this call: (defn get-dom-width [elt] (.log js/console "gdw:", (.getBBox (r/dom-node elt))))
the ".getBBox" is not found - is there an easy fix? - I don't understand how to set up an externs file for this
@jcw Doesn't doesn't sound like problem with renaming, if the error mentions .getBBox
Did you check that elt
is non-nil?
Okay. Svg externs are available somewhere.
Would make sense to package this at Cljsjs
Closure contrib folder also has one, this seems to be more recent: https://github.com/google/closure-compiler/blob/master/contrib/externs/svg.js
^ I realised this above question might be better for this channel, because functions like instance
don't work the same between clj and cljs and maybe type
has similar issues :/
ah, I like this description of pr-str
: "you can think of pr-str as the inverse of read-string, turn string into symbols"
pr-foo
stuff is supposed to print “readably”, meaning you could feed it back into the reader (which could then pass that result to something else like the ClojureScript analyzer)
@daiyi note this trick won’t work for JavaScript in general, just ClojureScript deftype
s and defrecord
s (which are just deftype
s with defaults)
I'm having a hard time getting cider to jack into a repl running in a lein figwheel project. Is there somewhere I can look to try to get those to talk to each other, or is there an editor that it might be worth trying out (like atom or lighttable) for the sake of clojurescript development with figwheel and an in-editor REPL?
@suskeyhose Not sure if this is the answer, but it sounds like you might want to try cider-connect rather than jack in
Ah, okay. Thanks!
@bbloom not aware of that, there’s a ticket for that, was a bit stalled on 1.9 release - maybe the spec.alpha breakout means we can proceed but I haven’t looked into that
I noticed that in cljs the specs definition seems a bit eager, when I try to use definitions that are still pending to load it fires an error saying that the given spec doesn't exists (because of load order), I remember someone talking about this here in past, is that being tracked?
@wilkerlucio not sure what you mean - just supply something minimal that doesn’t work in ClojureScript (and works in Clojure) and report that
@wilkerlucio Were you perhaps recalling this one? https://dev.clojure.org/jira/browse/CLJS-2275
@mfikes in my case it's simpler than that, just basic s/def
, ok, I'll try to create a minimal case to exemplify
What’s the best way to use the clojurescript on master in order to get the @cljs-oss/module-deps/index.js
fix mentioned yesterday to @petterik?
I'm having some trouble with extend-protocol / extend-type in cljc code. What's the best way to do something like this:
(extend-protocol parse-dates
#?(:clj java.lang.String :cljs string)
(parse-date [date] (format/parse const/date-formatter date))
(parse-datetime [date] (format/parse const/date-time-formatter date))
(parse-date-at-time [date] (format/parse const/date-at-time-formatter date))
#?(:clj org.joda.time.DateTime :clj function)
(parse-date [date] date)
(parse-datetime [date] date)
(parse-date-at-time [date] date))
Everything I've tried throws some type of error or warning. For this version the warning is WARNING: Bad extend-type method shape for protocol parse-dates method parse-date, method arities must be grouped together at line 25
. If I try to use extend-type instead it fails on the string
symbol, but every example I've seen says to use string
and not js/String
. What's the correct way to do this?For reference line 25 is the (extend-protocol parse-dates
line.
is there any attempt to write an alternative to react or preact in pure clojurescript ?
@lxsameer just found this on google: https://github.com/brandonbloom/cljs-vdom
I'm no expert on UI, But React contains some features which are not necessary and by creating an alternative in cljs we can take advantage of all the good features which cljs offers
but i'm sure that people already thought about this, and there might be a good reason which there is no pure cljs alternative
You might like to checkout preact which sounds like a small clutter free rewrite of react. https://github.com/developit/preact
probably the same reason people don't go reinventing Java libraries in Clojure - if a well-tested, well-documented library already exists, not much point redoing it unless there are exceedingly good reasons for doing so. otherwise, it could just be that no one has cared to.
if you wanted to, though, writing a wrapper around (or port of), say, https://github.com/snabbdom/snabbdom couldn't hurt