PlatformIO Community

How come "lib_deps = ESP Async WebServer" works?

I have been adding libraries using the Library page, and it used to be “developerID/libraryID @^version” format. I was following a tutorial and it told me to add ESP Async WebServer. I searched for it and there were two versions “me-no-dev” and “esphome”, I was not sure which one to add, and then I saw the tutorial page is just using "lib_deps = ESP Async WebServer. I was not sure it would work but I tried it and it worked. The output was like below. How come it does not need the “devloperID/” part like the very next “ayushsharma82/AsyncElegantOTA @ ^2.2.5” library in the tutorial?

[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino
monitor_speed = 115200
lib_deps = ESP Async WebServer
  ayushsharma82/AsyncElegantOTA @ ^2.2.5
Library Manager: Installing ESP Async WebServer
Library Manager: ESP Async WebServer @ 1.2.3 has been installed!
Library Manager: Installing dependencies...
Library Manager: Installing ESPAsyncTCP
Library Manager: ESPAsyncTCP @ 1.2.2 has been installed!
Library Manager: Installing AsyncTCP
Library Manager: AsyncTCP @ 1.1.1 has been installed!
Library Manager: Installing Hash
Library Manager: Already installed, built-in library

PlatformIO wants to keep backwards compatibility with older projects. Even now, the very olders “library ID number” (Wrong lib installed when there are 2 libs with the same name - #6 by maxgerhardt) is still functional but deprecated. The correct way to specify the library is to always use the new library_author / libraryname @ version syntax – if you just give it the libraryname, it will have to take a guess and you might end up with the wrong library. So “not needing the developer ID” is not correct in every case and may lead to… unforseen consequences if another developer decides to register a library with the same name and PlatformIO picks up that (dependency confusion attack).

me-no-dev is the original author of the library. As you can see in the esphome library page (https://github.com/esphome/ESPAsyncWebServer),

A fork of the ESPAsyncWebServer library by @me-no-dev for ESPHome.

So I reckon if you’re not in the ESPHome firmware context, you should be using the original library.