-
-
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.
Merge branch 'main' into content-layer
- Loading branch information
Showing
150 changed files
with
1,124 additions
and
587 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,23 @@ | ||
--- | ||
'@astrojs/db': minor | ||
--- | ||
|
||
Removes the `AstroDbIntegration` type | ||
|
||
Astro integration hooks can now be extended and as such `@astrojs/db` no longer needs to declare it's own integration type. Using `AstroIntegration` will have the same type. | ||
|
||
If you were using the `AstroDbIntegration` type, apply this change to your integration code: | ||
|
||
```diff | ||
- import { defineDbIntegration, type AstroDbIntegration } from '@astrojs/db/utils'; | ||
+ import { defineDbIntegration } from '@astrojs/db/utils'; | ||
import type { AstroIntegration } from 'astro'; | ||
|
||
- export default (): AstroDbIntegration => { | ||
+ export default (): AstroIntegration => { | ||
return defineDbIntegration({ | ||
name: 'your-integration', | ||
hooks: {}, | ||
}); | ||
} | ||
``` |
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 an issue where the development server was emitting a 404 status code when the user uses a rewrite that emits a 200 status 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,32 @@ | ||
--- | ||
'@astrojs/markdown-remark': minor | ||
'astro': minor | ||
--- | ||
|
||
Adds support for [Shiki's `defaultColor` option](https://shiki.style/guide/dual-themes#without-default-color). | ||
|
||
This option allows you to override the values of a theme's inline style, adding only CSS variables to give you more flexibility in applying multiple color themes. | ||
|
||
Configure `defaultColor: false` in your Shiki config to apply throughout your site, or pass to Astro's built-in `<Code>` component to style an individual code block. | ||
|
||
```js title="astro.config.mjs" | ||
import { defineConfig } from 'astro/config'; | ||
export default defineConfig({ | ||
markdown: { | ||
shikiConfig: { | ||
themes: { | ||
light: 'github-light', | ||
dark: 'github-dark', | ||
}, | ||
defaultColor: false, | ||
}, | ||
}, | ||
}); | ||
``` | ||
|
||
```astro | ||
--- | ||
import { Code } from 'astro:components'; | ||
--- | ||
<Code code={`const useMyColors = true`} lang="js" defaultColor={false} /> | ||
``` |
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,58 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Refactors the type for integration hooks so that integration authors writing custom integration hooks can now allow runtime interactions between their integration and other integrations. | ||
|
||
This internal change should not break existing code for integration authors. | ||
|
||
To declare your own hooks for your integration, extend the `Astro.IntegrationHooks` interface: | ||
|
||
```ts | ||
// your-integration/types.ts | ||
declare global { | ||
namespace Astro { | ||
interface IntegrationHooks { | ||
'myLib:eventHappened': (your: string, parameters: number) => Promise<void>; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Call your hooks on all other integrations installed in a project at the appropriate time. For example, you can call your hook on initialization before either the Vite or Astro config have resolved: | ||
|
||
```ts | ||
// your-integration/index.ts | ||
import './types.ts'; | ||
|
||
export default (): AstroIntegration => { | ||
return { | ||
name: 'your-integration', | ||
hooks: { | ||
'astro:config:setup': async ({ config }) => { | ||
for (const integration of config.integrations) { | ||
await integration.hooks['myLib:eventHappened'].?('your values', 123); | ||
} | ||
}, | ||
} | ||
} | ||
} | ||
``` | ||
Other integrations can also now declare your hooks: | ||
```ts | ||
// other-integration/index.ts | ||
import 'your-integration/types.ts'; | ||
|
||
export default (): AstroIntegration => { | ||
return { | ||
name: 'other-integration', | ||
hooks: { | ||
'myLib:eventHappened': async (your, values) => { | ||
// ... | ||
}, | ||
} | ||
} | ||
} | ||
``` |
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,20 @@ | ||
--- | ||
"astro": minor | ||
--- | ||
|
||
Adds a new `inferRemoteSize()` function that can be used to infer the dimensions of a remote image. | ||
|
||
Previously, the ability to infer these values was only available by adding the [`inferSize`] attribute to the `<Image>` and `<Picture>` components or `getImage()`. Now, you can also access this data outside of these components. | ||
|
||
This is useful for when you need to know the dimensions of an image for styling purposes or to calculate different densities for responsive images. | ||
|
||
```astro | ||
--- | ||
import { inferRemoteSize, Image } from 'astro:assets'; | ||
const imageUrl = 'https://...'; | ||
const { width, height } = await inferRemoteSize(imageUrl); | ||
--- | ||
<Image src={imageUrl} width={width / 2} height={height} densities={[1.5, 2]} /> | ||
``` |
This file was deleted.
Oops, something went wrong.
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 | ||
--- | ||
|
||
Refactors how `sync` works and when it's called. Fixes an issue with `astro:env` types in dev not being generated |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 | ||
--- | ||
|
||
Supports importing Astro components with Vite queries, like `?url`, `?raw`, and `?direct` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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': minor | ||
--- | ||
|
||
Adds two new values to the [pagination `page` prop](https://docs.astro.build/en/reference/api-reference/#the-pagination-page-prop): `page.first` and `page.last` for accessing the URLs of the first and last pages. |
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 |
---|---|---|
|
@@ -11,6 +11,6 @@ | |
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"astro": "^4.11.5" | ||
"astro": "^4.11.6" | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
}, | ||
"dependencies": { | ||
"@astrojs/vue": "^4.5.0", | ||
"astro": "^4.11.5", | ||
"astro": "^4.11.6", | ||
"vue": "^3.4.31" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -12,6 +12,6 @@ | |
}, | ||
"dependencies": { | ||
"@astrojs/node": "^8.3.2", | ||
"astro": "^4.11.5" | ||
"astro": "^4.11.6" | ||
} | ||
} |
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.