v2.0.0
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:
?run
is deprecated; replace with?as=run
when importing images.run
default directives are defined using therunDefaultDirectives
key now.?lqip={number}
is deprecated; replace with?as=run:{number}
.?width={number}
and?height={number}
are deprecated; use?w={number}
and?h={number}
instead.- Exposed CSS vars for
FxReveal
have changed. - If you're using
svelte-img
with an external image API, thesrc
meta data structure has changed; it is now in parity with imagetools' native?as=picture
output format.