-
-
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/customize-image-endpoint
- Loading branch information
Showing
170 changed files
with
1,934 additions
and
1,195 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,20 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Adapters can now specify the build output type they're intended for using the `adapterFeatures.buildOutput` property. This property can be used to always generate a server output, even if the project doesn't have any server-rendered pages. | ||
|
||
```ts | ||
{ | ||
'astro:config:done': ({ setAdapter, config }) => { | ||
setAdapter({ | ||
name: 'my-adapter', | ||
adapterFeatures: { | ||
buildOutput: 'server', | ||
}, | ||
}); | ||
}, | ||
} | ||
``` | ||
|
||
If your adapter specifies `buildOutput: 'static'`, and the user's project contains server-rendered pages, Astro will warn in development and error at build time. Note that a hybrid output, containing both static and server-rendered pages, is considered to be a `server` output, as a server is required to serve the server-rendered 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,15 @@ | ||
--- | ||
'astro': major | ||
--- | ||
|
||
Updates how the `build.client` and `build.server` option values get resolved to match existing documentation. With this fix, the option values will now correctly resolve relative to the `outDir` option. So if `outDir` is set to `./dist/nested/`, then by default: | ||
|
||
- `build.client` will resolve to `<root>/dist/nested/client/` | ||
- `build.server` will resolve to `<root>/dist/nested/server/` | ||
|
||
Previously the values were incorrectly resolved: | ||
|
||
- `build.client` was resolved to `<root>/dist/nested/dist/client/` | ||
- `build.server` was resolved to `<root>/dist/nested/dist/server/` | ||
|
||
If you were relying on the previous build paths, make sure that your project code is updated to the new build paths. |
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 refresh context data was not passed correctly to content layer loaders |
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,21 @@ | ||
--- | ||
'astro': major | ||
--- | ||
|
||
Merges the `output: 'hybrid'` and `output: 'static'` configurations into one single configuration (now called `'static'`) that works the same way as the previous `hybrid` option. | ||
|
||
It is no longer necessary to specify `output: 'hybrid'` in your Astro config to use server-rendered pages. The new `output: 'static'` has this capability included. Astro will now automatically provide the ability to opt out of prerendering in your static site with no change to your `output` configuration required. Any page route or endpoint can include `export const prerender = false` to be server-rendered, while the rest of your site is statically-generated. | ||
|
||
If your project used hybrid rendering, you must now remove the `output: 'hybrid'` option from your Astro config as it no longer exists. However, no other changes to your project are required, and you should have no breaking changes. The previous `'hybrid'` behavior is now the default, under a new name `'static'`. | ||
|
||
If you were using the `output: 'static'` (default) option, you can continue to use it as before. By default, all of your pages will continue to be prerendered and you will have a completely static site. You should have no breaking changes to your project. | ||
|
||
```diff | ||
import { defineConfig } from "astro/config"; | ||
|
||
export default defineConfig({ | ||
- output: 'hybrid', | ||
}); | ||
``` | ||
|
||
An adapter is still required to deploy an Astro project with any server-rendered pages. Failure to include an adapter will result in a warning in development and an error at build time. |
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 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Adds support for array patterns in the built-in `glob()` content collections loader | ||
|
||
The glob loader can now accept an array of multiple patterns as well as string patterns. This allows you to more easily combine multiple patterns into a single collection, and also means you can use negative matches to exclude files from the collection. | ||
|
||
```ts | ||
const probes = defineCollection({ | ||
// Load all markdown files in the space-probes directory, except for those that start with "voyager-" | ||
loader: glob({ pattern: ['*.md', '!voyager-*'], base: 'src/data/space-probes' }), | ||
schema: z.object({ | ||
name: z.string(), | ||
type: z.enum(['Space Probe', 'Mars Rover', 'Comet Lander']), | ||
launch_date: z.date(), | ||
status: z.enum(['Active', 'Inactive', 'Decommissioned']), | ||
destination: z.string(), | ||
operator: z.string(), | ||
notable_discoveries: z.array(z.string()), | ||
}), | ||
}); | ||
``` |
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,63 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Adds support for Zod discriminated unions on Action form inputs. This allows forms with different inputs to be submitted to the same action, using a given input to decide which object should be used for validation. | ||
|
||
This example accepts either a `create` or `update` form submission, and uses the `type` field to determine which object to validate against. | ||
|
||
```ts | ||
import { defineAction } from 'astro:actions'; | ||
import { z } from 'astro:schema'; | ||
|
||
export const server = { | ||
changeUser: defineAction({ | ||
accept: 'form', | ||
input: z.discriminatedUnion('type', [ | ||
z.object({ | ||
type: z.literal('create'), | ||
name: z.string(), | ||
email: z.string().email(), | ||
}), | ||
z.object({ | ||
type: z.literal('update'), | ||
id: z.number(), | ||
name: z.string(), | ||
email: z.string().email(), | ||
}), | ||
]), | ||
async handler(input) { | ||
if (input.type === 'create') { | ||
// input is { type: 'create', name: string, email: string } | ||
} else { | ||
// input is { type: 'update', id: number, name: string, email: string } | ||
} | ||
}, | ||
}), | ||
} | ||
``` | ||
|
||
The corresponding `create` and `update` forms may look like this: | ||
|
||
```astro | ||
--- | ||
import { actions } from 'astro:actions'; | ||
--- | ||
<!--Create--> | ||
<form action={actions.changeUser} method="POST"> | ||
<input type="hidden" name="type" value="create" /> | ||
<input type="text" name="name" required /> | ||
<input type="email" name="email" required /> | ||
<button type="submit">Create User</button> | ||
</form> | ||
<!--Update--> | ||
<form action={actions.changeUser} method="POST"> | ||
<input type="hidden" name="type" value="update" /> | ||
<input type="hidden" name="id" value="user-123" /> | ||
<input type="text" name="name" required /> | ||
<input type="email" name="email" required /> | ||
<button type="submit">Update User</button> | ||
</form> | ||
``` |
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 | ||
--- | ||
|
||
Adds a new `buildOutput` property to the `astro:config:done` hook returning the build output type. | ||
|
||
This can be used to know if the user's project will be built as a static site (HTML files), or a server-rendered site (whose exact output depends on the adapter). |
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 | ||
--- | ||
|
||
Updates error messages that assume content collections are located in `src/content/` with more generic language |
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": "^5.0.0-alpha.4" | ||
"astro": "^5.0.0-alpha.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,6 +12,6 @@ | |
}, | ||
"dependencies": { | ||
"@astrojs/node": "^9.0.0-alpha.1", | ||
"astro": "^5.0.0-alpha.4" | ||
"astro": "^5.0.0-alpha.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,6 @@ | |
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"astro": "^5.0.0-alpha.4" | ||
"astro": "^5.0.0-alpha.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,6 @@ | |
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"astro": "^5.0.0-alpha.4" | ||
"astro": "^5.0.0-alpha.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,6 @@ | |
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"astro": "^5.0.0-alpha.4" | ||
"astro": "^5.0.0-alpha.6" | ||
} | ||
} |
Oops, something went wrong.