Fork me on GitHub

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


or is self-hosted CLJS an interpreted CLJS?


it is always compiled


i think you mean transpiled troll

kappa 1

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 2

pretty much yeah


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

Jaime Sangcap21: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))))


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


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

👍 1
Jaime Sangcap21:02:05

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


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.


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.


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.


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?


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.


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


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.


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.


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