Repository navigation
chore(deps): update sharp to v0.35 - #17234
Conversation
🦋 Changeset detectedLatest commit: f07746e The changes in this PR will be included in the next version bump. This PR includes changesets to release 393 packages
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 |
|
| 📦 Package | 📏 Size |
|---|---|
| @img/[email protected] | 18.2 MB |
| @img/[email protected] | 9 MB |
| [email protected] | 950.4 kB |
| @img/[email protected] | 427.1 kB |
| @img/[email protected] → @img/[email protected] | 22.3 kB |
| [email protected] → [email protected] | 3.3 kB |
Total size change: 28.7 MB
|
|
||
| let sharp: typeof import('sharp'); | ||
| let sharp: SharpConstructor | ||
|
|
There was a problem hiding this comment.
Type-only change. No runtime JS change.
|
|
||
| async function loadSharp() { | ||
| let sharpImport: typeof import('sharp'); | ||
| async function loadSharp(): Promise<SharpConstructor> { | ||
| let sharpImport: SharpConstructor; | ||
| try { |
There was a problem hiding this comment.
Type-only change. No runtime JS change.
| const result = sharp(inputBuffer, { | ||
| failOnError: false, | ||
| failOn: 'none', | ||
| pages: -1, |
There was a problem hiding this comment.
failOnError was deprecated in v0.30.4 in favor of failOn, removed entirely in v0.35.0.
Per sharp's own mapping:
failOnError: trueis equivalent tofailOn: 'warning'.failOnError: falseis equivalent tofailOn: 'none'.
| import type { | ||
| AvifOptions, | ||
| FitEnum, | ||
| FormatEnum, | ||
| JpegOptions, | ||
| PngOptions, | ||
| ResizeOptions, | ||
| SharpOptions, | ||
| WebpOptions, | ||
| SharpConstructor, | ||
| } from 'sharp'; |
There was a problem hiding this comment.
Type-only change. No runtime JS change.
|
I contributed esm+cjs to sharp 0.35. Are there places where we did things because it was cjs? Like somewhere in the Vite config. Otherwise LGTM! |
|
I still think we should add a changeset, mostly an FYI for users to say "if you use this option in your package manager, you don't need it anymore" |
Wow you're amazing!
No CJS-only workarounds to remove here: we only mark |
@ematipico But we still support |
I know, but before this PR, users couldn't install 0.35 without some kind of warning. Now, it's fully supported. This is a new change for users astro/packages/astro/package.json Lines 194 to 196 in a1ab7b5 This means we need at least a changeset. |
|
@ematipico Changeset file added in f07746e |
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`7.0.3` → `7.0.4`](https://renovatebot.com/diffs/npm/astro/7.0.3/7.0.4) |  |  | --- ### Release Notes <details> <summary>withastro/astro (astro)</summary> ### [`v7.0.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#704) [Compare Source](https://github.com/withastro/astro/compare/[email protected]@7.0.4) ##### Patch Changes - [#​17212](withastro/astro#17212) [`7ba0bb1`](withastro/astro@7ba0bb1) Thanks [@​matthewp](https://github.com/matthewp)! - Ensures transition directive values are HTML-escaped when rendered on hydrated islands - [#​17224](withastro/astro#17224) [`dc5e52f`](withastro/astro@dc5e52f) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes trailing slash handling for dynamic file endpoints in dev mode. Dynamic file endpoints (e.g., `src/pages/api/[name].json.ts`) with `trailingSlash: "always"` incorrectly required a trailing slash in dev mode, returning 404 for `/api/bar.json` and 200 for `/api/bar.json/`. - [#​17067](withastro/astro#17067) [`23f9446`](withastro/astro@23f9446) Thanks [@​fkatsuhiro](https://github.com/fkatsuhiro)! - Fixed a bug where the development toolbar did not output a warning even though the implicit ARIA role and the manually specified role were duplicated. - [#​17234](withastro/astro#17234) [`d5fbee8`](withastro/astro@d5fbee8) Thanks [@​ocavue](https://github.com/ocavue)! - Adds support for [`sharp` v0.35](https://github.com/lovell/sharp/releases/tag/v0.35.0). pnpm users no longer need to approve `sharp`'s build script (see [`allowBuilds`](https://pnpm.io/settings#allowbuilds)) when on v0.35. - [#​17223](withastro/astro#17223) [`5970ef4`](withastro/astro@5970ef4) Thanks [@​astrobot-houston](https://github.com/astrobot-houston)! - Fixes `getCollection()` returning empty in dev mode for large content collections (500k+ entries) - [#​17184](withastro/astro#17184) [`799e5cd`](withastro/astro@799e5cd) Thanks [@​Princesseuh](https://github.com/Princesseuh)! - Upgrades the Rust compiler to the latest, which fixes some bugs. Refer to its [changelog](https://github.com/withastro/compiler-rs/releases/tag/%40astrojs%2Fcompiler-rs%400.3.0) for more information. - [#​17208](withastro/astro#17208) [`da8b573`](withastro/astro@da8b573) Thanks [@​matthewp](https://github.com/matthewp)! - Hardens forwarded header handling so the internal request helper validates `X-Forwarded-Host` against `security.allowedDomains` before trusting `X-Forwarded-For` for `clientAddress`. Previously it only checked that the header was present, which was inconsistent with the public `createRequest` helper. This aligns both code paths; behavior is unchanged for correctly configured proxies. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDYuMSIsInVwZGF0ZWRJblZlciI6IjQzLjI0Ni4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Changes
sharpv0.35.0 changelog: https://github.com/lovell/sharp/releases/tag/v0.35.0. Notable, pnpm v11 users do not need to marksharpasallowBuildanymore since v0.35.0.I made the following changes in this PR:
astropackage, update thesharpfield insideoptionalDependenciesfrom^0.34.0to^0.34.0 || ^0.35.0.sharpfield insidedependenciesfrom^0.34.3to^0.35.0.Notice that some dependencies (e.g.,
miniflare) are still usingsharpv0.34, so we have both v0.34 and v0.35 installed in our ownpnpm-lock.yaml. This should be fine.Testing
CI should pass.
Docs
N/A. This doesn't require any changes on the user side. We still support
sharpv0.34 inoptionalDependencies.