News for hackers. Stuff that matters.
Re:Boring Avatars – React library to generate custom avatars by NohatCoder on Friday May 28, 2021 @03:44AM (#27312740)
Why make a library dependent on a particular framework? Seems to just limit usefulness for no particular gain.
Re:Boring Avatars – React library to generate custom avatars by jacobmischka on Friday May 28, 2021 @03:53AM (#27312783)
It creates SVGs using React[1], it would be nontrivial to support another view library with this design and if you're going to support only one at initial release React is probably the most popular bet.

[1]: https://github.com/boringdesigners/boring-avatars/blob/maste...

Re:Boring Avatars – React library to generate custom avatars by NohatCoder on Friday May 28, 2021 @04:01AM (#27312836)
But you could just write that generation in plain JavaScript, React is really just a syntax.
Re:Boring Avatars – React library to generate custom avatars by lcrz on Friday May 28, 2021 @04:44AM (#27313081)
Because they like the syntax? Because it has a nice way of passing properties? Because you can work with pseudo-DOM elements?

It's all open source. If you want a vanilla js implementation go ahead.

Re:Boring Avatars – React library to generate custom avatars by enlyth on Friday May 28, 2021 @04:52AM (#27313130)
I find it a bit sad that the most upvoted reaction to someone's cool little project they wanted to share is the classic HN misguided and overused response of 'React BAD'
Re:Boring Avatars – React library to generate custom avatars by Tade0 on Friday May 28, 2021 @05:35AM (#27313343)
There's a reason for that. The web is roughly 90% static pages with JS sprinkled on top(usually jQuery), and 10% SPAs made in various frameworks.

https://w3techs.com/technologies/overview/javascript_library

React is a small part of the web(in terms of the number of people using it commercially) and thus a library written in React isn't terribly useful for most of the market.

Re:Boring Avatars – React library to generate custom avatars by Kaze404 on Friday May 28, 2021 @09:18AM (#27314989)
> React is a small part of the web(in terms of the number of people using it commercially) and thus a library written in React isn't terribly useful for most of the market.

And why does that matter? The OP is someone's toy project, not an attempt at starting a SaaS company.

Re:Boring Avatars – React library to generate custom avatars by inbx0 on Friday May 28, 2021 @05:46AM (#27313416)
And what percetange of those "static pages with JS sprinkled on top" have a need for automatically generated custom avatars?
Re:Boring Avatars – React library to generate custom avatars by Tade0 on Friday May 28, 2021 @05:55AM (#27313489)
Quite a few actually! After all they include static pages with comment sections, forums, image boards etc. - all places where you would want to have user profiles and naturally avatars.
Re:Boring Avatars – React library to generate custom avatars by IshKebab on Friday May 28, 2021 @12:28PM (#27317381)
I don't think anyone's saying React is bad, they're saying it's weird that this library depends on it.
Re:Boring Avatars – React library to generate custom avatars by jacobmischka on Sunday May 30, 2021 @02:56AM (#27331181)
"You could just write that routine in plain assembly, C is really just a syntax"
Re:Boring Avatars – React library to generate custom avatars by bhl on Friday May 28, 2021 @05:53AM (#27313474)
I agree with React being a good bet, but looking at the source code at the link, porting the library over to vanilla javascript or vue seems rather simple given it's mostly using JSX and not using an in-depth React feature like hooks.
Re:Boring Avatars – React library to generate custom avatars by tobr on Friday May 28, 2021 @07:58AM (#27314317)
So now you’re stuck always including React and always rendering your avatars dynamically on the client, even though it’s really just an SVG that is being generated.
Re:Boring Avatars – React library to generate custom avatars by kashug on Friday May 28, 2021 @08:58AM (#27314828)
If I create a library I would usually make it to solve my own usecase. And if you mainly work with react-apps, and your plan is to use it in an react app. Why not also make the library in react?

In this case, I guess the developer wanted to use JSX to create it. And you could ofc use JSX without React. But most people are used to using it in react-context, and plan to use it in an react-app anyway.

So to answer your question, in my eyes it would be. Why not? If the devs plan on using it in react-app anyway, it's not their job to make sure it supports everyone elses usecase.

Re:Boring Avatars – React library to generate custom avatars by NohatCoder on Friday May 28, 2021 @12:07PM (#27317120)
Why put it on GitHub and a web page if you don't care about other people's use cases?

I have no problem with people writing code for themselves. But if that is what you do, please don't post on Hacker News about it.

Re:Boring Avatars – React library to generate custom avatars by Nullabillity on Friday May 28, 2021 @03:34PM (#27319571)
It can still be useful even if it doesn't cover every single corner case.