Skip to content

v0.29.0

Choose a tag to compare

@github-actions github-actions released this 21 Oct 14:03
· 3568 commits to main since this release

Images with fewer ways to go wrong. foldkit-media 0.2.0: a provider says which facts it takes,
so an image without a content hash given Provider.hosted is a type error, not an empty box; the
server reads its space from that same provider; serveFetch is the whole Worker, with
uploadPolicyBearer for a deployment's secret and variantsR2({ cache: true }).
foldkit-mixins-ui 0.18.0: Icon.view({ icon }) takes the icon itself, and alt takes plain
words. foldkit-plus is 0.11.0. Packages that pin one of them republish with a patch
(foldkit-mixins-form, foldkit-mixins-builder, foldkit-mixins-richtext, foldkit-richtext,
foldkit-richtext-code, foldkit-richtext-code-shiki, foldkit-richtext-dom,
foldkit-richtext-markdown). Code that calls serveFetch({ layer }), serveUploadFetch,
serveFetch({ space }), or Icon.view({ content }) needs changing (see Changed).

Changed

  • foldkit-media: a Provider says which facts it takes (Provider<Asset>), and
    Provider.hosted takes a HashedAsset, facts with a content hash, since it names an original
    by it. Facts without one are a type error where the view is written (Picture.derive,
    Image.view, Avatar.view), where they were drawn as an unavailable image. HashedAsset is
    also the Schema that decodes them (an upload's answer), and isHashed narrows; a ?image
    import's asset is one.
  • foldkit-media/server: serveFetch is the whole Worker: serveFetch({ images?, uploads?, otherwise? }) owns /_image/ and /_media/, answers anything else under them (a preflight
    included) with a 404, and hands every other path to otherwise. serveUploadFetch is
    removed; images: { layer } is what serveFetch({ layer }) was, and images takes no
    coalesce, which a Worker cannot use.
  • foldkit-media/server: the server reads its space from the provider the pages write URLs
    with: images: { provider: Provider.hosted({ space }) } (and layer({ provider })) in place
    of space, so the two cannot differ. Provider.hosted returns a Provider.Hosted, which
    carries its space.
  • foldkit-media/cloudflare: variantsR2(bucket, { cache: true }) puts the Worker's
    caches.default in front, with no cast of the DOM's caches; outside a Worker it throws
    where the layer is made.
  • foldkit-mixins-ui: Icon.view takes the icon itself, Icon.view({ icon, label?, key? }),
    and draws it with foldkit-media's Icon.draw, so a view imports one Icon. content is
    removed: Icon.view({ content: MediaIcon.draw(check, h) }) is Icon.view({ icon: check }).
  • foldkit-mixins-ui: Image.view's alt takes plain words, alt: 'The finals', as
    Image.described('The finals'); ornament is still Image.decorative, never left out.

Added

  • foldkit-media/server: uploadPolicyBearer(secret), the UploadPolicy for a deployment's
    secret: Authorization: Bearer <secret>, compared by digest in constant time, and nobody
    while the secret is unset or empty. The README's upload example compared with ===.