Fork me on GitHub
#reagent
<
2017-05-29
>
eoliphant15:05:22

Hi, I have a style question. I’m using a pretty awesome react UI library grommet (highly recommended, especially for people like me who suck as UI stuff), to make it easier to use I decided to write a wrapper lib that (def)s all the symbols, etc., in the same vein as soda-ash (a wrapper for semantic UI React). With it in place you can do stuff like [MyComponent …] However in looking at the reagent shorthand I also created a variation that allows you to [:> MyComponent ...] Just wondering what folks think is better. Even though it’s a few more chars, I’m leaning towards the latter at the moment as it signals the reader that your’e dealing with a native React component. Thoughts?

pesterhazy15:05:13

I think both variants are fine

pesterhazy15:05:02

Grommet looks pretty polished. What's its value proposition?

gadfly36116:05:31

@eoliphant I agree with @pesterhazy, both variants make sense 🙂 If you use :>, I would add a link to "Better interop with native React" section in https://reagent-project.github.io/news/news060-alpha.html in your readme ... I find many people end up asking what :> means and it is hard to google

eoliphant18:05:41

Ok, I’ll be sure to add the syntax ref

eoliphant18:05:22

@pesterhazy I gather that they’re attempting a pretty complete set of components along with complementary guidance on UX best practices, etc etc. And again, for someone like me who can’t draw cows, it’s pretty good. I’d been using Semantic UI a lot for similar reasons, but these guys seem to have gone a step further..

pesterhazy18:05:51

It looks great for sure and feels snappy

pesterhazy18:05:25

My concern would be running into a limitation, and getting stuck fixing it within the framework

pesterhazy18:05:31

Or there's a missing UI element, and if I just build my own calendar widget or whatever it sticks out like a sore thumb

gadfly36118:05:00

@eoliphant grommet looks pretty awesome! I'd be excited to use a wrapper lib

gadfly36118:05:21

In general with frameworks, I agree with @pesterhazy (i tend to write most css by hand) .. but at the same time, many people use them and they are great for spinning up things fast, so i think there is a place for them

eoliphant18:05:38

yeah that’s always the tradeoff @pesterhazy I actually did widget inventory against some of the projects I wanted to try it on. and it lined up pretty well. But yeah, youre on the hook for making any custom stuff look consistent

pesterhazy18:05:32

Widget inventory sounds great

eoliphant18:05:46

and for me the out of the box L&F is really nice, so it’s like I can get things going and looking presentable

eoliphant18:05:07

and then turn it over to someone who can draw cows and knows CSS better than I do lol

eoliphant18:05:36

I liked semantic for that as well, really nice to begin with, but tons of customization, etc options

pesterhazy18:05:39

A wrapper like baking soda for grommet sounds great

eoliphant18:05:55

yeah i’ll let you guys know when I publish it

eoliphant18:05:02

just making a few more tweaks

eoliphant18:05:43

I’ve gotten most of the major components working, and have all the icons exposed

pesterhazy18:05:48

Agree about prototyping, it's cool to show a demo to a client/stakeholder after a few days

eoliphant18:05:03

haven’t gotten arond to some of the cooler stuff like the charts and what have you

pesterhazy18:05:16

Especially with fancy transitions!

eoliphant19:05:07

one PITA, same thing the Soda-ash lib had to work around is defs that collide with clojure.core like (box,list, etc)

pesterhazy19:05:55

That's only a problem inside the lib though

eoliphant19:05:59

seems like there has to be a way around this, but for now I just copied Soda-ash, and created an exception list that tacks a suffix onto those symbols

pesterhazy19:05:07

Consumers can access via ns

eoliphant19:05:12

yeah that’s what I do

eoliphant19:05:48

but it causes clojurescript barfing, etc if they get redfined in the lib

gadfly36119:05:18

yeah, i added the exception list as a courtesy ... it isnt necessary, but so many people (myself included!) struggled with reagent atom vs clojure.core atom I figured id make them different