mirror of
https://github.com/withastro/astro.git
synced 2025-01-22 18:41:55 -05:00
[ci] release (#11857)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
9da5b3dab2
commit
17f71278f4
49 changed files with 263 additions and 278 deletions
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
'astro': minor
|
||||
---
|
||||
|
||||
Adds a new variant `sync` for the `astro:config:setup` hook's `command` property. This value is set when calling the command `astro sync`.
|
||||
|
||||
If your integration previously relied on knowing how many variants existed for the `command` property, you must update your logic to account for this new option.
|
|
@ -1,22 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fixes a bug in the logic of `Astro.rewrite()` which led to the value for `base`, if configured, being automatically prepended to the rewrite URL passed. This was unintended behavior and has been corrected, and Astro now processes the URLs exactly as passed.
|
||||
|
||||
If you use the `rewrite()` function on a project that has `base` configured, you must now prepend the base to your existing rewrite URL:
|
||||
|
||||
```js
|
||||
// astro.config.mjs
|
||||
export default defineConfig({
|
||||
base: '/blog'
|
||||
})
|
||||
```
|
||||
|
||||
```diff
|
||||
// src/middleware.js
|
||||
export function onRequest(ctx, next) {
|
||||
- return ctx.rewrite("/about")
|
||||
+ return ctx.rewrite("/blog/about")
|
||||
}
|
||||
```
|
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
**BREAKING CHANGE to experimental content layer loaders only!**
|
||||
|
||||
Passes `AstroConfig` instead of `AstroSettings` object to content layer loaders.
|
||||
|
||||
This will not affect you unless you have created a loader that uses the `settings` object. If you have, you will need to update your loader to use the `config` object instead.
|
||||
|
||||
```diff
|
||||
export default function myLoader() {
|
||||
return {
|
||||
name: 'my-loader'
|
||||
- async load({ settings }) {
|
||||
- const base = settings.config.base;
|
||||
+ async load({ config }) {
|
||||
+ const base = config.base;
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Other properties of the settings object are private internals, and should not be accessed directly. If you think you need access to other properties, please open an issue to discuss your use case.
|
|
@ -1,11 +0,0 @@
|
|||
---
|
||||
'astro': minor
|
||||
---
|
||||
|
||||
Adds a new, optional property `timeout` for the `client:idle` directive.
|
||||
|
||||
This value allows you to specify a maximum time to wait, in milliseconds, before hydrating a UI framework component, even if the page is not yet done with its initial load. This means you can delay hydration for lower-priority UI elements with more control to ensure your element is interactive within a specified time frame.
|
||||
|
||||
```astro
|
||||
<ShowHideButton client:idle={{timeout: 500}} />
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Uses `magicast` to update the config for `astro add`
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Replaces `execa` with `tinyexec` internally
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
'@astrojs/db': minor
|
||||
---
|
||||
|
||||
Adds support for connecting Astro DB to any remote LibSQL server. This allows Astro DB to be used with self-hosting and air-gapped deployments.
|
||||
|
||||
To connect Astro DB to a remote LibSQL server instead of Studio, set the following environment variables:
|
||||
|
||||
- `ASTRO_DB_REMOTE_URL`: the connection URL to your LibSQL server
|
||||
- `ASTRO_DB_APP_TOKEN`: the auth token to your LibSQL server
|
||||
|
||||
Details of the LibSQL connection can be configured using the connection URL. For example, `memory:?syncUrl=libsql%3A%2F%2Fdb-server.example.com` would create an in-memory embedded replica for the LibSQL DB on `libsql://db-server.example.com`.
|
||||
|
||||
For more details, please visit [the Astro DB documentation](https://docs.astro.build/en/guides/astro-db/#libsql)
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
'astro': minor
|
||||
---
|
||||
|
||||
Adds a new option `fallbackType` to `i18n.routing` configuration that allows you to control how fallback pages are handled.
|
||||
|
||||
When `i18n.fallback` is configured, this new routing option controls whether to [redirect](https://docs.astro.build/en/guides/routing/#redirects) to the fallback page, or to [rewrite](https://docs.astro.build/en/guides/routing/#rewrites) the fallback page's content in place.
|
||||
|
||||
The `"redirect"` option is the default value and matches the current behavior of the existing fallback system.
|
||||
|
||||
The option `"rewrite"` uses the new [rewriting system](https://docs.astro.build/en/guides/routing/#rewrites) to create fallback pages that render content on the original, requested URL without a browser refresh.
|
||||
|
||||
For example, the following configuration will generate a page `/fr/index.html` that will contain the same HTML rendered by the page `/en/index.html` when `src/pages/fr/index.astro` does not exist.
|
||||
|
||||
```js
|
||||
// astro.config.mjs
|
||||
export default defineConfig({
|
||||
i18n: {
|
||||
locals: ["en", "fr"],
|
||||
defaultLocale: "en",
|
||||
routing: {
|
||||
prefixDefaultLocale: true,
|
||||
fallbackType: "rewrite"
|
||||
},
|
||||
fallback: {
|
||||
fr: "en"
|
||||
},
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
'astro': minor
|
||||
---
|
||||
|
||||
Adds a new object `swapFunctions` to expose the necessary utility functions on `astro:transitions/client` that allow you to build custom swap functions to be used with view transitions.
|
||||
|
||||
The example below uses these functions to replace Astro's built-in default `swap` function with one that only swaps the `<main>` part of the page:
|
||||
|
||||
```html
|
||||
<script>
|
||||
import { swapFunctions } from 'astro:transitions/client';
|
||||
|
||||
document.addEventListener('astro:before-swap', (e) => { e.swap = () => swapMainOnly(e.newDocument) });
|
||||
|
||||
function swapMainOnly(doc: Document) {
|
||||
swapFunctions.deselectScripts(doc);
|
||||
swapFunctions.swapRootAttributes(doc);
|
||||
swapFunctions.swapHeadElements(doc);
|
||||
const restoreFocusFunction = swapFunctions.saveFocus();
|
||||
const newMain = doc.querySelector('main');
|
||||
const oldMain = document.querySelector('main');
|
||||
if (newMain && oldMain) {
|
||||
swapFunctions.swapBodyElement(newMain, oldMain);
|
||||
} else {
|
||||
swapFunctions.swapBodyElement(doc.body, document.body);
|
||||
}
|
||||
restoreFocusFunction();
|
||||
};
|
||||
</script>
|
||||
```
|
||||
|
||||
See the [view transitions guide](https://docs.astro.build/en/guides/view-transitions/#astrobefore-swap) for more information about hooking into the `astro:before-swap` lifecycle event and adding a custom swap implementation.
|
|
@ -1,17 +0,0 @@
|
|||
---
|
||||
'astro': minor
|
||||
---
|
||||
|
||||
Exposes `z` from the new `astro:schema` module. This is the new recommended import source for all Zod utilities when using Astro Actions.
|
||||
|
||||
## Migration for Astro Actions users
|
||||
|
||||
`z` will no longer be exposed from `astro:actions`. To use `z` in your actions, import it from `astro:schema` instead:
|
||||
|
||||
```diff
|
||||
import {
|
||||
defineAction,
|
||||
- z,
|
||||
} from 'astro:actions';
|
||||
+ import { z } from 'astro:schema';
|
||||
```
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Correctly resolves content layer images when filePath is not set
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
"astro": minor
|
||||
---
|
||||
|
||||
The Astro Actions API introduced behind a flag in [v4.8.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#480) is no longer experimental and is available for general use.
|
||||
|
||||
Astro Actions allow you to define and call backend functions with type-safety, performing data fetching, JSON parsing, and input validation for you.
|
||||
|
||||
Actions can be called from client-side components and HTML forms. This gives you to flexibility to build apps using any technology: React, Svelte, HTMX, or just plain Astro components. This example calls a newsletter action and renders the result using an Astro component:
|
||||
|
||||
```astro
|
||||
---
|
||||
// src/pages/newsletter.astro
|
||||
import { actions } from 'astro:actions';
|
||||
const result = Astro.getActionResult(actions.newsletter);
|
||||
---
|
||||
{result && !result.error && <p>Thanks for signing up!</p>}
|
||||
<form method="POST" action={actions.newsletter}>
|
||||
<input type="email" name="email" />
|
||||
<button>Sign up</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
If you were previously using this feature, please remove the experimental flag from your Astro config:
|
||||
|
||||
```diff
|
||||
import { defineConfig } from 'astro'
|
||||
|
||||
export default defineConfig({
|
||||
- experimental: {
|
||||
- actions: true,
|
||||
- }
|
||||
})
|
||||
```
|
||||
|
||||
If you have been waiting for stabilization before using Actions, you can now do so.
|
||||
|
||||
For more information and usage examples, see our [brand new Actions guide](https://docs.astro.build/en/guides/actions).
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
"@astrojs/mdx": "^3.1.5",
|
||||
"@astrojs/rss": "^4.0.7",
|
||||
"@astrojs/sitemap": "^3.1.6",
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
],
|
||||
"scripts": {},
|
||||
"devDependencies": {
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^4.0.0"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"@astrojs/react": "^3.6.2",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
"@astrojs/alpinejs": "^0.4.0",
|
||||
"@types/alpinejs": "^3.13.10",
|
||||
"alpinejs": "^3.14.1",
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/lit": "^4.3.0",
|
||||
"@webcomponents/template-shadowroot": "^0.2.1",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"lit": "^3.2.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"@astrojs/vue": "^4.5.0",
|
||||
"@types/react": "^18.3.4",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"preact": "^10.23.2",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/preact": "^3.5.2",
|
||||
"@preact/signals": "^1.3.0",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"preact": "^10.23.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@astrojs/react": "^3.6.2",
|
||||
"@types/react": "^18.3.4",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/solid-js": "^4.4.1",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"solid-js": "^1.8.22"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/svelte": "^5.7.0",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"svelte": "^4.2.19"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/vue": "^4.5.0",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"vue": "^3.4.38"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/node": "^8.3.3",
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
],
|
||||
"scripts": {},
|
||||
"devDependencies": {
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^4.0.0"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/node": "^8.3.3",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"html-minifier": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"@tailwindcss/forms": "^0.5.7",
|
||||
"@types/react": "^18.3.4",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"postcss": "^8.4.41",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/node": "^8.3.3",
|
||||
"@astrojs/svelte": "^5.7.0",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"svelte": "^4.2.19"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"sass": "^1.77.8",
|
||||
"sharp": "^0.33.3"
|
||||
}
|
||||
|
|
|
@ -15,6 +15,6 @@
|
|||
"./app": "./dist/app.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
"devDependencies": {
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@astrojs/node": "^8.3.3",
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/markdoc": "^0.11.4",
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@astrojs/markdown-remark": "^5.2.0",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"hast-util-select": "^6.0.2",
|
||||
"rehype-autolink-headings": "^7.1.0",
|
||||
"rehype-slug": "^6.0.0",
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.6"
|
||||
"astro": "^4.15.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/mdx": "^3.1.5",
|
||||
"@astrojs/preact": "^3.5.2",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"preact": "^10.23.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"@astrojs/preact": "^3.5.2",
|
||||
"@nanostores/preact": "^0.5.2",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"nanostores": "^0.11.3",
|
||||
"preact": "^10.23.2"
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"@astrojs/mdx": "^3.1.5",
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@types/canvas-confetti": "^1.6.4",
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"canvas-confetti": "^1.9.3",
|
||||
"postcss": "^8.4.41",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"test": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"astro": "^4.14.6",
|
||||
"astro": "^4.15.0",
|
||||
"vitest": "^2.0.5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,177 @@
|
|||
# astro
|
||||
|
||||
## 4.15.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#11729](https://github.com/withastro/astro/pull/11729) [`1c54e63`](https://github.com/withastro/astro/commit/1c54e633274ad47f6c83c9a16f375f0caa983fbe) Thanks [@ematipico](https://github.com/ematipico)! - Adds a new variant `sync` for the `astro:config:setup` hook's `command` property. This value is set when calling the command `astro sync`.
|
||||
|
||||
If your integration previously relied on knowing how many variants existed for the `command` property, you must update your logic to account for this new option.
|
||||
|
||||
- [#11743](https://github.com/withastro/astro/pull/11743) [`cce0894`](https://github.com/withastro/astro/commit/cce08945340312776a0480fc9ffe43929257639a) Thanks [@ph1p](https://github.com/ph1p)! - Adds a new, optional property `timeout` for the `client:idle` directive.
|
||||
|
||||
This value allows you to specify a maximum time to wait, in milliseconds, before hydrating a UI framework component, even if the page is not yet done with its initial load. This means you can delay hydration for lower-priority UI elements with more control to ensure your element is interactive within a specified time frame.
|
||||
|
||||
```astro
|
||||
<ShowHideButton client:idle={{ timeout: 500 }} />
|
||||
```
|
||||
|
||||
- [#11677](https://github.com/withastro/astro/pull/11677) [`cb356a5`](https://github.com/withastro/astro/commit/cb356a5db6b1ec2799790a603f931a961883ab31) Thanks [@ematipico](https://github.com/ematipico)! - Adds a new option `fallbackType` to `i18n.routing` configuration that allows you to control how fallback pages are handled.
|
||||
|
||||
When `i18n.fallback` is configured, this new routing option controls whether to [redirect](https://docs.astro.build/en/guides/routing/#redirects) to the fallback page, or to [rewrite](https://docs.astro.build/en/guides/routing/#rewrites) the fallback page's content in place.
|
||||
|
||||
The `"redirect"` option is the default value and matches the current behavior of the existing fallback system.
|
||||
|
||||
The option `"rewrite"` uses the new [rewriting system](https://docs.astro.build/en/guides/routing/#rewrites) to create fallback pages that render content on the original, requested URL without a browser refresh.
|
||||
|
||||
For example, the following configuration will generate a page `/fr/index.html` that will contain the same HTML rendered by the page `/en/index.html` when `src/pages/fr/index.astro` does not exist.
|
||||
|
||||
```js
|
||||
// astro.config.mjs
|
||||
export default defineConfig({
|
||||
i18n: {
|
||||
locals: ['en', 'fr'],
|
||||
defaultLocale: 'en',
|
||||
routing: {
|
||||
prefixDefaultLocale: true,
|
||||
fallbackType: 'rewrite',
|
||||
},
|
||||
fallback: {
|
||||
fr: 'en',
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
- [#11708](https://github.com/withastro/astro/pull/11708) [`62b0d20`](https://github.com/withastro/astro/commit/62b0d20b974dc932769221d210b751627fb4bbc6) Thanks [@martrapp](https://github.com/martrapp)! - Adds a new object `swapFunctions` to expose the necessary utility functions on `astro:transitions/client` that allow you to build custom swap functions to be used with view transitions.
|
||||
|
||||
The example below uses these functions to replace Astro's built-in default `swap` function with one that only swaps the `<main>` part of the page:
|
||||
|
||||
```html
|
||||
<script>
|
||||
import { swapFunctions } from 'astro:transitions/client';
|
||||
|
||||
document.addEventListener('astro:before-swap', (e) => { e.swap = () => swapMainOnly(e.newDocument) });
|
||||
|
||||
function swapMainOnly(doc: Document) {
|
||||
swapFunctions.deselectScripts(doc);
|
||||
swapFunctions.swapRootAttributes(doc);
|
||||
swapFunctions.swapHeadElements(doc);
|
||||
const restoreFocusFunction = swapFunctions.saveFocus();
|
||||
const newMain = doc.querySelector('main');
|
||||
const oldMain = document.querySelector('main');
|
||||
if (newMain && oldMain) {
|
||||
swapFunctions.swapBodyElement(newMain, oldMain);
|
||||
} else {
|
||||
swapFunctions.swapBodyElement(doc.body, document.body);
|
||||
}
|
||||
restoreFocusFunction();
|
||||
};
|
||||
</script>
|
||||
```
|
||||
|
||||
See the [view transitions guide](https://docs.astro.build/en/guides/view-transitions/#astrobefore-swap) for more information about hooking into the `astro:before-swap` lifecycle event and adding a custom swap implementation.
|
||||
|
||||
- [#11843](https://github.com/withastro/astro/pull/11843) [`5b4070e`](https://github.com/withastro/astro/commit/5b4070efef877a77247bb05a4806b75f22e557c8) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Exposes `z` from the new `astro:schema` module. This is the new recommended import source for all Zod utilities when using Astro Actions.
|
||||
|
||||
## Migration for Astro Actions users
|
||||
|
||||
`z` will no longer be exposed from `astro:actions`. To use `z` in your actions, import it from `astro:schema` instead:
|
||||
|
||||
```diff
|
||||
import {
|
||||
defineAction,
|
||||
- z,
|
||||
} from 'astro:actions';
|
||||
+ import { z } from 'astro:schema';
|
||||
```
|
||||
|
||||
- [#11843](https://github.com/withastro/astro/pull/11843) [`5b4070e`](https://github.com/withastro/astro/commit/5b4070efef877a77247bb05a4806b75f22e557c8) Thanks [@bholmesdev](https://github.com/bholmesdev)! - The Astro Actions API introduced behind a flag in [v4.8.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#480) is no longer experimental and is available for general use.
|
||||
|
||||
Astro Actions allow you to define and call backend functions with type-safety, performing data fetching, JSON parsing, and input validation for you.
|
||||
|
||||
Actions can be called from client-side components and HTML forms. This gives you to flexibility to build apps using any technology: React, Svelte, HTMX, or just plain Astro components. This example calls a newsletter action and renders the result using an Astro component:
|
||||
|
||||
```astro
|
||||
---
|
||||
// src/pages/newsletter.astro
|
||||
import { actions } from 'astro:actions';
|
||||
const result = Astro.getActionResult(actions.newsletter);
|
||||
---
|
||||
|
||||
{result && !result.error && <p>Thanks for signing up!</p>}
|
||||
<form method="POST" action={actions.newsletter}>
|
||||
<input type="email" name="email" />
|
||||
<button>Sign up</button>
|
||||
</form>
|
||||
```
|
||||
|
||||
If you were previously using this feature, please remove the experimental flag from your Astro config:
|
||||
|
||||
```diff
|
||||
import { defineConfig } from 'astro'
|
||||
|
||||
export default defineConfig({
|
||||
- experimental: {
|
||||
- actions: true,
|
||||
- }
|
||||
})
|
||||
```
|
||||
|
||||
If you have been waiting for stabilization before using Actions, you can now do so.
|
||||
|
||||
For more information and usage examples, see our [brand new Actions guide](https://docs.astro.build/en/guides/actions).
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#11677](https://github.com/withastro/astro/pull/11677) [`cb356a5`](https://github.com/withastro/astro/commit/cb356a5db6b1ec2799790a603f931a961883ab31) Thanks [@ematipico](https://github.com/ematipico)! - Fixes a bug in the logic of `Astro.rewrite()` which led to the value for `base`, if configured, being automatically prepended to the rewrite URL passed. This was unintended behavior and has been corrected, and Astro now processes the URLs exactly as passed.
|
||||
|
||||
If you use the `rewrite()` function on a project that has `base` configured, you must now prepend the base to your existing rewrite URL:
|
||||
|
||||
```js
|
||||
// astro.config.mjs
|
||||
export default defineConfig({
|
||||
base: '/blog',
|
||||
});
|
||||
```
|
||||
|
||||
```diff
|
||||
// src/middleware.js
|
||||
export function onRequest(ctx, next) {
|
||||
- return ctx.rewrite("/about")
|
||||
+ return ctx.rewrite("/blog/about")
|
||||
}
|
||||
```
|
||||
|
||||
- [#11862](https://github.com/withastro/astro/pull/11862) [`0e35afe`](https://github.com/withastro/astro/commit/0e35afe44f5a3c9f87b41dc89d5128b02e448895) Thanks [@ascorbic](https://github.com/ascorbic)! - **BREAKING CHANGE to experimental content layer loaders only!**
|
||||
|
||||
Passes `AstroConfig` instead of `AstroSettings` object to content layer loaders.
|
||||
|
||||
This will not affect you unless you have created a loader that uses the `settings` object. If you have, you will need to update your loader to use the `config` object instead.
|
||||
|
||||
```diff
|
||||
export default function myLoader() {
|
||||
return {
|
||||
name: 'my-loader'
|
||||
- async load({ settings }) {
|
||||
- const base = settings.config.base;
|
||||
+ async load({ config }) {
|
||||
+ const base = config.base;
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Other properties of the settings object are private internals, and should not be accessed directly. If you think you need access to other properties, please open an issue to discuss your use case.
|
||||
|
||||
- [#11772](https://github.com/withastro/astro/pull/11772) [`6272e6c`](https://github.com/withastro/astro/commit/6272e6cec07778e81f853754bffaac40e658c700) Thanks [@bluwy](https://github.com/bluwy)! - Uses `magicast` to update the config for `astro add`
|
||||
|
||||
- [#11845](https://github.com/withastro/astro/pull/11845) [`440a4be`](https://github.com/withastro/astro/commit/440a4be0a6ca135e47b0d37124c1be03735ba7ff) Thanks [@bluwy](https://github.com/bluwy)! - Replaces `execa` with `tinyexec` internally
|
||||
|
||||
- [#11858](https://github.com/withastro/astro/pull/11858) [`8bab233`](https://github.com/withastro/astro/commit/8bab2339374763d19dbc4cc2c7ce4ad8a2a49694) Thanks [@ascorbic](https://github.com/ascorbic)! - Correctly resolves content layer images when filePath is not set
|
||||
|
||||
## 4.14.6
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "astro",
|
||||
"version": "4.14.6",
|
||||
"version": "4.15.0",
|
||||
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
||||
"type": "module",
|
||||
"author": "withastro",
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
# @astrojs/db
|
||||
|
||||
## 0.14.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#11385](https://github.com/withastro/astro/pull/11385) [`d6611e8`](https://github.com/withastro/astro/commit/d6611e8bb05e7d913aeb5e59e90906b8b919d48e) Thanks [@Fryuni](https://github.com/Fryuni)! - Adds support for connecting Astro DB to any remote LibSQL server. This allows Astro DB to be used with self-hosting and air-gapped deployments.
|
||||
|
||||
To connect Astro DB to a remote LibSQL server instead of Studio, set the following environment variables:
|
||||
|
||||
- `ASTRO_DB_REMOTE_URL`: the connection URL to your LibSQL server
|
||||
- `ASTRO_DB_APP_TOKEN`: the auth token to your LibSQL server
|
||||
|
||||
Details of the LibSQL connection can be configured using the connection URL. For example, `memory:?syncUrl=libsql%3A%2F%2Fdb-server.example.com` would create an in-memory embedded replica for the LibSQL DB on `libsql://db-server.example.com`.
|
||||
|
||||
For more details, please visit [the Astro DB documentation](https://docs.astro.build/en/guides/astro-db/#libsql)
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @astrojs/studio@0.1.1
|
||||
|
||||
## 0.13.2
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@astrojs/db",
|
||||
"version": "0.13.2",
|
||||
"version": "0.14.0",
|
||||
"description": "Add libSQL and Astro Studio support to your Astro site",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
# @astrojs/web-vitals
|
||||
|
||||
## 3.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`d6611e8`](https://github.com/withastro/astro/commit/d6611e8bb05e7d913aeb5e59e90906b8b919d48e)]:
|
||||
- @astrojs/db@0.14.0
|
||||
|
||||
## 2.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@astrojs/web-vitals",
|
||||
"description": "Track your website’s performance with Astro DB",
|
||||
"version": "2.0.0",
|
||||
"version": "3.0.0",
|
||||
"type": "module",
|
||||
"author": "withastro",
|
||||
"license": "MIT",
|
||||
|
@ -35,7 +35,7 @@
|
|||
"web-vitals": "^4.2.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@astrojs/db": "^0.13.0"
|
||||
"@astrojs/db": "^0.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/db": "workspace:*",
|
||||
|
|
|
@ -116,7 +116,7 @@ importers:
|
|||
examples/basics:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/blog:
|
||||
|
@ -131,13 +131,13 @@ importers:
|
|||
specifier: ^3.1.6
|
||||
version: link:../../packages/integrations/sitemap
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/component:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/container-with-vitest:
|
||||
|
@ -146,7 +146,7 @@ importers:
|
|||
specifier: ^3.6.2
|
||||
version: link:../../packages/integrations/react
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
react:
|
||||
specifier: ^18.3.1
|
||||
|
@ -177,7 +177,7 @@ importers:
|
|||
specifier: ^3.14.1
|
||||
version: 3.14.1
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/framework-lit:
|
||||
|
@ -189,7 +189,7 @@ importers:
|
|||
specifier: ^0.2.1
|
||||
version: 0.2.1
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
lit:
|
||||
specifier: ^3.2.0
|
||||
|
@ -219,7 +219,7 @@ importers:
|
|||
specifier: ^18.3.0
|
||||
version: 18.3.0
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.23.2
|
||||
|
@ -249,7 +249,7 @@ importers:
|
|||
specifier: ^1.3.0
|
||||
version: 1.3.0(preact@10.23.2)
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.23.2
|
||||
|
@ -267,7 +267,7 @@ importers:
|
|||
specifier: ^18.3.0
|
||||
version: 18.3.0
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
react:
|
||||
specifier: ^18.3.1
|
||||
|
@ -282,7 +282,7 @@ importers:
|
|||
specifier: ^4.4.1
|
||||
version: link:../../packages/integrations/solid
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
solid-js:
|
||||
specifier: ^1.8.22
|
||||
|
@ -294,7 +294,7 @@ importers:
|
|||
specifier: ^5.7.0
|
||||
version: link:../../packages/integrations/svelte
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
svelte:
|
||||
specifier: ^4.2.19
|
||||
|
@ -306,7 +306,7 @@ importers:
|
|||
specifier: ^4.5.0
|
||||
version: link:../../packages/integrations/vue
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
vue:
|
||||
specifier: ^3.4.38
|
||||
|
@ -318,13 +318,13 @@ importers:
|
|||
specifier: ^8.3.3
|
||||
version: link:../../packages/integrations/node
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/integration:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/middleware:
|
||||
|
@ -333,7 +333,7 @@ importers:
|
|||
specifier: ^8.3.3
|
||||
version: link:../../packages/integrations/node
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
html-minifier:
|
||||
specifier: ^4.0.0
|
||||
|
@ -346,19 +346,19 @@ importers:
|
|||
examples/minimal:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/non-html-pages:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/portfolio:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/server-islands:
|
||||
|
@ -385,7 +385,7 @@ importers:
|
|||
specifier: ^18.3.0
|
||||
version: 18.3.0
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
postcss:
|
||||
specifier: ^8.4.41
|
||||
|
@ -409,7 +409,7 @@ importers:
|
|||
specifier: ^5.7.0
|
||||
version: link:../../packages/integrations/svelte
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
svelte:
|
||||
specifier: ^4.2.19
|
||||
|
@ -418,7 +418,7 @@ importers:
|
|||
examples/starlog:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
sass:
|
||||
specifier: ^1.77.8
|
||||
|
@ -430,7 +430,7 @@ importers:
|
|||
examples/toolbar-app:
|
||||
devDependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/view-transitions:
|
||||
|
@ -442,7 +442,7 @@ importers:
|
|||
specifier: ^5.1.0
|
||||
version: link:../../packages/integrations/tailwind
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/with-markdoc:
|
||||
|
@ -451,7 +451,7 @@ importers:
|
|||
specifier: ^0.11.4
|
||||
version: link:../../packages/integrations/markdoc
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/with-markdown-plugins:
|
||||
|
@ -460,7 +460,7 @@ importers:
|
|||
specifier: ^5.2.0
|
||||
version: link:../../packages/markdown/remark
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
hast-util-select:
|
||||
specifier: ^6.0.2
|
||||
|
@ -481,7 +481,7 @@ importers:
|
|||
examples/with-markdown-shiki:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
|
||||
examples/with-mdx:
|
||||
|
@ -493,7 +493,7 @@ importers:
|
|||
specifier: ^3.5.2
|
||||
version: link:../../packages/integrations/preact
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
preact:
|
||||
specifier: ^10.23.2
|
||||
|
@ -508,7 +508,7 @@ importers:
|
|||
specifier: ^0.5.2
|
||||
version: 0.5.2(nanostores@0.11.3)(preact@10.23.2)
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
nanostores:
|
||||
specifier: ^0.11.3
|
||||
|
@ -529,7 +529,7 @@ importers:
|
|||
specifier: ^1.6.4
|
||||
version: 1.6.4
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
autoprefixer:
|
||||
specifier: ^10.4.20
|
||||
|
@ -547,7 +547,7 @@ importers:
|
|||
examples/with-vitest:
|
||||
dependencies:
|
||||
astro:
|
||||
specifier: ^4.14.6
|
||||
specifier: ^4.15.0
|
||||
version: link:../../packages/astro
|
||||
vitest:
|
||||
specifier: ^2.0.5
|
||||
|
|
Loading…
Reference in a new issue