Skip to content
Merged
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
68 changes: 68 additions & 0 deletions src/content/docs/en/guides/upgrade-to/v6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,74 @@ const integration = () => {
}
```

### Removed: old `app.render()` signature (Adapter API)

<SourcePR number="14462" title="feat: clean deprecated APIs"/>

In Astro 4.0, the `app.render()` signature that allowed passing `routeData` and `locals` as optional arguments was deprecated in favor of a single optional `renderOptions` argument.

Astro 6.0 removes this signature entirely. Attempting to pass these separate arguments will now cause an error in your project.

#### What should I do?

Review your `app.render` calls and pass `routeData` and `locals` as properties of an object instead of as multiple independent arguments:

```ts title="my-adapter/entrypoint.ts" del={1} ins={2}
app.render(request, routeData, locals)
app.render(request, { routeData, locals })
```

<ReadMore>Learn more about the [Adapter API](/en/reference/adapter-reference/).</ReadMore>

### Removed: `handleForms` prop for the `<ClientRouter />` component

<SourcePR number="14462" title="feat: clean deprecated APIs"/>

In Astro 4.0, the `handleForms` prop of the `<ClientRouter />` component was deprecated, as it was no longer necessary to opt in to handling `submit` events for `form` elements. This functionality has been built-in by default and the property, if still included in your project, silently had no impact on form submission.

Astro 6.0 removes this prop entirely and it now must be removed to avoid errors in your project.

#### What should I do?

Remove the `handleForms` property from your `<ClientRouter />` component if it exists. It has provided no additional functionality, and so removing it should not change any behavior in your project:

```astro title="src/pages/index.astro" del="handleForms"
---
import { ClientRouter } from "astro:transitions";
---
<html>
<head>
<ClientRouter handleForms />
</head>
<body>
<!-- stuff here -->
</body>
</html>
```

<ReadMore>Learn more about [transitions with forms](/en/guides/view-transitions/#transitions-with-forms).</ReadMore>

### Removed: `prefetch()` `with` option

<SourcePR number="14462" title="feat: clean deprecated APIs"/>

In Astro 4.8.4, the `with` option of the programmatic `prefetch()` function was deprecated in favor of a more sensible default behavior that no longer required specifying the priority of prefetching for each page.

Astro 6.0 removes this option entirely and it is no longer possible to configure the priority of prefetching by passing the `with` option. Attempting to do so will now cause errors.

By default, Astro's prefetching now uses an automatic approach that will always try to use `<link rel="prefetch>` if supported, or will fall back to `fetch()`.

#### What should I do?

Review your `prefetch()` calls and remove the `with` option if it still exists:

```ts
prefetch('/about', { with: 'fetch' });
prefetch('/about');
```

<ReadMore>Learn more about [prefetching](/en/guides/prefetch/).</ReadMore>

## Changed Defaults

Some default behavior has changed in Astro v5.0 and your project code may need updating to account for these changes.
Expand Down
Loading