Repository navigation
v0.29.0
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: aProvidersays which facts it takes (Provider<Asset>), and
Provider.hostedtakes aHashedAsset, 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.HashedAssetis
also the Schema that decodes them (an upload's answer), andisHashednarrows; a?image
import'sassetis one.foldkit-media/server:serveFetchis 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 tootherwise.serveUploadFetchis
removed;images: { layer }is whatserveFetch({ layer })was, andimagestakes 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 }) }(andlayer({ provider })) in place
ofspace, so the two cannot differ.Provider.hostedreturns aProvider.Hosted, which
carries itsspace.foldkit-media/cloudflare:variantsR2(bucket, { cache: true })puts the Worker's
caches.defaultin front, with no cast of the DOM'scaches; outside a Worker it throws
where the layer is made.foldkit-mixins-ui:Icon.viewtakes the icon itself,Icon.view({ icon, label?, key? }),
and draws it withfoldkit-media'sIcon.draw, so a view imports oneIcon.contentis
removed:Icon.view({ content: MediaIcon.draw(check, h) })isIcon.view({ icon: check }).foldkit-mixins-ui:Image.view'salttakes plain words,alt: 'The finals', as
Image.described('The finals'); ornament is stillImage.decorative, never left out.
Added
foldkit-media/server:uploadPolicyBearer(secret), theUploadPolicyfor 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===.