Peer Dependencies - Explained

Опубликовано: 11 Февраль 2023
на канале: A shot of code
7,492
220

Peer Dependencies in NPM are often used to aid package management for plugins. In this tutorial video we look at why peer Dependencies are needed and the benefits they proved, how to add peer Dependencies to the package JSON file and then how to resolve the warnings/errors that are associated with peer Dependencies during NPM installs.

00:55 Create Test Application
03:50 Push Test Application to NPM
04:10 Install and Test Application
05:00 Create Test Application Plugin
06:00 Publish Test Application Plugin to NPM
06:30 Scenario 1 - Happy Case App and Plugin work together successfully
07:15 Scenario 2 - App API is updated with breaking change - no Peer Dependency to help us
07:30 API changed in App and version changed to v1
08:30 Install V1 of App - No Errors or Warnings
08:50 Run time error!
09:40 Scenario 3 - Using Peer Dependency on Plugin
10:20 Update version of Plugin to 10.0.2
11:30 Peer Dependency Warning on attempting to install plugin against V1 of App
13:20 Scenario 4 - Installing Plugin with App V1 - peer dependency should warn/error
14:40 Install Plugin shows Error and blocks install
15:40 Force install of Plugin


Смотрите видео Peer Dependencies - Explained онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь A shot of code 11 Февраль 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,49 раз и оно понравилось 22 людям.