Fork me on GitHub
#clojurescript
<
2015-06-25
>
rui.yang03:06:28

is there any streaming/video of the om next talk in euroclojure?

rui.yang07:06:19

so quite today, or I am in a different time zone?

dnolen07:06:57

heh well, it's 3am-11pm in US simple_smile

acron07:06:27

8.30am here in the UK!

rui.yang08:06:15

6:13pm in au :)

entrobe08:06:36

4:45pm in singapore

a.espolov12:06:57

Hi guys. I have a similar vector

a.espolov12:06:24

[:div {:class "navbar navbar-fixed-top"} [:div {:class "container-fluid"} [:div {:class "navbar-header"} [:a {:class "navbar-brand" :href "#"} "Photogallery"] [:div {:class "version"} "0.93"]]] [:button {:on-click #(do (println "click xxx") (om/set-state! owner :xxx [:table {} ; {:on-click (fn [] (js/alert "test"))} "asd" ;[:div {} ; [:table {} ; [:tr {} ; [:td {} ; "qwerty"]]]] ]))} "xxx"] (fn [] ;(html/render-html (om/get-state owner :xxx)) (when (not (nil? (om/get-state owner :xxx))) (om/get-state owner :xxx) ;(om/get-state owner :xxx) )) ]

a.espolov12:06:18

I wrote a function which generates the html from us this vector and renders it afterwards component of om

a.espolov12:06:37

everything worked OK until I tried to use the design (fn [] (when (not (nil? (om/get-state owner: xxx))) (html/html-render (om/get-state owner: xxx))))

a.espolov12:06:59

Uncaught TypeError: tag.call is not a function

ergl12:06:53

you can format your code with `

meow12:06:23

and slack posts are mutable 😉

meow12:06:57

per our discussions yesterday about :import and Google Closure I found an error in an otherwise very nice ClojureScript resource: https://github.com/funcool/clojurescript-unraveled/issues/36

ergl13:06:46

@a.espolov: formatted it for you

[:div {:class "navbar navbar-fixed-top"}
 [:div {:class "container-fluid"}
  [:div {:class "navbar-header"}
   [:a {:class "navbar-brand" :href  "#"} "Photogallery"]
   [:div {:class "version"} "0.93"]]]
 [:button {:on-click
           #(do
              (println "click xxx")
              (om/set-state! owner :xxx
                             [:table {} {:on-click (fn [] (js/alert "test"))}
                              [:div {}
                               [:table {}
                                [:tr {}
                                 [:td {}
                                  "qwerty"]]]]]))}
  "xxx"]
 
 (fn []
   ;(html/render-html (om/get-state owner :xxx))
   (when (not (nil? (om/get-state owner :xxx)))
     (om/get-state owner :xxx)
     ;(om/get-state owner :xxx)
     ))]

a.espolov13:06:22

in a correctly specified issue, half of the answer

maio14:06:57

anyone using figwheel? I'm having trouble using :on-jsload in project.clj. It doesn't trigger given function when I change some file. 😕

meow14:06:38

namespaces and Google Closure is still beating me up, but I'm not down for the count...

meow14:06:31

interestingly, all of these forms "work", but I suspect that the last one is meant to be idiomatic:

[:p "goog.global.COMPILED " goog.global.COMPILED]
    [:p "goog/global.COMPILED " goog/global.COMPILED]
    [:p "(.-COMPILED goog/global) " (.-COMPILED goog/global)]

meow14:06:25

goog is a namespace, global is an object attached to that namespace, COMPILED is an attribute of the global object

meow14:06:55

what's confusing is why the first two versions work

dnolen14:06:27

those are all valid.

dnolen14:06:29

will never change.

meow14:06:25

another interesting thing is that I can't find any mention on the wiki of the fact that "ClojureScript has a special syntax for access to the entire platform environment through the js/ special namespace. " http://funcool.github.io/clojurescript-unraveled/#access-to-the-platform Might be so simple that it's taken for granted but on the other hand it seems worth pointing out.

dialelo14:06:18

thanks for reporting @meow, going to reword that part about :import right now

meow14:06:19

@dnolen: hmm. okay. Is one form preferred? I like goog/global.COMPILED but I'm also trying to break myself of OOP idioms.

meow14:06:57

@dialelo: you're welcome simple_smile

dnolen14:06:30

@meow: no preferred thing in this case.

dnolen14:06:07

pkobrien: surprised about js/foo not being documented, I would double check to be sure.

meow14:06:21

well, on this page there is only one example that uses the js namespace, but no mention that the namespace exists or what it is for: https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#host-interop

meow14:06:54

the quickstart page makes no use of js/

meow14:06:53

the Dependencies page uses the js namespace but never explains it

meow14:06:51

I've been all over the wiki and can't find any explicit mention of the js namespace.

danielgrosse14:06:59

Hello, is there anything known, that Chrome is not working with the austin browser repl? When I run it, every operation hangs. After trying firefox, they are working as expected. 😩

meow14:06:06

@dnolen: when you say "no preferred thing in this case" do you mean the case of the Google Closure namespace? And that otherwise the rules defined for Host Interop on the wiki are meant to be the standard? https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure#host-interop

roberto14:06:08

I tend to refer to that instead of the official clojurescript wiki

meow15:06:10

@roberto: thanks. I need to spend more time there. Found their link to js/ https://github.com/cljsinfo/api-refs/blob/catalog/refs/syntax_js-ns.md

meow15:06:46

hmm, this also works: js/window.Infinity (no, really, I'm not confused by this at all...)

dnolen15:06:33

@meow: all this stuff is supposed to work

dnolen15:06:50

foo.bar.baz always works.

teslanick15:06:56

js/ references the global namespace, or window. Window has a circular self-reference. So: window.window === window in JS. So (= js/window.window js/window)

meow15:06:52

I just find it confusing when I read something like the Host Interop section of the wiki that states:

To access object properties (including functions that you want as a value, rather than to execute) use a leading hyphen:

(.-Infinity js/window)
 => Infinity
I'm still learning but I'll get there eventually. simple_smile

meow15:06:03

@teslanick: that part I have no problem with - it's only the syntax that's throwing me off at the moment

teslanick15:06:07

You should be able to do just: js/Infinity

meow15:06:26

@teslanick: true. I'm just starting with what is on the wiki and trying to understand the syntax rules for cljs.

meow15:06:27

so I'm not at all confused by what is represented by js, window, global, or how they might differ on different target platforms, or references to the exact same object on browser platforms, etc. That part is pure fun and I'm reading the Google Closure book and going through the closure source code.

meow15:06:13

I'm just getting tripped up on making use of all the Google Closure goodies from within cljs and trying to do it in an idiomatic fashion while also learning clojure and clojurescript at the same time.

meow15:06:57

But I see the light at the end of the tunnel and I'm having a blast so it's all good. simple_smile

mfikes17:06:15

@meow: FWIW, ClojureScript: Up and Running has a section covering the special js namespace.

meow17:06:11

@mfikes: Thanks. I just thought maybe it was worth mentioning its existence on the wiki somewhere.

mfikes17:06:50

@meow: Yes. IMHO, the wiki should contain a comprehensive normative description of ClojureScript.

meow17:06:15

@mfikes: I'd be happy to read/review/test/edit such a thing if someone were to write it.

meow17:06:07

I happen to think that ClojureScript is going to gain in popularity quite rapidly, quite soon, and may overtake (or at least catch up to) languages like Python. That means more programmers will be coming to it without previous exposure to Clojure and some without exposure to Javascript.

meow17:06:22

Coming from python (which I chose over perl, which was way more popular at that time around 1999) I'm a fan of having "one and only one right way" for things.

mfikes18:06:46

@meow: Best I can tell, the “Differences from Clojure” wiki page most nearly plays the role of being a language specification.

meow18:06:12

@mfikes: I agree. But the structure is cumbersome as a reference because you have to refer to the Clojure page.

mfikes18:06:24

@meow: Yeah. I've been wondering if a ClojureScript copy of the Clojure specification pages would be better.

meow18:06:21

And nowhere is there a good description of the host environment and its impact on the global namespace. By that I mean that values in the global namespace like NaN, Infinity, -Infinity, +Infinity, and the js and Math namespaces are a result of being hosted on JavaScript. And yet there is hardly a mention of them. This isn't necessarily a big deal, but it wouldn't hurt to explicitly describe what you get when you work in cljs, IMHO.

meow18:06:26

I recently did a bunch of work in QML, which is also a hosted language on JavaScript with the same things in their namespace because its part of the ECMA standard thingie. So I'm familiar with it.

meow18:06:54

@mfikes: I think it would be nice and useful to be able to go to a single page that captures everything to do with the ClojureScript spec without having to refer back to a Clojure spec. This might be a duplication of information but while I'm working in cljs as a newbie its been a struggle to pull together all the bits and pieces of information.

mfikes18:06:38

@meow: Maybe it could be multi-page and roughly of the same structure and content as the Clojure spec.

mfikes18:06:22

I think the only thing I've seed David comment on regarding this is the idea of it being a freely-editable wiki scales well for where we are now with the language.

mfikes18:06:34

Every time we discover some undocumented aspect of ClojureScript (like the js nsmespace) a few sentences or paragraphs could be added to the spec by the community.

meow18:06:23

@mfikes: Why not just create a single page to get things started and then if any section becomes too big we can split it off into a separate page?

mfikes18:06:02

@meow: Yes. That seems sensible.

meow18:06:03

And since David is in favor of using the wiki for this then I am happy to help.

meow18:06:35

I don't want to create a tutorial or api reference - those already exist elsewhere. We just need an overview with a few examples to illustrate the concepts.

meow18:06:08

I know I'm preaching to the choir. 😉

meow18:06:06

A cljs version of what's on this page would be nice: http://clojure.org/jvm_hosted

meow18:06:26

I'd like to at least deal with: importing, namespaces, notation (dotted member access), importing of Classes and implicit class constructors, the global namespace, whether or not the Math/ namespace has any value, and the Google Closure namespaces/classes/objects/attributes and how they represent exceptions to the general rules.

mfikes18:06:28

Even if you skim through http://clojure.org/data_structures you can envision a similar page that is accurate for ClojureScript.

mattly19:06:10

does anyone know how to get the react devtools working with Om?

meow19:06:51

I'm completely confused by this:

Library API

The "Library API" is an index of the symbols you can use inside any ClojureScript application.

These symbols span multiple sources, which you don't really need to know (see table below). We omit Google Closure* and JavaScript** symbols from this API reference, though they are included in and accessible from every ClojureScript application.

Google Closure Library
JavaScript's native library

meow20:06:00

My understanding is that there are no symbols from Google Closure that are included in and accessible. Not without specific imports, just like any other external namespace.

meow20:06:54

It's just that the Google Closure library is "bundled" as part of the compilation process, but no symbols are available within the global namespace of a ClojureScript application, right?

meow20:06:49

Or have I completely lost my mind?

nullptr20:06:29

pkobrien: yes -- in other words, it's there to be :required or :imported without needing to add a lib ref

meow20:06:40

Google Closure is bundled, making it easy to import and use in your app. There is a js/ namespace that provides access to the JavaScript host environment. Beyond that, there are no symbols from either of these that are "included in and accessible".

meow20:06:53

I think the original text is terribly misleading.

meow21:06:42

I just read the guide being given away by @bostonou on his http://clojurescriptmadeeasy.com/ and wanted to say that it was very well written and worthwhile. Anyone working with cljs and core.async is likely to get something of value out of it. Good job!

meow21:06:32

And I think everyone here has a sense of how picky I can be... 😉

zmaril21:06:56

I'm looking to use the clojurescript compiler from clojure to compile small cljs scripts. I'm digging through the documentaiton but can anybody point in the right direction?

nullptr22:06:16

zmaril: i'd start with the Quick Start and look at the entry points there to see how the internal interfaces work

michaelr23:06:48

sente users, is it expected that server->client events arrive at a different order than they were sent?