This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-28
Channels
- # admin-announcements (28)
- # beginners (30)
- # boot (6)
- # cljs-dev (48)
- # clojure (72)
- # clojure-android (8)
- # clojure-australia (1)
- # clojure-italy (9)
- # clojure-japan (12)
- # clojure-russia (21)
- # clojure-sg (1)
- # clojurescript (109)
- # core-async (11)
- # core-logic (17)
- # cursive (33)
- # datascript (1)
- # datomic (30)
- # dunaj (4)
- # editors (38)
- # events (1)
- # ldnclj (17)
- # off-topic (156)
- # om (2)
- # overtone (1)
- # re-frame (2)
- # reagent (63)
@pmooser re: configuring Cursive: https://cursiveclojure.com/userguide/ui.html
@shaunxcode: paredit support has gotten a lot better, particularly in the most recent releases
Is there a cursive equivalent to emacs prelude? (or maybe Cursive is to IntelliJ what prelude is to emacs?)
@roberto: Guess I should only ask one question at a time, to which where you responding ?
@petrus: did you ever figure out Mixpanel tracking from cljs?
@dnolen: Did you set up emacs key bindings or just adopt the standard intellij ones? I've found it awkward to try and mix the two, and seem to be constantly stumped and reaching for the mouse...
@p14n I set up Emacs paredit bindings, REPL commands, and a few window management ones and I was away
I can’t seem to find a Bidi clojurescript example, can anyone point me to any extract of code using it ?
gphillips: may be this https://github.com/juxt/bidi/blob/master/src/bidi/router.cljs#L28
compiling an empty repo (:optimizations :simple) with cljs.js as a dependency creates a 1.7mb file in build 3620, 6.2mb in 3652
Does the import macro only work for Google Closure classes? I have a class in google maps, e.g. google.maps.Map, but doing (:import [google.maps Map]) doesn’t work.
And (:import [google.maps.Map]) doesn’t make a difference - it works without and I still have to use the full name with it
@danielcompton: Thanks
Hi @casperc here is my setup for google.maps
https://gist.github.com/bensu/edd68d11102c2197a729
I was wrong last time when I said that cljsjs.google-maps
included the source, I forgot about it. In the gist there is a way to get the source using your API key.
I plan to do a talk on ClojureScript at a local university in two weeks (University of Cape Town) to a non-Clojure audience. Any tips for structuring a sub-40 minute talk for maximum impact/adoption?
@bensu: Thanks. It is slightly different from what I have working now. The problems I was having before was not having the google maps <script…> tag before the application one (doh)
@petrus: livecode something like this https://www.youtube.com/watch?v=k2QGj9TSUSk
Yeah live coding would be awesome. I was thinking something with reagent for web dev, but snake is more fun!
@bensu: I am using externs file from the google closure compiler people, so it actually works with advanced compilation as well.
@petrus: livecoding a game with figwheel that takes advantage of an undo stack is a pretty good call
chess is great for this
simple data model, well understood domain
@bensu: I might try the foreign-libs thing - I am not sure what the pros and cons are though. Any idea? Do you still need to include the <script…> thing, or does that replace it?
hmm chess could be a great one (I happened to have written a Chess AI in Java: https://github.com/pate/chessmate)
@casperc: you don't need markup. Also, when it is included in foreign-libs
now the compiler knows about, you can :require
it and it gets pulled in the dependency graphs. If you are including <script "http://cdn.google.maps" > you are not puting the code through the closure compiler.
@bensu: Yeah, so I guess it could actually optimize the google maps sourcein advanced mode (assuming they wrote it so that it is possible)?
@p14n: I just use the Emacs binding set and then I’ve a added bunch of my own things. I don’t really care about overriding the IntelliJ defaults as they are nearly always things I don’t use or things I would rebind anyway.
@p14n: the thing I’ve found most useful on OS X anyway for a more Emacs like experience - I just disable all the chrome. Then I add explicit bindings for everything I use all the time - Project Drawer, Debugger, Action Menu, Find Symbol, Run…, Terminal, Version Control.
@casperc: Also, @bostonou did a great writeup: http://clojurescriptmadeeasy.com/blog/when-do-i-use-require-vs-import.html
What are peeps using for games in ClojureScript? Reagent?
@dnolen: I thought it would be good if your webinar could be added to the README of core.async.
@casperc: from what I can tell, there is no goog.closure
compatible version of google.maps
The google.maps
call is just a loader for other code. The setup I sent you works with :optimizations :advanced
as long as I don't have any google.maps symbols in my top forms, that get loaded before the maps code is.
@malcolmsparks: why do you use [& {:as params}]
destructuring in bidi methods like path-for
? I like bidi, but things like passing constructed map of route-params to path-for
is pain, because I need to use smth. like (apply path-for (mapcat identity m))
And case when constructed map is passed is more frequent, and extra {}
in inline case are not too tedious to write.
How are y'all organizing your Secretary routes? Do you have a routes.cljs
, leave them in core.cljs
, or define them in each file/namespace?
Not a critical question, I've just been wondering. So far I'm mainly leaving them in the individual page files.
@ul there's a discussion about the pros and cons of kv args here: https://groups.google.com/forum/?hl=en-GB#!topic/modularity/QeWcq1CSTmY
@malcolmsparks: Thank! Scanned it, but not found pros of kv-args, only cons like I've described above.
@ul: I've written about that a bunch here: http://yellerapp.com/posts/2015-03-22-the-trouble-with-kwargs.html
(mapcat identity m) is nice, haven't seen that before - I use (apply concat m) - but if you're calling path-for with constructed args, you're already jumping through hoops so the thinking is that one more is ok
@malcolmsparks: sorry for my tone, i have no offensive intention, just bidi is the first library with kv convention which I started to use a lot in production, and not get used with need to make extra function calls, so feel some sort of pain
More debate than you ever wanted about kwargs vs explicit map here: https://groups.google.com/d/topic/clojure/yzLCZh-GiQ8/discussion
oh, no, this thread is older and longer than previous. i fear that a few year back more it should be a veeeeery long discusssion 😃
re my (shameless) link: I read all of those threads in order to write that post Tried to summarize it a bit.
I’m trying to use Clojurescript to produce greasemonkey scripts that deal with a pretty gross existing DOM. Any suggestions for parsing stuff? Seems like hickory might be a good idea since it parses stuff to hiccup-style data structures which are probably a lot easier to deal with than native DOM objects...
I’m not sure if I should just parse & hide and replace this entire DOM heap of junk, or if I should just play nice with the existing DOM (just thinking out loud, I appreciate that’s not really a useful point for anyone to meaningfully comment on)
I got my om+core.async+cljs.js app "functional" last night
with :simple optimizations, it compiles to 8MB
but gzips to ~700KB
which is acceptable
the gui is not where it needs to be, but it's working
I'll have a demo soon
@ericnormand: haha, cool
Best clojure quote: "We are in your stuff." from @dnolen's talk at TXJS https://www.youtube.com/watch?v=nKyHvVIotBo&index=13&list=PLMWftTFfsA8Om-GqKm46bw8GVxyKXRz0X
Actually, I just rewatched it. It's "We are inside your thing."
even better
what should be equivalent clojurescript of $(‘id’).on(‘click’, function (e) { dosomething(); });
When writing ClojureScript tests, is there a way to generate methods like if the application was being exercised by the user, like clicking a button?
@pupeno: easiest thing would be to extract all logic from the actual click handler. then wrap in tests the function that is called from the handler
@lazy-lambda: Using jQuery in clojurescript, or you want to know how you might do that in an idiomatic way in cljs?
bostonaholic: doing it like that would test the function but not test the application. That would be a sad workaround. I’m looking for what options are out there to test clojurescript apps.
I don't know of any clojurescript specific web automation libraries, but any will do
I haven’t found any yet, hence me asking.
@teslanick: Using jQuery in cljs
(.on (js/$ "id") "click" (fn [_] (js/doSomething)))
Alternatively:
(-> (js/$ "id")
(.on "click" (fn [_] (js/doSomething))))
@teslanick: Thanks !
@lvh: Any feelings on goog.dom? I'm trying to get a sense for how widely used it is.
dommy is p much just a set of macros that does the right thing (e.g. js/document.querySelector
) at compile time
chance: But Clojure(script) has non-screwy dependency mgmt so that’s not as strong of an argument
It works, it does a thing, but it’s still goog.dom
under the hood, i.e. it doesn’t really take advantage of all the cool compile-time stuff you can do in a lisp
Yeah, that's a good point -- I tend to use the raw DOM API because it's what I'm really familiar with and I figure that when it starts causing me pain, I can transition to something smarter.
@teslanick: Is that interop syntax (`(js/document.methodname)`) usually how you do it? Does that work in Clojure?
Yeah; periods are de-facto allowed in symbols, even though the spec says they aren't.
And if @dnolen uses it, it's good enough for me: https://github.com/omcljs/om/blob/master/src/om/core.cljs#L903 😉
@chancerussell: does not work in Clojure and it will never change in ClojureScript
@teslanick @dnolen Thanks. Think I'll stick to the other syntax and save some brain space.
for the curious, this form of property access has been there since Rich did the first version of ClojureScript in 2011 far as I know
My understanding is it is the idiomatic way to call constructors that are properties on object(s)
https://github.com/clojure/clojurescript/commit/25019841f67c877d1d6ec7b6625f2bb997f352bb
@dnolen: is this just establishing parity with Clojure 1.7 while keeping the current release strategy?
@danielcompton: yep this is not about semantic versioning or anything