This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-18
Channels
- # admin-announcements (7)
- # arachne (24)
- # beginners (40)
- # boot (24)
- # braid-chat (22)
- # cider (8)
- # cljsrn (35)
- # clojure (32)
- # clojure-austin (1)
- # clojure-belgium (52)
- # clojure-russia (16)
- # clojure-sanfrancisco (1)
- # clojure-taiwan (2)
- # clojure-uk (25)
- # clojurescript (112)
- # core-async (3)
- # cursive (18)
- # data-science (1)
- # datascript (7)
- # datomic (30)
- # devcards (2)
- # dirac (12)
- # emacs (4)
- # flambo (1)
- # funcool (5)
- # hoplon (146)
- # jobs (9)
- # jvm (5)
- # off-topic (4)
- # om (141)
- # onyx (22)
- # re-frame (89)
- # reagent (86)
- # ring-swagger (31)
- # rum (3)
- # spacemacs (1)
- # specter (10)
- # untangled (112)
- # yada (3)
@pedroiago: deref
on a var yields its value
@mfikes: I am getting a "clojure.lang.Cons cannot be cast to java.util.concurrent.Future" when trying to use deref inside a macro =\
@pedroiago: Hmm… well, you definitely don’t want the deref
to occur at macro expansion time. But I wonder… if it expands to a deref
it might be OK. Is your code expanding to a deref
or deref
ing while expanding?
anyone have a good reference for reagent component testing? I seem to be running into Warning: Something is calling a React component directly. Use a factory or JSX instead. See:
attempting to render a component using a phantom runner using lein doo
plugin
It looks like it happens when trying to call components that are using r/create-class forms
#C073DKH9P
@sbmitchell: the Reagent tests (in the reagent repo) will probably be an interesting source of information for you. Best to move further discussion onto the #C0620C0C8 channel.
How would I pass a clojurescript function reference to JavaScript? I just thought if I defn it and passed in the name, then that would suffice?
Wow, order is important. I needed a forward declaration on my function name, but the function name was passed in before the function was declared. Makes sense now that I’ve ‘said it out loud’...
I know clojurians traditionally have not been overly concerned with security 😉 but is anyone using a good RSA library that they can recommend? Both for enc/dec and key generation. Couldn’t find it in goog.crypt
lol couldn’t find in goog.crypt…did you bring a shovel?
What do people think of this use of js*
in Reagent? https://github.com/reagent-project/reagent/blob/master/src/reagent/interop.clj#L8
I'm asking because use of js*
is discouraged, but it seems they have a valid use case here. Would there be a way to do the same things without js*
?
Is it possible that transit-cljs
is lacking support for decimals at this point? It converts floats to integers at the moment:
cljs.user=> (transit/write (transit/writer :json) {123.123 :foo})
"[\"^ \",\"~i123.123\",\"~:foo\"]"
@jannis: I just test it only happens if you use decimal as a key in map, it works fine in value. But it's a good observation and it should be a bug .
Yep, you're right. I'll look into a fix (or perhaps a workaround for me plus a bug report).
hi everyone, does clojurescript have anything like import mockJson from “./fixtures/mockJson”
? I’m trying to load some local json data into my cljs file but running into circles
maybe you can have a my-project/fixtures/mockJson
like this:
(ns my-project.fixtures.mock-json)
(def sample-json “some sample json goes here”)
and you can use it in your code like this:
(require [my-project.fixtures.mock-json :refer [sample-json]])
;; use sample-json anywhere now
I generally don’t read files with cljs, never had the need. Mostly do that with clojure.
I was trying to load json via via a clj
file and then requiring the file as normal just like the how :require-macros
works but cljsbuild doesn’t like that
Anyone have experience using Hipo cljs templating library?
I’m trying to get an element with inline styles, but they’re not getting added.
So I would expect this: (hipo/create [:div {:style {:background-color "white"}}]))
To produce <div style=“background-color:white;”></div>
, but instead produces <div></div>
@jonathandale: You need the attribute handlers. Its in the main readme
@rauh, I’ll explore, was hoping it’d be more inline with hiccup/reagent. But thanks.
after starting a fresh figwheel template, lein new figwheel hello-world
, getting into a cljs repl, and entering a protocol,
`cljs.user=> (defprotocol SpecialNumber
#_=> (plus [this other])
#_=> (canonical [this]))`
I get clojure.lang.ExceptionInfo: Can't change/establish root binding of: *unchecked-if*
am I missing something?
Hello all, I´m trying to generate a jar file from lein uberjar. I have some .js files in resources/public/js like jquery and other stuffs. I see the uberjar include the compiled app.js like file into the generated jar. What is the uberjar configuration to I include all the resources/public/js/* files into the jar file?
@fabrao, make sure you include a hook to cljsbuild within your project.clj --> :hooks [leiningen.cljsbuild]
I'm speaking with respect to a deployment, which i'm thinking is similar to an uberjar
@jonathandale: You can find an example of what you are trying to achieve here: https://github.com/jeluard/hipo/blob/1c107002bc5d338050046e9d8be2d8eba3fa9187/test/hipo/interpreter_test.cljs#L47
@jonathandale: hipo follows hiccup syntax so this specific hook is not configured by default. I agree it would make more sense to align with other ClojureScript libraries.
Not really a ClojureScript question, but I was wondering if someone could point me to a resource that would help me ‘decode’ what JavaScript object I have in ClojureScript. At the moment, when I get my reference and log it I get #object[Object [object Object]]
, but I’m not really sure how I can get the data out of that object… 😕
then whenever you call prn on a cljs map/vector, etc, it will print it as js obj in the console
right, that’s my problem, I don’t have the JS knowledge to figure what it’s telling me 😉
I just need the spec to see how JS is stringified for the toString so I can then map that back to some understanding so that I can play with my data.
OK, tried one more quick thing. When I log the object in JS I get [object Object]
, so how in ClojureScript do I unwrap or get to the object data in #object[Object [object Object]]
or is the #object[Object [object Object]]
ClojureScript toString and not JS toString which probably is the case and I’m just totally confused? 😉
@dnolen: Are there any plans to get rid of clj->js
/`js->clj` and just have complete parity with JS types?
it also exists primarily as a convenience, so many perf bug reports that boil down to incorrectly using clj->js
etc. on larger amounts of data
Sorry, I guess that wasn't clear. I meant just to have all of the ClojureScript types be JavaScript types, so that they don't need the conversion
even if it wasn’t it does not support immutable updating rendering it useless to most Clojure programmers
@dnolen: I thought I saw some technique for Redux that "updates" the data structures that are frozen by creating a new one. I forgot how it worked though.
I don't know... I feel like in theory it should be easier to optimize for immutable objects over mutable ones. Which makes me think that if frozen objects are slower, then it's just because the engine hasn't optimized for them yet.
ClojureScript data structures are some of the fastest immutable implementations out there
I saw this talk between Rich Hickey and Brian Beckman about Clojure: https://www.youtube.com/watch?v=wASCH_gPnDw
Rich was talking about some kind of tree data structure (forgot it's name) that keeps track of the immutable data structure's changes which still keeps things efficient for lookup. Does ClojureScript also use that under the hood?
Does anyone know of a pluggable EDN editor you can use to write/complete EDN data?
@jeluard: Helpful, thanks.
@dnolen: and @benzap I changed the *.js files to folder vendor and include :resource-paths ["resources/public/vendor"] to :cljsbuild and the ended jar came with all the files, thanks a lot !!!
@dnolen: do you have an example of the implementation? How does cljs implement a map for example?
@thachmai: read the Clojure or ClojureScript source if you’re interested in the gory details