This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-14
Channels
- # admin-announcements (21)
- # aws (5)
- # boot (41)
- # cider (76)
- # cljs-dev (15)
- # clojure (251)
- # clojure-brasil (25)
- # clojure-dev (16)
- # clojure-japan (8)
- # clojure-nl (1)
- # clojure-russia (110)
- # clojure-uk (7)
- # clojurescript (168)
- # clojurewerkz (1)
- # cursive (10)
- # datomic (45)
- # devcards (50)
- # emacs (5)
- # hoplon (6)
- # instaparse (6)
- # ldnclj (73)
- # lein-figwheel (4)
- # leiningen (6)
- # liberator (7)
- # luminus (2)
- # off-topic (19)
- # om (80)
- # onyx (2)
- # re-frame (11)
- # testing (12)
has anyone used the xlink:href attribute with sablono? having issues with it working correctly
current strategy looks like
[:div {:class "menu"}
[:button
[:svg {:class "settings icon"}
[:use {"xlink:href" "#settings-icon"}]]]]
oh, if you do xlinkHref its supported in React 0.14 but can use dangerouslySetInnerHTML for now
@bhauman: I only just noticed that you had replied re: ranges in Reagent now. Why is it that you propose that ranges probably shouldn't be controlled components? I mean, is there more to it than "it doesn't work properly currently"?
@blissdev: this might be relevant https://groups.google.com/d/topic/reagent-project/PMZPUy5yBCc/discussion
@dnolen: I have rather weird question, but I'm not sure where to dig... So I have this server-side rendered app in React, and when I have a dev build, everything works just fine. But when I build an advanced minified version, running it with node spits out 'React is not defined'. Any pointers maybe how can I find out what's the problem?
@asolovyov: there’s a known bug with :main
+ :advanced
and :foreign-libs
that was filed by @maria
if it’s not the same issue then likely something with :advanced
and Node.js that hasn’t been encountered before
@asolovyov: https://github.com/clojure/clojurescript/commit/a4d6a241cd9d45bf0356809c18df14585befd68f
actually, React is included and it seems the problem is triggered somewhere inside of it
om.next looks awesome so far, requires quite a bit of re-thinking of how to do things but that is good
@colin.yates: thanks
@steve: I tried your instructions and this is the output of my figwheel REPL: https://gist.github.com/bensu/a8901162387c3340fb8e
A patch from @tonsky that should tested by people who are interested in this fix http://dev.clojure.org/jira/browse/CLJS-1458
another one that will affect Node.js users that could use testing http://dev.clojure.org/jira/browse/CLJS-1466
What’s the fastest way to have figwheel pic up a library I just installed instead the compiled one? It’s a library I’m modifying, so, the version number is not changing in each modification.
@bensu I'd been reading through some of the clojurescript code to see how the tests were setup there
@dnolen: I tried a simple
(in-ns 'my.namespace) (def a 3)
in http://clojurescript.net/and it fails with Error: Assert failed: (ana/ast? sym)
@richiardiandrea: that link has nothing to do with ClojureScript in any official way
tracked it down to defmethod emit* :var-special
I just wanted to ask if it can be a problem worth reporting (sorry if not) 😄
that link has nothing to do with ClojureScript beyond somebody (a nice person) put it on the internet
Anyone using auth.0 from cljs? How do you inject the client id into the js that runs on the client? The client id is not secret, but is different for different environments (e.g. uat, stage, prod etc) but ideally we'd like an identical build in each environment. I'm thinking of just putting the client ids into a little S3 resource and looking them up when the app initializes. Does this seem sane?
kk now I know, just wanted to be helpful in finding problems I noticed...I apologize about it
@richiardiandrea: if you happen to find problems like those in either Planck or Replete, I'd be happy to look into GitHub issues and see if they can be isolated as minimal repros against the upstream ClojureScript self-host implementation. For in-ns
it turns out that bootstrapped REPLs implement that REPL special (not ClojureScript proper).
yes I notices in the source of
kanaka/cljs-bootstrap
that he is not implementing everythingcan you achieve a fully in-browser repl in your opinion? I am trying to figure that out
for example here env/compiler is missing completely and I guess it is necessary for both cljs analyzer and compiler
@richiardiandrea: That's what http://clojurescript.net is, unless you are additionally thinking of require
and load-file
REPL specials. ClojureScript's cljs.js
support affords REPL implementors lots of flexibility, though.
oh maybe I am missing a piece then
@richiardiandrea: interesting... http://clojurescript.net certainly analyzes and compiles using only the JavaScript engine in your browser. Turn off your network connection and see. :)
yes I know, I am trying to create my own version based on that work 😄
@richiardiandrea: Cool! I've been down that path, using Joel's stuff, but targeting non-browser environments. :) Let me know if you have questions.
well the in-ns stuff does not work and I am trying to understand why, basically it needs to avoind using the env/compiler stuff
it is easy, it is just a map containing ::namespaces
I see in planck is using
(defonce current-ns (atom 'cljs.user))
but I don't want to spam the channel, maybe I will PM you 😄
@richiardiandrea: it is probably simply that in-ns
is only doing half: Setting the ns but not creating it.
@richiardiandrea: yep. Probably better.
is there a way to tell the closure compiler not to minify a function? I'm trying to use leaflet and setRadius
worked in dev mode but not when I attempted to compile for production
I had other use cases where I just used aget
and applied the function, but this doesn't seem to work... So I'm wondering if there's a way to hint or ...?
then, go to leaflet's externs file, under packages/leaflet/resources/cljsjs/common/leaflet.ext.js
or https://github.com/cljsjs/packages/blob/master/leaflet/resources/cljsjs/common/leaflet.ext.js
ok, so we need to tell the compiler that circleMarker
has the property setRadius
set to a function.
d3 has a similar construct and an almost verbatim externs: https://github.com/cljsjs/packages/blob/master/d3/resources/cljsjs/d3/common/d3.ext.js#L773
right, it is ok that it is a function, since classes end up being constructors to the externs.
"CircleMarker": function () {},
"circleMarker": function () {},
"CircleMarker": {
"setRadius": function () {}
},
"circleMarker": {
"setRadius": function () {}
},
You want to say, circleMaker
is a constructor, whose constructed instances will have a setRadius
set to a function. see the difference?
As you can see in the d3 externs, you need to add a leaflet.circleMaker.prototype = function() {}
to tell it it's a constructor
once you have that you can use d3's next line: https://github.com/cljsjs/packages/blob/master/d3/resources/cljsjs/d3/common/d3.ext.js#L774
this is very useful for me too thanks @bensu
@sjol No, you are right, that probably means that no instantiated objects will have their properties available under :advanced
.
@richiardiandrea: yeah, I might write this up somewhere
L.circleMarker.prototype = function () {};
L.circleMarker.prototype = {
"setRadius": function () {},
"addTo": function () {}
};
@richiardiandrea: that would explain a lot of woes I had!
ok, with that in you need to build the package so that your other project has access to it
in my jqconsole package I have done something different though
I want to write a function that steps through a function like chromes dev tool, where should I start?
https://github.com/cljsjs/packages/pull/256/files#diff-f2ad16814edc8b8360d57bf1cc3a0e7fR56
but I see the function when :advanced
@sjol ok, with that in you need to build the package so that your other project has access to it
boot package build-jar
cd-ing to your sub-dir first
cd leaflet
but first remove your old package with rm -r ~/.m2/repositories/cljsjs/leaflet
hahaha, no sir, I've dealt with enough tutorial related issues to know that instructions are not enough
I'd first recommend you to add all the symbols related to circleMaker
and the other classes you might use in the future. You understand the process now, but you'll probably forget in the future when you need rectMaker
and need to do everything again.
in case, these instructions don't work and you are in a hurry, you can always try with (let [m (goog.object/get o "setRadius")] (m radius))
which should protect you from symbol munging