This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-04
Channels
- # beginners (31)
- # boot (24)
- # braid-chat (17)
- # cider (4)
- # cljs-dev (33)
- # cljsrn (5)
- # clojure (79)
- # clojure-austin (1)
- # clojure-poland (229)
- # clojure-russia (51)
- # clojure-uk (3)
- # clojurescript (68)
- # core-async (1)
- # core-matrix (1)
- # datomic (18)
- # editors (24)
- # emacs (7)
- # hoplon (118)
- # jobs (1)
- # jobs-discuss (1)
- # juxt (7)
- # off-topic (16)
- # om (121)
- # onyx (3)
- # parinfer (224)
- # protorepl (3)
- # re-frame (29)
- # reagent (1)
- # rethinkdb (2)
- # ring (1)
- # spacemacs (2)
- # untangled (182)
I’d like to get some thoughts: How possible do you think it is to extend formula cells such that all sources
of type Node
are placed in delay
? My thinking is, this will allow people to do (cell= (if a (div “true-tpl”) (div “false-tpl”)))
and possibly (cell= (map #(div %) [“a” “b” “c”]))
I'm wondering what's the recommended use of boot-reload
with Hoplon.
Having a full page reload is quite costly and the application also loses its state.
Does it make sense to have (reload :on-jsload 'hoplon.app_pages._index_DOT_html/init)
where the init fn generates the page, like
(page "index.html")
(defn init []
(html
(head)
(body ...)))
(init)
@alandipert: are you guys using flux at adzerk?
ok, just catching up on comments 😛
@micha: that last commit seems improve startup time slightly since the scripts were previously being removed from the body one at a time with calls to insertBefore. hopefully i haven’t introduced any other regressions with that pr, there might be additional cases i’m not considering.
just watched @onetom’s video with the FOUC ticket, i recall it being pretty egregious around the time that ticket was filed, but i don’t have any issues now.
i’m not sure what the contributing factors are (or whether the FOUC ticket should still be open), but suspect that emptying the body’s innerHTML in a single operation may help.
@jumblerg: we are still experiencing the FOUC, though it seems to happen a bit less often
@onetom: howdy! good to know. i suspect the way the application is written also makes a difference. let me know if that last patch helps.
one big issue we are facing is sometimes semantic ui kicks in noticeably later than the 1st render happens and our menu, top-nav bar and all that looks like shit without styling
but i can't just include a few lines of initial css to make it look reasonably okay, because most of the grid classes would be necessary from semantic-ui for that
so i've recently changed the logic to just show a spinner which has the necessary styles embedded in the pre-rendered html, BUT the spinner (pulsing ring really) stalls while the page is getting initialized... see it in action on: https://appboard.exiconglobal.com/
@micha @onetom i believe it’s javascript, im working on a hoplon semantic-ui library right now, and FOUC is still an issue
it also seems not all of the jquery from semui works as multimethods
you can see our spinner at https://app.adzerk.com
I havent yet tried pre-rendering (since it didnt work at all with polymer), I hope it works better with semui
@flyboarder: i don't think we are actually using any of the semantic-ui js. we have re-implemented those few things we needed directly in hoplon
@flyboarder: the method i pasted in the gist might work with polymer
Lol i didnt notice :css before, that’s a bit nicer than using :style
I usually use :class
oooo that is nifty!!!
right, but between class and css I shouldnt need style anymore 😄
no more strings!!!
@onetom: if you find a solution to your FOUC issue, please advise
@flyboarder: ok, i will share for sure if i manage to solve it
Hi folks! I want to watch a cell-data-structure nested value (the path is [:foo :answer]
) so that if the value is "hide bar"
, I change the value at [:bar :hide]
to true
. How can I do this within hoplon page? Thanks!
Hope it is enough clear... 😕
yes lens
say I have (defc {:foo {:answer nil} :bar {:hide nil}})
if an event make the value at [:foo :answer]
change to "hide bar"
, what would be like the fn that listens to this path and change [:bar :hide]
to true
(defc state {:foo {:answer nil}})
(defc= derived state #(update-in % [:bar :hide] (= (get-in % [:foo :answer]) "hide bar")))
(let [c (cell {:foo {:answer nil}})]
(defc= state c
#(let [hide? (= (get-in % [:foo :answer] "hide bar"))]
(reset! state (update-in % [:bar :hide] hide?))))
Thanks @micha!
ah still stuck
he is a more complete exemple
{"question-1" {:hide nil :q "Do you want to subscribe?" :choices ["yes" "no"] :answer nil :hide-ids ["question-2" "question-3"] :hide-if-values ["no"]}
"question-2" {:hide nil :q "Are you living in NYC?" :choices ["yes" "no"] :answer nil hide-ids ["question-3"] :hide-if-values ["no"]}
"question-3" {:hide nil :q "What is your email?" :answer nil}}
If the user click the radio button "no" at question-1, ["question-1" :answer] becomes "no".
for this question there is a special rule expressed by :hide-ids ["question-2" "question-3"] :hide-if-values ["no"]
my watch fn I would like to have, would grab all rules in all questions, and then wait for [* :answer]
values, if the match, the question with ids gets hidden.
In that case, if you answer is no for the first question, you don't get to see two others. If it is no for the second one, you don't get to see the third one...
I know it might be complicated...
yeah I could be I guess
still would not know how to achieve this.. 😕
(defc subscribe? false)
(defc in-nyc? false)
(form
(label "subscribe?")
(checkbox :state subscribe?)
(div :toggle subscribe?
(label "living in NYC?")
(checkbox :state in-nyc?)
...
(defelem checkbox
[{:keys [state] :as attr} _]
(hoplon.core/input
(-> (dissoc attr :state)
(assoc :type "checkbox"
:value state
:click #(with-let [_ 1]
(let [e (js/jQuery (.-target %))]
(reset! state (.is e ":checked"))))))))
Thanks though the admin must control the config of the form throught an external datastructure that I import
I can store the answers in a different map but my rules come form the datastructure
This is a chalendge. I guess your first suggestion was good though i want to be able to parse any rule from any question...
I am trying to get a general solution. :-/
I got :type "checkbox" etc also
Exactly.
I connect to google spreadsheet and then normalize the config flat data i get http://stackoverflow.com/questions/36365642/how-do-simple-data-normalization-in-clojure
Each line in the spreadsheetis a question
So i guess i should start with https://clojurians.slack.com/archives/hoplon/p1459799433003325 and see how i could generalize the update fn...
Much thanks for your help @micha 😄
any hoplon peeps using firebase?