wave E stage 2: renderSvg goes native-first - resvg in-process

Visual-maker SVGs never execute script, so a browser added nothing but a
process. resvg rasterizes in-process now (white background and fitTo
width mirror the old Chrome-page semantics; svgViewport unchanged,
quirks included for parity). The old Chrome path stays verbatim as the
fallback for exotic-SVG parse failures - it was the only path before,
so nothing regresses.

The resvg binary (4MB per platform, one per build) rides the standalone
via the same tracing pattern. Gates 1519/1519; native path pinned
against real SVGs (intrinsic size, viewBox-only 900 default, opts
override, system-font text).
This commit is contained in:
amosblomqvist
2026-10-11 06:52:32 +03:00
parent 951c7704b9
commit e9cf841ce7
5 changed files with 322 additions and 0 deletions
+4
View File
@@ -61,6 +61,9 @@ const nextConfig: NextConfig = {
// npm installs only the current platform's binary, so this glob
// resolves to exactly one Skia binary per build.
"node_modules/@napi-rs/canvas-*/**/*",
// Wave E stage 2: resvg rasterizes visual-maker SVGs natively; same
// per-platform-binary story as the canvas above (one per build).
"node_modules/@resvg/resvg-js-*/**/*",
"node_modules/@earendil-works/pi-ai/dist/providers/data/**/*",
"node_modules/@earendil-works/pi-agent-core/dist/**/*.json",
],
@@ -73,6 +76,7 @@ const nextConfig: NextConfig = {
"@earendil-works/pi-agent-core",
"pdfjs-dist", // sources v0: bundling breaks its node fake-worker path
"@napi-rs/canvas", // native binding — bundling breaks the .node require
"@resvg/resvg-js", // native binding — same
],
};