github withastro/astro @astrojs/cloudflare@13.6.0

latest releases: @astrojs/markdown-satteri@0.2.1, @astrojs/markdown-satteri@0.2.0
3 hours ago

13.6.0

Minor Changes

  • #16729 01aa164 Thanks @matthewp! - Adds @astrojs/cloudflare/fetch and @astrojs/cloudflare/hono exports for composing Cloudflare-specific setup with Astro's advanced routing handlers.

    @astrojs/cloudflare/fetch

    For use with astro/fetch in a custom fetch handler:

    import { astro, FetchState } from 'astro/fetch';
    import { cf } from '@astrojs/cloudflare/fetch';
    
    export default {
      async fetch(request: Request, env: Env, ctx: ExecutionContext) {
        const state = new FetchState(request);
        const asset = await cf(state, env, ctx);
        if (asset) return asset;
        return astro(state);
      },
    };

    @astrojs/cloudflare/hono

    For use with astro/hono as Hono middleware:

    import { Hono } from 'hono';
    import { actions, middleware, pages, i18n } from 'astro/hono';
    import { cf } from '@astrojs/cloudflare/hono';
    
    const app = new Hono<{ Bindings: Env }>();
    
    app.use(cf());
    app.use(actions());
    app.use(middleware());
    app.use(pages());
    app.use(i18n());
    
    export default app;

    Both handlers configure SESSION KV bindings, static asset serving via the ASSETS binding, locals.cfContext, client address, waitUntil, and prerendered error page fetch.

Patch Changes

  • #16868 f9bae95 Thanks @helio-cf! - Fixes user options passed to cloudflare({...}) (remoteBindings, inspectorPort, persistState, configPath, auxiliaryWorkers) being silently ignored during astro preview. The adapter now resolves the full @cloudflare/vite-plugin config once at integration setup time and reuses that single resolved value across the dev/build plugin, the prerenderer's preview server, and the astro preview entrypoint, so user options can no longer be dropped at one of the call sites.

  • #16468 4cff3a1 Thanks @matthewp! - Fixes static Cloudflare builds with server islands or image endpoints that failed at preview time due to mismatched output directories.

  • Updated dependencies [f732f3c]:

    • @astrojs/internal-helpers@0.10.0
    • @astrojs/underscore-redirects@1.0.3

Don't miss a new astro release

NewReleases is sending notifications on new releases.