This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-24
Channels
- # admin-announcements (1)
- # aws (3)
- # beginners (52)
- # boot (150)
- # braid-chat (1)
- # braveandtrue (5)
- # bristol-clojurians (2)
- # cider (21)
- # cljs-dev (1)
- # cljsfiddle (1)
- # cljsjs (5)
- # cljsrn (4)
- # clojars (3)
- # clojure (236)
- # clojure-berlin (2)
- # clojure-czech (1)
- # clojure-madison (1)
- # clojure-russia (164)
- # clojure-sdn (1)
- # clojure-sg (2)
- # clojure-uk (64)
- # clojurescript (149)
- # core-async (31)
- # cursive (33)
- # datomic (2)
- # devcards (5)
- # funcool (3)
- # hoplon (142)
- # immutant (27)
- # juxt (7)
- # lein-figwheel (6)
- # liberator (6)
- # off-topic (4)
- # om (46)
- # onyx (26)
- # parinfer (5)
- # perun (56)
- # proton (6)
- # re-frame (19)
- # reagent (1)
- # remote-jobs (12)
- # ring-swagger (17)
- # slack-help (2)
- # spacemacs (11)
- # specter (1)
- # untangled (11)
- # yada (3)
so i just noticed that (div :class {“foo” (cell= foo?)})
doesn’t update dynamically but (div :class (cell= {“foo” foo? }))
does, is that correct?
the logic there needs to be very simple and not do any walking of the value or you could see performance issues at page load time
like if it has to walk every value looking for cells and then try to figure out how to make it into a cell
we want to minimize the amount of work that needs to be done to initialize and create new elements, which means simplifying the API there
this is especailly important in hoplon where you tend to allocate elements up front, statically
i think that’s OK
i just got the docs wrong
we could modify the :class do! method to do something special to accomodate that case, but then the API would depend on the do! method, which would probably be confusing
for each attribute/value pair hoplon uses a simple case analysis to determine how to do it
2. if the value is a cell then it adds a watch to the value and calls the do!
method for that attribute whenever the value cell changes
the idea is that there is no ambiguity there--the only sensible interpretation for an attribute whose value is a function is to set an event handler
@micha: i tried to document this at https://github.com/hoplon/hoplon/wiki/API-Documentation
@micha: but i think it could benefit with some fact checking from someone more across the internals like yourself
I missed the point about the distinction between cells and values in do!
there might be some other important points
@micha: also, i think you need to toggle on the hoplon repo in travis for my PR to work
it was using my account on my fork
but i don’t think that carries across
hmm, i wonder if travis has some way to allow organization access to an open source account?
not sure
but i assume the free version lets all the repo admins access?
@micha - the conditional macros look great! Did you make them different from the loop-tpl
on purpose? I recall loop-tpl
has a :bindings
argument in order to facilitate the HLisp calling convention and make it possible to use from HTML. Should the new macros also follow that route?
we could add in some argument parsing logic to support html attributes like loop-tpl, optionally
you should see travis do stuff in github the next time a PR goes up, if it’s working
@micha: yay! now we can start writing tests that could possibly fail
yeah, i can put up PRs for clj and cljs testing too
i’ve got all three in my project
if you just want to test functions and not DOM behaviour
but i was thinking of going through http://caniuse.com and comparing it against the HTML tag list
for the first test
Hey guys, have you considered switching to gitter? https://gitter.im
All the public rooms have unlimited history, and I think a lot of the newcomers can benefit from the wealth of information.
(not that we have many newcomers 😛 )
yup! In my company, one of the main reasons we hesitate switching to gitter is the fact that we have designers and marketing people who could benefit from the more agnostic approach of slack and hipchat.
chat history retention is why we don’t use slack at work
their paid plans are $$$
slack, for example, doesn’t require a github account
for something like hoplon that lives entirely in github, gitter makes a lot of sense.
anyway, i gotta cruise
see you all later
see ya man
@levitanong: are you here?
yessir
@raywillig: hello dude!
what’s up?
@levitanong: thanks again for brainstorming yesterday. as usual defelem ftw
awyis!
happy to help
so i was going through my project and realized I was changing every instance of (a … to (my-a
so would I need to refer hoplon excluding a in every on of them and then require the thing that has the new (a in it?
if you do want to override (a)
, then I do believe you have to.
which i think might be more work than just renaming 😛
i think it’s safer to use (my-a)
yeah. 😛
you can also do a find-replace all
if you use the right regex, you can do it with the press of a button
that looks about right!
omg it took me so long to figure out how to disable text wrapping in slack
so hard to read wrapped lisp code
out of curiosity, what IDE do you use?
hardcore
I've actually tried to go into vi, but I fell in love with Spacemacs' leader key. :p
so for this project i’m working on my client would like the effect where i display some partial results and as the user scrolls down, i display another one or two rows of results anyone have any thoughts on the “hoplon” way to achieve this affect?
i’m look at youse @levitanong and @micha lol
that's just to make sure the back button doesn't make you start over from the beginning
(defmacro case-tpl
"Conditionally displays templates. Delays evaluation of templates until flow is determined."
[value & clauses]
`(case-tpl* ~value
(fn [v#]
(case v#
~@(apply concat
(for [[value clause] (partition 2 clauses)]
`(~value (fn [] ~clause))))
))))
(defn case-tpl* [test-value case-fn]
"Resets current with appropriate tpl from cache.
cache is populated on demand, when tpl is not found for condition."
(let [cache (atom {})]
(with-let [current (with-meta (cell nil) {:preserve-event-handlers true})]
(do-watch test-value
(fn [_ t]
(println "case-tpl*" t (case-fn t))
(reset! current
(cache-tpl-replace! cache t (case-fn t))))))))
and I get core.cljs:99 Uncaught TypeError: Failed to execute 'insertBefore' on 'Node': parameter 1 is not of type 'Node'.
(defc c1 0)
(with-interval 1000 (swap! c1 inc))
(html
(body
(case= (cell= (mod c1 3))
0 (h1 "0 mod 3")
1 (h1 "1 mod 3")
(h1 "other"))))
@raywillig: The server roundtrip would be unnecessarily high if you pulled the rows one at a time. I’d recommend you consider decoupling the per-row appearance, and the infinite scrolling.
For example, just before you reach the bottom of the page, you get an additional 20 rows, but don’t display them immediately.
@roti: You can also look at https://github.com/hoplon/hoplon/blob/master/src/hoplon/core.clj#L170
and
https://github.com/hoplon/hoplon/blob/master/src/hoplon/core.cljs#L616
for something that uses cache-tpl-replace
. I expect, however, that @micha’s implementation will supplant both if-tpl
and switch-tpl
soon.