Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to Cdnjs API changes #687

Merged
merged 1 commit into from
Jun 21, 2022
Merged

Conversation

jimmylewis
Copy link
Contributor

The Cdnjs API is changing to stop including the assets for all versions of a library in the /libraries/:library API. We were using this to determine both library versions and library files.

The changes are fairly straightforward:

  • for versions, we can just use the "versions" property from the library. It's probably easier than what we were doing before (parsing each version from an "assets" entry).
  • for files, we need to invoke the /libraries/:library/:version API instead. However, the default file (which we use for selecting the default checked box in the wizard) is on the library group, not the library-version, so we still need to get that from the first request.
  • Lastly, I included fields on each API call, so that we're not downloading any data that we aren't intending to use. This drops 10s of KB from most library group queries, since there's a lot of metadata we don't care about. We can always add more back later.

Addresses #685 but this will also need to be backported for servicing VS2017 and VS2019.

The Cdnjs API is changing to stop including the assets for all versions of a library in the /libraries/:library API.  We were using this to determine both library versions and library files.

The changes are fairly straightforward:
- for versions, we can just use the "versions" property from the library.  It's probably easier than what we were doing before (parsing each version from an "assets" entry).
- for files, we need to invoke the /libraries/:library/:version API instead.  However, the default file (which we use for selecting the default checked box in the wizard) is on the library group, not the library-version, so we still need to get that from the first request.
- Lastly, I included fields on each API call, so that we're not downloading any data that we aren't intending to use.  This drops 10s of KB from most library group queries, since there's a lot of metadata we don't care about.  We can always add more back later.
@jimmylewis jimmylewis requested a review from tlmii June 21, 2022 00:00
Copy link
Contributor

@tlmii tlmii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jimmylewis jimmylewis merged commit ed732a8 into aspnet:main Jun 21, 2022
@jimmylewis jimmylewis deleted the cdnjsApiChange branch June 21, 2022 17:44
jimmylewis added a commit to jimmylewis/LibraryManager that referenced this pull request Jun 28, 2022
This is a port of aspnet#687 to accommodate changes to the "assets" no longer
providing data for all versions of a library.
jimmylewis added a commit to jimmylewis/LibraryManager that referenced this pull request Jun 28, 2022
This is a port of aspnet#687 to accommodate changes to the "assets" no longer
providing data for all versions of a library.
jimmylewis added a commit to jimmylewis/LibraryManager that referenced this pull request Jun 28, 2022
This is a port of aspnet#687 to accommodate changes to the "assets" no longer
providing data for all versions of a library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants