Fork me on GitHub
#clojurescript
<
2020-02-01
>
borkdude10:02:53

Is it safe to say that self-hosted CLJS is also compiled, like normal CLJS?

borkdude10:02:06

or is self-hosted CLJS an interpreted CLJS?

thheller10:02:40

it is always compiled

potetm15:02:52

i think you mean transpiled troll

kappa 4
borkdude15:02:09

I guess self hosted just compiles to an in memory string which is then called with eval in JS as opposed to compiled to a file with a normal app?

mario-star 8
thheller15:02:51

pretty much yeah

4
mfikes18:02:02

Yeah, self-hosted mainly means that the compiler is available in the target environment. Otherwise (ignoring :advanced) it isn't much different.

jaime21:02:05

Hello! I'm trying to learn reagent and clojurescript. I'm just wondering if there is a better way to increment the currentTime of reagent/atom audio element here?

(defn forward [audio seconds]
  (let [currentTime (.-currentTime audio)]
    (set! (.-currentTime audio) (+ currentTime seconds))))

p-himik21:02:01

You do here pretty much 1-to-1 to what you would do in JS.

p-himik21:02:08

I don't think there's any better way.

👍 4
jaime21:02:05

Oh ok. I was thinking there might be swap! magic 🙂 Thanks!

Drew Verlee22:02:00

Anyone using tailwind css able to explain they appeal? It seems like a collection of css classes. Like it feels like it would be easier to just make some sort of edn to css processor and define your own style groupings.

polymeris22:02:36

It's not for every project, but I find it good for cases where you have to build custom styles (i.e. not use a framework like Bulma), but you might not know the structure/styling of everything in advance. You just start composing tailwind classes. If you use reagent (or any React wrapper, I am sure) components are already encapsulated, so there is a relative DRYness even if you don't create specific CSS classes. Once your design is more mature, or if you need something not provided by tailwind (e.g. a spinner), you can always add your own CSS classes which @apply the tailwind ones.

polymeris22:02:29

PostCSS is a bit fiddly, I'll give you that (plugins can crash it), but I am not sure it is bad enough to warrant writing a replacement processor.

Drew Verlee22:02:39

So tailwind is just css classes? And Bulma raises the abstraction higher by being html and css? Then would it be fair to say material UI goes even higher and is that plus JavaScript?

polymeris22:02:55

Bulma is also just CSS classes, IIRC. They are higher-level, though, representing finished components, and the composability of bulma classes is much more limited than Tailwind's.

polymeris23:02:47

You basically have to have the docs open and follow the examples to see how you can compose bulma classes. It's not obvious.

polymeris23:02:37

I haven't used material ui (not a fan of material design in general), but I would not like to be forced by my CSS framework to bring in JS. I think that (behaviour as driven by JS) should be a separate concern from styling, and I prefer to do it in cljs, of course.

polymeris23:02:54

That said, something like Bulma (or any other CSS framework without JS) makes sense if you just want to build something that looks reasonably OK, but don't care about exactly how it looks. Say a prototype or maybe internal tooling.

polymeris23:02:37

I have also used semantic-ui for that purpose before. (just the css, not the js)