This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-20
Channels
- # aatree (257)
- # admin-announcements (13)
- # beginners (3)
- # boot (327)
- # cider (2)
- # cljs-dev (1)
- # clojure (127)
- # clojure-art (72)
- # clojure-russia (273)
- # clojure-sg (1)
- # clojurescript (39)
- # cursive (8)
- # datomic (6)
- # editors (2)
- # emacs (4)
- # hoplon (261)
- # immutant (2)
- # ldnclj (15)
- # liberator (10)
- # luminus (1)
- # off-topic (8)
- # om (9)
- # parinfer (1)
- # re-frame (11)
- # reagent (2)
- # yada (9)
I've reworked castra-chat to use the current hoplon-castra template: https://github.com/laforge49/castra-chat
@laforge49: the wiki page is great
Mostly I'm going to have lots and lots of questions going forward. But I'm more than happy to create demos and docs as I learn.
if you could file an issue with the boot project with a stacktrace that would be awesome
I am in the process of building a db of my own: https://github.com/laforge49/aatree
@flyboarder: https://github.com/degree9/silicone excites me too because i've ditched material ui a year ago in favour of semantic ui, because at that time material ui was just not mature enough (neither our clojure knowledge to integrate js libs) by any chance do u have any example which uses silicone?
@laforge49: u made a very informative and attractive intro for aatrees! do u know http://picolisp.com/wiki/?home ? it's a lisp built with 1st class db support. certain style of symbols are pointing directly into the db on disk, but they are treated equally with symbols bound to in-mem values.
@onetom: yes and no, im refactoring all the code right now but our flagship product is using it, it’s a very basic state right now and highly broken but most of the repo’s under https://github.com/degree9 are related the core project is https://github.com/degree9/theLounge
by the end of the year i’d like the full alpha working
@micha I have added issue 80: https://github.com/hoplon/hoplon/issues/80
I've also found that things are working better now, so I simplified the wiki page: https://github.com/hoplon/hoplon/wiki/Running-on-Windows
@onetom: im also interested in refactoring the importing so all the polymer imports are part of the static page prior to hoplon loading
not sure im using bower
and are you thinking about using it as is or hoplonifying the behaviour parts and just use the CSS?
@laforge49: the init-params shenanigans is no longer necessary with boot-jetty?
@onetom: well the idea is that you are able to select the exact components you want to load from the library so you dont need all of it
micha gave me some direction on fixing the interop between hoplon and polymer but most everything work the hoplon way
my db is still in the toy stage. takes a lot to move it forward. Having an haplon front end will help!
@flyboarder: if u could keep the development open, we would very like to be helping out
@onetom @micha all our source code will be open the idea is a community developed infrastructure automation software
getting it up and going is the current in progress, the libs we make will be for everyone 😀
@laforge49: is the idea to have clojure data that might not all fit in memory but can be lazily evaluated and modified?
@onetom: silicone 0.3.0
was pushed ill throw together a little sample app sometime
looking at the castra-chat, my first question is "must we poll for notifications?" I see a 200 ms poll loop. Ouch!
@micha I found this and was wondering if any work was done integrating hoplon with websockets: http://hoplon.discoursehosting.net/t/polling-vs-server-push/227/11
The alternative of course would be to aggregate events on the server side for each client and have the client fetch them by polling. Then at least there is a single pole rather than one for each possible event. For reliability, each poll could also serve as an ack previously received events. Numbering events per destination client means you can ack an event and all prior events, so the response would only contain higher events and the acked events get dropped.
So it looks like a first project would be a smart chat which works this way. Messages are then only sent once, though batched.
Oh, I also found this from not too far back: http://clojurians-log.mantike.pro/hoplon/2015-11-06.html
@tbrooke @alandipert What is the latest on integrating haplon and firebase? Any progress?
@laforge49: there is an example app using hoplon with websockets on https://github.com/staltz/flux-challenge/tree/master/submissions/mynomoto
@mynomoto Impressive. And beyond what I want to attempt at this time. I just lack the background. I'll stick with castra for the time being. Enough to learn there and I really want to get back to working on my own stuff. On the flip side, websockets are the obvious way to go and I'd love working on some joint projects, especially small ones.
Yeah, maybe some simple examples using websockets, sse with hoplon could be useful, including the server side. Right now I lack the time to do that but if you try and get stuck I should be able to help.
@laforge49: i like the idea of aggregating
castra-chat demo question--about defrpc: What is that vector at the beginning of the defrpc body? (defrpc get-state [& [user]] {:rpc/pre [(nil? user) (logged-in?)]} (let [user (or user (:user @session)) users (->> @db :users keys sort) convos (->> (->> @db :messages keys (filter #(contains? % user))) (select-keys (:messages @db)) (map-v (comp reverse (partial take 10))))] (when user {:user user, :users users, :messages convos})))
the idea is that you could have rpc functions that are composable, or you can call them from the repl
so if you have an rpc endpont foo
that calls another endpoint bar
internally, the preconditions are only applied to foo
this way you can compose them without needing to mock state or carry global state around
so the client will let the user log in, and then in the app there are states that depend on who the user is
I did find this in castra.core:
(when pre#
@(when pre [`(assert pre)])
but had not yet figured out pre#. Your comment helps.
but the "command" (the rpc function body) is completely decoupled from the response "query"
separating the rpc/query into metadata on the rpc function has the advantage that the function can return something else when called as a regular function
which is good because on the server you have synchronous access to the function and can catch exceptions synchronously
so it's good to have that, like for example when a new user registers for the first time
you generally want to create their user data in the database, and then log them in in one go
most web apps don't do this because it's problematic with the way they do authentication
the :rpc/pre
is an expression that is evaluated in the context of the rpc function body
so the same for :rpc/query? just add another key to the dictionary where :rpc/pre is associated?
get-user
is the endpoint that returns a query over the database for the current user's data
I notice the .hl file does not have any response logic tied to the forms except for the rpc call.
like it's good to separate the comand from the query, because then in the client the thing that sends the command to change the age doesn't need to know about the things that will update as a result of the age in the user cell changing
however, the piece of program that sends the command usually needs to handle errors locally
it was removed from http://hoplon.io at some point
so I take it there is some library function somewhere which gets that promise from a command.
this? (def handler (-> app-routes (castra/wrap-castra 'demo.api.chat) (castra/wrap-castra-session "a 16-byte secret") (d/wrap-defaults d/api-defaults)))
(form
:submit #(.fail (log-reg! @user @pass @pass2) (fn [& args] (.log js/console "error!"))))
(form :submit #(log-reg! @user @pass @pass2) (div (label "Username") (input :type "text" :autofocus "autofocus" :value user :change #(reset! user @%))) (div (label "Password") (input :type "password" :value pass :change #(reset! pass @%))) (div :toggle register? (label "Confirm") (input :type "password" :value pass2 :change #(reset! pass2 @%))) (button :type "submit" "submit") (a :href "javascript:void(0)" :click toggle-register! (text "~{reg-link-text}")))
since the servlet is delegating to a clojure function to handle the request you can do lots of interesting things
yeah but I thought the promise was handled in the .nl code somewhere. Or does that also use ring?