Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: withastro/astro
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: astro@5.5.4
Choose a base ref
...
head repository: withastro/astro
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: astro@5.5.5
Choose a head ref
  • 8 commits
  • 67 files changed
  • 9 contributors

Commits on Mar 24, 2025

  1. fix(app): call renderer when routes don't match (#13483)

    * fix(app): call renderer when routes don't match
    
    * chore: pick 404 exactly
    
    * chore: pick route differently
    
    Co-authored-by: ascorbic <213306+ascorbic@users.noreply.github.com>
    ematipico and ascorbic authored Mar 24, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fc2dcb8 View commit details
  2. [ci] format

    ematipico authored and astrobot-houston committed Mar 24, 2025
    Copy the full SHA
    70c9595 View commit details

Commits on Mar 25, 2025

  1. fix: update vite (#13505)

    * fix: update vite
    
    * use dedupe
    ematipico authored Mar 25, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    a98ae5b View commit details

Commits on Mar 26, 2025

  1. fix: cache raw cookie value and decode when getting (#13485)

    * fix: cache raw cookie value and decode when getting
    
    * Add test
    
    * Add comment
    ascorbic authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    018fbe9 View commit details
  2. [ci] format

    ascorbic authored and astrobot-houston committed Mar 26, 2025
    Copy the full SHA
    e4f870b View commit details
  3. fix(astro): dynamically import actions (#13510)

    * feat: update test
    
    * feat: dynamic import
    
    * chore: changeset
    
    * Update .changeset/clever-tigers-dig.md
    florian-lefebvre authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5b14d33 View commit details
  4. [ci] format

    florian-lefebvre authored and astrobot-houston committed Mar 26, 2025
    Copy the full SHA
    3488324 View commit details
  5. [ci] release (#13504)

    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    astrobot-houston and github-actions[bot] authored Mar 26, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b33cc17 View commit details
Showing with 449 additions and 271 deletions.
  1. +1 −1 examples/basics/package.json
  2. +2 −2 examples/blog/package.json
  3. +1 −1 examples/component/package.json
  4. +2 −2 examples/container-with-vitest/package.json
  5. +2 −2 examples/framework-alpine/package.json
  6. +6 −6 examples/framework-multiple/package.json
  7. +2 −2 examples/framework-preact/package.json
  8. +2 −2 examples/framework-react/package.json
  9. +2 −2 examples/framework-solid/package.json
  10. +2 −2 examples/framework-svelte/package.json
  11. +2 −2 examples/framework-vue/package.json
  12. +1 −1 examples/hackernews/package.json
  13. +1 −1 examples/integration/package.json
  14. +1 −1 examples/minimal/package.json
  15. +1 −1 examples/portfolio/package.json
  16. +2 −2 examples/ssr/package.json
  17. +1 −1 examples/starlog/package.json
  18. +1 −1 examples/toolbar-app/package.json
  19. +2 −2 examples/with-markdoc/package.json
  20. +3 −3 examples/with-mdx/package.json
  21. +2 −2 examples/with-nanostores/package.json
  22. +2 −2 examples/with-tailwindcss/package.json
  23. +1 −1 examples/with-vitest/package.json
  24. +12 −0 packages/astro/CHANGELOG.md
  25. +2 −2 packages/astro/package.json
  26. +5 −0 packages/astro/src/actions/noop-actions.ts
  27. +9 −1 packages/astro/src/core/app/index.ts
  28. +1 −1 packages/astro/src/core/app/types.ts
  29. +3 −2 packages/astro/src/core/base-pipeline.ts
  30. +3 −2 packages/astro/src/core/build/generate.ts
  31. +1 −2 packages/astro/src/core/build/plugins/plugin-ssr.ts
  32. +16 −12 packages/astro/src/core/cookies/cookies.ts
  33. +4 −0 packages/astro/test/fixtures/middleware space/integration-middleware-post.js
  34. +12 −0 packages/astro/test/middleware.test.js
  35. +16 −5 packages/astro/test/units/cookies/get.test.js
  36. +9 −0 packages/db/CHANGELOG.md
  37. +2 −2 packages/db/package.json
  38. +6 −0 packages/integrations/alpinejs/CHANGELOG.md
  39. +2 −2 packages/integrations/alpinejs/package.json
  40. +9 −0 packages/integrations/cloudflare/CHANGELOG.md
  41. +2 −2 packages/integrations/cloudflare/package.json
  42. +7 −0 packages/integrations/cloudflare/test/astro-env.test.js
  43. +1 −1 packages/integrations/cloudflare/test/fixtures/astro-env/package.json
  44. +12 −0 packages/integrations/cloudflare/test/fixtures/astro-env/src/actions.ts
  45. +9 −0 packages/integrations/cloudflare/test/fixtures/astro-env/src/middleware.ts
  46. +6 −0 packages/integrations/cloudflare/test/fixtures/astro-env/src/pages/test.astro
  47. +6 −0 packages/integrations/markdoc/CHANGELOG.md
  48. +2 −2 packages/integrations/markdoc/package.json
  49. +6 −0 packages/integrations/mdx/CHANGELOG.md
  50. +2 −2 packages/integrations/mdx/package.json
  51. +9 −0 packages/integrations/netlify/CHANGELOG.md
  52. +2 −2 packages/integrations/netlify/package.json
  53. +6 −0 packages/integrations/preact/CHANGELOG.md
  54. +2 −2 packages/integrations/preact/package.json
  55. +6 −0 packages/integrations/react/CHANGELOG.md
  56. +2 −2 packages/integrations/react/package.json
  57. +6 −0 packages/integrations/solid/CHANGELOG.md
  58. +2 −2 packages/integrations/solid/package.json
  59. +6 −0 packages/integrations/svelte/CHANGELOG.md
  60. +2 −2 packages/integrations/svelte/package.json
  61. +6 −0 packages/integrations/tailwind/CHANGELOG.md
  62. +2 −2 packages/integrations/tailwind/package.json
  63. +6 −0 packages/integrations/vue/CHANGELOG.md
  64. +2 −2 packages/integrations/vue/package.json
  65. +6 −0 packages/studio/CHANGELOG.md
  66. +2 −2 packages/studio/package.json
  67. +175 −175 pnpm-lock.yaml
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
@@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.5.4"
"astro": "^5.5.5"
}
}
4 changes: 2 additions & 2 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^4.2.1",
"@astrojs/mdx": "^4.2.2",
"@astrojs/rss": "^4.0.11",
"@astrojs/sitemap": "^3.3.0",
"astro": "^5.5.4"
"astro": "^5.5.5"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.5.4"
"astro": "^5.5.5"
},
"peerDependencies": {
"astro": "^4.0.0 || ^5.0.0"
4 changes: 2 additions & 2 deletions examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@
"test": "vitest run"
},
"dependencies": {
"@astrojs/react": "^4.2.1",
"astro": "^5.5.4",
"@astrojs/react": "^4.2.2",
"astro": "^5.5.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^3.0.9"
4 changes: 2 additions & 2 deletions examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/alpinejs": "^0.4.3",
"@astrojs/alpinejs": "^0.4.4",
"@types/alpinejs": "^3.13.11",
"alpinejs": "^3.14.9",
"astro": "^5.5.4"
"astro": "^5.5.5"
}
}
12 changes: 6 additions & 6 deletions examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
@@ -10,14 +10,14 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^4.0.6",
"@astrojs/react": "^4.2.1",
"@astrojs/solid-js": "^5.0.5",
"@astrojs/svelte": "^7.0.7",
"@astrojs/vue": "^5.0.7",
"@astrojs/preact": "^4.0.7",
"@astrojs/react": "^4.2.2",
"@astrojs/solid-js": "^5.0.6",
"@astrojs/svelte": "^7.0.8",
"@astrojs/vue": "^5.0.8",
"@types/react": "^18.3.19",
"@types/react-dom": "^18.3.5",
"astro": "^5.5.4",
"astro": "^5.5.5",
"preact": "^10.26.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
4 changes: 2 additions & 2 deletions examples/framework-preact/package.json
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^4.0.6",
"@astrojs/preact": "^4.0.7",
"@preact/signals": "^2.0.1",
"astro": "^5.5.4",
"astro": "^5.5.5",
"preact": "^10.26.4"
}
}
4 changes: 2 additions & 2 deletions examples/framework-react/package.json
Original file line number Diff line number Diff line change
@@ -10,10 +10,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^4.2.1",
"@astrojs/react": "^4.2.2",
"@types/react": "^18.3.19",
"@types/react-dom": "^18.3.5",
"astro": "^5.5.4",
"astro": "^5.5.5",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
4 changes: 2 additions & 2 deletions examples/framework-solid/package.json
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/solid-js": "^5.0.5",
"astro": "^5.5.4",
"@astrojs/solid-js": "^5.0.6",
"astro": "^5.5.5",
"solid-js": "^1.9.5"
}
}
4 changes: 2 additions & 2 deletions examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/svelte": "^7.0.7",
"astro": "^5.5.4",
"@astrojs/svelte": "^7.0.8",
"astro": "^5.5.5",
"svelte": "^5.23.2"
}
}
4 changes: 2 additions & 2 deletions examples/framework-vue/package.json
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/vue": "^5.0.7",
"astro": "^5.5.4",
"@astrojs/vue": "^5.0.8",
"astro": "^5.5.5",
"vue": "^3.5.13"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@
},
"dependencies": {
"@astrojs/node": "^9.1.3",
"astro": "^5.5.4"
"astro": "^5.5.5"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^5.5.4"
"astro": "^5.5.5"
},
"peerDependencies": {
"astro": "^4.0.0"
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
@@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.5.4"
"astro": "^5.5.5"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
@@ -10,6 +10,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.5.4"
"astro": "^5.5.5"
}
}
4 changes: 2 additions & 2 deletions examples/ssr/package.json
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@
},
"dependencies": {
"@astrojs/node": "^9.1.3",
"@astrojs/svelte": "^7.0.7",
"astro": "^5.5.4",
"@astrojs/svelte": "^7.0.8",
"astro": "^5.5.5",
"svelte": "^5.23.2"
}
}
2 changes: 1 addition & 1 deletion examples/starlog/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^5.5.4",
"astro": "^5.5.5",
"sass": "^1.86.0",
"sharp": "^0.33.3"
}
2 changes: 1 addition & 1 deletion examples/toolbar-app/package.json
Original file line number Diff line number Diff line change
@@ -16,6 +16,6 @@
},
"devDependencies": {
"@types/node": "^18.17.8",
"astro": "^5.5.4"
"astro": "^5.5.5"
}
}
4 changes: 2 additions & 2 deletions examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/markdoc": "^0.13.1",
"astro": "^5.5.4"
"@astrojs/markdoc": "^0.13.2",
"astro": "^5.5.5"
}
}
6 changes: 3 additions & 3 deletions examples/with-mdx/package.json
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^4.2.1",
"@astrojs/preact": "^4.0.6",
"astro": "^5.5.4",
"@astrojs/mdx": "^4.2.2",
"@astrojs/preact": "^4.0.7",
"astro": "^5.5.5",
"preact": "^10.26.4"
}
}
4 changes: 2 additions & 2 deletions examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
@@ -10,9 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/preact": "^4.0.6",
"@astrojs/preact": "^4.0.7",
"@nanostores/preact": "^0.5.2",
"astro": "^5.5.4",
"astro": "^5.5.5",
"nanostores": "^0.11.4",
"preact": "^10.26.4"
}
4 changes: 2 additions & 2 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
@@ -10,10 +10,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^4.2.1",
"@astrojs/mdx": "^4.2.2",
"@tailwindcss/vite": "^4.0.15",
"@types/canvas-confetti": "^1.9.0",
"astro": "^5.5.4",
"astro": "^5.5.5",
"canvas-confetti": "^1.9.3",
"tailwindcss": "^4.0.15"
}
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^5.5.4",
"astro": "^5.5.5",
"vitest": "^3.0.9"
}
}
12 changes: 12 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# astro

## 5.5.5

### Patch Changes

- [#13510](https://github.com/withastro/astro/pull/13510) [`5b14d33`](https://github.com/withastro/astro/commit/5b14d33f81cdac0f7ac77186113dcce4369d848d) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where `astro:env` secrets used in actions would not be available

- [#13485](https://github.com/withastro/astro/pull/13485) [`018fbe9`](https://github.com/withastro/astro/commit/018fbe90f4030bbc2b2db7589d750e5392f38e59) Thanks [@ascorbic](https://github.com/ascorbic)! - Fixes a bug that caused cookies to ignore custom decode function if has() had been called before

- [#13505](https://github.com/withastro/astro/pull/13505) [`a98ae5b`](https://github.com/withastro/astro/commit/a98ae5b8f5c33900379012e9e253a755c0a8927e) Thanks [@ematipico](https://github.com/ematipico)! - Updates the dependency `vite` to the latest.

- [#13483](https://github.com/withastro/astro/pull/13483) [`fc2dcb8`](https://github.com/withastro/astro/commit/fc2dcb83543d88af9e0920b90a035652d6db5166) Thanks [@ematipico](https://github.com/ematipico)! - Fixes a bug where an Astro adapter couldn't call the middleware when there isn't a route that matches the incoming request.

## 5.5.4

### Patch Changes
4 changes: 2 additions & 2 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro",
"version": "5.5.4",
"version": "5.5.5",
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
"type": "module",
"author": "withastro",
@@ -167,7 +167,7 @@
"unist-util-visit": "^5.0.0",
"unstorage": "^1.15.0",
"vfile": "^6.0.3",
"vite": "^6.2.1",
"vite": "^6.2.3",
"vitefu": "^1.0.6",
"xxhash-wasm": "^1.1.0",
"yargs-parser": "^21.1.1",
5 changes: 5 additions & 0 deletions packages/astro/src/actions/noop-actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { SSRActions } from '../core/app/types.js';

export const NOOP_ACTIONS_MOD: SSRActions = {
server: {},
};
10 changes: 9 additions & 1 deletion packages/astro/src/core/app/index.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ import { normalizeTheLocale } from '../../i18n/index.js';
import type { RoutesList } from '../../types/astro.js';
import type { RouteData, SSRManifest } from '../../types/public/internal.js';
import {
DEFAULT_404_COMPONENT,
REROUTABLE_STATUS_CODES,
REROUTE_DIRECTIVE_HEADER,
clientAddressSymbol,
@@ -88,7 +89,6 @@ export class App {
#baseWithoutTrailingSlash: string;
#pipeline: AppPipeline;
#adapterLogger: AstroIntegrationLogger;
#renderOptionsDeprecationWarningShown = false;

constructor(manifest: SSRManifest, streaming = true) {
this.#manifest = manifest;
@@ -331,6 +331,14 @@ export class App {
this.#logger.debug('router', 'Astro matched the following route for ' + request.url);
this.#logger.debug('router', 'RouteData:\n' + routeData);
}
// At this point we haven't found a route that matches the request, so we create
// a "fake" 404 route, so we can call the RenderContext.render
// and hit the middleware, which might be able to return a correct Response.
if (!routeData) {
routeData = this.#manifestData.routes.find(
(route) => route.component === '404.astro' || route.component === DEFAULT_404_COMPONENT,
);
}
if (!routeData) {
this.#logger.debug('router', "Astro hasn't found routes that match " + request.url);
this.#logger.debug('router', "Here's the available routes:\n", this.#manifestData);
2 changes: 1 addition & 1 deletion packages/astro/src/core/app/types.ts
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ export type SSRManifest = {
key: Promise<CryptoKey>;
i18n: SSRManifestI18n | undefined;
middleware?: () => Promise<AstroMiddlewareInstance> | AstroMiddlewareInstance;
actions?: SSRActions;
actions?: () => Promise<SSRActions> | SSRActions;
checkOrigin: boolean;
sessionConfig?: ResolvedSessionConfig<any>;
cacheDir: string | URL;
5 changes: 3 additions & 2 deletions packages/astro/src/core/base-pipeline.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ZodType } from 'zod';
import { NOOP_ACTIONS_MOD } from '../actions/noop-actions.js';
import type { ActionAccept, ActionClient } from '../actions/runtime/virtual/server.js';
import { createI18nMiddleware } from '../i18n/middleware.js';
import type { ComponentInstance } from '../types/astro.js';
@@ -131,9 +132,9 @@ export abstract class Pipeline {
if (this.resolvedActions) {
return this.resolvedActions;
} else if (this.actions) {
return this.actions;
return await this.actions();
}
return { server: {} };
return NOOP_ACTIONS_MOD;
}

async getAction(path: string): Promise<ActionClient<unknown, ActionAccept, ZodType>> {
5 changes: 3 additions & 2 deletions packages/astro/src/core/build/generate.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ import os from 'node:os';
import { bgGreen, black, blue, bold, dim, green, magenta, red, yellow } from 'kleur/colors';
import PLimit from 'p-limit';
import PQueue from 'p-queue';
import { NOOP_ACTIONS_MOD } from '../../actions/noop-actions.js';
import {
generateImagesForPath,
getStaticImageList,
@@ -66,7 +67,7 @@ export async function generatePages(options: StaticBuildOptions, internals: Buil

const actions: SSRActions = internals.astroActionsEntryPoint
? await import(internals.astroActionsEntryPoint.toString()).then((mod) => mod)
: { server: {} };
: NOOP_ACTIONS_MOD;
manifest = createBuildManifest(
options.settings,
internals,
@@ -651,7 +652,7 @@ function createBuildManifest(
onRequest: middleware,
};
},
actions,
actions: () => actions,
checkOrigin:
(settings.config.security?.checkOrigin && settings.buildOutput === 'server') ?? false,
key,
3 changes: 1 addition & 2 deletions packages/astro/src/core/build/plugins/plugin-ssr.ts
Original file line number Diff line number Diff line change
@@ -168,7 +168,6 @@ function generateSSRCode(adapter: AstroAdapter, middlewareId: string) {

const imports = [
`import { renderers } from '${RENDERERS_MODULE_ID}';`,
`import * as actions from '${ASTRO_ACTIONS_INTERNAL_MODULE_ID}';`,
`import * as serverEntrypointModule from '${ADAPTER_VIRTUAL_MODULE_ID}';`,
`import { manifest as defaultManifest } from '${SSR_MANIFEST_VIRTUAL_MODULE_ID}';`,
`import { serverIslandMap } from '${VIRTUAL_ISLAND_MAP_ID}';`,
@@ -180,7 +179,7 @@ function generateSSRCode(adapter: AstroAdapter, middlewareId: string) {
` pageMap,`,
` serverIslandMap,`,
` renderers,`,
` actions,`,
` actions: () => import("${ASTRO_ACTIONS_INTERNAL_MODULE_ID}"),`,
` middleware: ${edgeMiddleware ? 'undefined' : `() => import("${middlewareId}")`}`,
`});`,
`const _args = ${adapter.args ? JSON.stringify(adapter.args, null, 4) : 'undefined'};`,
Loading