This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-28
Channels
- # admin-announcements (1)
- # announcements (1)
- # beginners (17)
- # boot (29)
- # cider (8)
- # clojure (87)
- # clojure-czech (2)
- # clojure-nl (2)
- # clojure-russia (108)
- # clojurebridge (9)
- # clojurescript (34)
- # cursive (5)
- # datascript (15)
- # devcards (14)
- # editors (6)
- # hoplon (121)
- # jobs (7)
- # ldnclj (22)
- # onyx (2)
- # re-frame (31)
- # reagent (43)
- # testing (2)
and i never really wanted to have any so im a bit hesitant to dig deep into it instead of spending my life on cleaner, simpler systems... 😕
Hi I see in castra there is something like :rpc/query and also it seems it is after method body is evaulated. What is a rationale behind that :rpc/query - is it about isolating queries for results to be placed into response from method body only ? Are there some examples taking advantage from this ?
@voytech: the purpose of the :rpc/query
annotation is to decouple the http response from the value returned by the function
in order to facilitate this kind of composition, most importantly for example when one rpc endpoint calls another, we only evaluate the preconditions/annotations on the endpoint that was actually called from the http client
that is to say if rpc endpoints f
and g
have :rpc/pre
annotations, and f
internally calls g
, when f
calls g
the :rpc/pre
will not be evaluated
the overall shape of my backends is like clusters of rpc functions that all have the same query
@micha ahh that is why there is condifiont on a request binding in the macro (in make-arity)
@micha if in request context then the body is evaluated and a response is returned using query.
@micha I'was recently had question on discourse hoplon about castra and http codes support.
@micha because as far as I saw it uses only 500 and 200, and I was tarting to thing about authentication in Castra. And I think for me this is something what stops me to d othis on castra level
@micha forgot. Thanks for great explanation of :rpc/query, and forgive so many typos (I didn't used to my new laptop's keyboard at work 😞 )
the status code is simply a signal of whether the operation succeeded at the application layer
the nature of the problem is best expressed via the exception that's thrown and returned to the client
@micha Thanks Micha I think I need to think about it. Currently I have authentication before castra endpoints. There is friend for security. It will let RPC calls only if authenticated, or if RPC calls can be public it also will let it go.
@micha yes it does. And im using it. But now Im not sure yet - suppose we are doing castra call and we are not yet autenticated. It will return eg 401 but does castra on frontend handle it correctly - as it doesnt come from castra but from friend handler.. i need to check. Maybe it is focused only on 200 or 500. Maybe it will require some additional work.
Hi. I am trying to wrap my head around loop-tpl* and understand how it removes no longer needed DOM nodes when the wrapped items
get shrinked - https://github.com/hoplon/hoplon/blob/2d68aef74c00b2bbe2231973df08c08b5de32e80/src/hoplon/core.cljs#L564
so there are two parts to think about: the items that are in the dom and the items that are in the pool
oh, so on-deck
is an DOM element pool that get moved into the current
cell and when they are no longer needed (`items` get smaller) they are returned to the pool (`on-deck`)?
so in case I get a very long seq in the template and I replace it with a much smaller seq, those DOM elements won’t be deallocated?
I want to create an element which will remove the child node (you might recall my previous question some time ago on ng-if
)
but I really need to remove the DOM element as it might be quite a big DOM sub tree (like in a UI tab content when I switch to another tab)
loop-tpl exists to provide way to move things into and out of the dom without deallocating them
if you create things in there that will hold references to other things so they can't be garbage collected then you will have leaks
there's no way for hoplon to know what you created in there, or how to deallocate what you made
piotrek: i don't really know all the internal details of GC in browsers, and the known bugs etc