-
-
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 'main' into svelte-5-slots-fix
- Loading branch information
Showing
253 changed files
with
6,434 additions
and
1,987 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 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 | ||
--- | ||
|
||
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,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fixes a case where invalid `astro:env` variables at runtime would not throw correctly |
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,42 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Experimental Server Islands | ||
|
||
Server Islands allow you to specify components that should run on the server, allowing the rest of the page to be more aggressively cached, or even generated statically. Turn any `.astro` component into a server island by adding the `server:defer` directive and optionally, fallback placeholder content: | ||
|
||
```astro | ||
--- | ||
import Avatar from '../components/Avatar.astro'; | ||
import GenericUser from '../components/GenericUser.astro'; | ||
--- | ||
<header> | ||
<h1>Page Title</h1> | ||
<div class="header-right"> | ||
<Avatar server:defer> | ||
<GenericUser slot="fallback" /> | ||
</Avatar> | ||
</div> | ||
</header> | ||
``` | ||
|
||
The `server:defer` directive can be used on any Astro component in a project using `hybrid` or `server` mode with an adapter. There are no special APIs needed inside of the island. | ||
|
||
Enable server islands by adding the experimental flag to your Astro config with an appropriate `output` mode and adatper: | ||
|
||
```js | ||
import { defineConfig } from 'astro/config'; | ||
import netlify from '@astrojs/netlify'; | ||
|
||
export default defineConfig({ | ||
output: 'hybrid', | ||
adapter: netlify(), | ||
experimental { | ||
serverIslands: true, | ||
}, | ||
}); | ||
``` | ||
|
||
For more information, see the [server islands documentation](https://docs.astro.build/en/reference/configuration-reference/#experimentalserverislands). |
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 a `--noSync` parameter to the `astro check` command to skip the type-gen step. This can be useful when running `astro check` inside packages that have Astro components, but are not Astro projects |
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 Shiki's [`defaultColor`](https://shiki.style/guide/dual-themes#without-default-color) option to the `<Code />` component, giving you more control in applying multiple themes |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Fixes Astro not working on low versions of Node 18 and 20 |
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
Oops, something went wrong.