Skip to content

refactor(eve): batch the registry catalog's title lookups - #1477

Closed
chadhietala wants to merge 1 commit into
mainfrom
simplify-commit-review-registry
Closed

refactor(eve): batch the registry catalog's title lookups#1477
chadhietala wants to merge 1 commit into
mainfrom
simplify-commit-review-registry

Conversation

@chadhietala

Copy link
Copy Markdown
Contributor

Found

Did
Batched the page into one getRegistryItems call (the index mapping the surrounding map already relies on is unchanged), and collapsed the URL validation with URL.parse, already used in cli/dev/url-target.ts. −25/+16 across 2 files.

Validated
1615 tests pass across src/cli/ and src/setup/. One test changed: the case pinning the per-item fan-out now pins the batch — same expected titles in the same order, plus an assertion that a page costs one call. tsc --noEmit, lint, fmt, guard:invariants clean.

#1436 replaced the hardcoded title map with real manifest titles, fetching
one manifest per search result inside a `Promise.all` over the page. But
`getRegistryItems` already takes an array: the vendored implementation is
`Promise.all(items.map(...))` behind a shared source cache, returning
manifests in input order. So the per-item fan-out wrapped an API that was
already batched, and #1436's `CATALOG_PAGE_SIZE = 100` made that up to 100
independent calls — each with its own cache — for one browse.

One call now fetches the page, and the index mapping the surrounding
`result.items.map` already relies on is unchanged.

`resolveOfficialRegistryUrl` from #1427 validated its URL with a
try/catch around `new URL` plus a protocol check, repeating the same error
message in both arms. `URL.parse` — already used in `cli/dev/url-target.ts`
— collapses them into one condition.

The one test that pinned the fan-out ("in parallel", two resolvers keyed by
address) now pins the batch instead: same expected titles in the same
order, plus an assertion that the whole page costs one call.

Signed-off-by: Chad Hietala <chadhietala@gmail.com>
@chadhietala chadhietala added the simplify-devbox Simplification found by the automated devbox code review label Jul 31, 2026
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
eve-docs Ready Ready Preview Jul 31, 2026 4:54pm
eve-docs-4759 Ready Ready Preview, v0 Jul 31, 2026 4:54pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

simplify-devbox Simplification found by the automated devbox code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant