Repository navigation
Metaplate v0.8.4
Metaplate v0.8.4
Metaplate 0.8.4 is a security and correctness release. A signed image route no longer becomes unsigned when you add .cached() to it. The render cache and metaplate render --incremental no longer serve one copy's image for another, and metaplate render no longer replaces a good card with one that fails its checks. It also adds checkUrl to verifySocialImage, so render, preview, and your own tests handle local and relative image URLs the same way.
Upgrade recommendation: Recommended for everyone, and urgent if you use signed image routes with
plate.cached(). One behavior change:cached()now throws for copy that holds a function. Expect one round of cache misses, and a full first--incrementalbuild, after upgrading.
Why upgrade
- Signed routes stay signed. From JavaScript,
plate.cached().handlerFrom(resolve, { signed })silently dropped{ signed }and served unsigned requests. The cached routes now check the signature before resolving copy or reading the cache. - The right image for each copy. Copies that differed only in key order shared a cache entry and an incremental hash. A component that reads that order could be served, or left with, the other copy's image.
- A failed render keeps the previous card.
metaplate renderused to write each image before checking it, so a card that failed its format, size, or--targetcheck had already overwritten the last good one.
Highlights
Security
- A cached view's
handlerFromandfetchableFromtake the same{ signed }option as the plate's, onmetaplate/nodeandmetaplate/edge. A missing or invalid signature gets the configured 403 or 404 withCache-Control: no-store, and neither the resolver nor the cache runs. Secret rotation and a custom URL extractor work as before. See Signed image routes.
Correctness
- Cache and incremental identity. Both key copy by its object keys in insertion order, at every depth, instead of sorting them. A function in copy, whose captured values its source cannot show, makes
cached()throw aTypeErrornaming it, and makes--incrementalalways render that page. Copy-derived URL versions (version: "copy") still sort keys, so published?v=tokens are unchanged. See Caching renders. - Atomic image writes.
metaplate renderruns every check on the bytes first, then writes to a temporary file beside the target, reads it back, checks it again, and renames it into place. A failed image keeps its previous file. Each image is atomic; a run of many is not, and the render guide explains how to publish all or nothing. - HEAD requests. A cached
HEADresponse has theGETresponse's headers,ETagandContent-Lengthincluded, and no body. - Image versions. Array holes serialize as
null, asJSON.stringifywrites them, soArray(1)no longer versions like[]. AtoJSONthat returns its own object now throws the usual circular-reference error instead of overflowing the stack. - One URL rule.
verifySocialImageacceptscheckUrlandcheckAlt.metaplate render --targetandmetaplate preview --targetcheck the image URL only when it is absolute HTTPS, so a plate with anhttp://localhostorigin or root-relative URLs no longer fails every card. - Preview and the export audit.
metaplate previewwithout a JSX loader tells you to restart under one instead of to save. The testing guide's export audit passes non-HTTPS builds, checks that each page names its own card, fails a page with noog:image:alt, and reports instead of crashing on a relativeog:imageor a missing width.
Breaking changes
One behavior change: plate.cached() throws a TypeError for copy that holds a function, where it used to cache it under the function's source text and could serve the wrong image. Pass the data the function uses instead. No other API changes, and peer ranges are unchanged.
Upgrading changes every render-cache key and --incremental input hash once, so a shared cache store misses once and the first incremental build renders everything. See Upgrading.
Install or upgrade
npm install metaplate@0.8.4That single command still includes the framework-neutral SVG and PNG renderer: npm 7+ and pnpm 8+ install the satori, @resvg/resvg-js, and react peers. Yarn needs them added explicitly. Node.js 20 or newer is required.
Verification
npm run checkpasses: lint, the duplication scan, workflow pin policy, dependency inventory and Socket disposition policy, deployment evidence policy, release-note validation, source and example type checks, 1,369 tests, the build, and the package dry run.npm run check:packageinstalls the packed tarball into fresh consumers and builds and serves the Next.js, Astro, React Router, SvelteKit, Express, and edge fixtures from it.- Each fix has a regression test that fails on 0.8.3. The signed-route and HEAD fixes were also reproduced and confirmed from plain JavaScript against the built package.
- Socket baseline. It is the Socket CLI deep score of the published
metaplate@0.8.3, captured 2026-11-09. The package scores 80 overall; its own alerts arerecentlyPublishedandunpopularPackage(medium) andurlStrings(low). The same two high dependency alerts carry time-bounded dispositions that expire 2027-04-30:string.prototype.codepointat, under the Satori peer, andtslib@2.9.1's ownership change, reached only through optional and development dependencies.tslibwas re-checked against current registry metadata, and nothing has changed. There are no critical alerts. - npm registry signature and SLSA provenance verification run after publication, against the published artifact.
Documentation and support
- README and Upgrading
- Signed image routes and Caching renders
- Testing your cards
- RFC 9110 HEAD
- Release process
- npm package
- Report a problem