feat(next/image)!: remove `squoosh` in favor of `sharp` as optional dep (#61696)
## History Previously, we added support for `squoosh` because it was a wasm implementation that "just worked" on all platforms when running `next dev` for the first time. However, it was slow so we always recommended manually installing `sharp` for production use cases running `next build` and `next start`. Now that [`sharp` supports webassembly](https://sharp.pixelplumbing.com/install#webassembly), we no longer need to maintain `squoosh`, so it can be removed. We also don't need to make the user install sharp manually because it can be installed under `optionalDependencies`. I left it optional in case there was some platform that still needed to manually install the wasm variant with `npm install --cpu=wasm32 sharp` such as codesandbox/stackblitz (I don't believe sharp has any fallback built in yet). Since we can guarantee `sharp`, we can also remove `get-orientation` dep and upgrade `image-size` dep. I also moved an [existing `sharp` test](https://github.com/vercel/next.js/pull/56674) into its own fixture since it was unrelated to image optimization. ## Related Issues - Fixes https://github.com/vercel/next.js/issues/41417 - Closes https://github.com/vercel/next.js/pull/54670 - Related https://github.com/vercel/next.js/issues/54708 - Related https://github.com/vercel/next.js/issues/44804 - Related https://github.com/vercel/next.js/issues/48820
Showing
| ... | ... | @@ -107,7 +107,6 @@ |
| "@types/react-dom": "18.2.15", | ||
| "@types/relay-runtime": "14.1.13", | ||
| "@types/selenium-webdriver": "4.0.15", | ||
| "@types/sharp": "0.29.3", | ||
| "@types/string-hash": "1.1.1", | ||
| "@types/trusted-types": "2.0.3", | ||
| "@typescript-eslint/eslint-plugin": "6.14.0", | ||
| ... | ... | @@ -158,7 +157,7 @@ |
| "html-validator": "5.1.18", | ||
| "http-proxy": "1.18.1", | ||
| "husky": "8.0.0", | ||
| "image-size": "0.9.3", | ||
| "image-size": "1.1.1", | ||
| "is-animated": "2.0.2", | ||
| "isomorphic-unfetch": "3.0.0", | ||
| "jest": "29.7.0", | ||
| ... | ... |
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File deleted
This diff is collapsed.
File deleted
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File deleted
This diff is collapsed.
File deleted
This diff is collapsed.
File deleted
This diff is collapsed.
File deleted
This diff is collapsed.
File deleted
File deleted
This diff is collapsed.
This diff is collapsed.
File deleted
This diff is collapsed.
File deleted
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment