Repository navigation
Metaplate v0.9.0
Metaplate v0.9.0
Metaplate 0.9.0 is the Cloudflare Workers release. The experimental metaplate/takumi entry renders cards on a Worker with Takumi's precompiled WebAssembly. For Next.js on Workers through OpenNext, the new definePlate lets pages import a plate's URL contract without its renderer, while the build prerenders the cards. metaplate render can now write the social tags into static HTML pages. metaplate verify-page can treat a staging site's robots block as expected. fetchImageLoader loads per-page images safely on any Fetch runtime. Two new render guards, fontFallback and lineClamp, catch text Satori draws in the wrong font or without the clamp you asked for.
Upgrade recommendation: Recommended for everyone, and worth a look if you deploy to Cloudflare Workers or an edge runtime. There is no runtime migration. TypeScript code that switches exhaustively over
RenderGuardIssue["guard"]needs"fontFallback"and"lineClamp"cases. Scripts that parse the text output ofverify-pagefor robots lines should read its--jsonoutput instead.
Why upgrade
- Cards on Cloudflare Workers.
metaplate/edgecannot start on Workers. Satori's bundled HarfBuzz compiles its WebAssembly at run time, which Workers forbid.metaplate/takumirenders there through a precompiled module, with the same plate surface ascreateEdgeOg. - Safe remote images on edge runtimes.
remoteImageLoaderneeds Node's DNS and sockets, so edge plates had to hand-write their ownfetch.fetchImageLoaderbrings the same allowlist, redirect, byte, and time limits to the Fetch API. - Next.js on Workers without drift. Pages on a Worker must not import the renderer, so they rebuilt image metadata by hand and restated the plate's
imagePath, version, and revision.definePlateis the plate's contract with no renderer attached. Pages and the build share it, so their URLs cannot drift apart. - Silent rendering mistakes are caught. A typo in
fontFamily, a weight the family lacks, or alineClampon a flex column used to render with no error. ThefontFallbackandlineClampguards report them.
Highlights
Rendering on Cloudflare Workers (experimental)
createTakumiOgfrommetaplate/takumirenders plates with Takumi (takumi-js, a new optional peer,>=2.22.1 <3). It supports variants, handlers,fetchableFrom, ETags, output encoders,languageFonts, and every render guard exceptavoid. Emoji come from the plate's own emoji loader and never from a CDN. Takumi itself fetches nothing: an imagesrcor CSSurl()that is not adata:URI fails the render before any request, so remote images go throughfetchImageLoaderwith its allowlist. Fonts must be TrueType, OpenType, or WOFF2. See Takumi.- Takumi lays out like a browser in a few places where Satori does not. It defaults to
box-sizing: border-box, keeps an image's width in a flex row, and fails on a truncated image instead of drawing part of it. The guide lists every difference and shows how to compare a plate withcompareImagesbefore switching. - On the Workers Free plan, a warm render measured about 13 ms of CPU, against the documented 10 ms limit. Serve cards with long-lived
Cache-Controland an ETag, put them behind the Cache API, or render at build time. The Paid plan fits uncached rendering easily. The entry is not hosted-certified: the evidence is a spike Worker in production and a test that bundles the entry with Wrangler'sworkerdconditions and checks that it carries Takumi's WebAssembly module and no Node built-ins. - A new parity suite renders 16 plates through both
metaplate/nodeandmetaplate/takumiand holds each to its own pixel budget. Atakumi-jsorsatoriupdate that moves layout fails before it merges.
Next.js on Cloudflare Workers, and static pages
definePlatein the rootmetaplateentry returns a plate's URL and metadata contract (alt,size,variants,imagePath,basePath,origin,version,revision,contentType) with the plate'smetadata,signedMetadata,image,sitePath, andvariantmembers. It imports no renderer. Spread it intocreateNodeOg,createEdgeOg,createTakumiOg,createSvgOg, orcreateNextOgand addfontsandcomponent. Both sides run the same metadata code, and a test compares them across 288 option combinations. A factory throws when the contract'scontentTypeis not what it serves. See A contract without a renderer.- A new guide, Next.js on Cloudflare Workers, covers the hybrid setup for
@opennextjs/cloudflare. Cards are rendered intopublic/before the build and served as Workers static assets. Pages import only the contract, andverify-pagechecks the result after deploying. - A
metaplate renderpage can name anhtmlfile and its page-level tags. The command then writes the plate's social<meta>tags between<!-- metaplate:social -->markers, or before</head>the first time.og:imagecarries the same?v=URL the render recorded. Re-running writes the same bytes, and a page is written atomically and only after all of its images succeed. Malformed markers, a missing</head>, or a hand-writtenog:imageoutside the block fail the run before anything renders. See Writing tags into static HTML.
Staging checks with verify-page
metaplate verify-pageprints one robots.txt line per crawler, listing the page and image URLs it blocks. It used to print the same block up to once per target and image.--expect-robots-block(expectRobotsBlockinverifyRemotePage) is for sites that block crawlers on purpose. A block is reported as expected, and the run fails when a crawler can fetch the page.--jsonadds acrawlerfield to robots issues, a per-crawlerexpectation, and arobots-not-blockedissue code; no field is removed. See Sites that block crawlers on purpose.
Remote images on Fetch runtimes
fetchImageLoaderinmetaplate/imageisremoteImageLoaderbuilt on the Fetch API, for Cloudflare Workers (withmetaplate/takumi), Netlify Edge, Deno, and Vercel Edge. It keeps the requiredoriginsallowlist, the URL, scheme, credential, and port checks, redirects re-checked on every hop, a byte cap enforced fromContent-Lengthand while streaming, one time budget, and the bounded cache. It reports the sameRemoteImageErrorcodes, whichmetaplate/imagenow also exports. Fetch runtimes hide DNS, so it refuses only hosts written as non-public IP addresses orlocalhostnames, and the allowlist is the boundary. See Edge runtimes.
Reliability
- The
fontFallbackguard, forcreateSvgOg,createNodeOg,createEdgeOg, andcreateTakumiOg, reports each font request that no loaded face satisfies, asmissing: "family"ormissing: "face", with the loaded faces listed. It follows inline styles down the tree, calls nested function components, and counts faces fromlanguageFontsas loaded. Like every guard, it is off by default. See Render guards. - The
lineClampguard reports a clamp or ellipsis that Satori ignores and draws in full:lineClampon an element whose display is notblock,WebkitLineClampwithout-webkit-box,textOverflow: "ellipsis"withoutoverflow: "hidden"and a non-wrappingwhiteSpace, and a clamp whose text sits inside a child element. A test renders every case through Satori, so a Satori update that changes these rules fails it. On Takumi, which clamps more cases, the guard applies Satori's rules so a plate stays portable. - The rendering guide said plates have no stylesheet. Custom properties declared in the plate resolve in every adapter, and
<style>elements apply increateSvgOg,createNodeOg, andcreateEdgeOgon Satori 0.51.0 or later. Only the site's own CSS is out of reach.createNextOgis the exception, and tests now pin each behavior.
Breaking changes
None at run time. Two changes may need attention:
RenderGuardNamegains"fontFallback"and"lineClamp", andRenderGuardIssuegains a member for each. TypeScript code with an exhaustiveness check overissue.guardneeds a case for each. Both guards are off by default.- The text output of
metaplate verify-pageshows each robots.txt block once per crawler, with only the deciding rule. Scripts that parse those lines should read--json, which only gains fields. ItsRobotsIssueCodetype gains"robots-not-blocked", so an exhaustive switch over issue codes needs a case for it.
The existing peer ranges are unchanged. See Upgrading.
Install or upgrade
npm install metaplate@0.9.0That 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. takumi-js is optional and is only needed for metaplate/takumi. Add it with npm install takumi-js when you use that entry.
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, the full test suite, 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.metaplate/takumiis tested on Node.js through Takumi's native addon on Linux, Windows, and macOS, and as a Workers bundle built with Wrangler's import conditions. The Takumi spike found Takumi's Wasm and native outputs pixel-identical on all 19 of its fixtures.- Socket baseline. It is the Socket CLI deep score of the published
metaplate@0.8.4, captured 2026-11-25. The package scores 80 overall, and its own alerts arerecentlyPublishedandunpopularPackage(medium) andurlStrings(low). Two high dependency alerts carry time-bounded dispositions that expire 2027-04-30.string.prototype.codepointat, under the Satori peer, carries over.obfuscatedFileoncaniuse-lite@1.0.30001828is new and is reached only through the optionalnextpeer and development tooling. A tarball diff shows it is that release's new packed data format, with no dynamic code, network, or filesystem access, and it was published with SLSA provenance. Thetslibownership alert no longer appears. There are no critical alerts. Because the baseline scores the published 0.8.4, it does not yet cover the new optionaltakumi-jspeer (a native addon and a WebAssembly build, mostly from one maintainer). The 0.9.0 package's own score will. - npm registry signature and SLSA provenance verification run after publication, against the published artifact.
Documentation and support
- README and Upgrading
- Takumi, Next.js on Cloudflare Workers, and Edge runtimes
- Writing tags into static HTML and Sites that block crawlers on purpose
- Cloudflare Workers limits, Cloudflare Workers WebAssembly, Workers static assets, and OpenNext for Cloudflare
- Release process
- npm package
- Report a problem