This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-04
Channels
- # admin-announcements (6)
- # alda (1)
- # announcements (3)
- # aws (4)
- # beginners (233)
- # boot (82)
- # cider (11)
- # cljsjs (21)
- # cljsrn (7)
- # clojure (262)
- # clojure-japan (1)
- # clojure-russia (129)
- # clojure-sg (2)
- # clojure-taiwan (2)
- # clojurecup (23)
- # clojurescript (162)
- # clojurex (3)
- # core-async (18)
- # cursive (81)
- # datavis (183)
- # datomic (23)
- # emacs (2)
- # funcool (25)
- # ldnclj (82)
- # lein-figwheel (3)
- # om (196)
- # onyx (74)
- # parinfer (7)
- # portland-or (12)
- # re-frame (60)
- # reagent (48)
- # slack-help (1)
- # yada (9)
@mfikes: can't seem to call that ns-interns
macro with cljs-bootstrap
: https://gist.github.com/tolitius/c17b2d4a98eabb591926 (neither via cljs.js
nor via replumb/read-eval-call
), but I maybe missing something. I see that *load-macros*
is true by default
@tolitius: Need to keep state around. Commented: https://gist.github.com/tolitius/c17b2d4a98eabb591926#gistcomment-1639027
@tolitius: In other words, your (def foo 42)
is being done in “regular” ClojureScript, but then you are passing an empty compiler state to cljs.js
.
hi, i started working on the om tutorial https://github.com/omcljs/om/wiki/Basic-Tutorial, its up and running, but the figwheel repl doesn't come up after i've refreshed the browser, thanks
Figwheel: trying to open cljs reload socket socket.js:62 WebSocket connection to '<ws://localhost:5060/figwheel-ws/dev>' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
@tolitius: Yeah. I suppose you can use cljs.js
like that in a regular ClojureScript REPL, but in a deployment scenario you are dealing only with the state atom, essentially. If you need to load analysis metadata for stuff that is compiled and ships with your app, I suspect you can (it has been a little while since I’ve looked at that code).
@mfikes: did not occur to me how the pieces are used first time I looked at it, but it is coming together
@tesseract: there is an #C06DT2YSY specific channel. Answer not quite, but we’re working steadily towards beta
is there a way to interact with clojure/jvm from the figwheel repl? or for figwheel watchers to produce output to that repl?
the only way i've found to produce output is by throwing an exception
Why do I get “Uncaught TypeError: Cannot read property 'appendChild' of null” when trying (defonce conn (repl/connect "http://localhost:9000/repl”)) ? I’m running ring/compojure to serve HTML and I have started ClojureScript REPL with "lein trampoline cljsbuild repl-listen"
it doesn't have to be at runtime, i just want to build a tree of my namespace and a given value that each of them provides
currently i'm requiring them individually and building the tree by hand, but this is going to get pretty tedious as the project grows
to be a bit more concrete, say I have three namespaces 'foo.one', 'foo.two', 'foo.bar.one' and each of these have an 'info' symbol. I want a map {:foo {:one foo.one/info :two foo.two/info} :bar {:one foo.bar.one/info}}
I can't know for sure since I never tried, but you could see if the analyzer API is available during macroexpansion - https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer/api.clj#L152-L158
You tried it in a clj
file, right? Then I guess tough luck. Unless someone more experienced with that comes along and has a brighter idea.
grepping around on github, there seem to be people doing something similar with all-ns
in clojurescript, e.g. https://github.com/darwin/plastic/blob/7c81a4fcc0bb53c25e1c1bbe5d41e23913ddbfcd/src/test/plastic/test/karma.clj
Yeah, I imagined it would work like that, not sure why it doesn't. But then again I never tried it in practice, so there might be something else you need to do I'm unaware of.
hah, had a mistake in my macro... i syntax-quoted the outer form and thought I'd deleted the backtick. turns out there was some dust on my screen over that exact position :3
wow, that is really neat ❤️ that's got to be the easiest way of metaprogramming i've ever done. doing that with python or java would have taken dozens of lines of code
Hey, @jaen, do you remember that gist you sent me
@trancehime: I dunno, what was it about?
tables
containing data from an atom which has vector
@jbaiter: I guess you could just use the usual Clojure macroexpand since it's Clojure code.
@trancehime: ah, you mean this? - https://gist.github.com/jaen/dd22b3432581fc7ab8f5
what is ..
in [new-value (.. e -target -value)]
i glossed over that last time
it's probably a reference to something but not sure what
interop with js to get a property of an object? iirc?
oh ..
is a macro
Ahhh.
I think you can do even fancier things, like (.. e (function arg) -property-on-result)
which should be eqivalent to e.function(arg).property-on-result
Every element in a seq should have a unique :key
wat
but.. pretty sure there is
oh wait the keys are like "this"
not like :this
The thing described here - https://facebook.github.io/react/docs/multiple-components.html#dynamic-children
If you have a dynamic list of children react has an optimisation to reuse existing DOM to make the updates faster
You can tag each component with a unique (in the scope of a list) key to make use of that
yeah, i did ^{ }
for some other stuff
my problem is my data is keyed {"like" "this"}
so doing it your way makes the thing behave weird even if I have server-based id
it makes it believe all the children have "id"
which makes flattenChildren
throw a warning
So far I haven't run into any problems until now...
derefing the atom gives me a vector of data which each element looks like this: {"end_level" 18, "schedule_game_detail_id" 157356, "id" 760501, "deaths" 1, "win" nil, "kills" 1, "player_name" "Huni", "schedule_game_id" 78749, "assists" 1}
In the mean time you might appreciate this:
(defn transform-keys
"Recursively transforms all map keys from strings to with given function."
[m f]
(walk/postwalk (fn [x] (if (map? x) (into {} (map f x)) x)) m))
(defn api->keyword-key [[key value]]
[(keyword (str/dasherize (name key))) value])
and then you can just do (reset! local-match-state (transform-keys response api->keyword-key))
and get sensible keys like :player-name
.str
is this lib - https://github.com/funcool/cuerdas
But yeah, I think I misunderstood you when you said "oh wait the keys are like "this"
not like :this
", I thought you were referring to the metadata map.
In that case you probably were right - you're using :keys
instead of :strs
in the destructuring
So your id
is nil
each time, because you indeg by :id
not "id"
and all rows end up being mapped to the same single row.
I suggest you try the code I've pasted above so you can get nice, dasherized keywords keys instead
@jaen thanks, I will try that when I can. Right now I have to take care of some chores now that I'm back home. And my sister is still sick.
If namespace foo.core
depends upon bar.core
(via a :require
and a fn call), and I change bar.core
’s on-disk implementation, should I see evidence of those changes if I do (require ‘foo.core :reload-all)
? (Say by calling a fn in foo.core
that then calls a revised fn in bar.core
?)
@dnolen: Cool. I think I may write a minimal ticket then. (Not working for me for a very simple case with script/noderepljs
.)
and all of them manage this by tracking the loaded set in the JS environment via Google Closure
gmorning, Clojurists! Can anyone pointout resources for debugging go loop bugs via sourcemap in browser, or if there’s an issue already in progress on it?
@dnolen: Ahh… I think I see stuff you did specifically for the browser REPL for :reload-all
. I’ll start there then. (I want to make it work in Ambly.)
@wildermuthn: nobody has ever picked up that problem
I’d be happy to dig in with a little pointing in the right direction
Should I start with sourcemaps? Learning how that works?
@wildermuthn: nothing to do with source maps at all
Currently, it uses something else, or just uses tools.analyzer differently?
@wildermuthn: I don’t have any more pointers to give you
Ok, thanks for pointing the right direction
:thumbsup:
Hi, I'm found some trouble when trying compile some example code with :advanced/:simple compilation modes but I'm always getting this error: No implementation of method: :-find-sources of protocol: #'cljs.closure/Compilable found for class: nil
, the same configuration but changing the :optimizations
to :none
everything works correctly.
The concrete build script is here: https://github.com/funcool/catacumba/blob/master/scripts/build-postal-chat.clj
^^ would love to see your responses! thanks...
@alexmiller: just FYI, when I press next on page 2 on an iPad I get back to page 1.
@martinklepsch: that happened to me too, I had to go back and click next again \cc @alexmiller
@alexmiller: Page 2 answers didn’t save for me.
@alexmiller: I filled it out!
@dnolen: It did that for me multiple times, I'll try again later with proper computer
I got sent back to page 2 as well, from my laptop
well I stopped changing it so if that's the problem it will be fixed!
well my changes were additive, so there was no reason they needed to force a re-do :)
Worked on first try with laptop
@martinklepsch: I restored my old build.boot file for some of my projects and I can confirm that now the speed is much much better in almost all tasks.
@dnolen @mfikes Would it make sense to open a cljs-bootstrap Slack channel?
@richiardiandrea: I don’t think so
@dnolen yes I was more thinking about projects
Maybe with a different name
@richiardiandrea: yes that makes sense to me
Ok then, I will try to come out with a better name, and wait for @mfikes opinion as well
Sometimes I’m a little bit concerned if we get off into the weeds about bootstrapped stuff. But, it is a part of ClojureScript proper now.
Well on the official wiki there are I think ten bootstrapped project in total, I just was thinking that it might be useful as a point of reference
But again, the community opinion counts more and that's why I was asking :)
I was starting to think we might need another channel, but I hadn’t reached that level of pain.
@mfikes I fine with people talking about it, it’s a very useful thing for people who are experienced with ClojureScript
some people seem to want to jump into the deep end, but there’s not really much that can be done about that
since that discussion is more focused on sharing ideas, approaches to building generic stuff
Yes that's true, and ease the pain for us as well, for instance today I wanted to check how it ended up with ns-resolve
and I had to scroll up quite a bit. Let's keep it under the radar, if questions increase a bit, we will create it I propose...
Hm, this reminds me of a random idea I've had. I've re-played Ruby Warrior recently and thought it's a pretty cool way to introduce people to a programming language. I figured doing something like Champion of Clojure would be awesome and with bootstrapped Clojurescript it would actually also be possible.
Yes analyzing code and comparing it to (optimal) solutions was something I was thinking of for http://clojurescript.io, then I went for something simpler...
Heh, playing Ruby Warrior on intermediate made me appreciate how Clojurescript is a first-class implementation. Ruby Warrior is (I assume) using Opal and some common idioms don't Just Work™ (nothing against Opal guys though, I can imagine what a pain implementing Ruby must be with it's schizophrenic non-spec).
Hey everyone im trying to check a url and having problems getting a window function to work. Any ideas? (re-seq #"/#/login$" (.href js/window.location))
@noonian: ahh thanks!