mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] release (beta) (#12405)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
3c72cdbc61
commit
b745e382f1
29 changed files with 125 additions and 54 deletions
|
@ -94,6 +94,7 @@
|
|||
"poor-frogs-dream",
|
||||
"poor-seals-clap",
|
||||
"pretty-walls-camp",
|
||||
"proud-games-repair",
|
||||
"quick-ads-exercise",
|
||||
"quick-onions-leave",
|
||||
"rotten-phones-scream",
|
||||
|
@ -110,6 +111,7 @@
|
|||
"strange-sheep-film",
|
||||
"strong-months-grab",
|
||||
"sweet-timers-smash",
|
||||
"tall-waves-impress",
|
||||
"tame-pumpkins-swim",
|
||||
"tame-rats-cross",
|
||||
"ten-students-repair",
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
"@astrojs/mdx": "^4.0.0-beta.3",
|
||||
"@astrojs/rss": "^4.0.9",
|
||||
"@astrojs/sitemap": "^3.2.1",
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
],
|
||||
"scripts": {},
|
||||
"devDependencies": {
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^4.0.0 || ^5.0.0"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"@astrojs/react": "^3.6.2",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
"@astrojs/alpinejs": "^0.4.0",
|
||||
"@types/alpinejs": "^3.13.10",
|
||||
"alpinejs": "^3.14.3",
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"@astrojs/vue": "^5.0.0-beta.1",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"preact": "^10.24.3",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/preact": "^3.5.3",
|
||||
"@preact/signals": "^1.3.0",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"preact": "^10.24.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"@astrojs/react": "^3.6.2",
|
||||
"@types/react": "^18.3.12",
|
||||
"@types/react-dom": "^18.3.1",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/solid-js": "^4.4.2",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"solid-js": "^1.9.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/svelte": "^6.0.0-beta.2",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"svelte": "^4.2.19"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/vue": "^5.0.0-beta.1",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"vue": "^3.5.12"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/node": "^9.0.0-alpha.1",
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
],
|
||||
"scripts": {},
|
||||
"devDependencies": {
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^4.0.0"
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/node": "^9.0.0-alpha.1",
|
||||
"@astrojs/svelte": "^6.0.0-beta.2",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"svelte": "^4.2.19"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"sass": "^1.80.6",
|
||||
"sharp": "^0.33.3"
|
||||
}
|
||||
|
|
|
@ -15,6 +15,6 @@
|
|||
"./app": "./dist/app.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/markdoc": "^0.12.0-beta.0",
|
||||
"astro": "^5.0.0-beta.7"
|
||||
"astro": "^5.0.0-beta.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/mdx": "^4.0.0-beta.3",
|
||||
"@astrojs/preact": "^3.5.3",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"preact": "^10.24.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/preact": "^3.5.3",
|
||||
"@nanostores/preact": "^0.5.2",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"nanostores": "^0.11.3",
|
||||
"preact": "^10.24.3"
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"@astrojs/mdx": "^4.0.0-beta.3",
|
||||
"@astrojs/tailwind": "^5.1.2",
|
||||
"@types/canvas-confetti": "^1.6.4",
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"canvas-confetti": "^1.9.3",
|
||||
"postcss": "^8.4.47",
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"test": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^5.0.0-beta.7",
|
||||
"astro": "^5.0.0-beta.8",
|
||||
"vitest": "^2.1.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,74 @@
|
|||
# astro
|
||||
|
||||
## 5.0.0-beta.8
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#12373](https://github.com/withastro/astro/pull/12373) [`d10f918`](https://github.com/withastro/astro/commit/d10f91815e63f169cff3d1daef5505aef077c76c) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Changes the default behavior for Astro Action form requests to a standard POST submission.
|
||||
|
||||
In Astro 4.x, actions called from an HTML form would trigger a redirect with the result forwarded using cookies. This caused issues for large form errors and return values that exceeded the 4 KB limit of cookie-based storage.
|
||||
|
||||
Astro 5.0 now renders the result of an action as a POST result without any forwarding. This will introduce a "confirm form resubmission?" dialog when a user attempts to refresh the page, though it no longer imposes a 4 KB limit on action return value.
|
||||
|
||||
## Customize form submission behavior
|
||||
|
||||
If you prefer to address the "confirm form resubmission?" dialog on refresh, or to preserve action results across sessions, you can now [customize action result handling from middleware](https://5-0-0-beta.docs.astro.build/en/guides/actions/#advanced-persist-action-results-with-a-session).
|
||||
|
||||
We recommend using a session storage provider [as described in our Netlify Blob example](https://5-0-0-beta.docs.astro.build/en/guides/actions/#advanced-persist-action-results-with-a-session). However, if you prefer the cookie forwarding behavior from 4.X and accept the 4 KB size limit, you can implement the pattern as shown in this sample snippet:
|
||||
|
||||
```ts
|
||||
// src/middleware.ts
|
||||
import { defineMiddleware } from 'astro:middleware';
|
||||
import { getActionContext } from 'astro:actions';
|
||||
|
||||
export const onRequest = defineMiddleware(async (context, next) => {
|
||||
// Skip requests for prerendered pages
|
||||
if (context.isPrerendered) return next();
|
||||
|
||||
const { action, setActionResult, serializeActionResult } = getActionContext(context);
|
||||
|
||||
// If an action result was forwarded as a cookie, set the result
|
||||
// to be accessible from `Astro.getActionResult()`
|
||||
const payload = context.cookies.get('ACTION_PAYLOAD');
|
||||
if (payload) {
|
||||
const { actionName, actionResult } = payload.json();
|
||||
setActionResult(actionName, actionResult);
|
||||
context.cookies.delete('ACTION_PAYLOAD');
|
||||
return next();
|
||||
}
|
||||
|
||||
// If an action was called from an HTML form action,
|
||||
// call the action handler and redirect with the result as a cookie.
|
||||
if (action?.calledFrom === 'form') {
|
||||
const actionResult = await action.handler();
|
||||
|
||||
context.cookies.set('ACTION_PAYLOAD', {
|
||||
actionName: action.name,
|
||||
actionResult: serializeActionResult(actionResult),
|
||||
});
|
||||
|
||||
if (actionResult.error) {
|
||||
// Redirect back to the previous page on error
|
||||
const referer = context.request.headers.get('Referer');
|
||||
if (!referer) {
|
||||
throw new Error('Internal: Referer unexpectedly missing from Action POST request.');
|
||||
}
|
||||
return context.redirect(referer);
|
||||
}
|
||||
// Redirect to the destination page on success
|
||||
return context.redirect(context.originPathname);
|
||||
}
|
||||
|
||||
return next();
|
||||
});
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#12339](https://github.com/withastro/astro/pull/12339) [`bdb75a8`](https://github.com/withastro/astro/commit/bdb75a87f24d7f032797483164fb2f82aa691fee) Thanks [@ematipico](https://github.com/ematipico)! - Adds an error when `Astro.rewrite()` is used to rewrite an on-demand route with a static route when using the `"server"` output.
|
||||
|
||||
This is a forbidden rewrite because Astro can't retrieve the emitted static route at runtime. This route is served by the hosting platform, and not Astro itself.
|
||||
|
||||
## 5.0.0-beta.7
|
||||
|
||||
### Minor Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "astro",
|
||||
"version": "5.0.0-beta.7",
|
||||
"version": "5.0.0-beta.8",
|
||||
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
||||
"type": "module",
|
||||
"author": "withastro",
|
||||
|
|
|
@ -3,7 +3,7 @@ import { AstroError } from '../core/errors/errors.js';
|
|||
import { viteID } from '../core/util.js';
|
||||
import type { AstroSettings } from '../types/astro.js';
|
||||
import type { AstroIntegration } from '../types/public/integrations.js';
|
||||
import { ACTIONS_TYPES_FILE, VIRTUAL_MODULE_ID, ACTION_RPC_ROUTE_PATTERN } from './consts.js';
|
||||
import { ACTIONS_TYPES_FILE, ACTION_RPC_ROUTE_PATTERN, VIRTUAL_MODULE_ID } from './consts.js';
|
||||
|
||||
/**
|
||||
* This integration is applied when the user is using Actions in their project.
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
import { z } from 'zod';
|
||||
import { ActionCalledFromServerError } from '../../../core/errors/errors-data.js';
|
||||
import { AstroError } from '../../../core/errors/errors.js';
|
||||
import type { APIContext } from '../../../types/public/index.js';
|
||||
import { ACTION_RPC_ROUTE_PATTERN } from '../../consts.js';
|
||||
import {
|
||||
formContentTypes,
|
||||
hasContentType,
|
||||
type ActionAPIContext,
|
||||
type ErrorInferenceObject,
|
||||
type MaybePromise,
|
||||
formContentTypes,
|
||||
hasContentType,
|
||||
} from '../utils.js';
|
||||
import type { Locals } from '../utils.js';
|
||||
import { getAction } from './get-action.js';
|
||||
import {
|
||||
ACTION_QUERY_PARAMS,
|
||||
ActionError,
|
||||
|
@ -18,10 +22,6 @@ import {
|
|||
deserializeActionResult,
|
||||
serializeActionResult,
|
||||
} from './shared.js';
|
||||
import type { Locals } from '../utils.js';
|
||||
import { getAction } from './get-action.js';
|
||||
import type { APIContext } from '../../../types/public/index.js';
|
||||
import { ACTION_RPC_ROUTE_PATTERN } from '../../consts.js';
|
||||
|
||||
export * from './shared.js';
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ importers:
|
|||
examples/basics:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/blog:
|
||||
|
@ -158,13 +158,13 @@ importers:
|
|||
specifier: ^3.2.1
|
||||
version: link:../../packages/integrations/sitemap
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/component:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/container-with-vitest:
|
||||
|
@ -173,7 +173,7 @@ importers:
|
|||
specifier: ^3.6.2
|
||||
version: link:../../packages/integrations/react
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
react:
|
||||
specifier: ^18.3.1
|
||||
|
@ -204,7 +204,7 @@ importers:
|
|||
specifier: ^3.14.3
|
||||
version: 3.14.3
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/framework-multiple:
|
||||
|
@ -231,7 +231,7 @@ importers:
|
|||
specifier: ^18.3.1
|
||||
version: 18.3.1
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.24.3
|
||||
|
@ -261,7 +261,7 @@ importers:
|
|||
specifier: ^1.3.0
|
||||
version: 1.3.0(preact@10.24.3)
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.24.3
|
||||
|
@ -279,7 +279,7 @@ importers:
|
|||
specifier: ^18.3.1
|
||||
version: 18.3.1
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
react:
|
||||
specifier: ^18.3.1
|
||||
|
@ -294,7 +294,7 @@ importers:
|
|||
specifier: ^4.4.2
|
||||
version: link:../../packages/integrations/solid
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
solid-js:
|
||||
specifier: ^1.9.2
|
||||
|
@ -306,7 +306,7 @@ importers:
|
|||
specifier: ^6.0.0-beta.2
|
||||
version: link:../../packages/integrations/svelte
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
svelte:
|
||||
specifier: ^4.2.19
|
||||
|
@ -318,7 +318,7 @@ importers:
|
|||
specifier: ^5.0.0-beta.1
|
||||
version: link:../../packages/integrations/vue
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
vue:
|
||||
specifier: ^3.5.12
|
||||
|
@ -330,25 +330,25 @@ importers:
|
|||
specifier: ^9.0.0-alpha.1
|
||||
version: 9.0.0-alpha.1(astro@packages+astro)
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/integration:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/minimal:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/portfolio:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/ssr:
|
||||
|
@ -360,7 +360,7 @@ importers:
|
|||
specifier: ^6.0.0-beta.2
|
||||
version: link:../../packages/integrations/svelte
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
svelte:
|
||||
specifier: ^4.2.19
|
||||
|
@ -369,7 +369,7 @@ importers:
|
|||
examples/starlog:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
sass:
|
||||
specifier: ^1.80.6
|
||||
|
@ -381,7 +381,7 @@ importers:
|
|||
examples/toolbar-app:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/with-markdoc:
|
||||
|
@ -390,7 +390,7 @@ importers:
|
|||
specifier: ^0.12.0-beta.0
|
||||
version: link:../../packages/integrations/markdoc
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/with-mdx:
|
||||
|
@ -402,7 +402,7 @@ importers:
|
|||
specifier: ^3.5.3
|
||||
version: link:../../packages/integrations/preact
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.24.3
|
||||
|
@ -417,7 +417,7 @@ importers:
|
|||
specifier: ^0.5.2
|
||||
version: 0.5.2(nanostores@0.11.3)(preact@10.24.3)
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
nanostores:
|
||||
specifier: ^0.11.3
|
||||
|
@ -438,7 +438,7 @@ importers:
|
|||
specifier: ^1.6.4
|
||||
version: 1.6.4
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
autoprefixer:
|
||||
specifier: ^10.4.20
|
||||
|
@ -456,7 +456,7 @@ importers:
|
|||
examples/with-vitest:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^5.0.0-beta.7
|
||||
specifier: ^5.0.0-beta.8
|
||||
version: link:../../packages/astro
|
||||
vitest:
|
||||
specifier: ^2.1.4
|
||||
|
|
Loading…
Reference in a new issue