-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into feat/new-basics
- Loading branch information
Showing
150 changed files
with
1,523 additions
and
605 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,50 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Adds a new `astro:routes:resolved` hook to the Integration API. Also update the `astro:build:done` hook by deprecating `routes` and adding a new `assets` map. | ||
|
||
When building an integration, you can now get access to routes inside the `astro:routes:resolved` hook: | ||
|
||
```js | ||
const integration = () => { | ||
return { | ||
name: 'my-integration', | ||
hooks: { | ||
'astro:routes:resolved': ({ routes }) => { | ||
console.log(routes) | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
This hook runs before `astro:config:done`, and whenever a route changes in development. | ||
|
||
The `routes` array from `astro:build:done` is now deprecated, and exposed properties are now available on `astro:routes:resolved`, except for `distURL`. For this, you can use the newly exposed `assets` map: | ||
|
||
```diff | ||
const integration = () => { | ||
+ let routes | ||
return { | ||
name: 'my-integration', | ||
hooks: { | ||
+ 'astro:routes:resolved': (params) => { | ||
+ routes = params.routes | ||
+ }, | ||
'astro:build:done': ({ | ||
- routes | ||
+ assets | ||
}) => { | ||
+ for (const route of routes) { | ||
+ const distURL = assets.get(route.pattern) | ||
+ if (distURL) { | ||
+ Object.assign(route, { distURL }) | ||
+ } | ||
+ } | ||
console.log(routes) | ||
} | ||
} | ||
} | ||
} | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Call server island early so it can set headers |
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,7 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Changes the default content config location from `src/content/config.*` to `src/content.config.*`. | ||
|
||
The previous location is still supported, and is required if the `legacy.collections` flag is enabled. |
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,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fixes a regression where Astro was trying to access `Request.headers` |
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.