github withastro/astro @astrojs/cloudflare@14.2.0

latest releases: @astrojs/solid-js@7.0.2, @astrojs/vue@7.0.2, astro@7.2.0...
5 hours ago

Minor Changes

  • #16194 2a59663 Thanks @Daedalus-Icarus! - Adds opt-in build-time image optimization for the cloudflare-binding image service.

    When enabled, the Cloudflare IMAGES binding transforms static images in the workerd prerender environment, and the optimized bytes are written directly to the output directory. If the binding fails, it falls back to Sharp.

    To opt in, use the compound configuration form:

    export default defineConfig({
      adapter: cloudflare({
        imageService: { build: 'cloudflare-binding', runtime: 'cloudflare-binding' },
      }),
    });

    The string shorthand imageService: 'cloudflare-binding' preserves the current runtime-only behavior and is unaffected.

  • #16871 90c98ae Thanks @adamchal! - When session: false is set in astro.config, the adapter no longer auto-wires the Cloudflare KV session driver. Combined with the matching astro change, this lets the session runtime tree-shake out of the Worker bundle.

  • #17084 961bbe5 Thanks @matthewp! - Supports Astro's experimental incremental static builds. When experimental.incrementalBuild is enabled, the adapter skips unchanged pages between builds.

Patch Changes

  • #17576 0a79753 Thanks @alexanderniebuhr! - Fixes /_image returning 500 in dev mode when using imageService: 'custom'. Astro's default dev image endpoint imports vite and node:fs, which cannot be loaded inside workerd. The custom and fallback cases now use the generic fetch-based endpoint in dev, matching the other image service modes. A user-configured image.endpoint is left untouched.

    Additionally, a dev-time warning is now logged when imageService: 'custom' resolves to the Sharp service (including when no image.service is configured), since Sharp's native binding cannot run inside workerd in dev or production.

  • #17481 0c32649 Thanks @ondraulehla! - Fixes a crash on /_image cache hits when the Cloudflare cache provider is enabled. Responses served from the Workers Cache API have immutable headers, and the request handler crashed with "Can't modify immutable headers" when applying its default Cloudflare-CDN-Cache-Control: no-store header to them. The handler now rebuilds the response with mutable headers when needed.

  • #17347 ce83c39 Thanks @astrobot-houston! - Fixes imageService: 'compile' producing unoptimized images when prerenderEnvironment is set to 'node'

  • #17594 2b8915a Thanks @astrobot-houston! - Fixes a type-checking error when using app.use(cf()) from @astrojs/cloudflare/hono in projects with wrangler types-generated ExecutionContext declarations

  • Updated dependencies []:

    • @astrojs/underscore-redirects@1.0.3

Don't miss a new astro release

NewReleases is sending notifications on new releases.