This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-02
Channels
- # admin-announcements (2)
- # beginners (14)
- # boot (38)
- # cider (2)
- # cljsjs (3)
- # clojure (114)
- # clojure-russia (64)
- # clojure-taiwan (1)
- # clojurescript (40)
- # code-reviews (8)
- # component (2)
- # core-async (2)
- # cursive (7)
- # editors (3)
- # euroclojure (1)
- # hoplon (53)
- # leiningen (4)
- # om (129)
- # onyx (5)
- # proton (4)
- # protorepl (5)
- # re-frame (5)
- # reagent (11)
- # untangled (5)
- # yada (3)
@bhauman: That fix was so simple! Yes, thank you. I was able to call the function and then it all worked. You're awesome! 👍
I'm trying to use a js react component in my clojurescript project but can't figure out how to include the commonjs module into my build... trying this http://blog.fikesfarm.com/posts/2015-12-22-foreign-libs-processing-in-repl.html didn't seem to work
@jiangts: I dealt with this earlier, what exactly are you trying to do, do you have some code I can help you look at?
yes! I'm trying to integrate https://github.com/balloob/react-sidebar into my project
:foreign-libs [{:file "node_modules/react-sidebar/dist-modules/sidebar.js" :provides ["sidebar"] :module-type :commonjs} {:file "node_modules/react-sidebar/dist-modules/index.js" :provides ["index"] :module-type :commonjs}]
And what's the error you're getting?
the compile doesn't give any errors but I only get nil when I try to use require'd code!
Let me try, I noticed that react-sidebar needs react and react-dom as peer dependencies
hey, trying to run figwheel + regeant in cursive, following the guide. problem I'm having is when I run (cljs-repl)
all that happens is it runs nil
ok, I figured it out. the template I was using had my cljsbuild
in a :profiles :dev
, and I pulled it. not sure how profiles work, but I think I would have to use a library to extract the :dev
profile and manually pass it into start-figwheel!
if I wanted to use it that way
@urbanslug: You can’t. Since there is no format
I had to write a pad-left
for bootstrap before it was in fashion to do so https://github.com/clojure/clojurescript/blob/16666f37cc13ead5a66330046db82a2976b6f1f0/src/main/clojure/cljs/compiler.cljc#L135-L138
@urbanslug: Perhaps, depending on what you want to do, you can make use of cljs.pprint
. It has some fairly sophisticated formatting capabilities.
@urbanslug: In particular, check out cljs.pprint/cl-format
.
@urbanslug: there is also goog.string.format
Hey people! I have a library (`foo`) in the making, has a CLJSJS dependency (`bytebuffer`). I have another app (`bar`), which requires foo
. When compiling bar
with advanced optimizations, the sources of bytebuffer
do not get munged / dead code eliminated. How could I include those?
@moxaj: DCE doesn’t apply to 3rd party JS libraries, only Closure compatible JavaScript
i’ve got a really simple question I’m hoping someone can answer … what’s the “right way” to defer to someone else’s api through my own?
…
[other-api.core :as other]
…
(defn some-func [& args] (apply other/some-func args))
that’s the simplest thing I can think of, but I want to make sure i’m not shooting myself in the foot...@dm3 @lwhorton you have to be careful with that pattern - don’t do that in libraries for example - will prevent DCE & code motion.
hm, so whats’ the preferred way to do it? the idea is i’m wrapping a library with my own decorated api, but there are a few pieces of that api that don’t need any enhancements/decorations.. so I just want to defer to the original implementation. I’ve dug around wikis at /clojure/clojurescript but unfortunately it’s pointing me to a whole book that’s 16 chapters 😕
@dnolen: interesting, I didn’t know it prevents DCE, I’m sure defonce prevents DCE, because the definition is wrapped in a global test Closure cannot reason about, but plain defs should be fine as long as Closure has full visibility of both places I believe