-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove deprecated Astro globals * Remove deprecated hook param * Fix test * Add changeset * Add TODO
- Loading branch information
Showing
18 changed files
with
87 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
'@astrojs/cloudflare': major | ||
'@astrojs/deno': major | ||
'@astrojs/image': minor | ||
'@astrojs/netlify': major | ||
'@astrojs/node': major | ||
'@astrojs/vercel': major | ||
--- | ||
|
||
Remove `astro:build:start` backwards compatibility code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
'astro': major | ||
--- | ||
|
||
Remove deprecated `Astro` global APIs, including `Astro.resolve`, `Astro.fetchContent`, and `Astro.canonicalURL`. | ||
|
||
#### `Astro.resolve` | ||
|
||
You can resolve asset paths using `import` instead. For example: | ||
|
||
```astro | ||
--- | ||
import 'style.css' | ||
import imageUrl from './image.png' | ||
--- | ||
<img src={imageUrl} /> | ||
``` | ||
|
||
See the [v0.25 migration guide](https://docs.astro.build/en/migrate/#deprecated-astroresolve) for more information. | ||
|
||
#### `Astro.fetchContent` | ||
|
||
Use `Astro.glob` instead to fetch markdown files, or migrate to the [Content Collections](https://docs.astro.build/en/guides/content-collections/) feature. | ||
|
||
```js | ||
let allPosts = await Astro.glob('./posts/*.md'); | ||
``` | ||
|
||
#### `Astro.canonicalURL` | ||
|
||
Use `Astro.url` instead to construct the canonical URL. | ||
|
||
```js | ||
const canonicalURL = new URL(Astro.url.pathname, Astro.site); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
'astro': major | ||
--- | ||
|
||
Remove `buildConfig` option parameter from integration `astro:build:start` hook in favour of the `build.config` option in the `astro:config:setup` hook. | ||
|
||
```js | ||
export default function myIntegration() { | ||
return { | ||
name: 'my-integration', | ||
hooks: { | ||
'astro:config:setup': ({ updateConfig }) => { | ||
updateConfig({ | ||
build: { | ||
client: '...', | ||
server: '...', | ||
serverEntry: '...', | ||
}, | ||
}); | ||
}, | ||
}, | ||
}; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.