# Dependency Policy

> Type: Policy. How to choose a library for the current task and assess its maintenance.

## The library's task

Choosing a dependency starts with the task it solves in the project. A clear API, support, and documentation help assess how convenient the library and its integration will be to maintain.

Comparing it with the standard library and existing packages shows what the new dependency adds. If the operation is already one standard call, an extra wrapper usually adds more maintenance than value. A library with a distinct, lasting purpose can simplify several parts of an application.

## Maintenance cost

Alongside API convenience, the choice takes account of updates, compatibility, distribution size, and reliance on an external interface. These considerations help explain why a particular package is useful and why existing tools are insufficient.

Adding a dependency serves current needs. A small syntax difference or possible future use alone says little about its value to the project.

## Compatibility and reproducibility

Checks whether the runtime package is needed or only the development circuit, whether it is compatible with supported versions of the platform and whether it adds an extra browser bundle. For the UI, SSR, accessibility, and the ability to localize external APIs are taken into account. The facade is justified by the actual contract boundary rather than being created on a per-packet basis.

The selected package manager and supported platform versions are indicated in the project documentation. A dependency update is not mixed with a feature or visual edit if it is not needed for the current task. Major update requires checking the migration guide. Before updating, release notes, peer ranges and the actual dependency graph are studied.

After the change, the consistency of the manifest and lockfile, lint, types, affected tests, build and relevant runtime smoke are checked. Security audit is performed at the level accepted in the project.

Updating dependency files and using `overrides` in npm are covered in [npm dependencies](./languages-and-platforms.md#зависимости-npm).
