Fork me on GitHub
#clojurescript
<
2022-10-28
>
ag00:10:11

what's the nicest way of dealing with promises and using await in clojurescript today? In the past I used promesa, is it still good or there's something better?

ag00:10:10

I have found Silva's blogpost https://clojurescript.org/guides/promise-interop I guess I'll use core.async

thheller05:10:08

no extra dependency, no extra code, just basic promise interop

thheller05:10:30

core.async might be overkill if you just want to await some promises

Lambdaphile00:10:13

Hi, I’ve been reading about Clojure and Elm quite extensively in last few days, and one thing that I find interesting is the “rejection” of components and components architecture in Elm. As a mainly React dev, I do think that components don’t scale very well (patterns like compound components help, but still…).

Lambdaphile00:10:48

In short, I wanted to ask: how are the things done in ClojureScript side?

Lambdaphile00:10:05

I know that there are libraries similar to React

Lambdaphile00:10:30

Are components the usual way to write in Clojure like in the JS world or some different approach is favored?

Ferdinand Beyer06:10:59

This is hard to answer, as ClojureScript itself has no opinion about that. ClojureScript is general purpose and not necessarily geared towards the web or React. To me (not knowing Elm), the question is also what you mean with “component” here. ClojureScript’s React wrappers like Reagent, Helix or UIx do talk about “components”, but usually prefer lightweight or even pure functions instead of OOP-style components. One popular framework is re-frame, which offers an event-based architecture and the “views” are (mostly) pure functions that return data in form of Hiccup. In Reagent’s terms (what re-frame uses), these are called “components”.

❤️ 1
pithyless12:10:48

Fulcro is one CLJS framework that I would say is component-centric. This approach helps create an expectation of how to structure both UI nodes and data flow. It's not all rainbows and unicorns, but having this expectation does help with having a proven way of building bigger apps (especially where data update patterns are more complicated than bare UIs), and leaning on this symmetry to have better dev tooling and auxiliary libraries (routing, etc). So, while there may be competing ideas in the space, I would not say component-centric architectures are rejected. https://book.fulcrologic.com/#_the_glue_ui_components

👍 1
Lambdaphile22:10:26

@U922FGW59 Thanks for the answer! Indeed—from what I’ve seen in the examples in re-frame docs—components in CLJS frameworks seem to be mostly pure.

Hankstenberg07:10:58

There's a very interesting new project for building native apps based on javascript: https://sockets.sh/

blak3mill3r16:10:16

Hello CLJSists! I have a need to show off some CLJS eye-candy. Can anyone point me to something publicly available that is a fancy user interface built as a CLJS SPA? I want it to be pretty...

chaos20:10:13

Hi, there appears to have been a change in behavior when compiling a cljs file for node with clojurescript 1.10.748+, the output dir defaults to .cljs_node_repl instead of out (the default according to some doc), pretty minor but nevertheless it seems inconsistent: https://ask.clojure.org/index.php/12335/clojurescript-cljs-main-compilation-recent-releases-create

chaos07:11:26

Hi @U050B88UR, I would like to bring the above to your attention please. It appears like a minor regression/bug manifested itself in a previous release. It is not clear to me what is the best way to report a cljs bug, and thus I'm going through to what seems a reasonable approach, ask-clojure (for stating the issue)->#clojurescript (for attracting some attention)->direct-message (as a last resort) in the hope of getting some feedback. Thanks

dnolen20:11:01

Thanks for the report I responded and opened a issue.