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
base64LQIP.
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:
?runis deprecated; replace with?as=runwhen importing images.rundefault directives are defined using therunDefaultDirectiveskey 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
FxRevealhave changed. - If you're using
svelte-imgwith an external image API, thesrcmeta data structure has changed; it is now in parity with imagetools' native?as=pictureoutput format.