Re: [ClojureScript] sente - client ids and ring plumbing

2015-03-27 Thread Colin Yates
I did try that but then I can't find where to access that in the messages received from a client. I know I am going to kick myself... On Friday, 27 March 2015 00:54:46 UTC, Wei Hsu wrote: If you want each client to be unique, what if your user-id-fn could just generated a UUID? On

Re: [ClojureScript] Re: [ANN] Synthread with Clojurescript support

2015-03-27 Thread Atamert Ölçgen
Actually there is a pull request with these changes: https://github.com/LonoCloud/synthread/pull/9 And the author says he'll go over them. Which is quite normal. This is not too long ago (3 days). But you decided to release your fork using the original project's name. I think that's uncool.

[ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Colin Yates
In re-frame event dispatching is handled by (dispatch [:discriminator detail]). A corresponding (register-handler :discriminator (fn [db [_ detail]]) then reacts to that dispatched event. My question is how are people managing this with re-usable components? For example, I have a tree and when

Re: [ClojureScript] Re: re-frame - sanity check for re-usable components

2015-03-27 Thread Colin Yates
That does make things more ignorant which is very nice. Not sure why I didn't see that originally given I usually jump all over coupling. Guess I need some more sleep ;) Thanks Mike. On 27 March 2015 at 13:43, Jane Dampney janedamp...@gmail.com wrote: On Friday, March 27, 2015 at 11:54:16 PM

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Khalid Jebbari
On Friday, March 27, 2015 at 2:39:37 PM UTC+1, Jamie Orchard-Hays wrote: Does it make sense to pass the reusable component's context as an argument to it? ie, (defn ReusableComponent [some-context] ) Jamie On Mar 27, 2015, at 8:54 AM, Colin Yates colin.ya...@gmail.com wrote:

[ClojureScript] react - performance difference between hiding or removing elements?

2015-03-27 Thread Colin Yates
I realise this is one of those 'it depends', but in general, is it recommended to hide elements in react or not render them? For example, I have an SPA with a bunch of top-level pages. Each page has a number of tabs, each tab might be a tree or a table and so on. I could render the whole thing

[ClojureScript] Re: react - performance difference between hiding or removing elements?

2015-03-27 Thread Khalid Jebbari
On Friday, March 27, 2015 at 2:40:45 PM UTC+1, Colin Yates wrote: I realise this is one of those 'it depends', but in general, is it recommended to hide elements in react or not render them? For example, I have an SPA with a bunch of top-level pages. Each page has a number of tabs, each

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Colin Yates
It sure does, but _what_ would you put in that argument ;). On 27 March 2015 at 13:39, Jamie Orchard-Hays jamie...@gmail.com wrote: Does it make sense to pass the reusable component's context as an argument to it? ie, (defn ReusableComponent [some-context] ) Jamie On Mar 27, 2015,

[ClojureScript] Re: re-frame - sanity check for re-usable components

2015-03-27 Thread Jane Dampney
On Friday, March 27, 2015 at 11:54:16 PM UTC+11, Colin Yates wrote: In re-frame event dispatching is handled by (dispatch [:discriminator detail]). A corresponding (register-handler :discriminator (fn [db [_ detail]]) then reacts to that dispatched event. My question is how are people

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Colin Yates
Thanks both - it does. My brain wasn't really engaged when I asked the question. The salient point is that there are levels/layers in play here. I like your idea that dispatched events are application level events.. I might get shot for saying this, but I actually don't care particularly about

Re: [ClojureScript] Re: react - performance difference between hiding or removing elements?

2015-03-27 Thread Colin Yates
Thanks Khalid. On 27 March 2015 at 14:05, Khalid Jebbari khalid.jebb...@gmail.com wrote: By the way, he developped a nice tool (and open-sourced it!) to measure perf based on a lot of criteria : http://yellowlab.tools/ -- Note that posts from new members are moderated - please be patient

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Khalid Jebbari
If you're more interesed into the pattern I described, you can read more here : https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0. This is really where the React.js community is headed. -- Note that posts from new members are moderated - please be patient with your first

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Daniel Kersten
I'm currently tinkering with an approach where my code does not dispatch re-frame events at all, but rather uses my own emit function to emit signals[1]. I then, separately, have a signal-event map, so the (single global) signal handler then maps signals to events and dispatches these events to

[ClojureScript] Re: react - performance difference between hiding or removing elements?

2015-03-27 Thread Khalid Jebbari
By the way, he developped a nice tool (and open-sourced it!) to measure perf based on a lot of criteria : http://yellowlab.tools/ -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Mike Thompson
On Saturday, March 28, 2015 at 12:58:17 AM UTC+11, Khalid Jebbari wrote: On Friday, March 27, 2015 at 2:39:37 PM UTC+1, Jamie Orchard-Hays wrote: Does it make sense to pass the reusable component's context as an argument to it? ie, (defn ReusableComponent [some-context] )

Re: [ClojureScript] sente - client ids and ring plumbing

2015-03-27 Thread Dillon Forrest
Hey Colin, as a crazy coincidence, I'm trying to accomplish something very similar. I started wondering if I should set a session uuid server-side, but I'm sure there's a more elegant solution out of the box. Also expecting to kick myself once I know the correct way to do it. :) On Friday,

Re: [ClojureScript] Two possible clojurescript errors with accompanying repos

2015-03-27 Thread David Nolen
Nope. We've reached peak option combination support long ago. Sorry drawing the line at :none. There are few use cases for :simple ever and none of this stuff makes sense under :advanced. David On Fri, Mar 27, 2015 at 1:38 PM, Erik Price e...@zensight.co wrote: This isn’t supported, the

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Daniel Kersten
Marc, can you tell us a little more about the approach your taking? On Fri, 27 Mar 2015 at 17:43 Marc Fawzi marc.fa...@gmail.com wrote: Yeah but then what are you really reusing? I have components that have sophisticated behavior... sharing just the markup and styles is of limited value since

Re: [ClojureScript] Two possible clojurescript errors with accompanying repos

2015-03-27 Thread Erik Price
This isn’t supported, the browser REPL relies fundamentally on loading code dynamically which is not supported in any way whatsoever under any optimization setting other than :none. Even an optimization of :whitespace is unsupported? e ​ On Fri, Mar 27, 2015 at 12:23 PM, David Nolen

Re: [ClojureScript] sente - client ids and ring plumbing

2015-03-27 Thread Daniel Kersten
We should start a club for people who will be kicking themselves :) On Fri, 27 Mar 2015 at 17:07 Dillon Forrest dillonforr...@gmail.com wrote: Hey Colin, as a crazy coincidence, I'm trying to accomplish something very similar. I started wondering if I should set a session uuid server-side,

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Marc Fawzi
Yeah but then what are you really reusing? I have components that have sophisticated behavior... sharing just the markup and styles is of limited value since what I want to share in effect is the smart components, which is why I had settled on components encapsulating behavior as a pattern...

[ClojureScript] Two possible clojurescript errors with accompanying repos

2015-03-27 Thread Jonathon McKitrick
I've run across two optimization related issues I cannot get past. I followed the advice in 'reporting issues' on the ClojureScript wiki, and I've created 2 simple repos demonstrating the issues. These could be user error, but I've tried to remove anything clouding the issue. I thought it

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Khalid Jebbari
Yes, dumb components don't encapsulate beahvior. Indeed if you generic behaviour you need as someone proposed to push a generic event, and the app handles it specifically. Khalid aka DjebbZ @Dj3bbZ On Fri, Mar 27, 2015 at 4:45 PM, Jamie Orchard-Hays jamie...@gmail.com wrote: Good articles.

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Marc Fawzi
Khalid, I read about that on some blog post (dumb and smart component) but I'm afraid that dumb components in this case will be truly dumb and offer little benefit for them to be shared (what is worth reusing/sharing is the behavior, markup and styles, not the markup and styles alone) To make

Re: [ClojureScript] Two possible clojurescript errors with accompanying repos

2015-03-27 Thread David Nolen
First off thank you for putting examples like this together which don't involve any tooling other than ClojureScript itself. This saves me a countless amount of time by eliminating other variables. Both cases exhibit a subtle kind of user error - you are trying to load the browser REPL in a mode

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Jamie Orchard-Hays
Good articles. Thanks, Mike. In my apps I think of them as generic and specific, or something like that. IOW, I want some generic views that are dumb and know nothing about the app and can be used where ever I need them. They get composed into specific views. Jamie On Mar 27, 2015, at 10:12

[ClojureScript] re-frame newbie: render fn not called when state changed

2015-03-27 Thread Colin Yates
In the following code I would expect main-panel to be called when the target of ::selected-page changes but it isn't. I can confirm state has changed in the console.logs in 'application', but I don't see the console.log in 'main-panel'. I fully expect it is a numpty mistake but I can't see it

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Marc Fawzi
You can have your cake and eat it. Will present the complete approach on the next Reagent meetup in SF, and while we are talking about having a presentation about re-frame port of ANgular's phonecat example, the reusable smart components presentation will be based on RAW Reagent, nothing added.

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Khalid Jebbari
Staying tuned ! I'm not in SF, will there be slides or videos ? Le 27 mars 2015 à 20:16, Marc Fawzi marc.fa...@gmail.com a écrit : You can have your cake and eat it. Will present the complete approach on the next Reagent meetup in SF, and while we are talking about having a

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Daniel Kersten
I'm not in SF either (or even the same continent) so would very much appreciate slides/videos/blog posts. On Fri, 27 Mar 2015 at 19:20 Khalid Jebbari khalid.jebb...@gmail.com wrote: Staying tuned ! I'm not in SF, will there be slides or videos ? Le 27 mars 2015 à 20:16, Marc Fawzi

[ClojureScript] re-frame newbie: render fn not called when state changed

2015-03-27 Thread Mike Haney
Just from a quick glance, it looks like you forgot to use the bracket syntax when calling your page. Try [add-patient/page] instead of (add-patient/page). -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Marc Fawzi
Yes, for sure. On Fri, Mar 27, 2015 at 12:56 PM, Daniel Kersten dkers...@gmail.com wrote: I'm not in SF either (or even the same continent) so would very much appreciate slides/videos/blog posts. On Fri, 27 Mar 2015 at 19:20 Khalid Jebbari khalid.jebb...@gmail.com wrote: Staying tuned !

Re: [ClojureScript] re-frame newbie: render fn not called when state changed

2015-03-27 Thread Colin Yates
Yep, that works - thanks Mike! On 27 March 2015 at 20:19, Mike Haney txmikes...@gmail.com wrote: Just from a quick glance, it looks like you forgot to use the bracket syntax when calling your page. Try [add-patient/page] instead of (add-patient/page). -- Note that posts from new members are

[ClojureScript] re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Colin Yates
I have various chunks of reference data, say a tree or a list of _all_ (i.e. active and historical) entities. I then have various subscriptions which refine that view, for example: - only active - only active but including a given id In the handler I sometimes need access to this data, but

Re: [ClojureScript] Two possible clojurescript errors with accompanying repos

2015-03-27 Thread Erik Price
Would be more than happy to take a patch to make :simple + browser REPL work. As people get more particular about where they want to take ClojureScript we’re just going to have to get more patches from the community to go there (and the maintenance work to stay there). Okay, I’ll take a look into

Re: [ClojureScript] Two possible clojurescript errors with accompanying repos

2015-03-27 Thread David Nolen
Ok, browser extensions are a valid use case for desiring :simple. Would be more than happy to take a patch to make :simple + browser REPL work. As people get more particular about where they want to take ClojureScript we're just going to have to get more patches from the community to go there

Re: [ClojureScript] Two possible clojurescript errors with accompanying repos

2015-03-27 Thread jmckitrick
Thanks for taking the time to diagnose and explain. I'm glad it wasn't a boneheaded user mistake. So you are saying I can compile different parts of the classpath under different optimization settings, by stacking profiles, I assume? On Fri, Mar 27, 2015 at 12:23 PM David Nolen

Re: [ClojureScript] Re: [ANN] Synthread with Clojurescript support

2015-03-27 Thread Atamert Ölçgen
On Wed, Mar 25, 2015 at 3:24 AM, myguidingstar phuthuycuoimayhut...@gmail.com wrote: On Wednesday, March 25, 2015 at 5:37:59 AM UTC+7, Leon Grapenthin wrote: This seems like a thoughtful port. In your announcement, you should have mentioned that you have ported the library to CLJX, not just

[ClojureScript] cljsc/build or cljsc/watch surport sequence params ?

2015-03-27 Thread wewe Tom
cljsc/build or cljsc/watch surport sequence params ? if suported , I think it convenient to compose diffent build/watch. for example , I wrote a build file like this : ``` ;; modified from https://github.com/swannodette/mies/blob/master/src/leiningen/new/mies/release.clj (require

Re: [ClojureScript] Two possible clojurescript errors with accompanying repos

2015-03-27 Thread David Nolen
This is not a ClojureScript question anymore. Someone else can describe the nitty gritty Lein + cljsbuild details. David On Fri, Mar 27, 2015 at 2:33 PM, jmckitr...@gmail.com wrote: Thanks for taking the time to diagnose and explain. I'm glad it wasn't a boneheaded user mistake. So you are

Re: [ClojureScript] re-frame - sanity check for re-usable components

2015-03-27 Thread Daniel Kersten
Excellent, thanks! On Fri, 27 Mar 2015 at 20:00 Marc Fawzi marc.fa...@gmail.com wrote: Yes, for sure. On Fri, Mar 27, 2015 at 12:56 PM, Daniel Kersten dkers...@gmail.com wrote: I'm not in SF either (or even the same continent) so would very much appreciate slides/videos/blog posts. On

Re: [ClojureScript] Re: re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Mike Thompson
On Saturday, March 28, 2015 at 7:52:13 AM UTC+11, Colin Yates wrote: Hi Mike, yep, that is what I meant by I can work around this - the subscription code typically delegates to a 'plain' defn so I can retrieve the data from the db and call the same defn, but sometimes that jars a bit. :).

Re: [ClojureScript] Re: re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Colin Yates
I see, so a subscription is more than just a projection of the db, it has a life-time where as an event handler is about a snapshot in time (guaranteed to be now?). I wasn't asking about the mechanical reasons why they weren't appropriate, more the concept, which you explained - thanks. On 27

Re: [ClojureScript] cljsc/build or cljsc/watch surport sequence params ?

2015-03-27 Thread David Nolen
seqs are not supported for this use case since you can pass them to build a sequence ClojureScript source forms. You need to supply your own instance of cljs.closure/Compilable which abstracts multiple directories if you want this behavior. David On Fri, Mar 27, 2015 at 2:48 PM, wewe Tom

Re: [ClojureScript] React, ClojureScript, Data Vis Reagent SF Meetup Video (from 3/16/2015)

2015-03-27 Thread Daniel Kersten
Thanks for sharing this. On Fri, 27 Mar 2015 at 20:39 Marc Fawzi marc.fa...@gmail.com wrote: This is the video from our last Reagent SF Meetup. It shows the Minority Report like interactive Data Visualization by Weidong Yang as well as an intro to Reagent, the ClojureScript React wrapper,

Re: [ClojureScript] re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Jamie Orchard-Hays
My first thought about this is that you may run into problems with React's lifecycle. Wondering if that's true. On Mar 27, 2015, at 4:36 PM, Colin Yates colin.ya...@gmail.com wrote: The fact it is useful for me to do something not only discouraged but actively against the rules makes me

Re: [ClojureScript] Re: re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Colin Yates
Hi Mike, yep, that is what I meant by I can work around this - the subscription code typically delegates to a 'plain' defn so I can retrieve the data from the db and call the same defn, but sometimes that jars a bit. :). On 27 March 2015 at 20:47, Mike Thompson m.l.thompson...@gmail.com wrote:

Re: [ClojureScript] Re: re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Colin Yates
Is it ok to reference subscriptions in another subscription? I can't see any conceptual reason why not but better safe than sorry... On 27 March 2015 at 21:15, Mike Thompson m.l.thompson...@gmail.com wrote: On Saturday, March 28, 2015 at 7:52:13 AM UTC+11, Colin Yates wrote: Hi Mike, yep, that

Re: [ClojureScript] Re: re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Marc Fawzi
You need an Examples page that is hosted on a wiki that anyone can edit with a few folks you delegate to as moderators (to remove spam etc) Sent from my iPhone On Mar 27, 2015, at 3:23 PM, Mike Thompson m.l.thompson...@gmail.com wrote: On Saturday, March 28, 2015 at 8:22:30 AM UTC+11,

Re: [ClojureScript] Re: re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Jamie Orchard-Hays
Subscribing to subscriptions is very useful and works great. On Mar 27, 2015, at 6:19 PM, Colin Yates colin.ya...@gmail.com wrote: Is it ok to reference subscriptions in another subscription? I can't see any conceptual reason why not but better safe than sorry... On 27 March 2015 at

Re: [ClojureScript] Re: re-frame - rationale for not allowing subscriptions in handlers

2015-03-27 Thread Mike Thompson
On Saturday, March 28, 2015 at 8:22:30 AM UTC+11, Colin Yates wrote: I see, so a subscription is more than just a projection of the db, it has a life-time where as an event handler is about a snapshot in time (guaranteed to be now?). I wasn't asking about the mechanical reasons why they

[ClojureScript] Re: Sometimes can't update! Om cursor from within :on-change in render-state

2015-03-27 Thread Michael Joseph Rosenthal
after using lein-clean-m2 and deleting all my compiled javascript the errors were resolved. On Thursday, March 19, 2015 at 1:47:17 AM UTC+7, Michael Joseph Rosenthal wrote: I have an input component that looks something like: (defn handle-change! [e data edit-key owner] (if (= (type data)

[ClojureScript] Looking for some help with macros

2015-03-27 Thread Mike Rodriguez
I tried to post this once but I think it failed... The issue is your macro receives its arguments unevaluated by the compiler. In your example you are passing the symbol 'names' to the macro. At compile-time/macroexpansion-time you are expecting that 'names' will be resolved and dereferenced

[ClojureScript] Looking for some help with macros

2015-03-27 Thread Mike Rodriguez
You are calling a macro and passing it a symbol that refers to a var holding s vector of strings. The macro is given the raw symbol unevaluated and unresolved by the compiler. Remember macros receive their arguments unevaluated. Resolving symbols and dereferencing vars is part of *evaluation*.

[ClojureScript] Re: cljsc/build or cljsc/watch surport sequence params ?

2015-03-27 Thread wewe Tom
On Saturday, March 28, 2015 at 3:11:39 AM UTC+8, wewe Tom wrote: cljsc/build or cljsc/watch surport sequence params ? if suported , I think it convenient to compose diffent build/watch. for example , I wrote a build file like this : ``` ;; modified from