Skip to content

feat: add SVG support to image preloading#145

Draft
draggie wants to merge 1 commit intocallstackincubator:mainfrom
draggie:feat/svg-image-preloading
Draft

feat: add SVG support to image preloading#145
draggie wants to merge 1 commit intocallstackincubator:mainfrom
draggie:feat/svg-image-preloading

Conversation

@draggie
Copy link
Copy Markdown

@draggie draggie commented May 6, 2026

Closes #132.

Summary

Adds MVP SVG support to image preloading on iOS and Android by rasterizing SVG input into PNG data before storing it in the existing preloaded image cache.

  • Adds inline SVG preload input via svg, width, and height
  • Detects remote SVG responses in the existing URL preload path
  • Rasterizes SVGs with WebKit on iOS and AndroidSVG on Android
  • Keeps widgets using the existing Voltra.Image / preloaded asset rendering path
  • Updates iOS and Android examples with SVG widget test controls
  • Updates public docs and package types
  • Adds Android unit coverage for inline SVG preloading

Validation

  • git diff --check
  • npm run format:check
  • npm run typecheck --workspace voltra
  • npm run typecheck --workspace @use-voltra/ios
  • npm run typecheck --workspace @use-voltra/android
  • npm run test:kotlin --workspace voltra
  • Manual iOS example app widget test
  • Manual Android example app widget test

Notes

The iOS implementation uses WebKit for runtime SVG rasterization, so the podspec now links WebKit. SVG inputs require explicit positive width and height for predictable raster output.

Preview

iOS
simulator_screenshot_18FEA446-A034-4A1D-87E0-96B48538ABF3

simulator_screenshot_8890B93A-C3A8-4EB9-BEFD-9A80268A1F1A

Android
Screenshot_1778071875
Screenshot_1778071883

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.

SVG support

1 participant