dependency: Update dependency @takumi-rs/image-response to v2#252
Open
renovate[bot] wants to merge 1 commit into
Open
dependency: Update dependency @takumi-rs/image-response to v2#252renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
✅ Deploy Preview for eternalcodeteam-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
57a5bbc to
be5abc2
Compare
be5abc2 to
e28232f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR contains the following updates:
^0.73.0→^2.0.0Release Notes
kane50613/takumi (@takumi-rs/image-response)
v2.0.0Make the embedded font a true last resort
Both bindings now embed one font: a Latin Geist subset with a 400 to 700
weight axis (Geist Mono and Manrope are gone). It no longer claims the
sans-serifgeneric family and always sorts after registered fonts infallback selection, so generic families and unstyled text resolve to the fonts
you load. The new
FontResource::last_resortmarks a font's families to sortafter every normal registration.
Cap animation frame rate per format
Browsers clamp any animation frame of 10ms or less to 100ms, so a high frame
rate stalls instead of playing fast.
write_animationnow rejects a frame rateabove
AnimationFormat::max_fpswith the newAnimationFrameRateTooHigherror:90 fps for WebP and APNG, 50 fps for GIF (centisecond delays). The napi and WASM
renderAnimationbindings surface the error.Apply structured keyframes in
renderAnimationrenderAnimationaccepted akeyframesoption but never registered it, sostructured keyframes animated with
renderyet stayed static in animations. Itnow extends the stylesheet with them like the other entry points.
Fix buffer pool bucket capacity invariant
Release now buckets a buffer by the floor power of two its capacity guarantees,
and
acquire_dirtyreserves beforeset_len. A pooled buffer can no longer belengthened past its allocation.
Skip mask copies and per-pixel mask lookups in canvas fast paths
Borrow the combined constraint mask directly when it already matches the
canvas viewport instead of copying it per draw, and hoist mask lookups out of
the per-pixel blit loops. Output is unchanged.
Make subset-group font selection deterministic
Subsets registered under one logical family (via
FontResource::subset_of) were keptin registration order. Callers commonly register fonts concurrently, so that order — and
therefore which subset won for a codepoint covered by more than one (e.g. overlapping
weight subsets, where the loser is faux-bolded) — varied per process. Identical input
could render to different bytes run to run.
Subsets are now held in a
BTreeSet, ordered by their family name, so expansion andselection no longer depend on registration timing. Same input renders identically.
Shrink the published binaries
Size-optimize the layout and shaping crates that never run per pixel, cutting
the published WASM and native binary size.
Share the renderer facade between the napi and wasm bindings
The napi and wasm
Rendererwrappers now build on a sharedprepareRenderInputhelper in
@takumi-rs/helpers/renderer, so their option types and render bodieslive in one place. Both backends check
signalbefore and after resolvingfonts and images: on native, an already-aborted signal now throws before any
resource fetch.
Fix gradient stop snapping panic for oversized stop lists
Gradients with more color stops than the LUT can hold no longer panic. The
sample-index clamp and normalization passes stay within LUT bounds.
Reuse per-scene state across animation frames
Compute each scene's font snapshot once and share its image and stylesheet
handles across frames instead of re-snapshotting and deep-cloning the whole
option tree per frame. Frame output is unchanged.
Remove
encodeFramesRenderer.encodeFramesand itsEncodeFramesOptions/AnimationFrameSourcetypes are gone.
renderAnimationcovers scene-based animation; pre-renderedframe encoding had no callers.
Replace
fetchResources/extractResourceUrlswithprepareImages@takumi-rs/helpersexportsprepareImages({ node, sources?, fetchCache?, fetch?, timeout? }),which collects a node tree's remote images and fetches the ones not already supplied. Pass a
fetchCache(aMap<string, Promise<ArrayBuffer>>, or anyMap-like store) to coalesceconcurrent fetches of the same URL and reuse the bytes across renders; a failed fetch is
evicted so a later call retries.
The
extractResourceUrlsandfetchResourceshelpers are removed. Theimagesrender optiontakes the same group form:
{ sources, fetchCache, fetch, timeout }.Stream animation frames straight into the encoder
Add
write_animation, which renders a timeline and feeds each frame to theencoder as it arrives, holding one raw frame at a time instead of the whole
sequence. Both the napi and WASM
renderAnimationbindings use it, so a highframe rate or a long duration no longer exhausts memory. On native the WebP
encoder still runs frames in parallel, now over bounded chunks. The WASM WebP
encoder now merges runs of identical frames like the native one, so a static or
slow animation encodes and stores far less. The eager
render_animation+write_animated_*path stays for callers that want every frame at once.Guard shadow and blur buffer sizing against overflow
Extreme blur radii could overflow the
u32shadow-buffer area and panic orover-allocate. Sizing now uses saturating math and skips shadows above a 256
Mi-pixel budget.
Type keyframe declarations with
csstypeinstead of DOM'sCSSStyleDeclarationKeyframesMapandKeyframeRuletyped each keyframe's declarations asRecord<string, CSSStyleDeclaration>, requiring every CSS property on a singleoffset and needing the
DOMlib. Declarations are now typed withcsstype'sProperties, an optional peer dependency, so a single offset only needs theproperties it sets and consumers without the
DOMlib still typecheck.Accept a bare URL string in
fontsfontsentries can now be a URL string, e.g.fonts: ["https://example.com/Inter.woff2"].The bytes are fetched on demand and keyed by the URL; family name, weight, and style come
from the font file. The object form stays for overriding those. Adds
fontFromUrlto@takumi-rs/helpers.Cap image decode dimensions and GIF frame volume
Decoders reject images beyond 8192x8192 (via
image::Limitsfor PNG and JPEG,dimension checks for WebP) and GIFs beyond a total-frame pixel budget, stopping
decode-bomb OOM.
Drop the
./wasmexport@takumi-rs/image-response/wasmaliased the same file as the root entry. Import from@takumi-rs/image-response.Mark
ImageResponse.readyrejection as handledA failed render no longer crashes the process with an
unhandledRejectionwhenthe caller never awaits
ready. The failure still reaches the stream and acaller that does await
readystill observes it.Pin
@takumi-rs/*dependencies to the matching releasetakumi-jsresolved its@takumi-rs/core,@takumi-rs/helpers, and@takumi-rs/wasmdependencies to an older release than itself, so
takumi-js/responseimported a helperthe pinned
@takumi-rs/helpersdid not yet export and failed to load. The internaldependencies now track the same release as
takumi-js.Keep the format tagged union on
renderoptionsrender,renderSvg, andrenderAnimationused a non-distributiveOmitthatcollapsed the
format/quality/losslessunion, so{ format: "webp", quality: 80 }stopped type-checking. A distributive
Omitrestores it.Cache the Google Fonts CSS promise
googleFonts'scachenow stores the in-flightPromise<string>instead ofthe resolved CSS, so concurrent calls for the same URL share one request
instead of each missing and fetching. A failed fetch evicts itself, so the
next call retries. The cache type is now
Pick<Map<string, Promise<string>>, "get" | "set" | "delete">.Match the Chromium UA stylesheet for default element styles
Parse the relative font keywords
bolder/lighter(font-weight) andlarger/smaller(font-size), resolving to the values Chromium uses. Expandthe default element presets to cover lists,
sub/sup,ins/del, forms,details/summary, andsearch.Bound remote fetches with byte caps and default timeouts
Remote image, font, and Google Fonts CSS fetches now reject bodies past a byte
cap (
maxBytes, default 32 MiB; 2 MiB for CSS) and apply the 5 s timeout toevery fetch, not just images. Set
timeout: 0to disable it. A newallowUrlhook on
FetchOptionsskips URLs it rejects.Add the
@takumi-rs/helpers/rendererentrypointThe shared renderer wrapper backing the napi and wasm bindings is now exported
as
@takumi-rs/helpers/renderer.Fix
googleFontslosing your declared family ordergoogleFontsreturned subsets in whatever order Google'scss2response happened to list@font-faceblocks in — not the order families were passed infamilies. A render with noexplicit
fontFamiliesfalls back to registration order, so a Han-unified codepoint shared bytwo requested families (e.g.
"Noto Sans TC"and"Noto Sans JP") could pick the wrong oneregardless of how
familieswas ordered.googleFontsnow sorts its result to match thecaller's declared order.
Keep elements as containers when children carry no text
An element whose children resolved to a textless iterable (e.g.
{[]}) became anempty text node instead of a container, so its
backgroundand other box stylesnever painted. Such elements now stay containers.
Shrink and sharpen the Google Fonts family type
Group the ~1940 families by their distinct weight/style/axis shape (152 of them) so
GoogleFontFamilybuilds a discriminated union over shapes, not families. The shipped.d.tsdrops from ~192 KB to ~58 KB and the checker does ~75% fewer instantiations. Theobject form now autocompletes each known family's weight, style, and axes, and still accepts
a name built at runtime. The generator refuses to write a catalog with under 1000 families.
Add
baseUrltogoogleFontsgoogleFontstakes an optionalbaseUrl, defaulting to Google Fonts, so an API-compatiblecss2 mirror can be used instead, e.g.
baseUrl: "https://fonts.bunny.net/css2"for Bunny Fonts.Refactor
font_familiesandlangoption typeNow both option takes resolved value instead of raw strings.
Fix
fontFamiliesorder being ignoredfontFamiliesonly fed the fallback bucket, never the root style, so textpicked whichever registered font resolved first instead of the requested
order.
FontFamily's default is now empty instead of a genericsans-seriftoken, so an empty root style falls through to the fallback bucket directly.
Seal
parley::Layoutout of the inline-layout boundaryBuiltInlineLayout::{layout, custom_inline_boxes}are now private; themeasure-only walk moves into
BuiltInlineLayout::measure_runs, returningcore-owned
MeasuredInlineRun/MeasuredInlineBox(run text borrows thelayout).
get_parent_font_metrics,resolve_inline_line_metrics,resolve_inline_line_states, andscale_text_fit_xare no longer public.Add
takumi-htmlfor parsing HTML into a node treeNew
takumi-htmlcrate parses HTML + Tailwind markup into a node tree withfrom_html(source, FromHtmlOptions), mirroring the JSfromHtml. Thetw,style,class,id,dir, andlangattributes map to node styling andmetadata;
FromHtmlOptionssets theStylePresetstable and amax_depthnesting cap. The
takumiumbrella re-exports it under thefrom-htmlfeatureas
takumi::from_html, plusNode::from_htmlvia theFromHtmlpreludetrait.
Drop
background-blend-modefrom thebackgroundshorthandThe
backgroundshorthand parsed a blend-mode token and resetbackground-blend-mode, unlike browsers, where the shorthand touches neither. Itnow leaves
background-blend-modealone; set it through the longhand. Theblend_modefield is gone from theBackgroundshorthand value.Rename the
svgfeature tosvg-sourcesvgandsvg-backendread as the same thing at a glance despite gatingopposite directions (image-source input vs. render output). The umbrella's
input-side feature is now
svg-source;svg-backendis unchanged.Make
:lang()actually match:lang()parsed but never matched, like every other pseudo-class the engine treats asstateful. It needs no live state, only the
langattribute inherited up the tree, which astatic render already has. It now matches BCP-47 basic filtering (
:lang(zh-Hant), comma-separatedranges,
*) against the nearest ancestor-or-self with alangset — the standards-based way toroute different fonts to different languages on the same page, e.g.
:lang(ja) { font-family: "Noto Sans JP" }alongside:lang(zh-Hant) { font-family: "Noto Sans TC" }.Represent the
none/normalinitial values ofmax-*and gapsmax-widthandmax-heightare now aMaxSizevalue whose initial isNone(unbounded), instead of borrowing
Length'sauto.column-gap,row-gap, andthe
gapshorthand are now aGapvalue whose initial isNormal. Rendering isunchanged —
noneresolves like the old unbounded default andnormalcomputesto
0— but the values now round-trip throughto_cssasnone/normal.v1.8.7Compare Source
Patch Changes
9604fd7: Split package export types per import/require condition so CJS consumers resolve.d.cts9604fd7]v1.8.6Compare Source
Patch Changes
v1.8.5Compare Source
Patch Changes
v1.8.4Compare Source
Patch Changes
v1.8.3Compare Source
Patch Changes
v1.8.2Compare Source
Patch Changes
041e5fd: Fix+simd128flag being override by CI configurationv1.8.1Compare Source
Patch Changes
55b058d]v1.8.0Compare Source
Patch Changes
v1.7.0Compare Source
Patch Changes
45a7f4a: CorrectonErrorexample in README89a3088]56579a2]89a3088]v1.6.0Compare Source
Patch Changes
v1.5.1Compare Source
Patch Changes
v1.5.0Compare Source
Patch Changes
v1.4.1Compare Source
Patch Changes
d6936e5]v1.4.0Compare Source
Patch Changes
v1.3.0Compare Source
Patch Changes
v1.2.1Compare Source
Patch Changes
v1.1.2Compare Source
Patch Changes
v1.1.1Compare Source
Patch Changes
v1.1.0Compare Source
Patch Changes
v1.0.16Compare Source
Patch Changes
v1.0.15Compare Source
Patch Changes
3f96f48]v1.0.14Compare Source
Patch Changes
6323299]v1.0.13Compare Source
Patch Changes
ccfaff3]v1.0.12Compare Source
Patch Changes
v1.0.11Compare Source
Patch Changes
v1.0.10Compare Source
Patch Changes
v1.0.9Compare Source
Patch Changes
v1.0.8Compare Source
Patch Changes
8886c01]b287c43]v1.0.7Compare Source
Patch Changes
v1.0.6Compare Source
Patch Changes
v1.0.5Compare Source
Patch Changes
d113fb5]v1.0.4Compare Source
Patch Changes
v1.0.3Compare Source
Patch Changes
v1.0.2Compare Source
Patch Changes
v1.0.1Compare Source
Patch Changes
v1.0.0Compare Source
Major Changes
188079f: Changed initialdisplayvalue fromflextoinlineThis is to comply with the CSSWG spec.
You should update your code to use
display: flexif you want to use flexbox.Minor Changes
79c0c5a: Embed full-axis Manrope as the default font1373f0a: SupporticoformatPatch Changes
9b411ce: Reduce wasm size with more strippingda2d85f: Support unwasm for/autoexportb2e304a: Replaced nativeextractResourceUrlswith JS version to avoid roundtripbc6243a: Addbunconditional exportsConfiguration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.