Live data from Hacker News

Evergreen: a React UI Framework built by Segment

evergreen.segment.com

51–60 of 309 posts

Re: Evergreen: a React UI Framework built by Segment

#51

always hilarious to see the dumb dependencies that these projects have https://github.com/sindresorhus/arrify https://github.com/JedWatson/classnames

While I can understand your skepticism on the first one, the second package is actually very useful. It doesn't just concatenate strings filtering out falsy values, it supports the whole old AngularJS class format. You can, for example, pass an object {string:booleanish} and it will add only the keys whose values are truthy.

Pretty neat, actually.

Re: Evergreen: a React UI Framework built by Segment

#52
post #33

I've wondered about React, although I haven't used it myself. I know that the new Reddit was written using React components, and it's very slow. Is that a React problem (i.e. is it hard to write fast web apps) or is it a Reddit problem (or both)?

It's not a React problem. React runs Facebook, Instagram, and mobile Twitter, for example. But it's possible to build inefficient React implementations. Reddit rebuilt their front end from the ground up. It is possible they have front end issues there. Some flame chart analysis on Reddit's current front end and old front end would reveal the source of the problems.

Re: Evergreen: a React UI Framework built by Segment

#53

Earlier quoted context omitted.

Depends if you want a UI _kit_, vs the right tools to make a great custom design system. For the latter, take a look at tailwindcss.

I'm a tailwind fan but that was straight shilling and unrelated to the discussion at hand.

This comment breaks the site guidelines. Please review https://news.ycombinator.com/newsguidelines.html and follow the rules when posting here.

Re: Evergreen: a React UI Framework built by Segment

#54
post #33

I've wondered about React, although I haven't used it myself. I know that the new Reddit was written using React components, and it's very slow. Is that a React problem (i.e. is it hard to write fast web apps) or is it a Reddit problem (or both)?

It's not a React problem. React runs Facebook, Instagram, and mobile Twitter, for example. But it's possible to build inefficient React implementations. Reddit rebuilt their front end from the ground up. It is possible they have front end issues there. Some flame chart analysis on Reddit's current front end and old front end would reveal the source of the problems.

While I agree React isn't the issue here, you chose horrible examples. Loading Facebook on my computer (especially trying to open a chat window) brings my computer to a knee. And using twitter on mobile browser you quickly learn how the spinner looks.

Re: Evergreen: a React UI Framework built by Segment

#55

always hilarious to see the dumb dependencies that these projects have https://github.com/sindresorhus/arrify https://github.com/JedWatson/classnames

Is there a way to see what code in the project actually uses these dependencies? I gave up on learning Typescript for another 6 months after a starter template dragged in 400 dependencies.

Why would that matter for learning typescript..?

Re: Evergreen: a React UI Framework built by Segment

#56

always hilarious to see the dumb dependencies that these projects have https://github.com/sindresorhus/arrify https://github.com/JedWatson/classnames

  const arrify = a => a && (Array.isArray(a) ? a : [a])
vs. introducing a potential attack vector.

Re: Evergreen: a React UI Framework built by Segment

#58
I think it's a beautiful, thought out, polished and well built set of UI components. If that's what I needed for my next project, I wouldn't hesitate to use it. The docs are excellent too. There's so much attention to detail here. There's an immense amount of love poured into this project, even the code snippets are interactive.

Re: Evergreen: a React UI Framework built by Segment

#59
post #50

always hilarious to see the dumb dependencies that these projects have https://github.com/sindresorhus/arrify https://github.com/JedWatson/classnames

Curious what your issue with classnames is? Is it just because it’s a small and simple module (50 lines of code)?

I was curious so I checked out their Github page. I found this example:

  classNames('foo', 'bar'); // => 'foo bar'
  classNames('foo', { bar: true }); // => 'foo bar'
  classNames({ 'foo-bar': true }); // => 'foo-bar'
  classNames({ 'foo-bar': false }); // => ''
  classNames({ foo: true }, { bar: true }); // => 'foo bar'
  classNames({ foo: true, bar: true }); // => 'foo bar'
  ...
  var btnClass = classNames({
    btn: true,
    'btn-pressed': this.state.isPressed,
    'btn-over': !this.state.isPressed && this.state.isHovered
  });
Look like the button example is a good enough convention for me, I don't need any of the other conventions. Can anyone tell me why this is not sufficient?:

  const classNames = (pojo, c=[]) => {
    for (let k in pojo) if (pojo[k]) c.push(k);
    return !!c.length && c.join(" ");
  }
Do I need array-flattening support, multiple argument support? The size of this library probably comes from it supporting a handful of different coding styles. I would say the size (50 lines) is too large, if anything. Dependency worthy? I'm not convinced. I am very much so against requiring trivial utility functions from other people. Roll your own if it's trivial! It's better than depending on something over the network.
Post reply on HN