1 the introduction

The author gives a comprehensive analysis of the usability of JS library from 12 perspectives, which are as follows:

  1. Features.
  2. Stability.
  3. Performance.
  4. Package ecology.
  5. The community.
  6. Learning curve.
  7. The document.
  8. Tool.
  9. Development history.
  10. The team.
  11. Compatibility.
  12. Trend.

Here is a summary of the author’s views.

2 Overview & Intensive reading

features

When you investigate a JS library, functionality is of course the most important thing. React’s UI is very convenient, which is part of its popularity.

At the same time React was very focused on the problem it solved, leaving parts like the Router and Store to the community for solutions, which led to the development of an official maintenance ecosystem for Vue. But it depends more on your preferences, and a lean library like LoDash is here to stay. What matters is whether the capabilities provided by the library solve your business problems.

Grade: A – Turn the bad into the good. B – A more elegant solution. C – Worse than existing schemes.

The stability of

This library is obviously not usable in production if it is buggy. It’s better to be rigorously tested to make sure the library doesn’t go wrong, so we can focus on troubleshooting business problems.

Grade: A – Few bugs, easy to debug. B – Does not affect your stability, such as BUG probability similar to your business code. C – Introducing the library will cause your backline to fail.

performance

If it takes 15 seconds for the user to open the page, it’s all in vain.

Take PReact for example. Why did the same API wheel survive? Because of its small size and PReact’s emphasis on performance.

How to say in one sentence that you are not building useless wheels? Better performance.

Grade: A – Small size, high performance, support for various black tech features like Tree Shaking. B – Has no impact on performance. C – Performance deteriorates.

Package ecological

Have you used monaco-Editor? Everyone is using WebPack and it’s going the AMD route. I don’t know how you got it to support CommonJS, but it must have taken you a while.

Package ecology includes the maturity of third-party packages, how easy packages are to use, how many modular solutions are supported, whether THEY support TS, and how well they manage their dependencies.

Out of the box is best, long term maintenance organization is even better.

At the same time, it is better not to have too many competing community schemes. For example, the library uses LoDash, which is easy, but the React data flow scheme? Too many competitors are constantly writing advertorials to grab the attention of users (programmers), trying to convince them to work overtime refactoring.

Grade: A – The program is unique and ecologically sound, and the maintenance records are standard and smooth. B – Many new online red packets, and many competitive choices. C – No one will make a bag for you. If you want to use it, you have to wrap it yourself.

community

How quickly you can find answers to questions on Stack Overflow is a good indicator of how active the community is, whether it’s official documentation or third-party q&A.

The more active the community is, the more holes there are for you to step on ahead of time. If you run into a problem that no one else has, it doesn’t mean you’re using the wrong library at all.

Grade: A – Various forums are active daily, Github issue is clear. B – Forums/chat rooms are not very active. C – Can’t find any relevant information other than the author’s bragged documents.

The learning curve

Do not think that the library function is powerful, even if it is difficult to use a point there will be users lick, this is an illusion.

Vue is popular because native HTML has a lower barrier to entry than JSX, and React users tend to think JSX has a lower barrier to entry than HTML. I don’t know how to describe it, but in the sense that JS produces everything, learning HTML is considered a high bar.

So let’s face it, JSX Star is not about how advanced its theories are (they are), but about how many people feel that overall learning and maintenance costs are lower than HTML.

Grade: A – Become A skilled brick remover for this library in one day. B – Wasted a week before it was put into use. C – After studying for a week, I realized that my previous understanding was wrong and realized that this was just the beginning.

The document

The person who writes the document is generally the author of the library, and this person is generally more experienced. When writing the document, he or she will not consider the feelings of beginners, so it is not easy to find a friendly document for beginners.

For the maintainer of the library, to stand in the beginner’s point of view to write the document, stand in the user’s point of view, if the document does not understand at the beginning, it is best to change the document or change the library as soon as possible.

Grade: A – Dedicated to maintaining documentation sites, videos, images, sample projects, or better yet, A foundation that organizes programming contests where A three-year-old can get A day’s introduction to the integrity of the strong projection technology ecosystem. B – Have basic Readme and API documentation. C – Readme: Create React app

tool

Tools can be used to demonstrate the advantages of this library in many dimensions. First, it does bring ease of use, and second, it shows the strength of the team maintenance (energy overflow can be used as peripheral tools).

I have read some psychology books and experienced some technology selection. After seeing the graphical interface of Redux Dev Tools, my brain is much more affected by visual impact than rational logical thinking. The subconscious gave Redux so many points that the discussion became irrational.

If your library can be graphically expressed, or make a powerpoint presentation or aid, it will be a big plus. The React Chrome plugin lights up when opening a React page. The medal is so ceremonial that I didn’t want to change the frame.

Grade: A – Two or more tools, including browser extensions, code editor extensions, CLI tools, or SaaS services. If you’re really strong, there are A lot of fancy AIDS. B – A tool. C – No tools.

The development history

A Star 10K library, if submitted 10 days ago, should not be used, even if it is not brushed, because the author will stop maintaining it someday.

The older the library, the less risky it is to use, unless the side it is in is obsolete (technology stack, ecology, programming language, and so on).

Grade: A – At least 4 years of experience, with authority certification. B-1 to 4 years old, a lot of people have already used it. C – The author himself has not used the amway you use the line.

team

Look who’s the man behind the vault. Open source libraries that are widely used by large companies and have some international influence, and have a history of successful open source in large companies, will be more persuasive.

But Vue is an exception, almost built by UVU alone. In this case, I would like to say that a person who truly loves technology and practices full-time maintenance may be more reliable than a team with KPIs to maintain by-products.

Grade: A – first – line factory, quality authority certification. B – Medium team maintenance with a clear record of division of labor. C – Open source in my spare time, I have no intention of being responsible for this library.

compatibility

In addition to browser compatibility, library API compatibility is also very important. When you have easy access to authors and suggestions for API changes are quickly adopted, be careful.

React Router 3 -> 4 Update the React Router 3 -> 4 update does not support stage 0-4 and does not support stage 0-4. While frequent updates are often intended to add new functionality, they can be annoying if they introduce API compatibility issues.

If your team maintains a library for 10 years and there are dozens of different versions evenly distributed over time due to the diligent updating of one of its authors, you will swear that your next project will not use that library.

Grade: A – Always compatible with updates. If not, warn in advance that it will be deprecated in A certain version and provide migration tools such as React. B – There is a Break Change but the documentation makes the upgrade changes clear. C – Sudden minor version upgrades force you to refactor the previous calling code.

trend

Whether it’s hype or discussion, it’s important to keep the library fresh, because this will help the library do many of the things mentioned above.

But beware of excessive hype, which may reduce the stability of the library, after all, before the explosion of user growth, it is better to have some as guinea pigs.

Grade: A – Is the Star topic of HackNews, Star thousands, various meetings named this (Vue conf, React conf). B-hundreds Star, there’s some discussion. C – Don’t look at the Star now, sooner or later I will surpass that blah blah blah.

Moving costs

If the library is not used for one day, what is the cost of replacing it with something else?

In this respect, the test libraries do a good job. Many mainstream test libraries, such as Jest, Ava, Mocha, Jasmine, etc., have cross-scripts, and the industry has basically reached some consensus and standards.

React, Vue and Angluar are the worst. You are basically bound to them, and no one can seamlessly migrate them. Of course, THE age of JS is still very short, and it is not good to say that the future will be overturned by new languages, technologies, containers and become history, standardization is not to do but need time, perhaps in more than ten years later, but today is not to do.

3 summary

Next time the selection of technology discussion, you can take out the rules one by one comparison!

Then the technology selection is just the base base that you can use to maintain your open source libraries and spend more time creating business value.

If you think about it, programmers develop libraries of tools that also fit the concept of point, line, surface and volume. A library of react- buttons is a dot, and its react line would capsize if abandoned. React, vue, and angluar are all on the js engine. When WebAssembly can be written in C#, Reason, Blazor, and Dart will become the main browsers, and react libraries will need to be redeveloped. And when the future man-machine interconnection does not need browser as a medium, js engine this surface attached body-man-machine interaction scene has also been overturned, this wave will cause much change.

Therefore, the technology selection is to solve the current business problem, carefully consider several factors, suitable to solve the business scenario is enough.

4 More Discussions

The discussion address is: intensive reading 12 evaluation JS library things you need to care about · Issue #104 · dt-fe/weekly

If you’d like to participate in the discussion, pleaseClick here to, with a new theme every week, released on weekends or Mondays.