Revert "revert #15354" for configurable image defaults#16124
Revert "revert #15354" for configurable image defaults#16124Rich-Harris wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 200b675 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
While I'm not strongly against this, my inclination would probably be to be a bit selective about exposing the vite-imagetools options. I'm not sure users of enhanced-img necessarily have a reason to use many of the options like I have no objection to exposing an option to control whether or not metadata is removed @teemingc had a concern that making the cache directory configurable would be incompatible with cloudflare |
|
Should be fine for users to configure the cache directory if we can add a warning in the option documentation. From the top of my head, Vercel caches |
|
Besides cache directory, there's also #13085. The reason why I decided to just allow full configuration, is because I imagine a someone may want to just use vite-imagetools while also using this package. As it is, it interferes with users ability to use vite-imagetools in other ways, with other configuration. Therefore, it seems to me that allowing user to configure vite-imagetools fully is correct, otherwise enhanced-img is needlessly restrictive and having having it liability in a way. Ideally, i would want this package to only handle Anyways, initially, I just wanted to customize default formats and widths. Maybe we can merge that part for now? |
It looks like you wanted to avoid generating the fallback image. I think at some point, SvelteKit's minimally supported browser version will mean that it will only run in browsers where webp/avif are supported and maybe we just generate a picture or img with those and there will be no need for a fallback image format. In that case it's much better to change the default for everyone. I wonder if we're already there in SvelteKit 3 or not.
I actually thought that's how things were setup today. |
|
Actually, for my usecase I thought I'd just use webp only (hence the #15379 too). In any case, making them customizable is good in my opinion because we have avif, webp, the old formats, maybe jxl in the future, and it's different people might want a different subset of those. I also wanted to change the default widths, because using the original size and half of it when there's no
If you try to add both I don't think any of it is a good idea tbh. And it's probably not really desired too. If the user wants to change the cache directory or |
Placeholder to reinstate #15354 once we've settled the outstanding questions. cc @benmccann