diff options
author | 2024-08-28 17:25:13 +0200 | |
---|---|---|
committer | 2024-08-28 17:25:13 +0200 | |
commit | 68601a954907ef77470e7a5cf9d4c8ff89fe2c99 (patch) | |
tree | 38c4cf4836b9876cb2b093efb5a1a3c193719179 /.changeset | |
parent | 93932432e7239a1d31c68ea916945302286268e9 (diff) | |
parent | 26893f9a356e49c5c49052bd36f8b2e7e04edf4d (diff) | |
download | astro-68601a954907ef77470e7a5cf9d4c8ff89fe2c99.tar.gz astro-68601a954907ef77470e7a5cf9d4c8ff89fe2c99.tar.zst astro-68601a954907ef77470e7a5cf9d4c8ff89fe2c99.zip |
Merge branch 'main' into next
Diffstat (limited to '.changeset')
-rw-r--r-- | .changeset/afraid-apricots-develop.md | 7 | ||||
-rw-r--r-- | .changeset/blue-pens-divide.md | 22 | ||||
-rw-r--r-- | .changeset/clever-emus-roll.md | 11 | ||||
-rw-r--r-- | .changeset/eight-balloons-cover.md | 5 | ||||
-rw-r--r-- | .changeset/fair-rats-fail.md | 5 | ||||
-rw-r--r-- | .changeset/four-beans-remember.md | 5 | ||||
-rw-r--r-- | .changeset/healthy-boxes-poke.md | 14 | ||||
-rw-r--r-- | .changeset/lazy-feet-join.md | 32 | ||||
-rw-r--r-- | .changeset/long-months-burn.md | 5 | ||||
-rw-r--r-- | .changeset/mighty-trees-teach.md | 5 | ||||
-rw-r--r-- | .changeset/new-monkeys-sit.md | 32 | ||||
-rw-r--r-- | .changeset/new-pillows-kick.md | 5 | ||||
-rw-r--r-- | .changeset/odd-donuts-impress.md | 5 | ||||
-rw-r--r-- | .changeset/smart-comics-doubt.md | 5 | ||||
-rw-r--r-- | .changeset/smooth-melons-cough.md | 7 | ||||
-rw-r--r-- | .changeset/spicy-houses-fry.md | 5 | ||||
-rw-r--r-- | .changeset/tiny-lamps-lick.md | 5 | ||||
-rw-r--r-- | .changeset/weak-dancers-beam.md | 20 | ||||
-rw-r--r-- | .changeset/weak-masks-do.md | 6 |
19 files changed, 128 insertions, 73 deletions
diff --git a/.changeset/afraid-apricots-develop.md b/.changeset/afraid-apricots-develop.md new file mode 100644 index 000000000..acf897149 --- /dev/null +++ b/.changeset/afraid-apricots-develop.md @@ -0,0 +1,7 @@ +--- +'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. diff --git a/.changeset/blue-pens-divide.md b/.changeset/blue-pens-divide.md new file mode 100644 index 000000000..a295fe7b1 --- /dev/null +++ b/.changeset/blue-pens-divide.md @@ -0,0 +1,22 @@ +--- +'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") +} +``` diff --git a/.changeset/clever-emus-roll.md b/.changeset/clever-emus-roll.md new file mode 100644 index 000000000..5b9b2ee69 --- /dev/null +++ b/.changeset/clever-emus-roll.md @@ -0,0 +1,11 @@ +--- +'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}} /> +``` diff --git a/.changeset/eight-balloons-cover.md b/.changeset/eight-balloons-cover.md new file mode 100644 index 000000000..ea6364668 --- /dev/null +++ b/.changeset/eight-balloons-cover.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Uses `magicast` to update the config for `astro add` diff --git a/.changeset/fair-rats-fail.md b/.changeset/fair-rats-fail.md deleted file mode 100644 index b93bc8a2b..000000000 --- a/.changeset/fair-rats-fail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Deprecates the Squoosh image service, to be removed in Astro 5.0. We recommend migrating to the default Sharp service. diff --git a/.changeset/four-beans-remember.md b/.changeset/four-beans-remember.md new file mode 100644 index 000000000..cdef7197d --- /dev/null +++ b/.changeset/four-beans-remember.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Replaces `execa` with `tinyexec` internally diff --git a/.changeset/healthy-boxes-poke.md b/.changeset/healthy-boxes-poke.md new file mode 100644 index 000000000..d4c1e4302 --- /dev/null +++ b/.changeset/healthy-boxes-poke.md @@ -0,0 +1,14 @@ +--- +'@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) diff --git a/.changeset/lazy-feet-join.md b/.changeset/lazy-feet-join.md new file mode 100644 index 000000000..e2b0a4077 --- /dev/null +++ b/.changeset/lazy-feet-join.md @@ -0,0 +1,32 @@ +--- +'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" + }, + } +}) +``` + + diff --git a/.changeset/long-months-burn.md b/.changeset/long-months-burn.md deleted file mode 100644 index 4b11c58a1..000000000 --- a/.changeset/long-months-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Changes messages logged when using unsupported, deprecated, or experimental adapter features for clarity diff --git a/.changeset/mighty-trees-teach.md b/.changeset/mighty-trees-teach.md deleted file mode 100644 index 289a41816..000000000 --- a/.changeset/mighty-trees-teach.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/mdx': patch ---- - -Fixes stack trace location when failed to parse an MDX file with frontmatter diff --git a/.changeset/new-monkeys-sit.md b/.changeset/new-monkeys-sit.md new file mode 100644 index 000000000..b147b593f --- /dev/null +++ b/.changeset/new-monkeys-sit.md @@ -0,0 +1,32 @@ +--- +'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: + +```astro +<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. diff --git a/.changeset/new-pillows-kick.md b/.changeset/new-pillows-kick.md deleted file mode 100644 index ccc705d67..000000000 --- a/.changeset/new-pillows-kick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Prints prerender dynamic value usage warning only if it's used diff --git a/.changeset/odd-donuts-impress.md b/.changeset/odd-donuts-impress.md deleted file mode 100644 index 7dd8d6b1b..000000000 --- a/.changeset/odd-donuts-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes the path returned by `injectTypes` diff --git a/.changeset/smart-comics-doubt.md b/.changeset/smart-comics-doubt.md deleted file mode 100644 index 0582ebd91..000000000 --- a/.changeset/smart-comics-doubt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'create-astro': patch ---- - -Fixes initial git commit when initializing git diff --git a/.changeset/smooth-melons-cough.md b/.changeset/smooth-melons-cough.md deleted file mode 100644 index 0a4a3ea9d..000000000 --- a/.changeset/smooth-melons-cough.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@astrojs/vercel': patch ---- - -Prevent race condition with Node 18 - -Using Node 18 there can be a race condition where polyfill for the `crypto` global is not applied in time. This change ensures the polyfills run first. diff --git a/.changeset/spicy-houses-fry.md b/.changeset/spicy-houses-fry.md deleted file mode 100644 index 41f376a35..000000000 --- a/.changeset/spicy-houses-fry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Simplifies path operations of `astro sync` diff --git a/.changeset/tiny-lamps-lick.md b/.changeset/tiny-lamps-lick.md deleted file mode 100644 index 865994afa..000000000 --- a/.changeset/tiny-lamps-lick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes an error thrown by `astro sync` when an `astro:env` virtual module is imported inside the Content Collections config diff --git a/.changeset/weak-dancers-beam.md b/.changeset/weak-dancers-beam.md deleted file mode 100644 index 6d4667815..000000000 --- a/.changeset/weak-dancers-beam.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -'@astrojs/vercel': minor ---- - -Deprecates the `functionPerRoute` option - -This option is now deprecated, and will be removed entirely in Astro v5.0. We suggest removing this option from your configuration as soon as you are able to: - -```diff -import { defineConfig } from 'astro/config'; -import vercel from '@astrojs/vercel/serverless'; - -export default defineConfig({ - // ... - output: 'server', - adapter: vercel({ -- functionPerRoute: true, - }), -}); -``` diff --git a/.changeset/weak-masks-do.md b/.changeset/weak-masks-do.md deleted file mode 100644 index 96aa4a1db..000000000 --- a/.changeset/weak-masks-do.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'astro': patch -'@astrojs/db': patch ---- - -Disables the WebSocket server when creating a Vite server for loading config files |