Skip to content

chore(deps): update dependency @takumi-rs/core to v2 - #307

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/takumi-rs-core-2.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/takumi-rs-core-2.x

Conversation

@renovate

@renovate renovate Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
@takumi-rs/core (source) 1.7.0 → 2.22.1 age confidence

Release Notes

kane50613/takumi (@​takumi-rs/core)

v2.21.0

Reuse downloaded bytes across renders, and load Google Fonts for known text

Renderers now keep the images, @font-face files, and font URLs they download in a 32 MiB store keyed by URL, so a later render skips the download. A render that passes its own fetch skips the store, since that fetch may send credentials.

import { googleFonts } from "takumi-js/helpers";

const fonts = googleFonts({ families: ["Noto Sans JP"], text: "東京の夜景" });
  • googleFonts takes text to load one file holding just those characters.
  • A font in a render's fonts list takes cache: "none", which drops the font once the render settles. googleFonts sets it on every subset through cacheMode: "none".
  • Under the default "auto", a googleFonts subset loaded for text drops once its render settles too, since another render rarely asks for the same characters. Range subsets and other fonts stay as before.
  • CacheMode names the "auto" | "none" policy that images and fonts share. ImageCacheMode stays as a deprecated alias.
Migration

images.fetchCache is deprecated, since renders keep their downloads without it.

- await renderer.render(node, { images: { fetchCache } });
+ await renderer.render(node);
unregisterFont leaves the built-in Geist in place

unregisterFont now removes only the fonts you registered. Before, unregistering Geist also removed the built-in Geist, so text that no registered font covered drew nothing.

// @takumi-rs/core and @takumi-rs/wasm. Use `new Painter()` in takumi-paint and `new PdfRenderer()` in takumi-pdf.
const renderer = new Renderer();

// Before: true, and the built-in Geist is gone
// After: false, since no registered font is named Geist
renderer.unregisterFont({ name: "Geist" });
See what a renderer's cache holds

Renderer, PdfRenderer, and Painter have cacheStats(), which reports the bytes the pool holds and how lookups of each kind went.

const { memory, images } = renderer.cacheStats();
console.log(memory.current, memory.high);
console.log(images.hits, images.misses, images.evictions);

takumi-js exports cacheStats for the renderer that render and the other functions share. It returns undefined until the first render creates that renderer. In Rust, Cache::stats does the same for a Cache.

An image moved by a fraction of a pixel blends its edges

An image that a transform such as translate(0.5px) moved by part of a pixel, drawn at its own size, snapped to the nearest whole pixel and lost the shift. It now blends across the pixel it falls between, as a browser draws it.

The paint tree lists the CSS a render dropped

A declaration or at-rule that takumi drops no longer vanishes without a trace. The paint tree lists each one once, with its property and value as written, why takumi dropped it, and where it was written. The image stays the same.

const tree = await paint(html, { width: 600, height: 200 });

console.log(tree.ignoredDeclarations);
// [{ property: "writing-mode", value: "vertical-rl", reason: "unknown-property", origin: "style-attribute" }]
  • reason is unknown-property, invalid-value, or unknown-at-rule.
  • origin is style-attribute, style-sheet, or style-object.
  • takumi paint prints the list under ignored, and its JSON output holds it as ignoredDeclarations.
  • needs() in @takumi-rs/core, @takumi-rs/wasm, and takumi-pdf returns the same list as ignoredDeclarations.
  • In Rust, RenderNeeds::ignored_declarations and PaintDocument::ignored_declarations hold the same list, and StyleSheet::ignored_declarations holds what one style sheet dropped.
An image whose header claims too many pixels fails to load instead of aborting a PDF

A PNG or WebP whose header claims an edge longer than 8192 pixels, the limit every decode already enforced, now fails to load like any other undecodable image. A PDF used to embed such a PNG as is and abort the whole process when it sized a buffer from that header.

An offset-path with huge coordinates renders instead of panicking

A path() in offset-path whose coordinates run into the quintillions, as generated or user-supplied paths can, panicked while measuring its length. It now measures, and a percentage offset-distance lands at that share of the whole path instead of near its start.

Download fonts listed as URLs with the render's fetch options

A URL string in a render's fonts list now downloads with the fetch, allowUrl, timeout, maxBytes, and signal the render's images use, so allowUrl refuses it too.

await render(<div>Hello</div>, {
  width: 1200,
  height: 630,
  fonts: ["https://fonts.example.com/Brand.woff2"],
  images: { allowUrl: (url) => url.startsWith("https://cdn.example.com/") },
});
// Before: downloads the font
// After: rejects with "URL blocked by allowUrl policy: https://fonts.example.com/Brand.woff2"
A JSX <svg> or <img> sized with "100%" or "24px" draws at that size

A JSX <svg> or <img> whose width or height was a string with a unit, such as "100%", "2em", or "24px", drew nothing. It now draws at that size, as the same markup passed as HTML does.

<div style={{ display: "flex", width: 200, height: 100 }}>
  <svg width="100%" height="50%" viewBox="0 0 2 1">
    …
  </svg>
</div>
// Before: the svg draws nothing
// After: the svg's box is 200 × 50, since a percentage resolves against the containing block
  • An <svg> reads width and height as CSS lengths, such as 2em, and ignores a negative one.
  • An <img> reads them as HTML does, as pixels or a percentage, so width="2em" is 2 pixels.
A style value Takumi cannot read is ignored instead of failing the render

A node's style object now drops a declaration whose value is invalid, such as a negative height, and renders the rest, as a browser does with a style attribute. Where a render used to reject, console.warn now prints the same message after takumi: ignoring, and in Rust the message is a log warning under the takumi::style target.

Every renderer takes its cache size in one cache option

Renderer, PdfRenderer, and Painter take a cache option. Its maxBytes, 128 MiB by default, is one pool for everything a renderer reuses. Setting images, glyphs, or fonts to "none" keeps none of that kind. The options apply when the renderer is created.

const renderer = new Renderer({
  cache: {
    maxBytes: 256 * 1024 * 1024,
    glyphs: "none",
  },
});
Migration

cacheMaxBytes, fontCacheMaxBytes, and FontCacheOptions are deprecated. In @takumi-rs/core and @takumi-rs/wasm, setGlyphCacheMaxBytes is deprecated, and only 0 still changes anything.

- setGlyphCacheMaxBytes(0);
- const renderer = new Renderer({ cacheMaxBytes: 64 * 1024 * 1024 });
+ const renderer = new Renderer({ cache: { maxBytes: 64 * 1024 * 1024, glyphs: "none" } });

  // types
- let options: FontCacheOptions;
+ let options: RendererOptions;
A missing native binding names the package to install

When @takumi-rs/core cannot load its native binding, the error now names the platform package to install and links the troubleshooting guide, instead of blaming an npm bug. On a platform with no published binding, it points to @takumi-rs/wasm.

Animated PNGs and GIFs are smaller and encode faster when frames repeat

Each frame of an animated PNG now stores only the pixels that changed since the frame before it, and a frame that changes nothing stores one pixel. An animated GIF stores an image held across several frames once, shown for their total delay, so it has fewer frames. Both decode to the same images at the same times as before. GIF frames of 10ms or less stay separate, since browsers stretch each one to 100ms.

Renders warn about what they could not draw, and load fonts for missing characters

A render now warns when it goes without a character's glyph, a font family, an optional font, or an image under images.throwOnError: false. Each warning prints through console.warn as takumi: <message>, the same form as the warnings for unsupported CSS, every time a render raises it. To collect the warnings somewhere else, wrap console.warn.

takumi: No font draws "世界". Add a font that covers them to `fonts`, or return one from `loadFallbackFonts`.
  • prepare() prints the warnings it finds, and a later render of the prepared source warns only about a font that fails when it loads again.
  • A render() without prepare() checks glyphs and families only when it passes loadFallbackFonts.
  • loadFallbackFonts(characters) runs once when characters have no font, and the fonts it returns load with the render.
  • In Rust, RenderNeeds has missing_characters and unresolved_families, and is now #[non_exhaustive].
GIFs, APNGs, and animated WebPs draw at the device pixel ratio, and as backgrounds

With a devicePixelRatio above 1, an animated image drew at its CSS size in device pixels. It filled the top-left of its box, and its right column and bottom row streaked across the rest. A single-frame GIF drew the same way. An animated image used as a background-image drew nothing at all. Both now draw as a still PNG does.

ImageSource::dimensions gives an image's natural size in its own pixels.

A render aborted while its fonts list resolves starts no image loader

When the signal aborts while a promised fonts list is still resolving, the render now rejects as soon as the list resolves, without calling any image's data() loader. Before, it called each loader and then rejected.

Glyphs, Tailwind classes, and @font-face faces stay in the render's Cache

Two renderers in one process no longer share glyphs, compiled Tailwind classes, @font-face faces, or decoration intercepts. Each Cache keeps its own glyphs in the pool it shares with every other kind of data. glyphs(ImageCacheMode::None) keeps none.

let cache = CacheOptions::builder().glyphs(ImageCacheMode::None).build();

In @takumi-rs/core and @takumi-rs/wasm, setGlyphCacheMaxBytes(0) now keeps no glyphs only in renderers created after the call, and any other size keeps them in the shared pool. In takumi-js, it reaches only the renderer behind render, not a Renderer from takumi-js/node.

Migration

set_glyph_cache_max_bytes in takumi-core is deprecated. A size of 0 still keeps no glyphs in the caches built after the call, and a larger size no longer bounds them apart.

- set_glyph_cache_max_bytes(0);
- let cache = CacheOptions::builder().build();
+ let cache = CacheOptions::builder().glyphs(ImageCacheMode::None).build();
A cropped image decoded at its drawn size draws sharp

An image that object-fit: cover or object-position crops, decoded at the size it draws, could pass through the bilinear filter and come out slightly soft, as when a photo 4032 pixels wide draws 1200 wide. It now copies its pixels, and draws faster.

A font one render lists no longer changes another render

Each render now draws with the fonts its own fonts list names and the fonts registerFont registered. Before, a renderer kept using the fonts earlier renders had listed, so the same request could come out differently.

await renderer.render(html, { fonts: [brandRegular] });
await renderer.render(html, { fonts: [brandBold] });
await renderer.render(html, { fonts: [brandRegular] });
// Before: the third render draws Brand with the bold face the second one listed
// After: the third render matches the first

A family that only another render listed now falls back to the next family. List the font in this render, or register it with registerFont.

The options types of @takumi-rs/core and @takumi-rs/wasm no longer list failedFontFiles, a field only the renderer itself sets.

Evict fonts one file at a time from the renderer's cache

Font files that renders load now share the renderer's maxBytes pool and leave it one file at a time, least recently used first. A family that keeps gaining files, such as one Google Fonts text= subset per title, now stays within maxBytes. A render keeps the fonts it uses until it finishes, and fonts from registerFont still stay. With cache.fonts set to "none", each file goes as soon as the last render using it finishes.

const renderer = new Renderer({ cache: { fonts: "none" } });

fontCacheMaxBytes no longer bounds the fonts apart. A value of 0 still keeps none, as "none" does.

Among equally matching faces of one family, the one listed last now wins every time.

Render without a font that fails to load when the font is optional

A font in a render's fonts list takes optional: true. When an optional font fails to download, allowUrl refuses it, or its bytes do not decode, the render goes on without it instead of rejecting.

await render(<div style={{ fontFamily: "Brand, Inter" }}>Hello</div>, {
  width: 1200,
  height: 630,
  fonts: [
    fontFromUrl("https://example.com/Inter.woff2"),
    fontFromUrl("https://cdn.example.com/Brand.woff2", { optional: true }),
  ],
});
An svg element drawn in two text colors shows each color

An svg element that inherits color, through color="currentColor" on its root or a <style> rule, now draws in the color of each box it sits in. Before, every copy took the first color it was drawn in. An SVG image that uses its host's fonts follows each host too.

Migration

SvgSource::vector_ops is removed. SvgSource::picture returns the same ops, shared with the cache.

- let ops = source.vector_ops(&host, viewport);
+ let picture = source.picture(&host, viewport);
+ let ops = picture.ops();
Unsupported CSS warns through console.warn

@takumi-rs/core, @takumi-rs/wasm, and takumi-js on either of them now report a CSS property takumi does not support through console.warn each time they parse a style sheet or style attribute that uses it. A render that reuses a css list the renderer still holds parsed does not warn again. Before, the declaration dropped without a word, so a typo such as widht changed the render silently. Other warnings takumi logs, such as an animated image frame that fails to decode, print the same way.

v2.20.0

A unicodeRange subset without a glyph falls back to the next family again

A font in fonts whose unicodeRange claims a character it has no glyph for now hands that character on to the next family in the stack, as a browser does and as 0.18 did. Before, the render left the next family's subset unloaded. The PDF render then failed with "No registered font covers". That error now reads "No font the text can use draws", and suggests checking each font's unicodeRange and the font-family stack, because a registered font can have the glyph and still be out of reach.

prepare downloads the fonts @font-face rules load

An @font-face rule in css or a <style> element now loads its font in prepare, render, and ImageResponse. A src that fails to download falls back to the next one.

registerFont registers one buffer again under another name, weight, style or unicodeRange

Passing the same data buffer to registerFont a second time with other descriptors used to return the first registration, so the new family or weight never existed. Each set of descriptors now registers its own face, as @font-face rules sharing one src do. A lazy font's key includes its unicodeRange too.

v2.19.0

Renderers take HTML directly

render, renderSvg, measure, and the WASM renderAsDataUrl accept an HTML string in place of a node tree. The markup is parsed in Rust, and the CSS of its <style> elements follows the css option. A <style> with a media attribute applies only where its query matches. takumi-html adds parse_html, which returns that CSS with the tree. fromHtml from @takumi-rs/helpers/html is deprecated in favor of passing the string and will be removed in v3.

Renderer.prepare fetches what a render needs ahead of it

renderer.prepare(source, options) styles an HTML string or node tree, fetches the images it draws, and loads the font subsets its text uses. render, renderSvg, and measure take the prepared source with only output options such as format. renderer.prepareAnimation(options) does the same for every scene of an animation, and renderAnimation takes its result. prepareImages from @takumi-rs/helpers is deprecated in favor of prepare.

takumi-js renders through prepare, so it fetches the images the styled tree draws. An image that css, a <style> element, or a ::before rule sets now renders, an image under display: none is no longer fetched, and a custom fetch now receives relative URLs such as /logo.png.

Parse HTML strings in Rust in every renderer

takumi-paint and takumi-pdf take HTML strings as @takumi-rs/core and @takumi-rs/wasm do, and takumi-pdf takes them for header and footer bands too. A renderAnimation scene can be an HTML string, its <style> rules applying to the animation. With emoji: "from-font", takumi-js hands HTML to the renderer instead of parsing it in JavaScript.

Font subsets load as a browser loads them

When fonts holds unicodeRange subsets, as googleFonts returns, a render now loads only the subsets that font matching reaches for each character, through that text's own font stack, weight, and style. With font-family: Inter, "Noto Sans JP", Latin text no longer loads Noto Sans JP's Latin subset, and a bold subset loads only when bold text uses it.

The text comes from the styled tree, so a subset needed only by a stylesheet's generated content, a list marker, text-transform, the text elements of an SVG image, or a takumi-pdf page counter now loads. collectCodepoints, LIST_MARKER_CHARACTERS, and subsetFonts are deprecated.

Loading a font no longer blocks rendering

FontResource::into_resolved now also limits the cmap to the unicode_range and hashes the font, so registering a resolved font takes the same short time whatever its size. @takumi-rs/core registers fonts on the JavaScript thread after decompressing them in the background, and renders no longer wait on a lock while fonts load. The font cache budget now counts a unicode-range subset by the bytes it keeps.

v2.18.2

Faster renderer initialization

Renderers now load the bundled variable Geist font without decompressing WOFF2 or copying its bytes. Custom WOFF2 fonts remain supported.

v2.18.0

Draw an outline that sets only outline-style

An element with outline-style: solid and no outline-width now draws a medium (3px) outline, as browsers do. It used to draw no outline unless another outline longhand, such as outline-color, was also set.

Apply the dimension limit to each GIF frame

A GIF frame wider or taller than 8192 pixels now fails to decode, as a GIF whose canvas is that large already does.

Copy font and image bytes before a worker thread reads them

registerFont, render, renderSvg, measure, and renderAnimation now copy the Buffer, Uint8Array, or ArrayBuffer they are given before work moves to a worker thread. Rewriting or transferring those bytes while the call runs no longer corrupts its result or reads freed memory.

v2.17.1

Skip an SVG too large to rasterize instead of failing the render

An SVG image or background that would rasterize past the pixel budget, such as background-size: cover on an SVG with an extreme viewBox, is now left undrawn. The whole render used to fail with InvalidPixmapSize.

Clip a repeated background to its box

A repeated background-image whose tiles do not divide the box evenly, such as 15px tiles in a 96px box, now stops at the box's edge. Its last row and column of tiles used to paint past it.

Scale images up faster

A magnified image lerped every source row across the destination width again for each destination row that read it. Each source row is now lerped once and reused, so drawing a small image across a large box takes about 40% less time. The output is unchanged.

Blur what lies past the canvas edge

Since 2.15.0, an element with a pixel-moving filter such as blur() that reached past the canvas's top or left edge lost that part before filtering, so its blur faded toward the edge. The filter layer now takes in what the filter reads past the canvas, as Chrome's compositor does.

v2.17.0

Bound render fonts with fontCacheMaxBytes

Past this cap in decoded font bytes, a renderer releases the least recently used fonts that renders' fonts lists loaded, and a later render loads them again. Fonts from registerFont stay, and a running render keeps the fonts it started with. The wasm Renderer now passes its options, such as cacheMaxBytes, to the native renderer.

Release fonts a renderer no longer needs

unregisterFont({ name }) removes a family with all its unicodeRange subsets, and clearFonts() goes back to the bundled fallback font. A later render that lists a released font registers it again. In Rust, use Fonts::unregister_family.

v2.16.0

Register font subsets with unicodeRange

A font now takes unicodeRange, the codepoint ranges its @font-face declares. It serves only those codepoints, as in Chrome, so each subset of a family registers under the same name:

const fonts = [
  { name: "Inter", data: latin, unicodeRange: [[0x0000, 0x00ff]] },
  { name: "Inter", data: cyrillic, unicodeRange: [[0x0400, 0x045f]] },
];

googleFonts returns its subsets this way. subsetOf and subsetRank are deprecated: subsetOf now only sets the family name, and subsetRank does nothing. In Rust, use FontResource::unicode_range.

v2.15.2

Read node trees off the main thread

render, renderSvg, and measure pass a node tree to the native renderer as JSON when it holds only plain values. The renderer parses it on a worker thread, so a 48-card dashboard blocks the event loop for 0.1 ms instead of 0.7 ms and renders about 10% faster. Trees holding bytes or other values JSON cannot keep are read as before.

v2.13.7

Export the CssInput type from @​takumi-rs/core

The css option referenced CssInput without importing it, so type checking failed on the declaration file when skipLibCheck was off.

v2.13.2

Stop an oversized node from crashing the render

A node far larger than the viewport wrapped its buffer size past u32 and crashed the render. A clip path now rasterizes only the part that reaches the canvas, an oversized shadow is dropped, and a mask too large to rasterize hides its node instead of leaving it unmasked.

v2.13.1

Encode only the changed region of each animated WebP frame

Animated WebP frames after the first now carry just the rectangle that changed since the previous frame, stored with the no-blend flag so it replaces the canvas. Animations with a small moving region over a static background come out much smaller and encode faster. Frames that change everywhere are unaffected, and dispose: true keeps full-canvas frames.

Read premultiplied pixels as straight colour in filter

A colour filter ran on the canvas's premultiplied pixels as if they held straight colour, so it only landed on the right value where the element was fully opaque. Antialiased edges came out washed out, and opacity() left the colour unscaled, so a faded layer went pale instead of translucent.

v2.13.0

Resolve tw utilities through CSS variables

Utilities now read the CSS variables Tailwind compiles them to, falling back to the built-in value. Define tokens in :root. --color-brand-500 makes bg-brand-500 work, and spacing, fonts, shadows, animations and breakpoints follow the same rule.

Gradients now match Tailwind on two counts. Stops alone no longer paint without bg-linear-*, bg-radial or bg-conic, and a missing to stop fades to transparent.

Let stylesheet rules win over tw utilities

Utilities now sit in the last cascade layer, below unlayered CSS and above rules in a named @layer. Important reverses that order. An important utility beats unlayered important CSS but loses to one in a named layer. Inline important declarations stay on top. A template that relied on tw beating a matching rule needs a fix. Move that rule into a layer, or mark the utility !.

Honor !important in inline styles

An inline !important declaration now outranks important rules and animations. Both the style object and an HTML style attribute read the marker.

Inherit text-fit from a parent

text-fit now inherits. Descendant text uses the inherited value to calculate its scale.

Parse @theme blocks as :root rules

A Tailwind v4 source stylesheet now works in css without compiling it first. @theme declarations land on :root, and @keyframes inside the block register. Modifiers like reference read the same way. The prefix() modifier is not supported.

Wrap box-sizing: content-box text inside its padding

A box with box-sizing: content-box and horizontal padding wrapped its text
against the border box, so the text took fewer lines than it needed and
overflowed the bottom of the box.

Cut allocations in style property parsing

Parsing a string-valued property copied the value before handing it to cssparser. Normalizing a kebab-case or camelCase property name allocated a second string just to trim leading underscores. String values now parse in place, and names normalize in one allocation.

Compose filters and transforms through custom properties

Filter, translate, scale and grid-line utilities now compose through --tw-* variables like Tailwind's compiled CSS. Stacked filters follow Tailwind's fixed chain order instead of class order.

Size auto table columns by their content

An all-auto table shared its free space evenly, so a one-word column took as
much room as a paragraph. Each column now grows in proportion to its
max-content width, the way Blink distributes it, and never below the widest
word it has to hold. A table narrower than its content still approximates.

Escape control characters in serialized CSS strings

A quoted string containing a newline left it unescaped. This produced invalid CSS. CSS strings now use cssparser's escaping.

Write a css entry as an object

A css entry can be a rule, { selector, style, rules }, or an animation, { keyframes, steps }. Takumi checks the selector and every value before the entry reaches the parser, so a token that comes from application data cannot escape the rule it was written for. The keyframes option is deprecated and goes away in v3.

Turn on Preflight through @import "tailwindcss"

The import line at the top of a Tailwind v4 stylesheet now works. Preflight replaces the UA preset. Margins and padding go, lists lose their markers, and h1 through h6 drop their font sizing. It also brings the universal border reset, link and table resets, block-level images, and hidden on any element. Author rules outrank Preflight, apart from hidden, which it marks important. Other @import targets stay unsupported.

Support the disclosure-open and disclosure-closed counter styles

list-style-type now accepts disclosure-open and disclosure-closed, drawing the triangles CSS Counter Styles defines. disclosure-closed points the way the text runs, so it flips under direction: rtl. Font subsetting covers all three characters.

Report text runs for a node that holds text directly

measure returned no text runs for <div>word</div>, the shape an HTML parse
produces most often, while <div><span>word</span></div> reported them. The
render was correct either way; only the measurement was missing its geometry.

Support legacy WebKit box alignment properties

Map -webkit-box-orient to flex-direction, -webkit-box-pack to justify-content, and -webkit-box-align to align-items.

Stop a box narrower than its padding from panicking

A box whose horizontal padding exceeds its own width left the text a negative
width to lay out in, which tripped an assertion inside the text layouter and
crashed the render. The width the text lays out against now stops at zero.

Write a group of css entries as an object

A css entry can be { media, rules }, { supports, rules }, or { layer, rules }. A layer without rules declares its order alone. Takumi reads each prelude with the grammar its rule takes, so it cannot close the rule and open another.

Expand @apply inside stylesheet rules

.card { @apply mt-4 bg-brand-500; } now expands through the tw parser where it is written, ! suffix included. Variants like md: are rejected. A static render has nothing for them to gate on.

Rename the stylesheets render option to css

css takes inline CSS as one string or a list. The old stylesheets name still works everywhere and warns once on takumi-js and takumi-pdf.

Support legacy WebKit display values

Map -webkit-box and -webkit-flex to flex, and -webkit-inline-box and -webkit-inline-flex to inline-flex.

Render <text> elements in SVG image sources

SVG images with <text>, <tspan> and textPath now draw their text using
the registered fonts instead of dropping it. Glyphs render from font outlines;
color emoji glyphs inside SVG text are not supported.

Accept CSS-wide keywords on shorthand properties

margin: inherit, padding: initial and border: unset were rejected. Only longhands took CSS-wide keywords. A shorthand now expands the keyword across the longhands it targets.

Reject trailing content in style values

A style object accepted width: "55px zzz", applied 55px, and ignored the rest. It now rejects the whole value, the way a stylesheet already drops such a declaration. A substituted var() value follows the same rule.

Take an inline-block's baseline from the lines it actually laid out

An inline-block with horizontal padding re-wrapped its content against the
border box to find its baseline, so text beside it aligned with the wrong line.

v2.12.0

Support the legacy page-break-* properties

Print stylesheets written for page-break-before, page-break-after, and page-break-inside had those declarations dropped. They now drive the same pagination as break-before, break-after, and break-inside, and the forced-break keywords always, left, and right are accepted alongside page.

Support table-layout: fixed and border-spacing

border-spacing was a hardcoded 2px gap with no way to change it, and table-layout did nothing. Column widths now come from the first row under table-layout: fixed and the rest of the width is shared evenly, while border-spacing sets both the gap between cells and the inset from the table's own edges. On a three-column table measured against headless Chrome, auto columns land 67px to 136px away and fixed columns land within 2px.

border-spacing starts at 0 as CSS defines it, and the HTML and JSX element presets give <table> the 2px browsers apply, so a display: table box no longer gets a gap it never asked for.

Support border-collapse: collapse

Neighbouring cells each painted their own border either side of the border-spacing gap. A collapsing table now resolves every shared line once: the wider border wins, hidden clears the line, and a row's borders reach its cells the way its background already did.

v2.11.0

Align table cell content with vertical-align

vertical-align: middle on a table cell now centers its content in the cell, and bottom pushes it to the cell's bottom edge. baseline still renders as top.

A row's element children that are not table-cell, such as a <td style="display: flex">, are now laid out in the row instead of dropped. Text sitting directly in a row is still dropped: it has no anonymous cell to go into.

Start backwards-filled step animations on the first step

An animation with animation-fill-mode: backwards or both and a positive delay held the second step during the delay when its timing function was steps(n, jump-start) or steps(n, jump-both). Samples taken before the active phase now land on the step below the jump, as the CSS easing algorithm requires.

steps() also serializes the way the spec asks: steps(4, end) and steps(4, jump-end) both print as steps(4), since an end position is the default.

Store calc() as its non-zero terms

Length shrinks from 84 to 20 bytes, and a computed style from 5.9KB to 2.3KB. A calc() expression mixing more than four distinct units now fails to parse.

Sample background-clip text at pixel centres

Text clipped to a background or mask image sampled that image at pixel corners rather than centres, blending every pixel with its neighbour. The clip is now read exactly where it should be, so a background-clip: text fill is half a pixel sharper, and drawing one is about a third faster.

Animate WebP image sources

An animated WebP used as an image source now plays through its frames, the same way an animated GIF does. Before, decoding one threw WebP encode failed and took the whole render down with it. The still-image paths, which the SVG backend and the size cache go through, fall back to the first frame instead of failing.

ImageSource::Gif is now ImageSource::Animated, and GifSource is now AnimatedSource, since both carry GIF and WebP animations. ImageError::InvalidGif is now ImageError::InvalidAnimation for the same reason.

An animated source keeps only its encoded bytes and a frame timing table. It used to hold a decoded full-size copy of the first frame as well, which also meant the first frame ignored the draw box it was scaled into.

Reuse layout styles across sizing passes

Layout runs several sizing passes over each node, and each pass rebuilt that node's layout style from scratch. Only container query units (cqw, cqh, cqmin, cqmax) can change between passes, so a style using none of them is now built once and reused. A deeply nested flex tree lays out about 36% faster.

Support the full steps() step position syntax

steps() now accepts jump-start, jump-end, jump-none, and jump-both, and the position argument is optional, so steps(4) means steps(4, jump-end). Only start and end parsed before, so a declaration like steps(4, jump-none) was dropped as invalid and the animation fell back to ease, drawing a smooth curve instead of a staircase.

Undo premultiplication in integers

Converting the finished canvas back to straight alpha now divides in integers rather than f64. Rendering any image is a few percent faster, and pixels land on the same value on every target instead of depending on the platform's float division. Semi-transparent pixels can differ by one from previous output, which is where the float landed a hair under a rounding step.

Share inherited font lists across nodes

font-family, font-variation-settings, and font-feature-settings lists are now Arc-shared, so inheriting them no longer copies the list per node.

Keep direction: ltr blocks left-to-right

Blocks with direction: ltr now keep an LTR layout when text starts with an RTL script. The bidi base direction follows direction, matching browsers.

Composite opaque effect layers without resampling them

A blur, shadow or opacity group that is fully opaque and composites normally is copied onto its parent row by row instead of going through the sampling pipeline. Such a drop shadow is about 40% faster to render, such a blur about 30%. A group with partial opacity or a blend mode is unaffected.

Keep degenerate CSS values out of layout

aspect-ratio with a zero, negative, or non-finite ratio (such as 1/0) now behaves as auto, and an infinite percentage length is clamped instead of feeding infinity into layout.

Draw animated frames without replaying the ones before them

A frame that covers the whole canvas and replaces what is under it does not depend on the frames before it, so it is now decoded on its own. Reaching the last frame of a 300-frame animation drops from 16.6ms to 0.13ms for GIF, 158ms to 0.39ms for APNG, and 97ms to 0.05ms for WebP. Frames that do blend onto their predecessors still replay, as they must.

Render list markers on the right under direction: rtl

A direction: rtl list item now places its marker at the right edge and mirrors the counter suffix, matching Chrome. RTL blocks also force the right-to-left base direction instead of inferring it from the first strong character, so their text aligns to the right regardless of content.

Draw whole-pixel images without resampling them

An image placed at a whole-pixel offset is copied row by row instead of going through the sampling pipeline. Drawing one into a node is about three times faster; clips, shadows and blurs that composite an image get a few percent.

Share custom property maps across nodes

ComputedStyle::custom_properties and registered_custom_properties are now Arc-shared, so inheriting them no longer copies the maps per node.

Animate APNG image sources

An animated PNG used as an image source now plays through its frames, the same way an animated GIF or WebP does. Before, only the default image was decoded and the render held that one frame for the whole animation, with nothing to signal the rest had been dropped. Subframes composite through the fcTL dispose and blend operations, and a default image that no fcTL claims stays out of the timeline.

Match selectors against the rules that could apply

Stylesheet rules are grouped by what their rightmost selector requires, so a node only runs the matcher against rules naming one of its classes, its id or its tag. Rendering 800 nodes against 800 rules drops from 67ms to 2.5ms; the cost now grows with the rules that could match rather than with the whole stylesheet.

v2.10.0

Update the font stack

parley 0.11.1, skrifa 0.44, and write-fonts 0.50, with the hinting-gate fork rebased so a single fontations version serves layout and subsetting.

Lay out tables on the grid algorithm

A <table> used to fall back to block layout, so cells stacked instead of forming columns. Table boxes now lower onto a grid whose column tracks are shared by every row. Header groups render first, footer groups last. colspan and rowspan span tracks, captions render on the side caption-side picks, and a row's background lands on its cells. HTML and JSX gain element presets for table, thead, tbody, tfoot, tr, td, th, and caption.

Count the pages a repeated box prints on

A page counter filled only inside a header or footer band. A footer written into the document itself, as a fixed box, printed empty hooks, so the numbers had to come from a render option standing beside the document. A repeated box now lays out again for every page it draws on, with that page's numbers, so a component can carry its own footer.

Match Blink's spacing between a bullet marker and its item

An outside bullet keeps Blink's fixed 7px gap on top of its suffix space, an inside bullet separates with 1em, and the square style draws ▪, approximating Blink's painted size.

Drop reversed, gradient marker images, and menu/dir list counting

An <ol reversed> now counts up, a gradient list-style-image falls back to the counter style, and only ul/ol scope a list's count.

v2.9.2

Treat the synthetic HTML root as a block container

Markup written in a template literal carries whitespace either side, which parsed into text roots. The synthetic root that holds them was inline, so the leading one kept a line box and pushed the content down the page. It is a block container now, the way <body> is, and fromHtml drops the whitespace roots the way the Rust crate already did.

v2.9.1

Close the gap between two boxes on a fractional parent

A box's position snapped to the pixel grid against its parent while its size snapped against the page. A parent sitting on a fraction, such as a container padded in points, pushed the two apart and left a hairline of background between boxes that should meet.

v2.7.0

Restore JPEG, WebP and GIF decoding

takumi disables takumi-core's default features and never re-enables image decoding, so every build decoded PNG and ICO only. A WebP source failed with The image format could not be determined. image-decoding is now a takumi feature as well, on by default, and it splits into jpeg, webp and gif for a build that wants one format and not the others. The napi and wasm bindings turn it on too.

v2.6.0

Route shared codepoints to the subset that declares them

A Google Fonts subset encodes more than the unicode-range it was cut for, and the Cyrillic and Greek ones also carry the ASCII space and the Latin capitals. Selection took the first subset whose glyphs covered a character, in family-name order, so those codepoints left the Latin subset and every word split into separate runs. Subsets now rank by the range they declare, lowest first.

v2.5.5

Type render output as backed by ArrayBuffer

render and renderAnimation declared their output as Buffer / Uint8Array over ArrayBufferLike, so passing the bytes straight to new Response(...) failed to typecheck. They now declare Buffer<ArrayBuffer> / Uint8Array<ArrayBuffer>, which BodyInit accepts.

v2.5.0

Add setGlyphCacheMaxBytes

The resolved-glyph and glyph-mask caches share an 8 MiB budget that no binding exposed. cacheMaxBytes looks like the knob for it but covers a different set of caches: decoded images, SVG rasters, and parsed stylesheets.

setGlyphCacheMaxBytes sets the glyph budget. It is a module-level function rather than a Renderer option because those caches live in the module and are shared by every renderer, and the budget is read the first time a cache is used, so the call has to come before the first render.

The default suits Latin text. A CJK outline runs a few kilobytes, so 8 MiB holds on the order of a thousand of them and a page of Chinese re-rasterizes glyphs it evicted a moment earlier.

takumi-js forwards it too. That one records the budget and hands it to the backend as it loads, so it stays synchronous and cannot race the resolution.

v2.4.2

Stop copying Uint8Array font and image inputs on the native binding

Buffer inputs were already passed to render tasks as ref-counted views, but Uint8Array inputs went through a full to_vec copy first. Both now cross into the async tasks zero-copy; only bare ArrayBuffer inputs still copy.

v2.4.0

Unify decoded resources behind one budgeted cache

Decoded images had a byte budget, but each SVG kept up to 32 rasterized pixmaps outside it, and every render re-parsed its stylesheets from scratch. ImageCache is now ResourceCache: SVG sources, their rasterized pixmaps, and parsed stylesheets all weigh against the same budget as decoded images. The default budget drops from 64 MiB to 16 MiB and becomes configurable — new Renderer({ cacheMaxBytes }) in the bindings, ResourceCache::new(max_bytes) in Rust, with 0 disabling caching. SVG rasters and parsed stylesheets now also survive across renders, so a server re-rendering the same template stops re-rasterizing and re-parsing per request. Rust callers: RenderOptions.stylesheet is now Arc<StyleSheet>; pass sheet.into().

Return an error for viewports too large to allocate

A viewport whose pixel buffer overflowed the backing allocation used to fall back to a 1x1 canvas, so the render produced a valid-looking but wrong tiny image with no error. The root canvas is now built through a fallible path that surfaces the allocation failure as an InvalidViewport error instead. Internal offscreen canvases keep their bounded sizes and are unaffected.

Blend animated WebP frames by default on the native binding

AnimatedWebpOptions::builder() left blend and dispose unset, so they fell back to false while the type's Default and the wasm backend use blend: true. Native animated WebP now alpha-blends frames over prior content like wasm does, so animations with partially transparent later frames render the same on both backends. The builder defaults are pinned to the Default values.

Convert native panics into catchable errors instead of aborting the process

The published napi artifacts are now built with unwind panics, so a Rust panic reached through malformed input surfaces as a JS error rather than killing the host process. Wasm keeps abort panics by design.

v2.3.0

Accept raw RGBA pixels as an image source

An image node's src takes { width, height, data, premultiplied? } and renders the pixels without decoding; the Bitmap JSX helper wraps it as an <img>.

[v2.2.0](https://redirect.github.com/kane50613/takumi/blob/HEAD/takumi-napi/CHAN

[!IMPORTANT]
✂ PR body was truncated to here.


Configuration

📅 Schedule: (in timezone Asia/Taipei)

  • Branch creation
    • Between 12:00 AM and 03:59 AM, only on Monday (* 0-3 * * 1)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@rileychh-dokploy-coscup

rileychh-dokploy-coscup Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
Nuxt ❌ Failed Preview URL 2026-08-03T08:48:02.326Z

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36f3b39d40

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread package.json Outdated
"@iconify-json/tabler": "1.2.35",
"@nuxt/fonts": "0.14.0",
"@takumi-rs/core": "1.7.0",
"@takumi-rs/core": "2.5.4",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep Takumi on the renderer-compatible major

This bumps @takumi-rs/core to v2 while leaving nuxt-og-image at 6.5.2, whose peer range in the lockfile is still @takumi-rs/core: ^1.0.0-beta.3. That version of the Nuxt renderer still calls the v1 renderer.loadFont(...) API, while Takumi v2 uses registerFont/per-render fonts, so any OG image rendered through the repo's .takumi.vue templates will fail at runtime during prerender/dev. Please either keep Takumi on the supported v1 range or upgrade nuxt-og-image to a release with Takumi v2 compatibility.

Useful? React with 👍 / 👎.

@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch 13 times, most recently from 359c456 to 1cd77d7 Compare August 13, 2026 23:59
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch 5 times, most recently from 4f9ad29 to 1b90bfa Compare August 17, 2026 13:11
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch 3 times, most recently from 9145f2d to e082b2c Compare August 26, 2026 21:35
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch 6 times, most recently from 434d76f to 999698a Compare September 5, 2026 18:04
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch from 999698a to 0708520 Compare September 8, 2026 12:17
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch from 0708520 to 0dea2c7 Compare September 9, 2026 18:36
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch from 0dea2c7 to ebcc238 Compare September 18, 2026 21:42
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f48f4cd5-8c69-4659-9172-38af0a51eacb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch from ebcc238 to 2ff4f1e Compare October 15, 2026 07:27
@rileychh-dokploy-coscup

rileychh-dokploy-coscup Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
Nuxt ❌ Failed Preview URL 2026-11-23T19:17:23.182Z

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T19:13:20.167843Z 9a56196 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch 7 times, most recently from ae70bc0 to cf7b714 Compare October 22, 2026 11:03
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch 3 times, most recently from d30a1b6 to 787926d Compare October 30, 2026 02:42
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch from 787926d to 5e5dc5f Compare November 2, 2026 00:40
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch from 5e5dc5f to 0e7e148 Compare November 11, 2026 10:36
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch 2 times, most recently from e6e19d8 to 3d98e29 Compare November 23, 2026 09:52
@renovate
renovate Bot force-pushed the renovate/takumi-rs-core-2.x branch from 3d98e29 to 9a56196 Compare November 23, 2026 19:11

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants