This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-29
Channels
- # admin-announcements (2)
- # beginners (10)
- # boot (253)
- # cider (11)
- # cljs-dev (26)
- # cljsjs (21)
- # cljsrn (7)
- # clojure (87)
- # clojure-berlin (13)
- # clojure-dusseldorf (5)
- # clojure-greece (7)
- # clojure-poland (11)
- # clojure-russia (189)
- # clojure-spec (31)
- # clojure-uk (86)
- # clojurescript (89)
- # cursive (15)
- # datavis (2)
- # datomic (57)
- # devcards (3)
- # dirac (92)
- # editors-rus (3)
- # emacs (4)
- # events (1)
- # funcool (30)
- # hoplon (3)
- # jobs-rus (6)
- # leiningen (1)
- # luminus (12)
- # mount (25)
- # off-topic (5)
- # om (43)
- # onyx (41)
- # perun (1)
- # proton (2)
- # protorepl (7)
- # re-frame (17)
- # reagent (34)
- # ring (13)
- # specter (1)
- # spirituality-ethics (1)
@vinodg: are you talking about JSONP?
if so, you would probably provide the munged function name as the callback
i.e. if the function was my.cool-ns/cool-function
you would provide my.cool_ns.cool_function
it’s a bit late here for me to figure out if the same method would work with advanced compilation, but I think it would
ah, well it wouldn’t work just like I’ve described
but you should be able to get the name of a function somehow and pass that through
@rarous: you mean like https://github.com/lshift/cloverage ?
@vijaykiran: yes, but for cljs.
oh, I’m not aware then
Hi All, can anyone suggest how I’d get started working with D3 using clojurescript? I have a little data viz project I’d like to complete with these tools.
I found this: https://github.com/lynaghk/cljs-d3
but that has been deprecated in favor of this: https://github.com/lynaghk/c2
@ezmiller: I haven't used D3 much, but why would it be different from other things like jquery plugins?
@borkdude: Not sure I understand your question. D3 is a library like jQuery. My question is about interop libraries that might help me get up and running more quickly.
Found this: http://www.szakmeister.net/blog/2015/nov/26/clojurescript-d3-and-reagent/ + the deprecation note on c2 suggests looking at using React through Rum.
If so unlikely someone remembers my question yesterday. Anyway moral of that story is, cljs.reader/numeric?
does not work in any type of closure optimization (at least when used in sequence).
@hlolli: not sure what you are referring to but I'm very certain that cljs.reader/numeric?
works the same in every mode
yes it disfunctions the same in every mode. But works with figwheel, for reasons I cant understand. I used it as input validator, and I was getting messages: could not read QNAME in the js console.
and since it definitely never prints anything to the console, I suspect that you are looking at the wrong thing
I promise to file issue on github early next week with reproduceable bug. But I was basically using three different ways to get value of the element, from there I validated the input (in a for loop (and the same was for map)). It works now exacly the same after I made my own regex number validation.
element.g().attr('class', 'translate') .g().attr('class', 'rotate') .g().attr('class', 'scale') .append(childNodes);
(-> element
(.g)
(.attr "class" "translate")
(.g)
(.attr "class" "rotate")
(.g)
(.attr "class" "scale")
(.append childNodes))
Is clojurescript supposed to destructure js objects in fn arguments? With [{:keys [foo]}]
to do (-.foo)
? It seems to have stopped working.
@mattly: thanks, I found that one a bit after I posted my question, seems it’s what I want. I’ve also created a CLJSJS package for other interested folks
copy from #C0E66E1H7:
I’m having a problem by importing cljsjs.highlight.langs.clojure
and cljsjs.codemirror.mode.clojure
both are named clojure.inc.js
so I end up really only having one of them (edited)
¯\(ツ)/¯
anyone knows how to solve this?
besides manually downloading one of them and feeding it to :foreign-libs
under a different name, is there any other solution?
@anmonteiro: the names need to be different
@dnolen: right, I suppose this deserves an issue in CLJSJS then, to avoid conflicts between packages
@anmonteiro: perhaps a better an alternative would be place those files in a location that matches their namespace but it’s not clear to me at the moment how much work that would entail
@dnolen: that makes sense, I’ll open an issue in JIRA then
can one set environment variables (config) with cljsbuild? otherwise how do people handle environment variables in clojurscript with lein?
@fenton: I use lein-environ[1] [1] https://github.com/weavejester/environ
just be aware that this does not work safely when you spawn multiple lein tasks in parallel: https://github.com/weavejester/environ/pull/53
well, "clojurescript envrionment” is in fact “clojure environment” under lein-cljsbuild
what do you want to do? do you want to override env variables for particular cljsbuild? or use env vars in your cljs code?
i want to set the azerk cljs console debug level to warn
on production build but debug
on development builds
which is okay, but I like having this info somehow contained in my project versus the shell user environment.
ok, then I guess you want to use "lein profiles” feature for that, this is not really lein-cljsbuild related problem I think
you want to use lein-environ and set :cljs-log-level “debug”
under :dev lein profile and “warn” otherwise
the two commands i issue are: lein cljsbuild once dev
and lein cljsbuild once min
for dev and production builds.
do i have to add a with profile
or something like that to my command to activate a profile?
hmmm... for now i think i prefer the tradeoff of just using the shell user environment...
a friendly note: lein-pprint is super handy tools when debugging profiles merging https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#debugging
i do cider-jack-in
and dont want to figureout how to do a with-profile
for that...maybe...
you could use lein-shell to "shell out” into a bash script, alter your env there and return back invoking the same lein command
my main concern is I'm old and I forget things very easily, so the least complicated usually wins for me...
I wasn’t even born when those lein features were implemented, cannot really reason why they work the way they do 😉 Just learned how to achieve my goals with various workarounds
[rant] I would like to switch to boot, but figwheel is not there, that is probably the only thing preventing me to do that
I hear you. my local colleague is all into boot... he has the same comment.... he thinks about lein only because of figwheel! lol
look at this 400+ lines project.clj of mine 😉 here it the shell-out lein task name aliasing trick: https://github.com/binaryage/dirac/blob/master/project.clj#L380
@fenton: have you considered using lein aliases feature? you won’t be running it via lein cljsbuild once dev
but instead lein my-alias-name
, with lein-shell you should be able to even set env variable inline and then invoke lein again with original args
for example of the second approach, see this line: https://github.com/binaryage/dirac/blob/master/project.clj#L440-L441 basically I created bunch of “reusable” lein profiles and mix/merge them depending on invoked lein alias
and sometimes from alias I “shell out” into a bash script to do some shell work if really needed (which might invoke other lein commands in turn) - (but this approach is probably spawning multiple lein JVMs)
hmmm...i haven't considered that, but i perennially avoid becoming too dev-opsy. The amount of time my colleague devotes to boot...argh...reminds me too much of yak shaving. For my workflow, i just need those things to only disappear on the production server which i can do with the .zshenv
file.