Skip to content
Merged
44 changes: 44 additions & 0 deletions src/content/docs/en/guides/upgrade-to/v6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,51 @@ import { defineCollection, z } from "astro:content"
import { defineCollection } from "astro:content"
import { z } from "astro/zod"
```

<ReadMore>See more about [defining collection schemas with Zod](/en/guides/content-collections/#defining-datatypes-with-zod).</ReadMore>

### Deprecated: exposed `astro:transitions` internals

<SourcePR number="14989" title="feat!: deprecate transitions exports" />

In Astro 5.x, some internals were exported from `astro:transitions` and `astro:transitions/client` that were not meant to be exposed for public use.

Astro 6.0 removes the following functions and types as exports from the `astro:transitions` and `astro:transitions/client` virtual modules. These can no longer be imported in your project files:

- `createAnimationScope()`
- `isTransitionBeforePreparationEvent()`
- `isTransitionBeforeSwapEvent()`
- `TRANSITION_BEFORE_PREPARATION`
- `TRANSITION_AFTER_PREPARATION`
- `TRANSITION_BEFORE_SWAP`
- `TRANSITION_AFTER_SWAP`
- `TRANSITION_PAGE_LOAD`

#### What should I do?

Remove any occurrences of `createAnimationScope()`:

```ts del={1}
import { createAnimationScope } from 'astro:transitions';
```

Update any occurrences of the other deprecated exports:

```ts del={1-4,6,9} ins={7,10}
import {
isTransitionBeforePreparationEvent,
TRANSITION_AFTER_SWAP,
} from 'astro:transitions/client';

console.log(isTransitionBeforePreparationEvent(event));
console.log(event.type === 'astro:before-preparation');

console.log(TRANSITION_AFTER_SWAP);
console.log('astro:after-swap');
```

<ReadMore>Learn more about all utilities available in the [View Transitions Router API Reference](/en/reference/modules/astro-transitions/).</ReadMore>

## Removed

The following features have now been entirely removed from the code base and can no longer be used. Some of these features may have continued to work in your project even after deprecation. Others may have silently had no effect.
Expand Down
30 changes: 15 additions & 15 deletions src/content/docs/en/reference/modules/astro-transitions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Replaces the old body with the new body. Then, goes through every element in the

### Deprecated imports

The following imports are scheduled for deprecation in v6. You can still use them in your project, but you may prefer to update your code now.
The following imports are deprecated in v6 and will be removed in v7. You can still use them in your project, but you may prefer to update your code now. [See how to upgrade](/en/guides/upgrade-to/v6/#deprecated-exposed-astrotransitions-internals).

<h4>`isTransitionBeforePreparationEvent()`</h4>

Expand All @@ -316,8 +316,8 @@ The following imports are scheduled for deprecation in v6. You can still use the
<Since v="3.6.0" />
</p>

:::caution[Scheduled for deprecation]
This function is scheduled for deprecation in v6. You can still use it in your project, but you may prefer to update your code now.
:::caution[Deprecated]
This function is deprecated in v6 and will be removed in v7. You can still use it in your project, but you may prefer to update your code now.
:::

Determines whether the given value matches a [`TransitionBeforePreparationEvent`](#transitionbeforepreparationevent). This can be useful when you need to narrow the type of an event in an event listener.
Expand Down Expand Up @@ -349,8 +349,8 @@ Determines whether the given value matches a [`TransitionBeforePreparationEvent`
<Since v="3.6.0" />
</p>

:::caution[Scheduled for deprecation]
This function is scheduled for deprecation in v6. You can still use it in your project, but you may prefer to update your code now.
:::caution[Deprecated]
This function is deprecated in v6 and will be removed in v7. You can still use it in your project, but you may prefer to update your code now.
:::

Determines whether the given value matches a [`TransitionBeforeSwapEvent`](#transitionbeforeswapevent). This can be useful when you need to narrow the type of an event in an event listener.
Expand Down Expand Up @@ -382,8 +382,8 @@ Determines whether the given value matches a [`TransitionBeforeSwapEvent`](#tran
<Since v="3.6.0" />
</p>

:::caution[Scheduled for deprecation]
This constant is scheduled for deprecation in v6. You can still use it in your project, but you may prefer to update your code now.
:::caution[Deprecated]
This constant is deprecated in v6 and will be removed in v7. You can still use it in your project, but you may prefer to update your code now.
:::

A constant to avoid writing the `astro:before-preparation` event name in plain text when you define an event.
Expand All @@ -409,8 +409,8 @@ A constant to avoid writing the `astro:before-preparation` event name in plain t
<Since v="3.6.0" />
</p>

:::caution[Scheduled for deprecation]
This constant is scheduled for deprecation in v6. You can still use it in your project, but you may prefer to update your code now.
:::caution[Deprecated]
This constant is deprecated in v6 and will be removed in v7. You can still use it in your project, but you may prefer to update your code now.
:::

A constant to avoid writing the `astro:after-preparation` event name in plain text when you define an event.
Expand All @@ -436,8 +436,8 @@ A constant to avoid writing the `astro:after-preparation` event name in plain te
<Since v="3.6.0" />
</p>

:::caution[Scheduled for deprecation]
This constant is scheduled for deprecation in v6. You can still use it in your project, but you may prefer to update your code now.
:::caution[Deprecated]
This constant is deprecated in v6 and will be removed in v7. You can still use it in your project, but you may prefer to update your code now.
:::

A constant to avoid writing the `astro:before-swap` event name in plain text when you define an event.
Expand All @@ -463,8 +463,8 @@ A constant to avoid writing the `astro:before-swap` event name in plain text whe
<Since v="3.6.0" />
</p>

:::caution[Scheduled for deprecation]
This constant is scheduled for deprecation in v6. You can still use it in your project, but you may prefer to update your code now.
:::caution[Deprecated]
This constant is deprecated in v6 and will be removed in v7. You can still use it in your project, but you may prefer to update your code now.
:::

A constant to avoid writing the `astro:after-swap` event name in plain text when you define an event.
Expand All @@ -490,8 +490,8 @@ A constant to avoid writing the `astro:after-swap` event name in plain text when
<Since v="3.6.0" />
</p>

:::caution[Scheduled for deprecation]
This constant is scheduled for deprecation in v6. You can still use it in your project, but you may prefer to update your code now.
:::caution[Deprecated]
This constant is deprecated in v6 and will be removed in v7. You can still use it in your project, but you may prefer to update your code now.
:::

A constant to avoid writing the `astro:page-load` event name in plain text when you define an event.
Expand Down