This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-22
Channels
- # admin-announcements (22)
- # boot (109)
- # cider (119)
- # cljs-dev (19)
- # clojure (181)
- # clojure-berlin (3)
- # clojure-dev (10)
- # clojure-japan (10)
- # clojure-korea (2)
- # clojure-russia (105)
- # clojure-sg (1)
- # clojure-spain (2)
- # clojurescript (53)
- # code-reviews (2)
- # core-async (4)
- # datomic (2)
- # editors (21)
- # instaparse (5)
- # jobs (1)
- # ldnclj (12)
- # off-topic (2)
- # onyx (146)
I’m on a dual core laptop, would a quad core machine speed up ClojureScript compile times? i.e. does the ClojureScript compiler take advantage of multiple cores?
@danielcompton: not terribly sure but I guess not. I only see a single core max out to 100%
@danielcompton: the compiler itself is not multi threaded, so only one core.
Rohit & Saurabh: Thanks for your help. Yes, I started with the descjop lein template. Knowing that Om brings in React I thought I wouldn’t have to do anything to pull it in but it didn’t work. Let me start over again with that template and walk my way through the problems I originally encountered… maybe something I did broke it. The odd thing is that I can see the React code in the generated cljsbuild-main.js, but still no joy. I’ll then push the project to GH so you can take a look… It will take me about 10 minutes...
great @kahunamoore. i’ll have a look
btw, have a look at this as well: https://github.com/oakmac/cuttle
+1 will do, thanks!
@rohit Thanks for the link to cuttle. By reviewing it I noticed it has a separate app.js that is just hand coded js for loading the Electron main window. The cuttle index.html loads the main.js generated by http://cljsbuild.In the descjop template generates a cljsbuild that only has a single cljs core namespace that loads the Electron main window. This js
So I separated the Electron js logic from the cljs build. That was the missing piece, thanks again for pointing out cuttle. I’m going to study it further to learn more about how it integrates with Electron.
@danielcompton: does not there’s a ticket for parallel compile, no one’s taken it up yet
@kahunamoore: there are two js processes in electron: main process and the renderer process. you need a javascript file for each.
@danielcompton: we can probably improve compile times a bit working with some other folks on that. But in the end the slowest part cannot be improved - advanced compilation.
@dnolen: do you mean that to speed things up we'd need to speed up the Closure compiler for advanced optimisations?
Or at least that's where the biggest wins are?
@danielcompton: no I mean I don’t even know how you would make that faster.
@danielcompton: to clarify a bit more, I think we can make ClojureScript cold builds and incremental development build times much faster. Productions build time enhancements will come from people who work on Closure Compiler.
(when-not js/whatever ...) just blows up and trying the usual idiom in js typeof blah !== "undefined" is no good either
@greywolve: aget
for this is not idiomatic.
@teslanick: @greywolve in both cases you will need externs unless it is some browser feature you are checking for.
I have a design question: I’m rendering a map as a tree using reagent. I want to be able to update keys using a textfield, but changes cause a rerender and focus loss. It looks like the problem is I need to be using the key property, but I’m not sure what a good natural way to generate the keys. Is this a good use case for metadata on the keys?
estsauver: maybe convert the hash-map to a seq of entries, (which reagent is likely doing anyway even if you are not) and put the metadata on the entries?
(map #(with-meta % (meta-from-kv %)) m)
something like that
where meta-from-kv
would likely just be first
, but whatever works for your app logic
or, equivalently, key
So, @noisesmith if I’m changing the keys the map doing something like clojure.set/rename-keys
right, so maybe you want the name of the key as the :key, or maybe you want to process them in a separate collection before putting them in the collection the reagent component watches
that's what we often do, having a "staging collection" so radical alterations as part of processing don't case hella redraws
I find (into [:ul] (for [x xs] [:li x]))
pattern pops up a lot for me: react/reagent work better with true vectors than sequences, for the keys reason… using a vector has an implicit key, but a sequence doesn’t. Kind of annoying, but might get you around your issue?
When I'm trying to specify :hierarchy
in defmulti
I get an error Uncaught Error: No protocol method IDeref.-deref defined for type cljs.core/PersistentArrayMap: {:parents {}, :descendants {}, :ancestors {}}
doing defmethod
for that multimethod. Any ideas?
I see in clojure docs example that var should be passed: :hierarchy #'account-types
, going to try it
@mfikes: Good interview on the cognicast! http://blog.cognitect.com/cognicast/083
@shaun-mahood: Thanks. I’m hoping it helps!
I'm glad you talked about the library app, my wife is a teacher and literacy specialist with a pretty substantial library. Going to show her your apps and see if they would be useful.
@estsauver: I don't really understand the situation you describe, but do you need to generate recoverable keys based on data? Perhaps use https://google.github.io/closure-library/api/namespace_goog.html#getUid