Fork me on GitHub
#clojurescript
<
2023-01-26
>
slk50011:01:05

how to print nested list in hiccup? I have found this function https://gist.github.com/semperos/807755/8c0405b38cc3f8aac276aa2b02d302f6789b6ee4 but Im looking for something simpler

p-himik11:01:00

Unclear what exactly you want. You can just nest the :ul and :li elements appropriately:

[:ul
 [:li "Item 1"]
 [:li "Item 2 with sub-items"
  [:ul
   [:li "Sub-item 1"]]]]

👍 2
hifumi12321:01:16

is it possible to use clojurescript as a "scripting language" in the sense of running node and supplying a cljs file directly instead of a compiled js file? i know babashka exists but i'd rather explore my options first, and my primary target is node

borkdude21:01:38

Yep, #C029PTWD3HR :)

hifumi12321:01:00

This is perfect. It's exactly what I wanted for running scripts. Thanks you two! I only saw the native binary babashka and somehow missed this one 🙂

🎉 2
James Amberger22:01:39

why is there helix and uix ?

p-himik23:01:57

At the very least, different approaches. The former uses macros to create code that AFAIK would be pretty much what an analogous JSX code produce. The latter uses Hiccup to generate React elements at run time.

Rupert (All Street)23:01:02

Here's my take: > Old react was object based and verbose to use. so reagent made it much easier to use, then re-frame wrapped around reagent to provide a framework for it. > > However, react modernised and created hooks, so a thin wrapper around react (like uix and helix) is all that is needed now. There is no framework (like re-frame) for uix/helix, so projects have to implement their own structure or use something like integrant (in frontend ClojureScript). Using uix allows you to use the existing react ecosystem easily from ClojureScript and easily create modular/reusable frontend code.

👍 4
skylize23:01:04

I planned on extending this with at least a bit of meaningful detail, but got distracted by totally unrelated things. Since others have jumped in already, here is just the short-and sweet (and slightly-sarcastic) response I was starting with: Because https://github.com/lilactown and https://github.com/roman01la each had separate ideas on how React should be integrated with ClojureScript?

kennytilton06:01:30

It's a Lisp thing. Half the people who discover Lisp immediately start work on their own implementation. In C.

grav07:01:20

There's also a UIx2: https://github.com/pitch-io/uix I believe v2 also uses macros, like helix. I'm not sure of the status of v1 vs v2.

Roman Liutikov08:01:07

the curse of Lisp is to blame for everything :) I recall both me and Will started working on our implementations around same time, back then it ended with hx and uix libraries, later hx transitioned into helix and uix went through a complete rewrite which is now uix v2 As for differences, I’m not sure about details, both libraries are pretty minimal, perhaps different syntactically, both are used in production. Pick yours and become a part of the curse :)

Roman Liutikov08:01:22

I know that Helix provides a bit of syntax sugar to make things nicer to use @U4YGF4NGM correct me if I’m wrong Oh, and uix can render on JVM, some people found it useful

tatut11:01:24

I’ve even made my own some time ago https://github.com/tatut/koukku (not suggesting anyone use that for real work)

👍 2
tatut11:01:29

you can get quite far with just a macro to compile hiccup into react/createElement calls

yes 2
James Amberger13:01:12

thanks all for another interesting discussion

👍 4
lilactown00:01:55

I think everyone here summed it up nicely 😄