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 of getStaticPaths
result. .flatMap
and .flat
should now be used to ensure that you're returning a flat array.
3fdf509b2
Thanks @ematipico! - The build.split
and build.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 with edgeMiddleware
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 with functionPerRoute
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 for astro: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 of astro:assets
such as enforcing alt
, 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! - Update tsconfig.json
presets with moduleResolution: '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! - The astro check
command now requires an external package @astrojs/check
and an install of typescript
in your project. This was done in order to make the main astro
package smaller and give more flexibility to users in regard to the version of TypeScript they use.
3fdf509b2
Thanks @ematipico! - The build.split
and build.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 with edgeMiddleware
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 with functionPerRoute
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 exist
With this change, Astro.cookies.get(key) no longer always returns a AstroCookie
object. Instead it now returns undefined
if the cookie does not exist.
You should update your code if you assume that all calls to get()
return a value. When using with has()
you still need to assert the value, like so:
---
if (Astro.cookies.has(id)) {
const id = Astro.cookies.get(id)!;
}
---
7723c4cc9
Thanks @ematipico! - The property compressHTML
is now true
by default. Setting this value to true
is no longer required.
If you do not want to minify your HTML output, you must set this value to false
in astro.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 now 4321
.
This will reduce conflicts with ports used by other tools.
631b9c410
Thanks @bluwy! - Remove MDX special components
export handling