Re: [ClojureScript] goog.require in HTML

2014-01-31 Thread Samuel Aaron
Thanks for this explanation - makes complete sense :-) Sam --- http://sam.aaron.name On 31 Jan 2014, at 11:49, adrian.med...@mail.yu.edu wrote: > If you're not using either simple or advanced compilations with the Closure > compiler it simply outputs one JavaScript file for every namespace in

[ClojureScript] goog.require in HTML

2014-01-31 Thread Samuel Aaron
Hi there, I've noticed a practice in adding a script tags for both aspects of google closure's compile phase and also using the goog.require construct. For example: goog.require("om_tut.core"); It was my (clearly naive) understanding that google closure generated one js file which you needed

Re: [ClojureScript] OM - issue with props containing functions

2014-01-18 Thread Samuel Aaron
On 18 Jan 2014, at 16:19, David Nolen wrote: > gen-react-dom-inline-fns generates macros so non-higher order usage of > dom/tag inlines into React.DOM.tag > > gen-react-dom-fns generates real functions so higher order usage works. Ah, I see my misunderstanding now. I was only looking at dom.c

Re: [ClojureScript] OM - issue with props containing functions

2014-01-18 Thread Samuel Aaron
On 18 Jan 2014, at 15:50, David Nolen wrote: > It generates functions that call React.DOM.tag so that you can use apply. Sure, but I guess you have to call gen-react-dom-fns manually if you want cljs functions for all the React.DOM.tags, whereas gen-react-dom-inline-fns is automatically calle

Re: [ClojureScript] OM - issue with props containing functions

2014-01-18 Thread Samuel Aaron
On 18 Jan 2014, at 15:41, David Nolen wrote: > OK, I looked into this. First I was wrong about apply, I was a bit tired when > I wrote that, apply works fine in this instance because the dom macros are > also functions. Oh, interesting - that makes complete sense. Out of interest what's gen-

Re: [ClojureScript] OM - issue with props containing functions

2014-01-18 Thread Samuel Aaron
previously described: it renders first time and then fails the second rendering. It is possibly because the props are used as part of a key for react components and therefore shouldn't be changed? How might I give each div a random background colour? Sam --- http://sam.aaron.name On 18

Re: [ClojureScript] OM - issue with props containing functions

2014-01-17 Thread Samuel Aaron
Hi David, thanks for your help. On 18 Jan 2014, at 01:47, David Nolen wrote: > (apply dom/p nil > (map render-subdiv (:subdivs data))) > > Is not going to work. You need to put the result of map into a JavaScript > array. React doesn't know anything about ClojureScript sequences and I don't

[ClojureScript] OM - issue with props containing functions

2014-01-17 Thread Samuel Aaron
Hi there, I was playing about with Om and ran into an issue when attempting to put a function call inside a prop. Here's a minimal app: (defn subdiv-color [] (rand-nth ["black" "green" "blue" "red"])) (def app-state (atom {:title "Testing Testing" :subdivs ["subdiv1"

Re: [ClojureScript] ANN: Om, a ClojureScript binding to Facebook's React

2013-12-20 Thread Samuel Aaron
are symlinking the clj-src directory? > > lein checkouts works by you symlinking > > /projects/myproject/checkouts/om => /projects/om > > > > > On Fri, Dec 20, 2013 at 6:07 PM, Tim Visher wrote: > On Fri, Dec 20, 2013 at 1:01 PM, Samuel Aaron wrote: > > On

Re: [ClojureScript] Integrating one cljs project into the other during development time

2013-12-20 Thread Samuel Aaron
Quick caveat: don't trust me - I'm only starting to get my head around all this stuff. However... It's my understanding that checkouts are a lein functionality and lein currently focusses on standard Clojure projects. Therefore, adding stuff to checkouts will only add the projects to the JVM cl

Re: [ClojureScript] ANN: Om, a ClojureScript binding to Facebook's React

2013-12-20 Thread Samuel Aaron
On 20 Dec 2013, at 18:07, Tim Visher wrote: >> Is anyone aware of any specific reason(s) why symlinking om is a bad move? > > Transitive dependencies? Ah, excellent point, although Om currently only depends on cljs and clj. Sam --- http://sam.aaron.name -- Note that posts from new members

Re: [ClojureScript] ANN: Om, a ClojureScript binding to Facebook's React

2013-12-20 Thread Samuel Aaron
On 20 Dec 2013, at 17:43, Luke Morton wrote: > You should probably just use `lein install` like everyone else no? > > `git pull && lein install` When I work on other projects that depend on fast moving targets, I've definitely benefitted from symlinking them (traditionally with lein's checkou

Re: [ClojureScript] ANN: Om, a ClojureScript binding to Facebook's React

2013-12-20 Thread Samuel Aaron
On 20 Dec 2013, at 16:35, Vijay Kiran wrote: > > If you cloned the repo - using lein install should make the snapshot > available via dependencies. Ah ok, `lein install` did add om to my ~/.m2, it just didn't tell me it was doing it :-) OK, so that seems to get things working - I can now co

Re: [ClojureScript] ANN: Om, a ClojureScript binding to Facebook's React

2013-12-20 Thread Samuel Aaron
On 20 Dec 2013, at 16:38, Daniel Bell wrote: > Sam---What I did was, from the cloned git repo, run 'lein install,' which > installs the current project to your local repository. When lein sees Om in > your dependencies, it will look in the local repo as well as clojars, find > it, and all is

Re: [ClojureScript] ANN: Om, a ClojureScript binding to Facebook's React

2013-12-20 Thread Samuel Aaron
On 20 Dec 2013, at 16:12, David Nolen wrote: > I also don't see Om in your list of dependencies. I also started with that in my dependencies, but it doesn't seem to be available on Clojars etc: λ lein cljsbuild once Compiling ClojureScript. Could not find artifact om:om:jar:0.1.0-SNAPSHOT in

Re: [ClojureScript] ANN: Om, a ClojureScript binding to Facebook's React

2013-12-20 Thread Samuel Aaron
On 20 Dec 2013, at 13:07, David Nolen wrote: > Your externs path is wrong. It should be the same as the instructions in the > README. I started with it matching the README, but got (and still get) the same error. Seems to be a Clojure problem - perhaps Clojure can't find the om .clj files in

Re: [ClojureScript] ANN: Om, a ClojureScript binding to Facebook's React

2013-12-20 Thread Samuel Aaron
Hey David, this looks fab. I'm trying to play with it within a stub project of mine. However, I'm not having much success getting it to compile. This is likely to be some cljs setup issue I'm having (there are so many moving parts!). Steps taken: * Download, and build latest cljs (0.0-2127) *