Skip to content

fix: use useFetch for useDependencyAnalysis#551

Merged
danielroe merged 4 commits intonpmx-dev:mainfrom
OrbisK:perf/dependency-analytics
Jan 31, 2026
Merged

fix: use useFetch for useDependencyAnalysis#551
danielroe merged 4 commits intonpmx-dev:mainfrom
OrbisK:perf/dependency-analytics

Conversation

@OrbisK
Copy link
Contributor

@OrbisK OrbisK commented Jan 31, 2026

This fixes a bug where the state key was not updated when the version or package changed.

Now, requests are deduped correctly as well. We could remove useDependencyAnalysis() entirely in favour of just having useFetch(() =>`/api/registry/vulnerabilities/${encodePackageName(toValue(packageName))}/v/${toValue(version)}`)


There will be two followup issues:

  1. nuxt (upstream): deduped fetches cause theses warnings
image
  1. the vulnerabilies endpoint does not handle namespaced packages correctly (api/registry/vulnerabilities/ does not handle scoped packages #552)
image

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Jan 31, 2026 8:49pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Jan 31, 2026 8:49pm
docs.npmx.dev Skipped Skipped Jan 31, 2026 8:49pm

Request Review

@OrbisK
Copy link
Contributor Author

OrbisK commented Jan 31, 2026

@danielroe I think ci/knip is lying. Can I help you with: webpro-nl/knip#1265 ? (I removed some unnecessary imports)

@danielroe
Copy link
Member

please! do you want permissions for my fork?

@danielroe danielroe added this pull request to the merge queue Jan 31, 2026
Merged via the queue into npmx-dev:main with commit 0d06026 Jan 31, 2026
13 checks passed
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