Skip to content

Commit bd374b7

Browse files
authored
fix: deprecation warnings and inline comments from Astro 7.0 to 8.0. (#17712)
1 parent 2043e4f commit bd374b7

9 files changed

Lines changed: 25 additions & 20 deletions

File tree

.changeset/cyan-pigs-take.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Updates deprecation messages target from Astro 7 to 8

packages/astro/client.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// <reference path="./types/transitions.d.ts" />
88

99
interface ImportMetaEnv {
10-
// TODO: remove in Astro 7
10+
// TODO: remove in Astro 8
1111
/**
1212
* The prefix for Astro-generated asset links if the build.assetsPrefix config option is set. This can be used to create asset links not handled by Astro.
1313
* @deprecated This will be removed in a future major version of Astro. Use `build.assetsPrefix` from `astro:config/server` instead.
@@ -149,11 +149,11 @@ declare module 'astro:components' {
149149
export * from 'astro/components';
150150
}
151151

152-
// TODO: remove in Astro 7
152+
// TODO: remove in Astro 8
153153
/**
154154
* @deprecated
155155
* `import { z } from 'astro:schema'` is deprecated and will be removed
156-
* in Astro 7. Use `import { z } from 'astro/zod'` instead.
156+
* in Astro 8. Use `import { z } from 'astro/zod'` instead.
157157
*/
158158
declare module 'astro:schema' {
159159
export * from 'astro/zod';
@@ -162,7 +162,7 @@ declare module 'astro:schema' {
162162
/**
163163
* @deprecated
164164
* `import { z } from 'astro:schema'` is deprecated and will be removed
165-
* in Astro 7. Use `import { z } from 'astro/zod'` instead.
165+
* in Astro 8. Use `import { z } from 'astro/zod'` instead.
166166
*/
167167
export const z = zod.z;
168168
}

packages/astro/src/content/runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ export function createGetEntry({ liveCollections }: { liveCollections: LiveColle
214214
data,
215215
collection,
216216
} as DataEntryResult | ContentEntryResult;
217-
// TODO: remove in Astro 7
217+
// TODO: remove in Astro 8
218218
warnForPropertyAccess(
219219
result.data,
220220
'slug',
221221
`[content] Attempted to access deprecated property on "${collection}" entry.\nThe "slug" property is no longer automatically added to entries. Please use the "id" property instead.`,
222222
);
223-
// TODO: remove in Astro 7
223+
// TODO: remove in Astro 8
224224
warnForPropertyAccess(
225225
result,
226226
'render',

packages/astro/src/core/compile/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function compile({
5050
normalizedFilename: normalizeFilename(filename, astroConfig.root),
5151
sourcemap: 'both',
5252
internalURL: 'astro/compiler-runtime',
53-
// TODO: remove in Astro v7
53+
// TODO: remove in Astro v8
5454
astroGlobalArgs: JSON.stringify(astroConfig.site),
5555
scopedStyleStrategy: astroConfig.scopedStyleStrategy,
5656
resultScopedSlot: true,

packages/astro/src/core/create-vite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export async function createVite(
276276
find: 'astro:middleware',
277277
replacement: 'astro/virtual-modules/middleware.js',
278278
},
279-
// TODO: remove in Astro 7
279+
// TODO: remove in Astro 8
280280
{
281281
find: 'astro:schema',
282282
replacement: 'astro/zod',

packages/astro/src/core/session/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface BaseSessionConfig {
4444
interface DriverConfig<TDriver extends SessionDriverConfig> extends BaseSessionConfig {
4545
/** Config object for a session driver */
4646
driver: TDriver;
47-
/** @deprecated Pass options to the driver function directly. This will be removed in Astro 7 */
47+
/** @deprecated Pass options to the driver function directly. This will be removed in Astro 8 */
4848
options?: never;
4949
}
5050

@@ -56,25 +56,25 @@ interface UnstorageConfig<
5656
> extends BaseSessionConfig {
5757
/**
5858
* Entrypoint for an unstorage session driver
59-
* @deprecated Use `import { sessionDrivers } from 'astro/config'` instead. This will be removed in Astro 7
59+
* @deprecated Use `import { sessionDrivers } from 'astro/config'` instead. This will be removed in Astro 8
6060
*/
6161
driver?: TDriver;
6262
/**
6363
* Options for the unstorage driver
64-
* @deprecated Use `import { sessionDrivers } from 'astro/config'` instead. This will be removed in Astro 7
64+
* @deprecated Use `import { sessionDrivers } from 'astro/config'` instead. This will be removed in Astro 8
6565
*/
6666
options?: TOptions;
6767
}
6868

6969
interface CustomConfig extends BaseSessionConfig {
7070
/**
7171
* Entrypoint for a custom session driver
72-
* @deprecated Use the object shape (type `SessionDriverConfig`). This will be removed in Astro 7
72+
* @deprecated Use the object shape (type `SessionDriverConfig`). This will be removed in Astro 8
7373
*/
7474
driver?: string;
7575
/**
7676
* Options for the custom session driver
77-
* @deprecated Use the object shape (type `SessionDriverConfig`). This will be removed in Astro 7
77+
* @deprecated Use the object shape (type `SessionDriverConfig`). This will be removed in Astro 8
7878
*/
7979
options?: Record<string, unknown>;
8080
}

packages/astro/src/runtime/server/astro-global.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ function createError(name: string) {
1313
// inside of getStaticPaths. See the `astroGlobalArgs` option for parameter type.
1414
export function createAstro(site: string | undefined): AstroGlobal {
1515
return {
16-
// TODO: throw in Astro 7
16+
// TODO: throw in Astro 8
1717
get site() {
1818
// This is created inside of the runtime so we don't have access to the Astro logger.
1919
console.warn(
2020
`Astro.site inside getStaticPaths is deprecated and will be removed in a future major version of Astro. Use import.meta.env.SITE instead`,
2121
);
2222
return site ? new URL(site) : undefined;
2323
},
24-
// TODO: throw in Astro 7
24+
// TODO: throw in Astro 8
2525
get generator() {
2626
// This is created inside of the runtime so we don't have access to the Astro logger.
2727
console.warn(

packages/astro/templates/content/module.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export {
1313
defineLiveCollection,
1414
renderEntry as render,
1515
} from 'astro/content/runtime';
16-
// TODO: remove in Astro 7
16+
// TODO: remove in Astro 8
1717
export { z } from 'astro/zod';
1818

1919
/* @@LIVE_CONTENT_CONFIG@@ */
@@ -38,8 +38,8 @@ export const getLiveEntry = createGetLiveEntry({
3838
liveCollections,
3939
});
4040

41-
// TODO: remove in Astro 7
41+
// TODO: remove in Astro 8
4242
export const getEntryBySlug = createDeprecatedFunction('getEntryBySlug');
4343

44-
// TODO: remove in Astro 7
44+
// TODO: remove in Astro 8
4545
export const getDataEntryById = createDeprecatedFunction('getDataEntryById');

packages/astro/types/content.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ declare module 'astro:content' {
1010
} from 'astro/content/config';
1111
export { defineLiveCollection, defineCollection } from 'astro/content/config';
1212

13-
// TODO: remove in Astro 7
13+
// TODO: remove in Astro 8
1414
/**
1515
* @deprecated
1616
* `import { z } from 'astro:content'` is deprecated and will be removed
17-
* in Astro 7. Use `import { z } from 'astro/zod'` instead.
17+
* in Astro 8. Use `import { z } from 'astro/zod'` instead.
1818
*/
1919
export const z = zod.z;
2020

0 commit comments

Comments
 (0)