The Advantages of Adopting a Plugin System in Node.js Library Deployment: A Case Study of Toss

0

Node.js projects can quickly become complex, making efficient library management a challenging task. The case of Toss provides valuable insights into how this can be effectively managed. The Toss Node chapter, managing a vast number of libraries, implemented a plugin system to enhance their efficiency. The lessons learned during this implementation process offer actionable insights that can be applied in various development environments.

Challenges of Monorepos and Library Management

Since introducing their first monorepo in 2021, the Toss Node chapter now manages over 100 libraries. These monorepos are categorized into server libraries, core-specific libraries, and CA libraries, all tailored to meet different operational needs.

However, as the number of libraries increased, the complexity of the deployment pipeline also grew. Deployment commands became more complicated, making maintenance and management difficult. Addressing the requirements of each subsidiary or repository became burdensome, necessitating modifications to the shared deployment library. To resolve this issue, they introduced a plugin system.

Plugin System: Independent and Flexible Deployment Management

The Toss Node chapter identified the need for an independent and flexible system to meet diverse requirements, leading them to choose a plugin system. This system proved to be the perfect solution for accommodating various needs without modifying the shared deployment library.

With this system, it became easy to incorporate or modify deployment settings to suit the needs of each repository or subsidiary. For example, the system, inspired by plugin systems like ESLint in the Node.js ecosystem, offers high satisfaction to developers.

Real-World Plugin Usage Examples

Toss has developed and utilized a variety of plugins. Here are a few examples:

  • deploy-plugin-codegen. A plugin that manages export components marked with comments, ensuring accurate code generation during the CI/CD process.
  • deploy-plugin-collect-usage. A plugin that tracks and manages where, how, and to what extent libraries are used. It is particularly useful for gathering usage data of public APIs, allowing for impact assessment before library modifications.
  • deploy-plugin-lightweight. A plugin that reduces package metadata size, improving deployment speed and reducing download times.
  • deploy-plugin-bump. A plugin for managing workspace dependencies, keeping versioning up-to-date and preventing issues.

In addition to these, various plugins contribute to making Toss’s deployment pipeline more efficient. Each plugin operates independently while maintaining compatibility with the overall system, adding necessary functionality.

Lessons Learned from Toss’s Success

This case study highlights the importance of actively adopting and effectively utilizing tools to address technical complexity. In particular, using flexible tools like a plugin system to solve problems in large-scale projects is highly beneficial.

Are you ready to move beyond complex deployment pipelines and manage your libraries more intelligently? Draw inspiration from Toss’s success and take your development environment to the next level.

Reference: Toss, “Implementing a Plugin System in Node.js Library Deployment Pipeline”

Leave a Reply