diff options
Diffstat (limited to '.changeset')
43 files changed, 645 insertions, 0 deletions
diff --git a/.changeset/afraid-dots-whisper.md b/.changeset/afraid-dots-whisper.md new file mode 100644 index 000000000..a38150269 --- /dev/null +++ b/.changeset/afraid-dots-whisper.md @@ -0,0 +1,30 @@ +--- +'@astrojs/cloudflare': major +'@astrojs/partytown': major +'@astrojs/tailwind': major +'@astrojs/netlify': major +'@astrojs/sitemap': major +'@astrojs/preact': major +'@astrojs/svelte': major +'@astrojs/vercel': major +'@astrojs/react': major +'@astrojs/solid-js': major +'@astrojs/deno': major +'@astrojs/node': major +'@astrojs/lit': major +'@astrojs/vue': major +'create-astro': major +'@astrojs/prism': major +'@astrojs/rss': major +'@astrojs/telemetry': major +'astro': major +'@astrojs/turbolinks': minor +'@astrojs/alpinejs': minor +'@astrojs/prefetch': minor +'@astrojs/markdoc': minor +'@astrojs/underscore-redirects': minor +'@astrojs/mdx': minor +'@astrojs/internal-helpers': minor +--- + +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. diff --git a/.changeset/big-tips-whisper.md b/.changeset/big-tips-whisper.md new file mode 100644 index 000000000..ad532760f --- /dev/null +++ b/.changeset/big-tips-whisper.md @@ -0,0 +1,5 @@ +--- +'@astrojs/internal-helpers': patch +--- + +Trigger re-release to fix `collapseDuplicateSlashes` export diff --git a/.changeset/chilled-ducks-grin.md b/.changeset/chilled-ducks-grin.md new file mode 100644 index 000000000..b63b1f29c --- /dev/null +++ b/.changeset/chilled-ducks-grin.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Removed automatic flattening of `getStaticPaths` result. `.flatMap` and `.flat` should now be used to ensure that you're returning a flat array. diff --git a/.changeset/clever-bats-breathe.md b/.changeset/clever-bats-breathe.md new file mode 100644 index 000000000..2c1a6dc39 --- /dev/null +++ b/.changeset/clever-bats-breathe.md @@ -0,0 +1,13 @@ +--- +'astro': major +--- + +This import alias is no longer included by default with astro:assets. If you were using this alias with experimental assets, you must convert them to relative file paths, or create your own [import aliases](https://docs.astro.build/en/guides/aliases/). + +```diff +--- +// src/pages/posts/post-1.astro +- import rocket from '~/assets/rocket.png' ++ import rocket from '../../assets/rocket.png'; +--- +``` diff --git a/.changeset/cool-feet-rest.md b/.changeset/cool-feet-rest.md new file mode 100644 index 000000000..c2e724d80 --- /dev/null +++ b/.changeset/cool-feet-rest.md @@ -0,0 +1,7 @@ +--- +'@astrojs/solid-js': major +--- + +New `include` and `exclude` config options + +The Solid integration now has new `include` and `exclude` config options. Use these if you want to use Solid alongside another JSX framework; include specifies files to be compiled for Solid and `exclude` does the opposite. diff --git a/.changeset/dirty-lies-cover.md b/.changeset/dirty-lies-cover.md new file mode 100644 index 000000000..ae74e348e --- /dev/null +++ b/.changeset/dirty-lies-cover.md @@ -0,0 +1,32 @@ +--- +'@astrojs/cloudflare': minor +'@astrojs/netlify': minor +'@astrojs/vercel': minor +'@astrojs/deno': minor +'@astrojs/node': minor +'astro': minor +--- + +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. + +```ts +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, + }, + } + } +} +``` diff --git a/.changeset/fair-emus-divide.md b/.changeset/fair-emus-divide.md new file mode 100644 index 000000000..529760241 --- /dev/null +++ b/.changeset/fair-emus-divide.md @@ -0,0 +1,39 @@ +--- +'astro': major +'@astrojs/netlify': minor +--- + +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: + +```diff +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: + +```diff +import { defineConfig } from "astro/config"; +import netlify from "@astrojs/netlify/functions"; + +export default defineConfig({ + build: { +- split: true + }, + adapter: netlify({ ++ functionPerRoute: true + }), +}); +``` + diff --git a/.changeset/famous-queens-itch.md b/.changeset/famous-queens-itch.md new file mode 100644 index 000000000..e3538cdd6 --- /dev/null +++ b/.changeset/famous-queens-itch.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': patch +--- + +Re-orders the MDX plugin to run before Astro's JSX plugin diff --git a/.changeset/four-houses-compete.md b/.changeset/four-houses-compete.md new file mode 100644 index 000000000..641bb1035 --- /dev/null +++ b/.changeset/four-houses-compete.md @@ -0,0 +1,18 @@ +--- +'astro': major +--- + +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: + +```ts +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. diff --git a/.changeset/gentle-deers-yawn.md b/.changeset/gentle-deers-yawn.md new file mode 100644 index 000000000..30e577c69 --- /dev/null +++ b/.changeset/gentle-deers-yawn.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Call `astro sync` once before calling `astro check` diff --git a/.changeset/gentle-meals-crash.md b/.changeset/gentle-meals-crash.md new file mode 100644 index 000000000..5314442ea --- /dev/null +++ b/.changeset/gentle-meals-crash.md @@ -0,0 +1,9 @@ +--- +'astro': major +--- + +Remove support for `Astro.__renderMarkdown` which is used by `@astrojs/markdown-component`. + +The `<Markdown />` component was deprecated in Astro v1 and is completely removed in v3. This integration must now be removed from your project. + +As an alternative, you can use community packages that provide a similar component like https://github.com/natemoo-re/astro-remote instead. diff --git a/.changeset/giant-plants-sip.md b/.changeset/giant-plants-sip.md new file mode 100644 index 000000000..884021b8e --- /dev/null +++ b/.changeset/giant-plants-sip.md @@ -0,0 +1,29 @@ +--- +'astro': major +--- + +Remove backwards-compatible kebab-case transform for camelCase CSS variable names passed to the `style` attribute. If you were relying on the kebab-case transform in your styles, make sure to use the camelCase version to prevent missing styles. For example: + +```astro +--- +const myValue = "red" +--- + +<!-- input --> +<div style={{ "--myValue": myValue }}></div> + +<!-- output (before) --> +<div style="--my-value:var(--myValue);--myValue:red"></div> + +<!-- output (after) --> +<div style="--myValue:red"></div> +``` + +```diff +<style> + div { +- color: var(--my-value); ++ color: var(--myValue); + } +</style> +```
\ No newline at end of file diff --git a/.changeset/heavy-walls-arrive.md b/.changeset/heavy-walls-arrive.md new file mode 100644 index 000000000..68f64dacb --- /dev/null +++ b/.changeset/heavy-walls-arrive.md @@ -0,0 +1,8 @@ +--- +'@astrojs/cloudflare': major +'@astrojs/netlify': major +'@astrojs/vercel': major +'astro': major +--- + +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 diff --git a/.changeset/large-countries-share.md b/.changeset/large-countries-share.md new file mode 100644 index 000000000..b3101d2f2 --- /dev/null +++ b/.changeset/large-countries-share.md @@ -0,0 +1,7 @@ +--- +'@astrojs/preact': major +--- + +New `include` and `exclude` config options + +The Preact integration now has new `include` and `exclude` config options. Use these if you want to use Preact alongside another JSX framework; include specifies files to be compiled for Preact and `exclude` does the opposite. diff --git a/.changeset/loud-candles-admire.md b/.changeset/loud-candles-admire.md new file mode 100644 index 000000000..3fe1f12e7 --- /dev/null +++ b/.changeset/loud-candles-admire.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': patch +--- + +Handle `components` exports handling itself diff --git a/.changeset/mighty-dancers-lay.md b/.changeset/mighty-dancers-lay.md new file mode 100644 index 000000000..873c4edd1 --- /dev/null +++ b/.changeset/mighty-dancers-lay.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Removed support for old syntax of the API routes. diff --git a/.changeset/neat-owls-run.md b/.changeset/neat-owls-run.md new file mode 100644 index 000000000..501b5319f --- /dev/null +++ b/.changeset/neat-owls-run.md @@ -0,0 +1,25 @@ +--- +'astro': major +--- + +Remove exports for `astro/internal/*` and `astro/runtime/server/*` in favour of `astro/runtime/*`. Add new `astro/compiler-runtime` export for compiler-specific runtime code. + +These are exports for Astro's internal API and should not affect your project, but if you do use these entrypoints, you can migrate like below: + +```diff +- import 'astro/internal/index.js'; ++ import 'astro/runtime/server/index.js'; + +- import 'astro/server/index.js'; ++ import 'astro/runtime/server/index.js'; +``` + +```diff +import { transform } from '@astrojs/compiler'; + +const result = await transform(source, { +- internalURL: 'astro/runtime/server/index.js', ++ internalURL: 'astro/compiler-runtime', + // ... +}); +``` diff --git a/.changeset/neat-suns-search.md b/.changeset/neat-suns-search.md new file mode 100644 index 000000000..da743c9c7 --- /dev/null +++ b/.changeset/neat-suns-search.md @@ -0,0 +1,17 @@ +--- +'astro': major +--- + +Implements a new scope style strategy called `"attribute"`. When enabled, styles are applied using `data-*` attributes. + +The **default** value of `scopedStyleStrategy` is `"attribute"`. + +If you want to use the previous behaviour, you have to use the `"where"` option: + +```diff +import { defineConfig } from 'astro/config'; + +export default defineConfig({ ++ scopedStyleStrategy: 'where', +}); +``` diff --git a/.changeset/odd-books-live.md b/.changeset/odd-books-live.md new file mode 100644 index 000000000..40f0d7c17 --- /dev/null +++ b/.changeset/odd-books-live.md @@ -0,0 +1,23 @@ +--- +'astro': minor +--- + +Integrations can now log messages using Astro’s built-in logger. + +The logger is available to all hooks as an additional parameter: + +```ts +import {AstroIntegration} from "./astro"; + +// integration.js +export function myIntegration(): AstroIntegration { + return { + name: "my-integration", + hooks: { + "astro:config:done": ({ logger }) => { + logger.info("Configure integration..."); + } + } + } +} +``` diff --git a/.changeset/perfect-horses-tell.md b/.changeset/perfect-horses-tell.md new file mode 100644 index 000000000..7723c665f --- /dev/null +++ b/.changeset/perfect-horses-tell.md @@ -0,0 +1,27 @@ +--- +'astro': major +--- + +Astro's JSX handling has been refactored with better support for each framework. + +Previously, Astro automatically scanned your components to determine which framework-specific transformations should be used. In practice, supporting advanced features like Fast Refresh with this approach proved difficult. + +Now, Astro determines which framework to use with `include` and `exclude` config options where you can specify files and folders on a per-framework basis. When using multiple JSX frameworks in the same project, users should manually control which files belong to each framework using the `include` and `exclude` options. + +```js +export default defineConfig({ + // The `include` config is only needed in projects that use multiple JSX frameworks; + // if only using one no extra config is needed. + integrations: [ + preact({ + include: ['**/preact/*'] + }), + react({ + include: ['**/react/*'] + }), + solid({ + include: ['**/solid/*'], + }), + ] +}); +``` diff --git a/.changeset/plenty-keys-add.md b/.changeset/plenty-keys-add.md new file mode 100644 index 000000000..73a78ba3b --- /dev/null +++ b/.changeset/plenty-keys-add.md @@ -0,0 +1,23 @@ +--- +'@astrojs/vercel': major +--- + +Remove the Vercel Edge adapter + + `@astrojs/vercel/serverless` now supports Edge middleware, so a separate adapter for Edge itself (deploying your entire app to the edge) is no longer necessary. Please update your Astro config to reflect this change: + + ```diff + // astro.config.mjs +import { defineConfig } from 'astro/config'; +- import vercel from '@astrojs/vercel/edge'; ++ import vercel from '@astrojs/vercel/serverless'; + +export default defineConfig({ + output: 'server', + adapter: vercel({ ++ edgeMiddleware: true + }), +}); +``` + +This adapter had several known limitations and compatibility issues that prevented many people from using it in production. To reduce maintenance costs and because we have a better story with Serveless + Edge Middleware, we are removing the Edge adapter. diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 000000000..d0d69690d --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,73 @@ +{ + "mode": "pre", + "tag": "beta", + "initialVersions": { + "astro": "2.9.6", + "@astrojs/prism": "2.1.2", + "@astrojs/rss": "2.4.3", + "create-astro": "3.1.10", + "@astrojs/alpinejs": "0.2.2", + "@astrojs/cloudflare": "6.6.2", + "@astrojs/deno": "4.3.0", + "@astrojs/lit": "2.1.0", + "@astrojs/markdoc": "0.4.4", + "@astrojs/mdx": "0.19.7", + "@astrojs/netlify": "2.5.1", + "@astrojs/node": "5.3.0", + "@astrojs/partytown": "1.2.3", + "@astrojs/preact": "2.2.1", + "@astrojs/prefetch": "0.3.0", + "@astrojs/react": "2.2.1", + "@astrojs/sitemap": "2.0.1", + "@astrojs/solid-js": "2.2.0", + "@astrojs/svelte": "3.1.0", + "@astrojs/tailwind": "4.0.0", + "@astrojs/turbolinks": "0.2.2", + "@astrojs/vercel": "3.7.4", + "@astrojs/vue": "2.2.1", + "@astrojs/internal-helpers": "0.1.1", + "@astrojs/markdown-remark": "2.2.1", + "@astrojs/telemetry": "2.1.1", + "@astrojs/underscore-redirects": "0.2.0" + }, + "changesets": [ + "afraid-dots-whisper", + "big-tips-whisper", + "breezy-frogs-learn", + "chilled-ducks-grin", + "cool-feet-rest", + "dirty-lies-cover", + "fair-emus-divide", + "famous-queens-itch", + "four-houses-compete", + "gentle-deers-yawn", + "gentle-meals-crash", + "giant-plants-sip", + "heavy-walls-arrive", + "large-countries-share", + "loud-candles-admire", + "mighty-dancers-lay", + "neat-suns-search", + "odd-books-live", + "perfect-horses-tell", + "plenty-keys-add", + "purple-buses-prove", + "rude-ears-play", + "six-grapes-look", + "slimy-carrots-sell", + "spicy-eels-rush", + "tame-files-glow", + "three-adults-exist", + "three-onions-repeat", + "tricky-candles-suffer", + "twelve-coats-rush", + "twenty-cheetahs-deny", + "unlucky-hotels-try", + "unlucky-ravens-type", + "unlucky-sheep-build", + "violet-peaches-invent", + "wild-bobcats-carry", + "wild-jobs-tan", + "young-roses-teach" + ] +} diff --git a/.changeset/purple-buses-prove.md b/.changeset/purple-buses-prove.md new file mode 100644 index 000000000..c1e4876c9 --- /dev/null +++ b/.changeset/purple-buses-prove.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Remove StreamingCompatibleResponse polyfill diff --git a/.changeset/quick-boats-bow.md b/.changeset/quick-boats-bow.md new file mode 100644 index 000000000..1ab83ed5a --- /dev/null +++ b/.changeset/quick-boats-bow.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Removed duplicate `astro/dist/jsx` export. Please use the `astro/jsx` export instead diff --git a/.changeset/rude-ears-play.md b/.changeset/rude-ears-play.md new file mode 100644 index 000000000..660cfcb34 --- /dev/null +++ b/.changeset/rude-ears-play.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Remove MDX plugin re-ordering hack diff --git a/.changeset/six-grapes-look.md b/.changeset/six-grapes-look.md new file mode 100644 index 000000000..edf10e01a --- /dev/null +++ b/.changeset/six-grapes-look.md @@ -0,0 +1,15 @@ +--- +'astro': major +--- + +The value of `import.meta.env.BASE_URL`, which is derived from the `base` option, will no longer have a trailing slash added by default or when `trailingSlash: "ignore"` is set. The existing behavior of `base` in combination with `trailingSlash: "always"` or `trailingSlash: "never"` is unchanged. + +If your `base` already has a trailing slash, no change is needed. + +If your `base` does not have a trailing slash, add one to preserve the previous behaviour: + +```diff +// astro.config.mjs +- base: 'my-base', ++ base: 'my-base/', +``` diff --git a/.changeset/slimy-carrots-sell.md b/.changeset/slimy-carrots-sell.md new file mode 100644 index 000000000..c1c9e694f --- /dev/null +++ b/.changeset/slimy-carrots-sell.md @@ -0,0 +1,9 @@ +--- +'@astrojs/react': major +--- + +Support for React Refresh + +The React integration now fully supports React Refresh and is backed by `@vitejs/plugin-react`. + +Also included in this change are new `include` and `exclude` config options. Use these if you want to use React alongside another JSX framework; include specifies files to be compiled for React and `exclude` does the opposite. diff --git a/.changeset/spicy-eels-rush.md b/.changeset/spicy-eels-rush.md new file mode 100644 index 000000000..672de5c7d --- /dev/null +++ b/.changeset/spicy-eels-rush.md @@ -0,0 +1,8 @@ +--- +'astro': major +'@astrojs/netlify': major +'@astrojs/vercel': major +'@astrojs/node': major +--- + +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. diff --git a/.changeset/strong-papayas-chew.md b/.changeset/strong-papayas-chew.md new file mode 100644 index 000000000..f9d7bf4c2 --- /dev/null +++ b/.changeset/strong-papayas-chew.md @@ -0,0 +1,5 @@ +--- +'@astrojs/cloudflare': patch +--- + +Sync Astro Asset support across both modes diff --git a/.changeset/tame-files-glow.md b/.changeset/tame-files-glow.md new file mode 100644 index 000000000..32d95b5da --- /dev/null +++ b/.changeset/tame-files-glow.md @@ -0,0 +1,23 @@ +--- +'@astrojs/netlify': major +--- + +Remove the Netlify Edge adapter + + `@astrojs/netlify/functions` now supports Edge middleware, so a separate adapter for Edge itself (deploying your entire app to the edge) is no longer necessary. Please update your Astro config to reflect this change: + + ```diff + // astro.config.mjs +import { defineConfig } from 'astro/config'; +- import netlify from '@astrojs/netlify/edge'; ++ import netlify from '@astrojs/netlify/functions'; + +export default defineConfig({ + output: 'server', + adapter: netlify({ ++ edgeMiddleware: true + }), +}); +``` + +This adapter had several known limitations and compatibility issues that prevented many people from using it in production. To reduce maintenance costs and because we have a better story with Serveless + Edge Middleware, we are removing the Edge adapter. diff --git a/.changeset/tasty-camels-speak.md b/.changeset/tasty-camels-speak.md new file mode 100644 index 000000000..374163d9b --- /dev/null +++ b/.changeset/tasty-camels-speak.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Update Astro types to reflect that compress defaults to true diff --git a/.changeset/three-adults-exist.md b/.changeset/three-adults-exist.md new file mode 100644 index 000000000..f73b3624d --- /dev/null +++ b/.changeset/three-adults-exist.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +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 diff --git a/.changeset/three-onions-repeat.md b/.changeset/three-onions-repeat.md new file mode 100644 index 000000000..1781defcc --- /dev/null +++ b/.changeset/three-onions-repeat.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +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. diff --git a/.changeset/tricky-candles-suffer.md b/.changeset/tricky-candles-suffer.md new file mode 100644 index 000000000..3786399a6 --- /dev/null +++ b/.changeset/tricky-candles-suffer.md @@ -0,0 +1,39 @@ +--- +'astro': major +'@astrojs/vercel': minor +--- + +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: + +```diff +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: + +```diff +import { defineConfig } from "astro/config"; +import vercel from "@astrojs/vercel/serverless"; + +export default defineConfig({ + build: { +- split: true + }, + adapter: vercel({ ++ functionPerRoute: true + }), +}); +``` + diff --git a/.changeset/twelve-coats-rush.md b/.changeset/twelve-coats-rush.md new file mode 100644 index 000000000..29dd0f689 --- /dev/null +++ b/.changeset/twelve-coats-rush.md @@ -0,0 +1,35 @@ +--- +'astro': major +--- + +Lowercase names for endpoint functions are now deprecated. + +Rename functions to their uppercase equivalent: + +```diff +- 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" })); +} +``` diff --git a/.changeset/twenty-cheetahs-deny.md b/.changeset/twenty-cheetahs-deny.md new file mode 100644 index 000000000..38a7298bf --- /dev/null +++ b/.changeset/twenty-cheetahs-deny.md @@ -0,0 +1,17 @@ +--- +'astro': major +--- + +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: + +```astro +--- +if(Astro.cookies.has(id)) { + const id = Astro.cookies.get(id)!; +} +--- +``` diff --git a/.changeset/unlucky-hotels-try.md b/.changeset/unlucky-hotels-try.md new file mode 100644 index 000000000..359a239e2 --- /dev/null +++ b/.changeset/unlucky-hotels-try.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': minor +--- + +Add `astro` as peer dependency diff --git a/.changeset/unlucky-ravens-type.md b/.changeset/unlucky-ravens-type.md new file mode 100644 index 000000000..88b0aa748 --- /dev/null +++ b/.changeset/unlucky-ravens-type.md @@ -0,0 +1,14 @@ +--- +'astro': major +--- + +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`. + +```diff +import {defineConfig} from "astro/config"; +export default defineConfig({ ++ compressHTML: false +}) +``` diff --git a/.changeset/unlucky-sheep-build.md b/.changeset/unlucky-sheep-build.md new file mode 100644 index 000000000..6a69876de --- /dev/null +++ b/.changeset/unlucky-sheep-build.md @@ -0,0 +1,7 @@ +--- +'astro': major +--- + +Astro's default port when running the dev or preview server is now `4321`. + +This will reduce conflicts with ports used by other tools. diff --git a/.changeset/violet-peaches-invent.md b/.changeset/violet-peaches-invent.md new file mode 100644 index 000000000..f5d3e19d6 --- /dev/null +++ b/.changeset/violet-peaches-invent.md @@ -0,0 +1,5 @@ +--- +'@astrojs/telemetry': patch +--- + +Remove undici dependency diff --git a/.changeset/warm-weeks-yell.md b/.changeset/warm-weeks-yell.md new file mode 100644 index 000000000..9c0ca21da --- /dev/null +++ b/.changeset/warm-weeks-yell.md @@ -0,0 +1,13 @@ +--- +"astro": major +--- + +`astro:assets` is now enabled by default. If you were previously using the `experimental.assets` flag, please remove it from your config. Also note that the previous `@astrojs/image` integration is incompatible, and must be removed. + +This also brings two important changes to using images in Astro: + +- New ESM shape: importing an image will now return an object with different properties describing the image such as its path, format and dimensions. This is a breaking change and may require you to update your existing images. +- In Markdown, MDX, and Markdoc, the `![]()` syntax will now resolve relative images located anywhere in your project in addition to remote images and images stored in the `public/` folder. This notably unlocks storing images next to your content. + +Please see our existing [Assets page in Docs](https://docs.astro.build/en/guides/assets/) for more information about using `astro:assets`. + diff --git a/.changeset/wild-bobcats-carry.md b/.changeset/wild-bobcats-carry.md new file mode 100644 index 000000000..ef66ca952 --- /dev/null +++ b/.changeset/wild-bobcats-carry.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Add a new `astro/errors` module. Developers can import `AstroUserError`, and provide a `message` and an optional `hint` diff --git a/.changeset/young-roses-teach.md b/.changeset/young-roses-teach.md new file mode 100644 index 000000000..ff9c08e56 --- /dev/null +++ b/.changeset/young-roses-teach.md @@ -0,0 +1,5 @@ +--- +'astro': major +--- + +Remove MDX special `components` export handling |