This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-05
Channels
- # adventofcode (41)
- # bangalore-clj (4)
- # beginners (283)
- # boot (62)
- # clara (9)
- # cljsrn (3)
- # clojure (112)
- # clojure-brasil (1)
- # clojure-greece (1)
- # clojure-korea (6)
- # clojure-russia (99)
- # clojure-spec (29)
- # clojure-uk (12)
- # clojurescript (34)
- # clojurex (5)
- # core-logic (1)
- # cursive (31)
- # datomic (30)
- # devcards (5)
- # editors (19)
- # emacs (31)
- # events (5)
- # garden (4)
- # hoplon (137)
- # lein-figwheel (3)
- # luminus (4)
- # mount (7)
- # off-topic (7)
- # om (18)
- # om-next (3)
- # onyx (88)
- # proton (1)
- # protorepl (6)
- # re-frame (48)
- # reagent (15)
- # spacemacs (41)
- # testing (1)
- # untangled (2)
- # yada (18)
@alandipert: too bad you didn't get the nsf grant for it.
@micha: yeah, I'd definitely appreciate that. the issue is that I'm afraid to make design decisions because I'm not sure if these decisions will scale, and I'll need to rewrite everything later after a mess of spaghetti code. I don't need some special library, it's about how to conceptualize design and separate concerns.
it's easy to make an incomprehensible mess in a real spreadsheet, and it's the same with Javelin.
i guess the one rule of thumb that is pretty much always applicable is to make small formulas
if a formula gets large you can always factor it into regular functions and a small formula that composes those
like when i look at my namespace will all the little formulas it's pretty obvious where some unexpected result came from
bootstrap is not ideal because it precludes a clean separation of the low level from the upper layers
like if you compose this bootstrap list item in this bootstrap list structure you need to add a special wrapping div
like i'll extend the base elements with ones that are specialized for the ui in this application
this imposes even more constraints, which allows another layer of default settings and so on
using macros makes it easy to override the boilerplate default settings when you want to
that's the entry point for https://app.adzerk.com
vs. "registering handlers" for routes and/or events
this seems to be what people want when they say they want an architecture
i think, because most web type frameworks tend to orient around these
it's insane to imagine organizing a web app as a set of function calls lol
and yet, we do it
yeah the straw man framework
here is the source for the login screen: https://gist.github.com/micha/511a30686a9545aa740ed841480016e9
that's what you'll see if you go to http://app.adzerk.com
but it's ok, because the boilerplate stuff and the special unique stuff can coexist and compose with each other without issues
this is an example of the layer 1 type code: https://gist.github.com/micha/1f547325190c9c85aaf180002ff944f3
hoplon/ui should be much better than what i have there with the twitter bootstrap and whatnot
and here is the next layer up, layer 2: https://gist.github.com/micha/0fc78e4fa3112efaf1b621edac715fbf
notice we have some macros in use there, things to make it easier to see what's going on
Wouldn't syms1 & syms2 be identical and hence the intersection effectively be a no-op? Is something magical happening to bindings that means the destructure somehow alters it (dynamic var?)
agree
boot.user=> (destructure '[[x & xs] [1 2 3 4]])
[vec__1369 [1 2 3 4] x (clojure.core/nth vec__1369 0 nil) xs (clojure.core/nthnext vec__1369 1)]
it takes a binding vector and produces a binding vector suitable for let*
boot.user=> (->> '[a {:keys [foop]} [x y & z]] destructure)
[a {:keys [foop]} [x y & z]]
yeah it wants the values also
and if you don't give it exactly what it wants, it's not especially vocal lol
(->> '[{:keys [foop]} {:foop 123}] destructure)
=>
[map__35368
{:foop 123}
map__35368
(if (clojure.core/seq? map__35368) (clojure.lang.PersistentHashMap/create (clojure.core/seq map__35368)) map__35368)
foop
(clojure.core/get map__35368 :foop)]
yeah micha's thing had an odd number of items, probably threw it off
oh right
lol that's great
lisp did it
mad props @sbondaryev
has anyone experimented with custom error types in cljs land?
@micha i’m well on the way to organising my app in a similar way
no “strategic macros” yet, but the 3 levels are more or less there
actually, making DOM i’m now finding pretty easy
it’s third party libs and snippets now that i’m not always sure the best way to bring into hoplon
hi @leobm, welcome 👋
@micha is ther a way to get back the original removeChild etc. methods from js/Element?
not sure if there is some JS backdoor i am missing
@alandipert https://github.com/hoplon/hoplon/blob/master/src/hoplon/core.cljs#L102-L106
oh duh
maybe they should just be public?
workaround:
(defn removeChildNative [obj child]
(.call @#'hoplon.core/removeChild obj child))
(defn appendChildNative [obj child]
(.call @#'hoplon.core/appendChild obj child))