webcomponents / wc-catalog

BSD 3-Clause "New" or "Revised" License
11 stars 3 forks source link

Download package versions lazily #5

Open justinfagnani opened 2 years ago

justinfagnani commented 2 years ago

Right now the package import code downloads all package versions eagerly. This can be a lot of processing when the latest version is going to be requested and queried the vast majority of the time.

We should structure the import code so that the lastest version at import time is downloaded and indexed, as well as the list of versions and dist-tags. The other versions can be downloaded and indexed on demand.

This will mean that queries across packages will be limited to latest versions. This was likely the be the case in practice already as querying across packages at specific version numbers doesn't make a lot of sense since version numbers are mostly uncorrelated. We may want to download and index all versions referenced by dist-tags.