Live data from Hacker News

Evergreen: a React UI Framework built by Segment

evergreen.segment.com

121–130 of 309 posts

Re: Evergreen: a React UI Framework built by Segment

#121

Earlier quoted context omitted.

> Your little utility here doesn’t cover the whole 'classnames' API. Thats partly the point. The whole API doesn't really need to be covered in order to achieve the same utility. I think the library clearly over-engineered the simple task of string concatenation, and their API is redundant. Their API caters to too many styles and that increases its complexity. It takes 2 seconds to grok the two lines in my utility, w…

You don't "agree" on a convention, they have different use cases. Sometimes you'll want to merge a bunch of class names so you use array-style. Other times you have class names that have prop dependencies so you use object style and finally you'll want to merge in some always-on defaults so you have string style. You'll often need to combine them, depending on use-case. That's a whole lot of complaints for 50 lines o…

> Sometimes you'll want to merge a bunch of class names so you use array-style

> Other times you have class names that have prop dependencies so you use object style

> merge in some always-on defaults so you have string style

There's some irony here -- all of this just to avoid dealing with string templates:

  `${class1} ${class2} ${class3}`
> You'll often need to combine them

Need is definitely not the right word here. The classNames utility is a completely unnecessary abstraction.

Re: Evergreen: a React UI Framework built by Segment

#122
post #38
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)?

React is fast. If you are not experienced in react you'll make a mess because they work against its principles. To me the Reddit web app is fast, the show part I think is the server side.

The new Reddit design is often much slower loading the first time than the old one. It's performant after that, but that first load is annoying.

Re: Evergreen: a React UI Framework built by Segment

#123

This list was posted a few weeks ago, but here is a fairly definitive list of similar UI frameworks: https://element.eleme.io/ https://ant.design/ https://quasar-framework.org/ https://at-ui.github.io/at-ui/ https://developer.microsoft.com/en-us/fabric https://vmware.github.io/clarity/ http://appnexus.github.io/lucid/ https://ng-lightning.github.io/ng-lightning/ https://blueprintjs.com/ http://www.jetbrains.org/ring-…

Do any of these produce finished output that is less than a few kB, and works reliably in say the past two major versions of browsers? Bundle sizes are getting ridiculous. Is there a React UI framework that focuses on tiny build size and browser compatibility?

Wouldn't any of those fit the case if you just do tree-shaking?

Re: Evergreen: a React UI Framework built by Segment

#124

Earlier quoted context omitted.

it("should work with booleans", () => { expect(classNames({a:true, b: false}).to.equal("a b") }) Shouldnt this just equal "a" though? See, already a bug in your homegrown solution!

My test would fail, and I would fix it. + 2 seconds. Actually, the next test has the same problem. 2 more seconds. I'm gonna be in trouble with my boss!

No, your test wouldn't fail because you wrote your code already being confident it is correct and went on. The bug would surface later in your team, somebody else in your team not familiar with your code would spent hours figuring out what is wrong, will consult you about your intentions when you wrote the code etc.

Re: Evergreen: a React UI Framework built by Segment

#125

Earlier quoted context omitted.

I think he might be talking about trivial dependencies, like leftpad, classNames, arrify, etc. In the case of trivial dependencies, rolling your 30-line "util.js" file to remove 3 dependencies is definitely worth it. No one is suggesting you roll your own diffing algorithm.

I think I already responded to you elsewhere, but in case I'm incorrect: No it is not worth it. You are re-inventing the wheel so you can pat yourself on the back. Nobody hires a software engineer to write leftpad. Rolling your own diffing algorithm is exactly what actual engineering entails.

> You are re-inventing the wheel

Not quite, that would imply time and effort. I'm talking about reinventing the toothpick (2-3 lines of code), which is much different than reinventing a complex library for the sake of reinventing it.

> Rolling your own diffing algorithm is exactly what actual engineering entails

That's nice, but you're addressing a straw man. No one actually said rolling your own diffing algorithm is not what engineering entails. It was said that no one is suggesting you recreate a non-trivial dependency for the sake of reducing your dependency count.

I can use it in an example if it helps: If you are hired to write a basic website and you choose React, then you probably shouldn't reinvent React as your first step in writing the website. React is a fine dependency because it does a lot.

Humor me -- the next time you use classNames for a small project, try and see if you can't replace all of your calls to classNames with very basic template strings or other trivial code. It should not take any effort. For example I've seen things similar to "classNames({myClass: true})" in code before. Can you see what is wrong with this line? When people get comfortable with abstractions, they completely forget how to write the simplest code.

Re: Evergreen: a React UI Framework built by Segment

#126
post #116

This list was posted a few weeks ago, but here is a fairly definitive list of similar UI frameworks: https://element.eleme.io/ https://ant.design/ https://quasar-framework.org/ https://at-ui.github.io/at-ui/ https://developer.microsoft.com/en-us/fabric https://vmware.github.io/clarity/ http://appnexus.github.io/lucid/ https://ng-lightning.github.io/ng-lightning/ https://blueprintjs.com/ http://www.jetbrains.org/ring-…

Just clicked around and here's a note from the elastic/eui repo " WARNING While open source, the intended consumers of this repository are Elastic products. Read the FAQ for details." Doesn't instill confidence.

The point of the warning is to indicate that it's intended purpose is to be used with other elastic open source projects like elasticsearch and kibana. It's not a general purpose UI kit like the rest of those links.

Re: Evergreen: a React UI Framework built by Segment

#127

This list was posted a few weeks ago, but here is a fairly definitive list of similar UI frameworks: https://element.eleme.io/ https://ant.design/ https://quasar-framework.org/ https://at-ui.github.io/at-ui/ https://developer.microsoft.com/en-us/fabric https://vmware.github.io/clarity/ http://appnexus.github.io/lucid/ https://ng-lightning.github.io/ng-lightning/ https://blueprintjs.com/ http://www.jetbrains.org/ring-…

Do any of these produce finished output that is less than a few kB, and works reliably in say the past two major versions of browsers? Bundle sizes are getting ridiculous. Is there a React UI framework that focuses on tiny build size and browser compatibility?

Rebass.

Re: Evergreen: a React UI Framework built by Segment

#128

I wish people would stop making UI frameworks in , and instead make it web components based with vanilla JS/very light lib dependency, so that everyone can enjoy the benefit. React is becoming a bubble of its own, and it's exclusive.

Web components are not supported in many popular browsers. Until they are widely supported they are not a thing. And no, Polymer and co are not polyfills for them, they are their own incompatible frameworks.

I agree in principle but it's up to browser vendors to implement specs, and it is always the same offender that is dragging his feet.

Re: Evergreen: a React UI Framework built by Segment

#129

Earlier quoted context omitted.

My test would fail, and I would fix it. + 2 seconds. Actually, the next test has the same problem. 2 more seconds. I'm gonna be in trouble with my boss!

No, your test wouldn't fail because you wrote your code already being confident it is correct and went on. The bug would surface later in your team, somebody else in your team not familiar with your code would spent hours figuring out what is wrong, will consult you about your intentions when you wrote the code etc.

No, the test would fail in this case because the code was written properly because it was a TRIVIAL 2-line function (see above).

A few people in this thread have regurgitated the same reasoning you have. The problem is that your reasoning is NOT an invariant under complexity. This reasoning does not apply nearly as much to trivial utility functions such as:

  const isObj = o => !!o && typeof o === "object"
and classNames, etc. as it does to larger, more complex code.

> will consult you about your intentions when you wrote the code etc.

No, no they won't. No one will consult me on what my 2-line classNames functions does. It's 2 non-obfuscated lines. These aren't undergrads in CS101.

Re: Evergreen: a React UI Framework built by Segment

#130
post #38
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)?

React is fast. If you are not experienced in react you'll make a mess because they work against its principles. To me the Reddit web app is fast, the show part I think is the server side.

[deleted]
Post reply on HN