Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions .changeset/rich-horses-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'astro': major
---

Removes the deprecated `<ViewTransitions />` component

In Astro 5.0, the `<ViewTransitions />` component was renamed to `<ClientRouter />` to clarify the role of the component. The new name makes it more clear that the features you get from Astro's `<ClientRouter />` routing component are slightly different from the native CSS-based MPA router. However, a deprecated version of the `<ViewTransitions />` component still existed and may have functioned in Astro 5.x.

Astro 6.0 removes the `<ViewTransitions />` component entirely and it can no longer be used in your project. Update to the `<ClientRouter />` component to continue to use these features.

#### What should I do?

Replace all occurrences of the `ViewTransitions` import and component with `ClientRouter`:

```diff
// src/layouts/MyLayout.astro"
- import { ViewTransitions } from 'astro:transitions';
+ import { ClientRouter } from 'astro:transitions';
<html>
<head>
...
- <ViewTransitions />
+ <ClientRouter />
</head>
</html>
```
4 changes: 0 additions & 4 deletions packages/astro/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ declare module 'astro:transitions' {
export const createAnimationScope: TransitionModule['createAnimationScope'];

type ClientRouterModule = typeof import('./components/ClientRouter.astro');
/**
* @deprecated The ViewTransitions component has been renamed to ClientRouter
*/
export const ViewTransitions: ClientRouterModule['default'];
export const ClientRouter: ClientRouterModule['default'];
}

Expand Down
5 changes: 1 addition & 4 deletions packages/astro/src/transitions/vite-plugin-transitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ export default function astroTransitions({ settings }: { settings: AstroSettings
return {
code: `
export * from "astro/virtual-modules/transitions.js";
export {
default as ViewTransitions,
default as ClientRouter
} from "astro/components/ClientRouter.astro";
export { default as ClientRouter } from "astro/components/ClientRouter.astro";
`,
};
}
Expand Down