helix

https://github.com/Lokeh/helix
Luis C. Arbildo 2020-02-28T01:53:45.094700Z

@lilactown Thank you!

Luis C. Arbildo 2020-02-28T14:51:14.094800Z

Good day @lilactown! Can you explain this part? Don't get it but work neat!

Derek Passen 2020-02-28T18:02:04.095800Z

I believe it’s because :values and :key are known at macro expansion time

Derek Passen 2020-02-28T18:02:38.096600Z

The passed in props are only known at runtime and being turned from js-objects into cljs-objects via the bean function

lilactown 2020-02-28T18:04:19.096800Z

yeah, there I’m using this library: https://github.com/mfikes/cljs-bean

lilactown 2020-02-28T18:05:31.098Z

to convert the JS object passed back from the react lib, I wrapped it in a bean which will convert it to a CLJS map-like thing at the top level

❤️ 1
lilactown 2020-02-28T18:06:03.098700Z

I then also converted the :props value to a bean, and finally the :style value in the props

Derek Passen 2020-02-28T18:29:13.098900Z

Glad I’ve internalized it

Luis C. Arbildo 2020-02-28T19:03:17.100Z

So ... will I always have to use cljs-bean when I want to pass props to external libraries?

lilactown 2020-02-28T20:11:16.100600Z

@luis.cairampoma119 no

lilactown 2020-02-28T20:11:39.100900Z

the library you’re using uses a very complex pattern here

lilactown 2020-02-28T20:12:10.101500Z

you hand it a function that returns a component, and then it gives you the props to pass to your component

lilactown 2020-02-28T20:12:50.102300Z

if you are using external library components that pass you data/props/etc. frequently, then you will need to handle that data appropriately

lilactown 2020-02-28T20:13:11.102800Z

if you want to dynamically pass props to a component in helix, it must be a CLJS map-like thing.

lilactown 2020-02-28T20:14:22.104100Z

so the complicated mess is boiled down to: 1. library gives you props data 2. turn props data into a CLJS map structure 3. pass it to your component when you run into patterns like that, then yes you’ll probably want to use cljs-bean

Luis C. Arbildo 2020-02-28T20:24:57.104600Z

@lilactown Nice explanation, you are the best!

lilactown 2020-02-28T20:25:22.104800Z

you’re welcome 🙂

Luis C. Arbildo 2020-02-28T20:26:32.105700Z

btw, I have seen a lot of libraries called 'Helix', you did think in change the name?

lilactown 2020-02-28T20:29:43.106Z

hm, what other libraries?

Luis C. Arbildo 2020-02-28T20:35:40.107Z

the two first are the most problematics

Luis C. Arbildo 2020-02-28T20:36:59.108100Z

another day I wanted to share your Helix with my friends and shared the second repo XD

Luis C. Arbildo 2020-02-28T20:37:13.108300Z

😅

lilactown 2020-02-28T20:37:40.108600Z

those are all pretty distinct from what my library does

lilactown 2020-02-28T20:38:19.108900Z

googling “helix clojure” has my lib as the first result

🤘 3
lilactown 2020-02-28T20:38:23.109100Z

so I’m okay with a bit of collision

👍 1