Skip to content

Metaplate v0.9.1

Choose a tag to compare

@github-actions github-actions released this 02 Dec 03:42
· 20 commits to main since this release
03f0ef3

Metaplate v0.9.1

Metaplate 0.9.1 makes metaplate render --incremental safe for cards that draw image files. Until now, a card whose artwork or product photo changed under the same path was reused with the old image, because only the copy, the plate's code, and its fonts were part of the cache key. Each card now records the files it read and their contents, and renders again when one changes, and metaplate preview reloads when one of them is edited. The audited Satori release also moves to 0.64.3, which includes a security fix in a Satori dependency.

Upgrade recommendation: Recommended for everyone who uses metaplate render --incremental, and for anyone who wants the patched Satori. There is no migration. The first --incremental build after upgrading renders every image once, and Satori 0.64 can move a card by about a pixel, so compare your cards as the upgrade guide describes.

Why upgrade

  • No more stale cards from changed image files. Re-exporting an SVG or re-cutting a product photo kept its path, so --incremental reported every card unchanged and shipped the old picture. Cards that draw files through readImageAsset or fileImageLoader now render again when those files change, with no new configuration.
  • A way to declare files read with plain fs. A plate that reads a file itself can list it in the new inputs option, and --incremental watches it the same way.
  • A preview that sees image edits. metaplate preview reloaded only when code changed, so a re-exported logo or a new product photo stayed stale in the gallery until you saved a source file. It now reloads when any file a card read changes.
  • Patched Satori. A fresh install now selects Satori 0.64.3, which moves to a patched fflate. The satori peer range is unchanged.

Highlights

Incremental builds that see image files

  • Each manifest entry gains inputs: the files the card read while it rendered, with the SHA-256 of their contents. --incremental reuses a card only while every one of those files still has that hash; a changed or deleted file renders the card again. See Files a card reads.
  • readImageAsset and fileImageLoader from metaplate/assets record each file for the card being rendered, including a fileImageLoader call answered from memory. A file read while the render module loads, such as a logo read at its top level, counts for every card, and a card is not reused when this run's top-level reads differ from the ones it recorded. Renders running at once in one process, through runCli from metaplate/cli, keep each card's files apart, and a later render in the same process still counts the module's top-level reads.
  • createNodeOg, createEdgeOg, and createTakumiOg take inputs: (copy) => paths for files the plate reads with fs. A listed file that cannot be read fails that card, with the reason and where relative paths resolve. Plates gain a matching inputs(copy) member, and RenderInputsOption is exported from metaplate/node, metaplate/edge, and metaplate/takumi.
  • Paths are written relative to the directory the command runs in, with ../ for a file outside it, so cards are reused across checkouts; only a file on another Windows drive or a UNC path keeps its absolute path. The manifest is published with your site unless --manifest points outside --out, so keep it there if image file names are private.
  • Upgrading takumi-js now renders metaplate/takumi plates again. Before, --incremental hashed the Satori and Resvg versions but not Takumi's, and reused every card.
  • Still outside the cache key, as the guide explains: remote images, files read with fs that inputs does not list, and a promise the plate caches itself, which records its file only for the first card. Raise the plate's revision for those. A render repeated in one process draws the bytes its loaders already hold; the next build in a fresh process renders the changed card again.

A preview that reloads on image edits

  • metaplate preview watches the files a card reads through readImageAsset and fileImageLoader, and the files the plate's inputs option names, the same files --incremental records. A file the module reads at its top level is watched as soon as it loads; a card's files join the watch once it renders. A file inputs names is watched even before it exists, so creating it reloads the gallery. See Reloading.
  • The reload imports the module afresh, so a fileImageLoader it creates draws the new bytes. A directory keeps one file watch however many cards read from it, and an inputs that returns something other than file paths fails that card with the message metaplate render gives.

Satori 0.64.3

  • Satori 0.64 lays out at 1/64 px and snaps box edges and text baselines to device pixels, as Chrome does, so a card can differ from its 0.63 rendering by about a pixel. Satori 0.64.1 moves to fflate 0.7.5 (GHSA-px8p-9vwx-vf98).
  • The tests that pin each render guard to Satori's real behavior, and the parity budget that holds metaplate/takumi to metaplate/node, pass on it. Run npm install satori@0.64 to move an existing project.

Breaking changes

None.

Manifests written by earlier versions have no inputs, so the first --incremental build after upgrading renders every image once. See Upgrading.

Install or upgrade

npm install metaplate@0.9.1

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. Peer ranges are unchanged.

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, the full test suite, the build, and the package dry run. npm run check:package installs the packed tarball into fresh consumers, with Satori 0.64.3 selected, and builds and serves the Next.js, Astro, React Router, SvelteKit, Express, and edge fixtures from it.
  • The incremental fix is covered end to end through the spawned CLI, including files read at module load, renders running at once and one after another in one process, a deleted input, manifest paths on Windows, and a real createNodeOg plate drawing a changed SVG. The reproduction from issue #229 was confirmed against the built package, and an independent pre-release review of everything since 0.9.0 found no release blocker. Its findings are fixed or documented in this release, including making metaplate preview reload when an image file changes. The preview change is tested against a spawned CLI whose card shows the bytes of the file it reads.
  • npm audit --audit-level=high reports no vulnerabilities.
  • Socket baseline. It is the Socket CLI deep score of the published metaplate@0.9.0, captured 2026-12-02. The package scores 79 overall, and its own alerts are unpopularPackage (medium) and urlStrings (low). Two high dependency alerts carry time-bounded dispositions that expire 2027-04-30. string.prototype.codepointat, under the Satori peer, carries over: Satori 0.64.3 still reaches it through @shuding/opentype.js. obfuscatedFile now names caniuse-lite@1.0.30001829, reached only through the optional next peer and development tooling. A tarball diff against the reviewed 1.0.30001828 shows only its version and ten packed data files changed, with every decoder byte-identical, and it was published through npm trusted publishing with SLSA provenance. There are no critical alerts. The deep score raises no alert on the optional takumi-js peer, but Socket's export does not list the packages it resolved, so it does not show whether that peer was scored.
  • npm registry signature and SLSA provenance verification run after publication, against the published artifact.

Documentation and support

Full changelog