External libraries can significantly boost productivity and dramatically reduce turnaround time when developing new applications or when implementing new features. However, researching a new library can be a very time-consuming process. It's important to recognize that there's always a cost associated with introducing a new library to an application. This cost may not necessarily be monetary; there may be a learning curve to use the library, time for setup and integration, and requirements to maintain the dependency. Although, if chosen appropriately, the benefits of a library will very much outweigh the costs. Outlined below is a set of guidelines and questions to help navigate the process of researching a new library.
Before going down the potential rabbit hole of researching a new library to add to your application, peer into your current dependencies to see if a solution is already at hand.
- Inspect the libraries that have already been implemented, would any of these fulfill the task requirements?
- If they can, would it require you to make any modifications? Would a new library require less effort to implement?
- It's important to note if a library is intended to be used as a temporary measure that will require intervention soon, or as a long-term solution. This is important to keep in mind when researching how much effort is required to implement this library.
When choosing a new library, it's advantageous to select a consistently maintained, well-documented, and widely adopted solution.
- Is it extensively documented and easily navigable?
- Are security vulnerabilities patched on a regular basis?
- How many monthly downloads does it have? When was the last commit merged?
- While these aren't necessarily correlated with the quality of the library, wide adoption and frequent updates are green flags
- Is it developed by a team or an individual?
- Do they offer support plans?
- Are questions and issues addressed in their GitHub?
- Is there an active community behind this library?
Any additional libraries that you bring into your ecosystem, should not have any notable, negative impact on your performance. Ideally, you should also pursue libraries that don't require a significant amount of effort to implement, if at all possible.
- How large is the package size? How much will it affect the size of your code bundle?
- Is this library efficient? Would it negatively affect performance and load times?
- Is the software bloated with other features that you don't plan to utilize?
- It takes time to learn how to use new libraries. What is the learning curve for this new package?
- How much time would take to implement?
- It's highly recommended to implement the library into your application, in its simplest form. This will ensure the library is compatible with other dependencies and that it will be suitable for your use case.
Software should be inclusive and cater to as many individuals as possible. This includes bringing in libraries that accommodate individuals with disabilities, seeing impairments, color blindness, support dated equipment, and slower internet connectivity.
- Can you verify from examples if this library uses aria attributes, if it’s keyboard accessible, and if it meets any applicable WAI-ARIA Authoring Practices guidelines?
Pay close attention to the license conditions of the library. Ensure the license is compatible with your planned usage and align with your organization's requirements.
- Is there a "Pro" version? Do you need any features from the "Pro" version?
- If you do, are the charges reoccurring or is it a one-time payment?
- Will this require any additional system architecture to operate? What additional costs would that entail?
There may be occasions where no library exists that fits your exact needs. In cases like these, it would be best to consult your design team, product team, and/or other developers to see if it's within reason to modify the task at hand in such a way that would circumvent the need for an additional library. Lastly, if all else fails, a custom solution may need to be developed and employed. Consider making it open source, to benefit the community!