Repository navigation
chore(deps): update skia-canvas to v4 - #1001
Merged
Merged
Conversation
skia-canvas 4.0.0 fixes native memory leaks on macOS and in canvas-creating
loops, honours { gpu: false } in the Canvas constructor, and ships its
binaries as per-platform optional packages instead of a postinstall
download.
Drawing an image that failed to decode now throws instead of drawing
nothing, so the Image intrinsic and the API's head renderer skip images
with no size, which keeps today's output for a bad download.
assets/public and assets/private still pin skia-canvas 3, so skia-canvas
stays in onlyBuiltDependencies for its postinstall.
Every image Statsify sends is now encoded by toPng() in @statsify/rendering
instead of calling canvas.toBuffer("png") at each of the 18 call sites, so
PNG export settings live in one place.
The helper keeps skia-canvas v4's default of no row filtering. Cards come
out larger but encode about three times faster, and the extra bytes only
cross the server's link to Discord.
@statsify/discord now depends on @statsify/rendering for the paginator.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
skia-canvas v4 already exports PNGs with no row filtering when no
options are passed, so toPng({ filters: "none" }) did the same thing as
canvas.toBuffer("png"). Calling toBuffer directly keeps the output and
drops the 18 call-site edits and the new @statsify/discord dependency on
@statsify/rendering.
packages/skin-renderer/pkg is ignored wasm build output that a local pnpm install picked up as a workspace package. main's lockfile doesn't list it.
Keep the why in the comments and leave the skia-canvas history to the PR. An image that failed to decode has neither a width nor a height, so the Image intrinsic checks width alone, like the API's head renderer.
jacobk999
reviewed
Oct 26, 2026
jacobk999
left a comment
Member
There was a problem hiding this comment.
Maybe we should look into using the using feature for canvases/images.
jacobk999
approved these changes
Oct 27, 2026
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.
Description: skia-canvas 3 redrew the whole font sheet on every glyph pixel read, which made cards slow and the bot memory-heavy.
new Image(buffer), which still rejects them like 3.0.8 did.Testing:
/bedwars,/guildand/statusmatch main apart from a shade in the backgrounds.