593 points · by ggregoire · 8y ago · 296 comments
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/
http://www.jetbrains.org/ring-ui/
https://www.lightningdesignsystem.com/
Or the expectation is that one has to make a new UI anyway every several years to keep up with the changing fashion, so rewrites are inevitable?
Also, I haven't seen a lot of companies saying "Well, Angular is working great for us, but React is hot and trendy so let's rewrite the current UI in it". Rather, I think UI framework switches happen for two reasons:
- They've accumulated so much technical debt with their existing solution that progress has slowed to a crawl, developer morale is really low, etc. A migration strategy can be found that doesn't have such an upfront cost, and will dramatically improve velocity as features are converted.
- The design is totally changing, or the product is being rethought, and so it's not an invisible code rewrite, it's essentially building a new product.
I think in both of these cases, it's a good use of developer time.
You named Web Components, I've been embracing them for a while, but if you tried to switch from Google's Polymer to LitElement it wouldn't go smooth as you could have imagined. Both Polymer and LitElement are based on Shadow Dom and WC features curated by Google, but are not 100% backward compatible. That is to say, Web Components have been divided from within the same tech. No need to mention the rival concepts of "everything HTML" of Polymer 2.0 and fixing it to be "all JS and webpack-ready" in 3.0, and consequential deprecation of Bower.
And here you mention some Svelte and Stencil which I've never heard of before. Why need them? We have webcomponents.org already.
React was released in 2013, has only had minor breaking chanhes since then, and doesn't show any signs of disappearing anytime soon.
There's a big fear that projects that become unmaintained suddenly stop working; this isn't correct.
Besides, all webapps are rebuilt in a 3-5 year cycle anyway so it really doesn't matter.
I know of at least one company with such a stack. Just like I know others with Web Forms, Stucts, SEAM, JSP, Zope and many other stacks in production.
Not everyone re-writes their webapps, specially in companies where software is a cost center and totally unrelated to their main business.
While true, it only applies if you don't want to upgrade your lower level dependencies, ever. And given that this is a React based framework, so it's not based directly on the web platform, if it's not maintained, you'll have to port the framework yourself.
Coversely, if it is maintained, you may be forced to keep up and upgrade whatever this is based on, or backport fixes if the project moves on to a newer incompatible version of the lower level dependency.
> Besides, all webapps are rebuilt in a 3-5 year cycle anyway so it really doesn't matter.
Eh? :D I still iterate on 13 or 9 year old codebases for my clients without re-building anything.
And I thought places I worked at tended to be terrible :/
Also note that these frameworks lock you into design & feel of their choice. This might work for some use cases and for now, but when the requirements change you often end up fighting the framework. I don't have a solution to that though. :)
Using one of these frameworks helped us avoid that cost upfront and get the product out the door. If our company is still around in several years, I'll happily maintain it myself (or hire the original author).
EDIT: This comment assumes the framework of choice is open source.
End of the day, until it's rewritten with modularity in mind it will always be a drag to properly implement it in React.
I really like Blueprint JS but I think we'll end up building on top of Ant Design. It's a huge collection of work; they've also started to push Ant Pro which is higher-order components targeting building of admin apps (more opinionated, more than just a UI facade).
I like Blueprint a lot more than Ant, but Blueprint doesn't pretend to support responsive applications[1], which was somewhat important to us. Blueprint exposes a couple building blocks (like PopOver) which really help in building more custom functionality. It actually looks like Evergreen be closer to Blueprint in this regard so I might piss off all the devs and evaluate Evergreen.
[1]https://github.com/palantir/blueprint/wiki/Frequently-asked-...
While BlueprintJS is more intuitive, I find that it lacks a lot of built-in components compared to Ant Design.
Is there a React UI framework that focuses on tiny build size and browser compatibility?
Some of them (atlaskit, MS fabric, Jetbrains, vmware etc) are geared towards building an integration withing those company's products. Whilst they can be used independently (without assets in Fabrics case, and other restrictions in the others), my take is the Evergreen (and ant, etc) are geared towards isolated products, similar to Bootstrap.
If you're building an addon for use in an Atlassian product, or an Office 365 product, these are a great way to stay consistent with the host application's look and feel.
And if you use it for something else you may not comply with the license.
(Disclaimer: made by my coworkers)
Personally, I've found Ant Design to be the most comprehensive, feature and behavior-wise.
" WARNING While open source, the intended consumers of this repository are Elastic products. Read the FAQ for details."
Doesn't instill confidence.
All that said, it certainly works fine as a general kit, and we build it with that practicality, it's just not something we officially support.
As far as stability, my team is pretty well resourced (and growing if there are any engineers interested!). We're using the library in many places around Elastic and its not going away anytime soon.
I've looked through most of the kits out there and they all have their pros and cons. Likely our biggest selling point is that it aims to be fully accessible and comes with a lot of fun charting libs. That puts its sweet spot for use in enterprise applications. It's also completely themable with about 8 lines of Sass variables.
Obviously don't use that as a sole factor to determine what to go with, but with this many options, heuristics may be helpful to narrow down which ones to further investigate
https://habd.as/awesome-react-components/
https://habd.as/awesome-react-boilerplates/
Just added evergreen to the components list as it doesn't look like more than a UI kit.
It offers APIs compatible with React-native (which is obviously a huge time saver for cross platform UI dev).
Its disadvantage is that it does not offer (by intent and philosophy) any components outside of React native.
https://github.com/material-components/material-components-w...
All those things can be fixed, but I would rather go with a library with accessibility in mind.
Issue #2: Many (most?) of the form components show no indication of being selected when using keyboard navigation. This is the main issue I have with most web UI toolkits. (For example, Semantic UI is a notorious offender, even though it's frequently recommended at HN, including multiple times in the comments on this page.)
Issue #3: There are multiple problems in Firefox, including two carets displayed in each Select component.
Issue #2 and #3 almost make me miss the notices that used to be displayed at the bottom of web pages, such as "Best viewed in Internet Explorer 4 at 800x600 resolution". A lot of pages nowadays should have a warning like "Best used in Chrome with a mouse or touchscreen".
No real point here, but I do find it curious that there is this tendency to build new UI frameworks all the time.
Personally, I still like html + js (and I have used React).
The're frameworks and design systems. A React UI framework refines or enhances the React process to build UI components or design systems.
Bootstrap e.g. is 2 things in 1, it's a process/framework and design system that sits directly on top of html, css & js.
Those are not standard, some people like VDOM other not, and not everybody want to bind data the same way. So if we all contributed components in vanilla JS / Web Components, this still doesn't solve what should the API of those webcomponent look like.
With Web Components you're back in the land of saving element references, querySelector, addEventListener, and string-only attributes. It sucks. If you want something more like what React provides, where attributes (props) can be objects, functions, other React elements, etc. then you need to use a library (e.g. Polymer) that's just as non-standard as React is.
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.
On mobile Web 100% of the browsers support Web Components.
https://www.webcomponents.org/
So what are the many popular browsers you refer to? As anything else is meaningless.
Your statement makes no sense whatsoever, they are "only missing" 2 of the most fundamental features of web components? that would actually help getting rid of all these incompatible UI toolkits? I don't call that supporting Web Components at all if you can't write custom elements natively. You obviously do not understand how the lack of support for custom element and shadow DOM affects Web Components adoption.
Not supporting 2/3 of a spec is not being compliant with that spec, obviously.
> On mobile Web 100% of the browsers support Web Components.
Wait. Which is it? Or are you ignoring Firefox Mobile?
Also polyfills are separate thing from polymer - they are reused by ALL other frameworks including vuejs for example, so I'm not sure what you meant by that comment.
It's a super-lightweight base class for web components, and a descendant of the Polymer framework.
A Material Design framework uses this: https://github.com/material-components/material-components-w...
It's a bit disheartening to see titles like "Ember ninja" and "Angular guru", if only because recruiters don't know that both of those things are just JavaScript frameworks.
I'm excited for Web Components but I wonder how it will play out practically. Do people put "HTML Expert" on their resumes today?
Because their current system might already be using Bootstrap, so they need someone who understands it to be able to continue the work.
Everything else that builds their little platform on top of the browser is not interesting to me.
And TypeScript is a JavaScript superset with optional type annotations, which can be ignored if one so chooses.
They are React component frameworks for common functionality with a unified style approach.
Something purpose-built for React is usually much better than something where React is bolted on to an existing framework, like Reactstrap (React + Boostrap) because those usually are built with jQuery and just handle state and functionality in a way that's not easy to integrate with React cleanly, so you end up re-implementing the actual functionality again.
The reason I asked it is that, if you're building an HTML+CSS framework for use in React, then why wouldn't you separate out the HTML+CSS part, and then depend on this. That way it would be easy to re-use 90% of the work, if you then want to use the components with Vue or some other framework, or even for plain static pages.
Just something to consider if you're looking at using Evergreen.
It's responding to the device and the ways the user will interact with it. For example, the combobox example in Evergreen doesn't actually use a <select> in the background, so users on mobile devices will actually have to use the dropdown implementation rather than the browser displaying a proper native mobile select. That's a much worse experience. Not to mention Evergreen will be completely inaccessible for users who need assistive technology, which potentially poses legal issues...
You'd think in 2018 going back to a page would be a solved problem, but apparently each new framework needs to re-solve this in a new orignal way.
Just tried it in Firefox 62 on Ubuntu. Works good there too.
To me the Reddit web app is fast, the show part I think is the server side.
So no, I do not believe reddit's new design is "performant" at all.
One has to wonder - if Reddit's engineers can't get React right (I'm sure they hire smart people), is it really not a problem with React in the end?
So for many people, the benefits you get on the development side outweight the performance overhead
Pretty neat, actually.
Why is this something you can't do on your own in a few lines of code?
const classNames = (o, c=[]) => {
for (let k in o) if (o[k]) c.push(k) // booleanish
return c.join(" ")
}
This is not cool at all! Why import a trivial function over NPM to do this for you? Better to lower your dependency count and have a "util.js" file for helpers like this.The cost of using it is the same as locally, and creation cost is lower per-project if you let npm manage your own libs. Plus, bug fixes are automatically propagated.
[1] https://github.com/sindresorhus/ama/issues/10#issuecomment-1...
export default function classNames(...args) {
return args.filter(valid).map(single);
}
function valid(arg) {
return arg && (!Array.isArray(arg) || arg.length);
}
function single(arg) {
if (typeof arg === 'string') {
return arg;
} else if (Array.isArray(arg)) {
return classNames(...arg);
} else {
return Object.keys(arg).filter(k => ………
This is getting similar… 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. const cmpClass = classnames('componentsMainClass', props.className, { dynamicClassesHere });
I like that the component's main class stands out and is easy to find, that allowing the consumer to pass along their own class is trivial, and that the dynamic classes are grouped together.So I'd argue multi argument and falsy thinning are welcome features. I've never used array flattening.
Does it really need to be a dependency? I guess that's a matter of opinion. I like that the various React projects I deal with on a regular basis all handle classes in a consistent manner. I also don't usually mind dependencies that don't pull the entire world in with them.
const classNames = [
“btn”,
this.props.isSelected && “btn-selected”
].filter(Boolean).join(“ “) const arrify = a => a && (Array.isArray(a) ? a : [a])
vs. introducing a potential attack vector.No, it really isn't. The library does not dictate how things should be done, that's the fantastic thing about using your own utilities. In my implementation, we return the value itself if it's falsy. In yours, we return an empty array. Again, trivial "fix" (not that there's anything to "fix", it's a matter of convention, not correctness).
Also worth noting the ones I listed aren't transitive dependencies. Those are both explicit dependencies of this project
I feel like, a lot of ppl still create horrible UIs based on good components, because they lack the bright overview.
Responsive (in terms of interaction with components) and lightweightedness were our top priorities when we started developing (~3 years ago) and no third party solutions seemed to fit the bill back then. Always a fear as well of reliance on third parties for such an important part of the product - is a very large technical risk for the entire business.
We're pleased with the results, our entire app is smaller than the Apple homepage (usable after ~1MB of network transfer) and often starts up faster than our C++ native Windows predecessor. Bloating third party solutions could add significant %'s onto the download size - the example HN React Clone is a comparible size to our product: http://www.hnclone.win/
There was a lot of resistance from users initially when we announced the future of our product would be in the browser and not the native desktop app they were currently using, but we do get emails from users saying after using it for a while they forget they are working in the browser which is amazing.
If we started developing today, I think we'd still roll our own.
https://github.com/segmentio/evergreen/blob/master/src/icon/...
This looks good, though it also feels like it leans towards native controls; see Select vs. Select Menu, for instance. Material and Grommet have a unified style thing going on that this doesn't seem to. But this has more controls and seems more mature.
https://ant.design/ is the main page, https://ant.design/docs/react/introduce for react, and for angular: https://ng.ant.design/docs/introduce/en
Can't we embrace web components already and have those UI frameworks work in all popular solutions out there? Every time something new comes out existing solutions are being rewritten from scratch.
Why specifically this one?
I take it the main thing is their methodology for applying styles rather than css classes which might or might not make the code more readable.
Also, custom select inputs always ignore a big percentage of the functionality that native select inputs deliver.
Props to @jeroenransijn, @rowno and others!