Fork me on GitHub
#hoplon
<
2017-01-12
>
thedavidmeister02:01:06

@micha so, we talked a bit a while ago about how to organise elements/components in a hoplon project

thedavidmeister02:01:20

@micha how do you organise your on!/do! extensions?

micha02:01:29

@thedavidmeister i have been defining them in the component namespaces when it's an attribute that launches a component

micha02:01:35

like for instance tooltips

micha02:01:25

since the tooltip is absolutely positioned by the tooltip plugin, it doesn't really make sense to have a separate custom element for it

micha02:01:54

i would do like (div :tooltip (cell= (when foo "this is some text") ...

micha02:01:01

or something like that

micha02:01:15

so that do! method would be in the tooltip namespace

micha02:01:45

but there are also some do! attributes that are for working around issues with browser compat or other hacks you need in your specific application for whatever reason

micha02:01:57

i make a "hacks.cljs.hl" namespace for those

thedavidmeister02:01:05

so then do you just require that hacks namespace in the .hl file?

micha02:01:18

yeah i require it in my main entrypoint .hl file

micha02:01:25

in the index.cljs.hl

thedavidmeister02:01:12

i'm just a bit concerned about not getting clues from the compiler if i use something that doesn't have the right implementation loaded at that point

thedavidmeister03:01:39

mostly for the hacks, not the components

alandipert03:01:12

that's a cool thing about the new first-class attributes

alandipert03:01:31

they can be required/referred/documented just like any other def

alandipert03:01:08

vs. maintain a mysterious relationship to elements through the multimethod

thedavidmeister03:01:41

@alandipert oh ok, that sounds cool

thedavidmeister03:01:53

you'll have to show me how that works sometime 🙂