Skip to content

v2.0.0

Compare
Choose a tag to compare
@zerodevx zerodevx released this 10 Aug 11:23
· 17 commits to master since this release

High-performance responsive/progressive images for SvelteKit.

v2 has landed, and it's more optimised than ever! 🥳

First, a little background. v1 was originally developed to address issues with vite-imagetools, like how:

  • inline directives are merged with default directives, instead of overriding them as expected;
  • there's no easy way to create a <picture> tag;
  • and there's no easy way to generate a base64 LQIP.

Fixing these required a tonne of patching. However, with the v5 release of imagetools (and the merge of this PR), svelte-img can be refactored to work the right way. Benefits include:

  • handling more work at build step;
  • leading to faster component rendering;
  • and a much smaller payload (build size).

So please migrate.

BREAKING CHANGES:

  1. ?run is deprecated; replace with ?as=run when importing images.
  2. run default directives are defined using the runDefaultDirectives key now.
  3. ?lqip={number} is deprecated; replace with ?as=run:{number}.
  4. ?width={number} and ?height={number} are deprecated; use ?w={number} and ?h={number} instead.
  5. Exposed CSS vars for FxReveal have changed.
  6. If you're using svelte-img with an external image API, the src meta data structure has changed; it is now in parity with imagetools' native ?as=picture output format.