Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/content/docs/en/guides/upgrade-to/v6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,56 @@ export const server = {

<ReadMore>Learn more about [rewrites](/en/guides/routing/#rewrites).</ReadMore>

### Removed: internal exports from the `astro:actions` module

<SourcePR number="14844" title="refactor: cleanup public actions API"/>

Astro 6.0 removes the following functions, classes and types that may no longer be used:

- `ACTION_ERROR_CODES`
- `ActionInputError`
- `appendForwardSlash`
- `astroCalledServerError`
- `callSafely`
- `deserializeActionResult`
- `formDataToObject`
- `getActionQueryString`
- `serializeActionResult`
- `type Actions`
- `type ActionAccept`
- `type AstroActionContext`
- `type SerializedActionResult`

#### What should I do?

Review your Actions and remove all imports from non-exported utilities, e.g. `ActionInputError`:

```ts title="src/actions/index.ts" del={1,9-12} ins={2,13-16}
import { defineAction, ActionInputError } from "astro:actions";
import { defineAction, ActionError } from "astro:actions";

export const server = {
getUserOrThrow: defineAction({
accept: 'form',
handler: async (_, { locals }) => {
if (locals.user?.name !== 'trueberryless') {
throw new ActionInputError({
code: 'BAD_REQUEST',
message: 'Felix may not log in',
});
throw new ActionError({
code: 'BAD_REQUEST',
message: 'Felix may still not log in',
});
}
return locals.user;
},
}),
}
```

<ReadMore>Learn more about [Astro Actions](/en/guides/actions/) and all utilities available in the [Actions API Reference](/en/reference/modules/astro-actions/).</ReadMore>

### Experimental Flags

Experimental flags allow you to opt in to features while they are in early development. Astro may also use experimental flags to test breaking changes to default behavior. The following experimental flags have been removed in Astro 6.0 and are now stable, or the new default behavior.
Expand Down