Skip to content

Metaplate v0.8.4

Choose a tag to compare

@github-actions github-actions released this 10 Nov 04:19

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 --incremental build, 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 render used to write each image before checking it, so a card that failed its format, size, or --target check had already overwritten the last good one.

Highlights

Security

  • A cached view's handlerFrom and fetchableFrom take the same { signed } option as the plate's, on metaplate/node and metaplate/edge. A missing or invalid signature gets the configured 403 or 404 with Cache-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 a TypeError naming it, and makes --incremental always 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 render runs 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 HEAD response has the GET response's headers, ETag and Content-Length included, and no body.
  • Image versions. Array holes serialize as null, as JSON.stringify writes them, so Array(1) no longer versions like []. A toJSON that returns its own object now throws the usual circular-reference error instead of overflowing the stack.
  • One URL rule. verifySocialImage accepts checkUrl and checkAlt. metaplate render --target and metaplate preview --target check the image URL only when it is absolute HTTPS, so a plate with an http://localhost origin or root-relative URLs no longer fails every card.
  • Preview and the export audit. metaplate preview without 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 no og:image:alt, and reports instead of crashing on a relative og:image or 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.4

That 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 check passes: 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:package installs 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 are recentlyPublished and unpopularPackage (medium) and urlStrings (low). The same two high dependency alerts carry time-bounded dispositions that expire 2027-04-30: string.prototype.codepointat, under the Satori peer, and tslib@2.9.1's ownership change, reached only through optional and development dependencies. tslib was 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

Full changelog