Skip to content

v0.3.0

Latest

Choose a tag to compare

@pallaoro pallaoro released this 29 Jul 12:42

Stale-index results now degrade to a favicon, not to nothing

The bundled index is a snapshot of a registry that moves — upstream touched the
icon data on 25 separate days in the last fortnight, and occasionally renames a
slug (SMMIXBlogent).

An added brand was always fine: lookup misses, the chain falls through to the
favicon tier. A renamed one was not — resolution succeeded against the stale
index, the URL 404'd, and because logo() stops at the first provider that
resolves, nothing else was ever tried. The documented onError handler could
only hide the image.

logo() now attaches the rest of the chain as fallback, resolved recursively:

<img
  src={hit.url}
  onError={(e) => { if (hit.fallback) e.currentTarget.src = hit.fallback.url; }}
/>

The same shape covers thesvg.org being unreachable — a single origin sits behind
every vector URL the library emits.

fallback is absent when nothing else can serve the query: format: "vector"
excludes raster by design, and a brand-name query has no domain for the favicon
tier. fetchLogo() already walked past failing providers and is unchanged.

Additive only — no breaking changes.