This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-17
Channels
- # alda (5)
- # bangalore-clj (1)
- # beginners (9)
- # bigdata (1)
- # boot (51)
- # carry (1)
- # cider (9)
- # cljs-dev (22)
- # clojars (39)
- # clojure (118)
- # clojure-brasil (1)
- # clojure-czech (8)
- # clojure-france (2)
- # clojure-italy (5)
- # clojure-korea (9)
- # clojure-russia (9)
- # clojure-spec (17)
- # clojure-uk (42)
- # clojurescript (48)
- # core-async (1)
- # emacs (3)
- # figwheel (1)
- # funcool (3)
- # hoplon (39)
- # klipse (51)
- # lein-figwheel (4)
- # leiningen (2)
- # luminus (5)
- # off-topic (245)
- # om (18)
- # onyx (19)
- # parinfer (1)
- # pedestal (18)
- # re-frame (47)
- # reagent (19)
- # ring-swagger (1)
- # specter (18)
- # untangled (93)
- # vim (8)
- # yada (56)
@netchkin: I got it to compile on both Mac and Windows, and I get the same error when trying to run it in Windows. Same thing if I compile in advanced mode. I think it’s got to be related to something specific that has to be done to get it to run in Node, it might be worth looking on the ClojureScript site for Node specific help. I don’t think there’s any issues with the ClojureScript compiler, Leiningen, or Reagent though - most likely just an extra bit of config or code that you have to put in to get it to work for that example.
hey all--for learning cljs, what would you recommend? looking to get an overview of what things exist in the language so I know to use them when I can, i’ve programmed for a while mostly c, c++, javascript and have done a fair amount of lisp and haskell stuff
i think getting an idea of what is new in cljs w.r.t those langs and the design ideas would be neat
i was thinking to go through clojure-for-the-brave-and-true real fast then go over a clj -> cljs diff
@nikki - sounds like a good plan. consider also watching a few rich hickey talks, eg https://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey and https://www.youtube.com/watch?v=-6BsiVyC1kM , for more information about design decisions in clj/s (i haven’t read brave-and-true, maybe it does a fine job of covering this stuff on its own)
the idea of starting with clj and moving to cljs once you’ve got a good handle on clj is definitely correct imo
editor-wise, intellij+cursive is great for both languages, i hear emacs+cider is great too
ya i’m v comfortable with emacs atm and was using slime for lisp, so cider will be great!
@nikki http://www.parens-of-the-dead.com/ should be on your list too
btw const createModule = function* () { const exports = {}; while (true) { eval(yield exports); } }
is a livecodey JS repl 😉
need to stick to var
for def
tho
@shaun-mahood : I believe I have finally pinpointed the core of the issue. It should be the clojurescript compiler, I am positive I have even found the line of code that causes this, but while reading this: https://github.com/clojure/clojurescript/wiki/Reporting-Issues, I feel crushed by the sheer weight of what I must do to even report the bug, let alone see if I can fix it...
anyone know of any cljs books that are like a literate programming book that you can eval regions from in emacs
What’s the idiomatic way to cache functions with local deps which are being passed from parent to child components so that shouldComponentUpdate
check doesn’t fail on child components?
(rum/defc Head [prop]
[:div
(render-row #(Row prop %))])
I can think of storing a function within local state, but it doesn’t feel clean.
@netchkin for many cases - reporting an issue is typing a sentence and clicking a button. in your case it would be helpful to supply something minimal (reproducer). You can of course supply something non-minimal but who will spend time to look at your issue then?
@netchkin looking at the backlog it seems that it would be trivial for you to supply a failing case outside of your project - make an example where a :foreign-lib
file starts with an r
and test that on Windows.
@nfisher your expectation does not hold - we do not namespace random :foreign-libs
- only in the case where they can be processed as some standard JS module type
@shaun-mahood: thanks, that had not occurred to me! As soon as I get home, I'll file the issue. Btw, I was thinking that I would download the source code and try to fix the bug myself, wouldn't you happen to know if there's a guide on how to do so? I mean the technical part, getting the cljs running
@netchkin: I think that last reply was meant for @dnolen, right?
@netchkin https://github.com/clojure/clojurescript/wiki/Building-the-compiler
speaking as someone who’s just done this for the first time last week, it’s actually super easy. clone https://github.com/clojure/clojurescript, script/bootstrap, script/build, copy the version it outputs to your project, start your cljs build.
Has anyone kicked the tires on including commonjs modules in clojurescript? I’ve been trying to get it to work, but can’t access the modules from clojurescript
@chris-andrews it should be considered an Alpha feature, but here are some resources: A repository that you can have a look at where it’s working: https://github.com/mneise/circle-color newly added docs to the ClojureScript website referring to this feature: http://clojurescript.org/reference/javascript-module-support
if anything still doesn’t work for you after having gone through those, and you think you’ve found a bug, do report it in the ClojureScript’s JIRA!
@anmonteiro thanks a lot! I’ll try this out and see how it goes
is there a way to tell the closure compiler to not apply 'advanced mode' to a particular cljsjs dep, but use it everywhere else, in this case React? React->closure ends up clobbering window vars like Em, which unhappily belongs to Ember.
ok, for the commonjs support: so far, so good. appears to work fine as is in the example and still works for me when I bump to clojure 1.8.0
and cljs 1.9.229
@arohner it might be possible with some analyzer sorcery
I don’t know exactly what it would entail, but probably hooking into the compiler analysis for the namespace that you want to mess with and add the :export
metadata to the definition
it definitely is
I can’t think of any other way right now
@arohner oh actually it might be simpler than that
give me 1 sec
@arohner try this: (js/goog.exportSymbol “om.dom.div”, om.dom/div)
you could also probably get away with something like: (def ^:export div om.dom/div)
?
and then just call div
instead?
How do you handle providing utility functions for a library that may or may not be included in your final project. e.g. I want to provide some utility functions for Datascript in my library. The project that uses my library may or may not have Datascript as a dependency. I can't add Datascript to my ns
:require
in my library because then projects that use my library and don't have Datascript as a dependency will not compile due to the missing Datascript dependency.
clojure.spec.gen
get's around this by lazily loading test.check. Is there an equivalent in Clojurescript?