Releases: withastro/astro
[email protected]
Patch Changes
- #7939
89cd4b877
Thanks @natemoo-re! - Handle error state for version number
[email protected]
Patch Changes
-
#7935
6035bb35f
Thanks @natemoo-re! - Properly handle routing when multiple slashes are present in the request by collapsing them to a single/
-
#7936
4b6deda36
Thanks @matthewp! - Export createTransitionScope for the runtime -
Updated dependencies [
6035bb35f
]:- @astrojs/[email protected]
[email protected]
Minor Changes
-
#7861
41afb8405
Thanks @matthewp! - Persistent DOM and Islands in Experimental View TransitionsWith
viewTransitions: true
enabled in your Astro config's experimental section, pages using the<ViewTransition />
routing component can now access a newtransition:persist
directive.With this directive, you can keep the state of DOM elements and islands on the old page when transitioning to the new page.
For example, to keep a video playing across page navigation, add
transition:persist
to the element:<video controls="" autoplay="" transition:persist> <source src="https://ia804502.us.archive.org/33/items/GoldenGa1939_3/GoldenGa1939_3_512kb.mp4" type="video/mp4" /> </video>
This
<video>
element, with its current state, will be moved over to the next page (if the video also exists on that page).Likewise, this feature works with any client-side framework component island. In this example, a counter's state is preserved and moved to the new page:
<Counter count={5} client:load transition:persist />
See our View Transitions Guide to learn more on usage.
Patch Changes
-
#7821
c00b6f0c4
Thanks @ottomated! - Fixes an issue that prevents importing'astro/app'
-
#7917
1f0ee494a
Thanks @bluwy! - Prevent integration hooks from re-triggering if the server restarts on config change, but the config fails to load. -
#7901
00cb28f49
Thanks @bluwy! - Improve sourcemap generation and performance -
#7911
c264be349
Thanks @martrapp! - fix for #7882 by setting state in page navigation (view transitions) -
#7909
e1e958a75
Thanks @tonydangblog! - Fix: ignore.json
files nested in subdirectories within content collection directories starting with an_
underscore.
@astrojs/[email protected]
Minor Changes
- #7729
560d0dab1
Thanks @soilSpoon! - Add cache headers to assets in Vercel adapter
Patch Changes
@astrojs/[email protected]
@astrojs/[email protected]
Patch Changes
- #7935
6035bb35f
Thanks @natemoo-re! - AddcollapseDuplicateSlashes
helper
@astrojs/[email protected]
[email protected]
Major Changes
1eae2e3f7
Thanks @Princesseuh! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.
[email protected]
Major Changes
-
1eae2e3f7
Thanks @Princesseuh! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023. -
76ddef19c
Thanks @Princesseuh! - Removed automatic flattening ofgetStaticPaths
result..flatMap
and.flat
should now be used to ensure that you're returning a flat array. -
3fdf509b2
Thanks @ematipico! - Thebuild.split
andbuild.excludeMiddleware
configuration options are deprecated and have been replaced by options in the adapter config.If your config includes the
build.excludeMiddleware
option, replace it withedgeMiddleware
in your adapter options:import { defineConfig } from "astro/config"; import netlify from "@astrojs/netlify/functions"; export default defineConfig({ build: { - excludeMiddleware: true }, adapter: netlify({ + edgeMiddleware: true }), });
If your config includes the
build.split
option, replace it withfunctionPerRoute
in your adapter options:import { defineConfig } from "astro/config"; import netlify from "@astrojs/netlify/functions"; export default defineConfig({ build: { - split: true }, adapter: netlify({ + functionPerRoute: true }), });
-
2f951cd40
Thanks @Princesseuh! - Sharp is now the default image service used forastro:assets
. If you would prefer to still use Squoosh, you can update your config with the following:import { defineConfig, squooshImageService } from 'astro/config'; // https://astro.build/config export default defineConfig({ image: { service: squooshImageService(), }, });
However, not only do we recommend using Sharp as it is faster and more reliable, it is also highly likely that the Squoosh service will be removed in a future release.
-
c022a4217
Thanks @Princesseuh! - When using an adapter that supports neither Squoosh or Sharp, Astro will now automatically use an image service that does not support processing, but still provides the other benefits ofastro:assets
such as enforcingalt
, no CLS etc to users -
67becaa58
Thanks @ematipico! - Removed support for old syntax of the API routes. -
dfc2d93e3
Thanks @bluwy! - Remove MDX plugin re-ordering hack -
3dc1ca2fa
Thanks @Princesseuh! - Reduced the amount of polyfills provided by Astro. Astro will no longer provide (no-op) polyfills for several web apis such as HTMLElement, Image or Document. If you need access to those APIs on the server, we recommend using more proper polyfills available on npm. -
1be84dfee
Thanks @Princesseuh! - Updatetsconfig.json
presets withmoduleResolution: 'bundler'
and other new options from TypeScript 5.0. Astro now assumes that you use TypeScript 5.0 (March 2023), or that your editor includes it, ex: VS Code 1.77 -
35f01df79
Thanks @Princesseuh! - Theastro check
command now requires an external package@astrojs/check
and an install oftypescript
in your project. This was done in order to make the mainastro
package smaller and give more flexibility to users in regard to the version of TypeScript they use. -
3fdf509b2
Thanks @ematipico! - Thebuild.split
andbuild.excludeMiddleware
configuration options are deprecated and have been replaced by options in the adapter config.If your config includes the
build.excludeMiddleware
option, replace it withedgeMiddleware
in your adapter options:import { defineConfig } from "astro/config"; import vercel from "@astrojs/vercel/serverless"; export default defineConfig({ build: { - excludeMiddleware: true }, adapter: vercel({ + edgeMiddleware: true }), });
If your config includes the
build.split
option, replace it withfunctionPerRoute
in your adapter options:import { defineConfig } from "astro/config"; import vercel from "@astrojs/vercel/serverless"; export default defineConfig({ build: { - split: true }, adapter: vercel({ + functionPerRoute: true }), });
-
78de801f2
Thanks @ematipico! - Lowercase names for endpoint functions are now deprecated.Rename functions to their uppercase equivalent:
- export function get() { + export function GET() { return new Response(JSON.stringify({ "title": "Bob's blog" })); } - export function post() { + export function POST() { return new Response(JSON.stringify({ "title": "Bob's blog" })); } - export function put() { + export function PUT() { return new Response(JSON.stringify({ "title": "Bob's blog" })); } - export function all() { + export function ALL() { return new Response(JSON.stringify({ "title": "Bob's blog" })); } // you can use the whole word "DELETE" - export function del() { + export function DELETE() { return new Response(JSON.stringify({ "title": "Bob's blog" })); }
-
59d6e569f
Thanks @matthewp! - Astro.cookies.get(key) returns undefined if cookie doesn't existWith this change, Astro.cookies.get(key) no longer always returns a
AstroCookie
object. Instead it now returnsundefined
if the cookie does not exist.You should update your code if you assume that all calls to
get()
return a value. When using withhas()
you still need to assert the value, like so:--- if (Astro.cookies.has(id)) { const id = Astro.cookies.get(id)!; } ---
-
7723c4cc9
Thanks @ematipico! - The propertycompressHTML
is nowtrue
by default. Setting this value totrue
is no longer required.If you do not want to minify your HTML output, you must set this value to
false
inastro.config.mjs
.import {defineConfig} from "astro/config"; export default defineConfig({ + compressHTML: false })
-
fb5cd6b56
Thanks @ematipico! - Astro's default port when running the dev or preview server is now4321
.This will reduce conflicts with ports used by other tools.
-
631b9c410
Thanks @bluwy! - Remove MDX specialcomponents
export handling
Minor Changes
-
9b4f70a62
Thanks @ematipico! - Introduced the concept of feature map. A feature map is a list of features that are built-in in Astro, and an Adapter
can tell Astro if it can support it.import { AstroIntegration } from './astro'; function myIntegration(): AstroIntegration { return { name: 'astro-awesome-list', // new feature map supportedAstroFeatures: { hybridOutput: 'experimental', staticOutput: 'stable', serverOutput: 'stable', assets: { supportKind: 'stable', isSharpCompatible: false, isSquooshCompatible: false, }, }, }; }
-
bc37331d8
Thanks @ematipico! - Integrations can now log messages using Astro’s built-in logger.The logger is available to all hooks as an additional parameter:
import { AstroIntegration } from './astro'; // integration.js export function myIntegration(): AstroIntegration { return { name: 'my-integration', hooks: { 'astro:config:done': ({ logger }) => { logger.info('Configure integration...'); }, }, }; }
Patch Changes
- Updated dependencies [[
1eae2e3f7
](1eae2e3...
@astrojs/[email protected]
Major Changes
1eae2e3f7
Thanks @Princesseuh! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.