From 0891ac9de5a6996e5ebd227e3443f7f4a4ea935a Mon Sep 17 00:00:00 2001 From: "Houston (Bot)" <108291165+astrobot-houston@users.noreply.github.com> Date: Fri, 7 Aug 2026 08:11:44 -0700 Subject: [PATCH 1/7] Fix dynamic redirect routes ignoring configured status code in underscore-redirects (#17620) * fix(underscore-redirects): use configured redirect status in dynamic branch The dynamic-route branch of createRedirectsFromAstroRoutes hardcoded 301 for redirect routes, ignoring user-configured status codes. The static branch already used getRedirectStatus(route) correctly. Fixes #17619 * chore: add changeset --- .changeset/fix-dynamic-redirect-status.md | 5 ++ packages/underscore-redirects/src/astro.ts | 2 +- .../underscore-redirects/test/astro.test.ts | 71 +++++++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-dynamic-redirect-status.md diff --git a/.changeset/fix-dynamic-redirect-status.md b/.changeset/fix-dynamic-redirect-status.md new file mode 100644 index 000000000000..cd1ff4444f52 --- /dev/null +++ b/.changeset/fix-dynamic-redirect-status.md @@ -0,0 +1,5 @@ +--- +'@astrojs/underscore-redirects': patch +--- + +Fixes dynamic redirect routes to honour user-configured status codes instead of hardcoding 301. Previously, a redirect configured with `{ destination: '/new', status: 302 }` would be emitted as 301 in the `_redirects` file when the route was dynamic. diff --git a/packages/underscore-redirects/src/astro.ts b/packages/underscore-redirects/src/astro.ts index 860a171eedf7..3e03c2e17152 100644 --- a/packages/underscore-redirects/src/astro.ts +++ b/packages/underscore-redirects/src/astro.ts @@ -153,7 +153,7 @@ export function createRedirectsFromAstroRoutes({ dynamic: true, input: `${base}${pattern}`, target, - status: route.type === 'redirect' ? 301 : 200, + status: route.type === 'redirect' ? getRedirectStatus(route) : 200, weight: 1, }); } else { diff --git a/packages/underscore-redirects/test/astro.test.ts b/packages/underscore-redirects/test/astro.test.ts index 623c7261f502..c378ea7d08be 100644 --- a/packages/underscore-redirects/test/astro.test.ts +++ b/packages/underscore-redirects/test/astro.test.ts @@ -48,6 +48,77 @@ describe('Astro', () => { assert.deepEqual(getTrailingSlashPaths('/path', 'never'), ['/path']); assert.deepEqual(getTrailingSlashPaths('/path/', 'never'), ['/path']); }); + it('Dynamic redirect honours configured status', () => { + const route = { + pattern: '/old/[id]', + pathname: undefined, + segments: [ + [{ content: 'old', dynamic: false, spread: false }], + [{ content: 'id', dynamic: true, spread: false }], + ], + type: 'redirect', + redirect: { destination: '/new/:id', status: 302 }, + redirectRoute: { + pattern: '/new/[id]', + segments: [ + [{ content: 'new', dynamic: false, spread: false }], + [{ content: 'id', dynamic: true, spread: false }], + ], + }, + entrypoint: '/old/[id]', + isPrerendered: true, + origin: 'internal', + } as unknown as IntegrationResolvedRoute; + + const redirects = createRedirectsFromAstroRoutes({ + config: { + build: { format: 'directory' }, + trailingSlash: 'never', + } as AstroConfig, + routeToDynamicTargetMap: new Map([[route, '']]), + dir: new URL(import.meta.url), + buildOutput: 'server', + assets: new Map([['/old/[id]', [new URL('./old/index.html', import.meta.url)]]]), + }); + + assert.equal(redirects.definitions[0].status, 302); + }); + + it('Dynamic redirect defaults to 301 when redirect is a string', () => { + const route = { + pattern: '/old/[id]', + pathname: undefined, + segments: [ + [{ content: 'old', dynamic: false, spread: false }], + [{ content: 'id', dynamic: true, spread: false }], + ], + type: 'redirect', + redirect: '/new/:id', + redirectRoute: { + pattern: '/new/[id]', + segments: [ + [{ content: 'new', dynamic: false, spread: false }], + [{ content: 'id', dynamic: true, spread: false }], + ], + }, + entrypoint: '/old/[id]', + isPrerendered: true, + origin: 'internal', + } as unknown as IntegrationResolvedRoute; + + const redirects = createRedirectsFromAstroRoutes({ + config: { + build: { format: 'directory' }, + trailingSlash: 'never', + } as AstroConfig, + routeToDynamicTargetMap: new Map([[route, '']]), + dir: new URL(import.meta.url), + buildOutput: 'server', + assets: new Map([['/old/[id]', [new URL('./old/index.html', import.meta.url)]]]), + }); + + assert.equal(redirects.definitions[0].status, 301); + }); }); function createIntegrationRoute(pattern: string, pathname = pattern): IntegrationResolvedRoute { From 5861cf5528096c36be05ce98fb233ffb811c1c7e Mon Sep 17 00:00:00 2001 From: mkismy Date: Sat, 8 Aug 2026 00:13:15 +0900 Subject: [PATCH 2/7] update: Basics template for Astro 7.0 (#17623) --- examples/basics/src/components/Welcome.astro | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/basics/src/components/Welcome.astro b/examples/basics/src/components/Welcome.astro index 1b2cf9c416d0..6652a7541221 100644 --- a/examples/basics/src/components/Welcome.astro +++ b/examples/basics/src/components/Welcome.astro @@ -27,16 +27,16 @@ import background from '../assets/background.svg'; - + -

What's New in Astro 6.0?

+

What's New in Astro 7.0?

- Redesigned dev server, fonts, live collections, built-in CSP support, and more! Click to - explore Astro 6.0's new features. + Rust-powered compiler, advanced routing, AI agent support, and more! Click to explore Astro + 7.0's new features.

From ba6a9f6e4523fe4e88ea31d4664835d3ba1ff3bc Mon Sep 17 00:00:00 2001 From: "Houston (Bot)" <108291165+astrobot-houston@users.noreply.github.com> Date: Fri, 7 Aug 2026 08:24:05 -0700 Subject: [PATCH 3/7] fix(cloudflare): bump astro peer dependency to ^7.2.0 (#17627) @astrojs/cloudflare@14.2.0 imports beginContentEntryCollection, beginImageCollection, endContentEntryCollection, and endImageCollection from astro/app, which were added in astro@7.2.0. The previous peer dependency range of ^7.0.0 allowed resolution of astro@7.1.x, causing a MISSING_EXPORT build failure. Fixes #17622 --- .changeset/fix-cloudflare-peer-dep.md | 5 +++++ packages/integrations/cloudflare/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-cloudflare-peer-dep.md diff --git a/.changeset/fix-cloudflare-peer-dep.md b/.changeset/fix-cloudflare-peer-dep.md new file mode 100644 index 000000000000..ecd2995dba44 --- /dev/null +++ b/.changeset/fix-cloudflare-peer-dep.md @@ -0,0 +1,5 @@ +--- +'@astrojs/cloudflare': patch +--- + +Fixes the `astro` peer dependency range from `^7.0.0` to `^7.2.0`. The adapter imports symbols (`beginContentEntryCollection`, `beginImageCollection`, `endContentEntryCollection`, `endImageCollection`) from `astro/app` that were added in Astro 7.2.0, so earlier versions fail at build time with a `MISSING_EXPORT` error. diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index 2e9258ec394b..a836eeb93cea 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -51,7 +51,7 @@ "vite": "^8.0.13" }, "peerDependencies": { - "astro": "^7.0.0", + "astro": "^7.2.0", "wrangler": "^4.83.0" }, "devDependencies": { From 4ada24889fc1bcc1ee89f3f8e5c6bc4cbe87cce6 Mon Sep 17 00:00:00 2001 From: "Houston (Bot)" <108291165+astrobot-houston@users.noreply.github.com> Date: Fri, 7 Aug 2026 08:41:43 -0700 Subject: [PATCH 4/7] fix(csp): include speculation rules hash in CSP when clientPrerender is enabled (#17628) When both `security.csp` and `experimental.clientPrerender` are enabled, the prefetch module's dynamic per-URL `