This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-04
Channels
- # admin-announcements (9)
- # beginners (40)
- # boot (61)
- # cider (6)
- # cljsrn (5)
- # clojure (65)
- # clojure-gamedev (6)
- # clojure-greece (8)
- # clojure-ireland (1)
- # clojure-portugal (5)
- # clojure-russia (46)
- # clojure-uk (38)
- # clojurescript (177)
- # core-async (9)
- # cursive (17)
- # datomic (6)
- # dirac (8)
- # emacs (5)
- # error-message-catalog (8)
- # hoplon (248)
- # ldnclj (11)
- # ldnproclodo (1)
- # lein-figwheel (36)
- # leiningen (12)
- # mount (2)
- # off-topic (3)
- # om (26)
- # onyx (12)
- # perun (2)
- # planck (26)
- # re-frame (62)
- # reagent (55)
- # remote-jobs (2)
- # rethinkdb (1)
- # ring-swagger (14)
- # spacemacs (47)
- # untangled (69)
@micha: That is weird. Using env lib, I use to have bind KEY_1 to KEY_2, but now KEY_2 has its own value, still, when I do boot make-war, seems KEY_1 var is used for KEY_2.
Or maybe I'm wrong...
I am wrong...
Still can't use heroku var. Brings back default string var from my env.cljs
Yes I confirm.
It seems I can't read Heroku's environment variable or that defaults in (env/def...)
has the priority
@beatngu13: i think because there isn't an invocation of the target
task in the build.boot, and target-by-default is disabled in the template's boot.properties
@beatngu13: you can do boot prod target
to see output
(we should probably add target
to the prod task)
but yes, for local dev boot dev
should be sufficient
boot prod target
would give you files you can FTP/scp etc to host statically somewhere
@beatngu13: glad you like it btw. bring it with the questions 😄
Do you guys know if there’s a size limit for castra’s RPC payloads?
welcome to the group, @syk0saje!
@levitanong: no limit, since the payload is in the POST body
i guess there is a practical limit since the body is parsed into objects that must fit in memory
Oh sorry, I meant response. My team and I seem to be hitting some kind of size limit when the server is trying to send something.
We checked the castra source and found a 4096 byte thingy
Bit stream
It shows up as a generic server error.
None at all. :( it's weird because the error object has an empty serverStack property
Okay hang on, will do
No exception from the server.
from the terminal, i mean
cljs$core$ExceptionInfo {message: "Server Error", data: c…s.c…e.PersistentArrayMap, cause: cljs$core$ExceptionInfo, name: "Error", description: undefined…} "Error: Server Error
at new cljs$core$ExceptionInfo ()
at Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 ()
at cljs$core$ex_info ()
at castra$core$make_ex ()
at
at
at
at Object.<anonymous> ()
at fire ()
at Object.self.fireWith [as rejectWith] ()” null
This is a cause of one nesting level only: cljs$core$ExceptionInfo cause : null columnNumber : undefined data : cljs.core.PersistentArrayMap description : undefined fileName : undefined lineNumber : undefined message : "Server Error" name : "Error" number : undefined serverStack : null stack : "Error: Server Error↵ at new cljs$core$ExceptionInfo (http://localhost:8765/index.html.out/cljs/core.js:32838:10)↵ at Function.cljs.core.ex_info.cljs$core$IFn$invoke$arity$3 (http://localhost:8765/index.html.out/cljs/core.js:32914:9)↵ at cljs$core$exinfo (http://localhost:8765/index.html.out/cljs/core.js:32900:26)↵ at castra$core$make_ex (http://localhost:8765/index.html.out/castra/core.js:54:34)↵ at http://localhost:8765/index.html.out/castra/core.js:142:46↵ at http://localhost:8765/index.html.out/castra/core.js:195:56↵ at Object.<anonymous> (http://localhost:8765/index.html.out/castra/core.js:199:3)↵ at fire (http://localhost:8765/index.html.out/jquery.inc.js:1037:30)↵ at Object.self.fireWith [as rejectWith] (http://localhost:8765/index.html.out/jquery.inc.js:1148:7)↵ at Object.deferred.(anonymous function) [as reject] (http://localhost:8765/index.html.out/jquery.inc.js:1237:34)" status : 500
@thedavidmeister: I’m looking in to Rethinkdb and Hoplon but I’m not very far with it yet - looks like a good fit - Keep me posted on your progress
@tbrooke: this is my progress, pretty much nothing yet 😛
@levitanong: with a curl request, here's the output:
@levitanong: we'd need to get the exception to print in the terminal to see
@micha can you point me to some resource for middlewares? I’m woefully out of my league here 😛
My first guess is to look into handler.clj
specifically with the castra/wrap-castra
stuff
presumably an exception is being thrown elsewhere, or you'd get the stack trace in the client
(-> app-routes
(castra/wrap-castra ‘app.api)
(castra/wrap-castra-session "a 16-byte secret")
(d/wrap-defaults d/api-defaults)
(d/wrap-stacktrace))
like so?(def app
(-> (foo)
(bar)
(wrap-stacktrace)))
or
(def app
(wrap-stacktrace (bar (foo))))
the two are equivalentthanks 😄
not getting anything in the terminal though
could it be that it’s not exactly a server thing?
I’m trying both wrap-stacktrace and wrap-stacktrace-web
yeah, none of the three seem to be printing anything out in the terminal
could something else be catching it?
also, @syk0saje is working on a simple case so you guys can demo it
how do i get castra to add transit writers?
@thedavidmeister: i don't think it's possible currently. i think we may want to add some atoms to castra.core that users can swap handlers onto
then we can pass the atom contents to t/reader and t/writer at https://github.com/hoplon/castra/blob/master/src/castra/core.cljs#L109-L110
someone contributed this recently to https://github.com/alandipert/storage-atom/commit/7afd495eb3e7f450175d6b19c96eb2c15b49bbd2
@alandipert: kk, i’ll just try converting datoms to a straight hashmap
@alandipert: ah, even if i do that, it just fails on my own defrecord
so is castra not able to handle defrecord
and deftype
?
but you can normally extend it to work with that right?
mmm, unfortunately i can’t really use castra with my data then 😞
do they have an atom or something?
if they have an atom of handlers then we don't need to modify castra to fix up the transit function calls
so i can pass castra a string?
i get this
so how do i make middleware to do serialization?
i think micha's point is that you can use castra to move values around, like strings
you would wrap that with middleware that assocs the clojure forms onto the request :foo
key then
ah yeah i get it
I had a philosophical question, apart from performance, why not have a system which takes a model and a transform function of (model -> dom representation) and re-renders the lot on any model change? What does cell and cell= give you over that model?
and there are things in javascript-land that are not exposed to your program in any useful way
but a retained mode rendering surface like the dom cannot be managed that way without a lot of duct tape
because you're building a retained mode thing on top of a false immediate mode thing that's on top of a real retained mode thing
you need to have your code inspect the state of the dom elements before they're destroyed and stuff
the essential difference between vdom and hoplon is that hoplon is fully lisp, so you can use closures and scopes
i can't think of a single time i made a clojure program that had all the data in a single var
@levitanong: found that if i commented out wrap-castra-session in handler, the problem goes away
we have discussed in the past that maybe a vdom is a useful thing to embed in a hoplon program
similar to the architecture of emacs, it is a retained-mode system in which there are immediate-mode "holes"
one of the illuminating things is "objects that know about themselves"
like the case of the row in a table with a "delete" button
there are a few ways to do this and they seem all to correspond to different ways of attacking the problem
the vdom way is manage a namespace of events to virtual objects and to capture all events
the jquery way is to navigate tot he parent and delete it from the dom
the hoplon way is to remove the domain object from whatever cell its in
the cell-based vdom thing would need system #1 probably, virtual objects would need a way to refer to themselves
could be, would then need to tie in a system for fixing up paths when a thing gets removed or added
the other part would be managing the dom objects without leaks, so you'd need a pool of them probably
also a pool for the events you're intercepting
schemes like this seem to converge on react
never bad to do experiments tho. who knows, maybe a thing with the affordances of both hoplon and react is possible, just takes a new perspective
i just took a shower, and was thinking about how awesome browsers could be
that's really the main hoplon limitation, that browsers aren't more awesome
they don't have weak references, and the dom attributes aren't cells
if cells and proper GC were in at the browser level, we'd have an amazing system. lisp-machine like
instead they spend all their time doing dumbo syntax things in javascript 😞
vdom schemes seem to diff the vdom, i wonder if its better to cache the previous model/vdom result fragment, and just compare the model
that's definitely how browsers themselves work
like HTMl rendering engines work like that
if the rendering engine captures the transform function from model -> VDOM should be fairly trivial
cells and ratoms are good, but in my instance i think the simplest conceptual model is to regenerate all from data every update
Any ideas why running a jquery plugin using interop works, but when i try to do the same thing as a do! multimethod, the plugin seems to do nothing? Has anyone else run into this problem before?
it’s fairly simple js
How is validate used?
Could you also link the plugin documentation?
@alandipert: reading your remarks above… i've been wondering if there’s some way to add weak reference emulation for event handlers through the hoplon layer
if hoplon exposed an add-event fn or wrapped the existing addEventListener on elements, and could detect when those corresponding elements were attached and detached to the dom (maybe via mutation observers), perhaps it could call removeEventListener for elements as they were detached.