always hilarious to see the dumb dependencies that these projects have https://github.com/sindresorhus/arrify https://github.com/JedWatson/classnames
Pretty neat, actually.
51–60 of 309 posts
always hilarious to see the dumb dependencies that these projects have https://github.com/sindresorhus/arrify https://github.com/JedWatson/classnames
Pretty neat, actually.
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)?
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.
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.
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.
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.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)?
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.https://github.com/segmentio/evergreen/blob/master/src/icon/...