diff --git a/.changeset/brown-pets-clean.md b/.changeset/brown-pets-clean.md deleted file mode 100644 index 28cc4e98f5f82..0000000000000 --- a/.changeset/brown-pets-clean.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"astro": minor ---- - -Allows middleware to run when a matching page or endpoint is not found. Previously, a `pages/404.astro` or `pages/[...catch-all].astro` route had to match to allow middleware. This is now not necessary. - -When a route does not match in SSR deployments, your adapter may show a platform-specific 404 page instead of running Astro's SSR code. In these cases, you may still need to add a `404.astro` or fallback route with spread params, or use a routing configuration option if your adapter provides one. diff --git a/.changeset/calm-bags-deliver.md b/.changeset/calm-bags-deliver.md deleted file mode 100644 index 8cb125d60ee77..0000000000000 --- a/.changeset/calm-bags-deliver.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@astrojs/markdown-remark": minor -"astro": minor ---- - -Allows passing any props to the `` component diff --git a/.changeset/cool-jobs-fetch.md b/.changeset/cool-jobs-fetch.md deleted file mode 100644 index 3aa3ab5f0c7f8..0000000000000 --- a/.changeset/cool-jobs-fetch.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -"astro": minor ---- - -Adds a new `experimental.directRenderScript` configuration option which provides a more reliable strategy to prevent scripts from being executed in pages where they are not used. - -This replaces the `experimental.optimizeHoistedScript` flag introduced in v2.10.4 to prevent unused components' scripts from being included in a page unexpectedly. That experimental option no longer exists and must be removed from your configuration, whether or not you enable `directRenderScript`: - -```diff -// astro.config.mjs -import { defineConfig } from 'astro/config'; - -export default defineConfig({ - experimental: { -- optimizeHoistedScript: true, -+ directRenderScript: true - } -}); -``` - -With `experimental.directRenderScript` configured, scripts are now directly rendered as declared in Astro files (including existing features like TypeScript, importing `node_modules`, and deduplicating scripts). You can also now conditionally render scripts in your Astro file. - -However, this means scripts are no longer hoisted to the `` and multiple scripts on a page are no longer bundled together. If you enable this option, you should check that all your ` -``` diff --git a/.changeset/slimy-avocados-sniff.md b/.changeset/slimy-avocados-sniff.md deleted file mode 100644 index 3cf85cd928be6..0000000000000 --- a/.changeset/slimy-avocados-sniff.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": patch ---- - -Updates the base `tsconfig.json` preset with `jsx: 'preserve'` in order to fix errors when importing Astro files inside `.js` and `.ts` files. diff --git a/.changeset/slow-items-heal.md b/.changeset/slow-items-heal.md deleted file mode 100644 index 0095974f6037d..0000000000000 --- a/.changeset/slow-items-heal.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -"astro": minor ---- - -Adds experimental JSON Schema support for content collections. - -This feature will auto-generate a JSON Schema for content collections of `type: 'data'` which can be used as the `$schema` value for TypeScript-style autocompletion/hints in tools like VSCode. - -To enable this feature, add the experimental flag: - -```diff -import { defineConfig } from 'astro/config'; - -export default defineConfig({ - experimental: { -+ contentCollectionJsonSchema: true - } -}); -``` - -This experimental implementation requires you to manually reference the schema in each data entry file of the collection: - -```diff -// src/content/test/entry.json -{ -+ "$schema": "../../../.astro/collections/test.schema.json", - "test": "test" -} -``` - -Alternatively, you can set this in your [VSCode `json.schemas` settings](https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings): - -```diff -"json.schemas": [ - { - "fileMatch": [ - "/src/content/test/**" - ], - "url": "../../../.astro/collections/test.schema.json" - } -] -``` - -Note that this initial implementation uses a library with [known issues for advanced Zod schemas](https://github.com/StefanTerdell/zod-to-json-schema#known-issues), so you may wish to consult these limitations before enabling the experimental flag. diff --git a/.changeset/thin-chicken-greet.md b/.changeset/thin-chicken-greet.md deleted file mode 100644 index a018fd10f2682..0000000000000 --- a/.changeset/thin-chicken-greet.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@astrojs/markdown-remark": minor -"astro": minor ---- - -Migrates `shikiji` to `shiki` 1.0 diff --git a/.changeset/thirty-beds-smoke.md b/.changeset/thirty-beds-smoke.md deleted file mode 100644 index 6d57166c12b9c..0000000000000 --- a/.changeset/thirty-beds-smoke.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"@astrojs/mdx": minor -"@astrojs/markdown-remark": minor ---- - -Changes Astro's internal syntax highlighting to use rehype plugins instead of remark plugins. This provides better interoperability with other [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) that deal with code blocks, in particular with third party syntax highlighting plugins and [`rehype-mermaid`](https://github.com/remcohaszing/rehype-mermaid). - -This may be a breaking change if you are currently using: -- a remark plugin that relies on nodes of type `html` -- a rehype plugin that depends on nodes of type `raw`. - -Please review your rendered code samples carefully, and if necessary, consider using a rehype plugin that deals with the generated `element` nodes instead. You can transform the AST of raw HTML strings, or alternatively use [`hast-util-to-html`](https://github.com/syntax-tree/hast-util-to-html) to get a string from a `raw` node. diff --git a/.changeset/two-ads-bathe.md b/.changeset/two-ads-bathe.md deleted file mode 100644 index beb330146021e..0000000000000 --- a/.changeset/two-ads-bathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": minor ---- - -Adds support for page mutations to the audits in the dev toolbar. Astro will now rerun the audits whenever elements are added or deleted from the page. diff --git a/.changeset/witty-wombats-attend.md b/.changeset/witty-wombats-attend.md deleted file mode 100644 index ef9d3b5f9e032..0000000000000 --- a/.changeset/witty-wombats-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": minor ---- - -Updates the UI for dev toolbar audits with new information diff --git a/examples/basics/package.json b/examples/basics/package.json index 0f3d0cbb27422..cbe2449c17b9e 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index cc079bda391e6..c8ccc99a1076c 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^2.1.1", + "@astrojs/mdx": "^2.2.0", "@astrojs/rss": "^4.0.5", "@astrojs/sitemap": "^3.1.1", - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/component/package.json b/examples/component/package.json index 31dca9ecd0f38..922f3b047061b 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.4.15" + "astro": "^4.5.0" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index ec27e2973e45b..dbb126883bf0b 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.4.0", "@types/alpinejs": "^3.13.5", "alpinejs": "^3.13.3", - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index cc8f560dc69ab..a0bdf01cd5f84 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^4.0.1", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^4.4.15", + "astro": "^4.5.0", "lit": "^3.1.2" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index f2cbe95012ccd..f207b9c0cad21 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -12,11 +12,11 @@ }, "dependencies": { "@astrojs/preact": "^3.1.1", - "@astrojs/react": "^3.0.10", + "@astrojs/react": "^3.1.0", "@astrojs/solid-js": "^4.0.1", "@astrojs/svelte": "^5.2.0", "@astrojs/vue": "^4.0.8", - "astro": "^4.4.15", + "astro": "^4.5.0", "preact": "^10.19.2", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index a28f3be95a76a..a7e4eef2080f6 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.1.1", "@preact/signals": "^1.2.1", - "astro": "^4.4.15", + "astro": "^4.5.0", "preact": "^10.19.2" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 99e914c14d409..8f5fe6a26e801 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/react": "^3.0.10", + "@astrojs/react": "^3.1.0", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", - "astro": "^4.4.15", + "astro": "^4.5.0", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 91b6289948307..56432600236e5 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^4.0.1", - "astro": "^4.4.15", + "astro": "^4.5.0", "solid-js": "^1.8.5" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 7a8109ee15a67..311fa4e40beb4 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^5.2.0", - "astro": "^4.4.15", + "astro": "^4.5.0", "svelte": "^4.2.5" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index 5d9e1f274219c..89ea16fb4d42c 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^4.0.8", - "astro": "^4.4.15", + "astro": "^4.5.0", "vue": "^3.3.8" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index 89930a13a8f89..8db1aba17ad37 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^8.2.3", - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 0a0310ed797cb..7e6b9d06c9c4d 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.4.15" + "astro": "^4.5.0" }, "peerDependencies": { "astro": "^4.0.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index d4f7fa7f16be7..d6bee1615752b 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^8.2.3", - "astro": "^4.4.15", + "astro": "^4.5.0", "html-minifier": "^4.0.0" }, "devDependencies": { diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 419180170a530..7220c194c82ba 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index cf25b8dc723c0..b7ac752bc03ef 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 3c9f4766f598e..0ccdee3c81e09 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index ea5d05ff0a772..13e75fc005e3b 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -14,7 +14,7 @@ "dependencies": { "@astrojs/node": "^8.2.3", "@astrojs/svelte": "^5.2.0", - "astro": "^4.4.15", + "astro": "^4.5.0", "svelte": "^4.2.5" } } diff --git a/examples/starlog/package.json b/examples/starlog/package.json index d46d9729e0ab2..a629a6460ed10 100644 --- a/examples/starlog/package.json +++ b/examples/starlog/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.4.15", + "astro": "^4.5.0", "sass": "^1.69.5", "sharp": "^0.32.6" } diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json index 58c63411d983d..5ac9ce8f41b06 100644 --- a/examples/view-transitions/package.json +++ b/examples/view-transitions/package.json @@ -12,6 +12,6 @@ "devDependencies": { "@astrojs/tailwind": "^5.1.0", "@astrojs/node": "^8.2.3", - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 16e5a5ecaf769..5c8f50c3a1f93 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "@astrojs/markdoc": "^0.9.1", - "astro": "^4.4.15" + "@astrojs/markdoc": "^0.9.2", + "astro": "^4.5.0" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 72438c077091f..489eeef24a883 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -11,8 +11,8 @@ "astro": "astro" }, "dependencies": { - "@astrojs/markdown-remark": "^4.2.1", - "astro": "^4.4.15", + "@astrojs/markdown-remark": "^4.3.0", + "astro": "^4.5.0", "hast-util-select": "^6.0.2", "rehype-autolink-headings": "^7.1.0", "rehype-slug": "^6.0.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 1069689aeb81c..f229570120d64 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.4.15" + "astro": "^4.5.0" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 17a8a433ba5e1..04f80dfc4a967 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -11,9 +11,9 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^2.1.1", + "@astrojs/mdx": "^2.2.0", "@astrojs/preact": "^3.1.1", - "astro": "^4.4.15", + "astro": "^4.5.0", "preact": "^10.19.2" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 337d0a67554e3..d1497452500e7 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.1.1", "@nanostores/preact": "^0.5.0", - "astro": "^4.4.15", + "astro": "^4.5.0", "nanostores": "^0.9.5", "preact": "^10.19.2" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index fcc6729db657a..297bee91c8950 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -11,10 +11,10 @@ "astro": "astro" }, "dependencies": { - "@astrojs/mdx": "^2.1.1", + "@astrojs/mdx": "^2.2.0", "@astrojs/tailwind": "^5.1.0", "@types/canvas-confetti": "^1.6.3", - "astro": "^4.4.15", + "astro": "^4.5.0", "autoprefixer": "^10.4.15", "canvas-confetti": "^1.9.1", "postcss": "^8.4.28", diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index 5841c328fbd02..0e1ce0c11bb52 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^4.4.15", + "astro": "^4.5.0", "vitest": "^1.3.1" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index c041b15c2d765..56862626e819b 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,166 @@ # astro +## 4.5.0 + +### Minor Changes + +- [#10206](https://github.com/withastro/astro/pull/10206) [`dc87214141e7f8406c0fdf6a7f425dad6dea6d3e`](https://github.com/withastro/astro/commit/dc87214141e7f8406c0fdf6a7f425dad6dea6d3e) Thanks [@lilnasy](https://github.com/lilnasy)! - Allows middleware to run when a matching page or endpoint is not found. Previously, a `pages/404.astro` or `pages/[...catch-all].astro` route had to match to allow middleware. This is now not necessary. + + When a route does not match in SSR deployments, your adapter may show a platform-specific 404 page instead of running Astro's SSR code. In these cases, you may still need to add a `404.astro` or fallback route with spread params, or use a routing configuration option if your adapter provides one. + +- [#9960](https://github.com/withastro/astro/pull/9960) [`c081adf998d30419fed97d8fccc11340cdc512e0`](https://github.com/withastro/astro/commit/c081adf998d30419fed97d8fccc11340cdc512e0) Thanks [@StandardGage](https://github.com/StandardGage)! - Allows passing any props to the `` component + +- [#10102](https://github.com/withastro/astro/pull/10102) [`e3f02f5fb1cf0dae3c54beb3a4af3dbf3b06abb7`](https://github.com/withastro/astro/commit/e3f02f5fb1cf0dae3c54beb3a4af3dbf3b06abb7) Thanks [@bluwy](https://github.com/bluwy)! - Adds a new `experimental.directRenderScript` configuration option which provides a more reliable strategy to prevent scripts from being executed in pages where they are not used. + + This replaces the `experimental.optimizeHoistedScript` flag introduced in v2.10.4 to prevent unused components' scripts from being included in a page unexpectedly. That experimental option no longer exists and must be removed from your configuration, whether or not you enable `directRenderScript`: + + ```diff + // astro.config.mjs + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + experimental: { + - optimizeHoistedScript: true, + + directRenderScript: true + } + }); + ``` + + With `experimental.directRenderScript` configured, scripts are now directly rendered as declared in Astro files (including existing features like TypeScript, importing `node_modules`, and deduplicating scripts). You can also now conditionally render scripts in your Astro file. + + However, this means scripts are no longer hoisted to the `` and multiple scripts on a page are no longer bundled together. If you enable this option, you should check that all your ` + ``` + +- [#10145](https://github.com/withastro/astro/pull/10145) [`65692fa7b5f4440c644c8cf3dd9bc50103d2c33b`](https://github.com/withastro/astro/commit/65692fa7b5f4440c644c8cf3dd9bc50103d2c33b) Thanks [@alexanderniebuhr](https://github.com/alexanderniebuhr)! - Adds experimental JSON Schema support for content collections. + + This feature will auto-generate a JSON Schema for content collections of `type: 'data'` which can be used as the `$schema` value for TypeScript-style autocompletion/hints in tools like VSCode. + + To enable this feature, add the experimental flag: + + ```diff + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + experimental: { + + contentCollectionJsonSchema: true + } + }); + ``` + + This experimental implementation requires you to manually reference the schema in each data entry file of the collection: + + ```diff + // src/content/test/entry.json + { + + "$schema": "../../../.astro/collections/test.schema.json", + "test": "test" + } + ``` + + Alternatively, you can set this in your [VSCode `json.schemas` settings](https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings): + + ```diff + "json.schemas": [ + { + "fileMatch": [ + "/src/content/test/**" + ], + "url": "../../../.astro/collections/test.schema.json" + } + ] + ``` + + Note that this initial implementation uses a library with [known issues for advanced Zod schemas](https://github.com/StefanTerdell/zod-to-json-schema#known-issues), so you may wish to consult these limitations before enabling the experimental flag. + +- [#10130](https://github.com/withastro/astro/pull/10130) [`5a9528741fa98d017b269c7e4f013058028bdc5d`](https://github.com/withastro/astro/commit/5a9528741fa98d017b269c7e4f013058028bdc5d) Thanks [@bluwy](https://github.com/bluwy)! - Migrates `shikiji` to `shiki` 1.0 + +- [#10268](https://github.com/withastro/astro/pull/10268) [`2013e70bce16366781cc12e52823bb257fe460c0`](https://github.com/withastro/astro/commit/2013e70bce16366781cc12e52823bb257fe460c0) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for page mutations to the audits in the dev toolbar. Astro will now rerun the audits whenever elements are added or deleted from the page. + +- [#10217](https://github.com/withastro/astro/pull/10217) [`5c7862a9fe69954f8630538ebb7212cd04b8a810`](https://github.com/withastro/astro/commit/5c7862a9fe69954f8630538ebb7212cd04b8a810) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates the UI for dev toolbar audits with new information + +### Patch Changes + +- [#10360](https://github.com/withastro/astro/pull/10360) [`ac766647b0e6156b7c4a0bb9a11981fe168852d7`](https://github.com/withastro/astro/commit/ac766647b0e6156b7c4a0bb9a11981fe168852d7) Thanks [@nmattia](https://github.com/nmattia)! - Fixes an issue where some CLI commands attempted to directly read vite config files. + +- [#10291](https://github.com/withastro/astro/pull/10291) [`8107a2721b6abb07c3120ac90e03c39f2a44ab0c`](https://github.com/withastro/astro/commit/8107a2721b6abb07c3120ac90e03c39f2a44ab0c) Thanks [@bluwy](https://github.com/bluwy)! - Treeshakes unused Astro component scoped styles + +- [#10368](https://github.com/withastro/astro/pull/10368) [`78bafc5d661ff7dd071c241cb1303c4d8a774d21`](https://github.com/withastro/astro/commit/78bafc5d661ff7dd071c241cb1303c4d8a774d21) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates the base `tsconfig.json` preset with `jsx: 'preserve'` in order to fix errors when importing Astro files inside `.js` and `.ts` files. + +- Updated dependencies [[`c081adf998d30419fed97d8fccc11340cdc512e0`](https://github.com/withastro/astro/commit/c081adf998d30419fed97d8fccc11340cdc512e0), [`1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd`](https://github.com/withastro/astro/commit/1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd), [`5a9528741fa98d017b269c7e4f013058028bdc5d`](https://github.com/withastro/astro/commit/5a9528741fa98d017b269c7e4f013058028bdc5d), [`a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18`](https://github.com/withastro/astro/commit/a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18)]: + - @astrojs/markdown-remark@4.3.0 + - @astrojs/internal-helpers@0.3.0 + ## 4.4.15 ### Patch Changes diff --git a/packages/astro/package.json b/packages/astro/package.json index d34955b18439b..3673a95388ed5 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "4.4.15", + "version": "4.5.0", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts index bf0c61232f096..0e2d745ef57c5 100644 --- a/packages/astro/src/core/app/index.ts +++ b/packages/astro/src/core/app/index.ts @@ -1,5 +1,10 @@ +import type { + ComponentInstance, + ManifestData, + RouteData, + SSRManifest, +} from '../../@types/astro.js'; import { normalizeTheLocale } from '../../i18n/index.js'; -import type { ComponentInstance, ManifestData, RouteData, SSRManifest } from '../../@types/astro.js'; import type { SinglePageBuiltModule } from '../build/types.js'; import { DEFAULT_404_COMPONENT, @@ -23,9 +28,9 @@ import { import { RedirectSinglePageBuiltModule } from '../redirects/index.js'; import { RenderContext } from '../render-context.js'; import { createAssetLink } from '../render/ssr-element.js'; +import { ensure404Route } from '../routing/astro-designed-error-pages.js'; import { matchRoute } from '../routing/match.js'; import { AppPipeline } from './pipeline.js'; -import { ensure404Route } from '../routing/astro-designed-error-pages.js'; export { deserializeManifest } from './common.js'; export interface RenderOptions { @@ -479,9 +484,10 @@ export class App { async #getModuleForRoute(route: RouteData): Promise { if (route.component === DEFAULT_404_COMPONENT) { return { - page: async () => ({ default: () => new Response(null, { status: 404 }) }) as ComponentInstance, - renderers: [] - } + page: async () => + ({ default: () => new Response(null, { status: 404 }) }) as ComponentInstance, + renderers: [], + }; } if (route.type === 'redirect') { return RedirectSinglePageBuiltModule; diff --git a/packages/astro/src/core/render/params-and-props.ts b/packages/astro/src/core/render/params-and-props.ts index eeae1a9b45abf..fb02a997d78ff 100644 --- a/packages/astro/src/core/render/params-and-props.ts +++ b/packages/astro/src/core/render/params-and-props.ts @@ -25,7 +25,11 @@ export async function getProps(opts: GetParamsAndPropsOptions): Promise { return {}; } - if (routeIsRedirect(route) || routeIsFallback(route) || route.component === DEFAULT_404_COMPONENT) { + if ( + routeIsRedirect(route) || + routeIsFallback(route) || + route.component === DEFAULT_404_COMPONENT + ) { return {}; } diff --git a/packages/astro/src/core/routing/astro-designed-error-pages.ts b/packages/astro/src/core/routing/astro-designed-error-pages.ts index ac2b082740741..e3f2fd553866c 100644 --- a/packages/astro/src/core/routing/astro-designed-error-pages.ts +++ b/packages/astro/src/core/routing/astro-designed-error-pages.ts @@ -1,8 +1,8 @@ -import type { ManifestData } from "../../@types/astro.js"; -import { DEFAULT_404_COMPONENT } from "../constants.js"; +import type { ManifestData } from '../../@types/astro.js'; +import { DEFAULT_404_COMPONENT } from '../constants.js'; export function ensure404Route(manifest: ManifestData) { - if (!manifest.routes.some(route => route.route === '/404')) { + if (!manifest.routes.some((route) => route.route === '/404')) { manifest.routes.push({ component: DEFAULT_404_COMPONENT, generate: () => '', @@ -14,7 +14,7 @@ export function ensure404Route(manifest: ManifestData) { route: '/404', fallbackRoutes: [], isIndex: false, - }) + }); } return manifest; } diff --git a/packages/astro/src/runtime/server/render/astro/instance.ts b/packages/astro/src/runtime/server/render/astro/instance.ts index 2119823c4fa43..5f6b26c728aa1 100644 --- a/packages/astro/src/runtime/server/render/astro/instance.ts +++ b/packages/astro/src/runtime/server/render/astro/instance.ts @@ -57,7 +57,8 @@ export class AstroComponentInstance { await this.init(this.result); } - let value: Promise | AstroFactoryReturnValue | undefined = this.returnValue; + let value: Promise | AstroFactoryReturnValue | undefined = + this.returnValue; if (isPromise(value)) { value = await value; } diff --git a/packages/astro/src/vite-plugin-astro-server/pipeline.ts b/packages/astro/src/vite-plugin-astro-server/pipeline.ts index 157f0c603db88..0b7859846ee6a 100644 --- a/packages/astro/src/vite-plugin-astro-server/pipeline.ts +++ b/packages/astro/src/vite-plugin-astro-server/pipeline.ts @@ -22,8 +22,8 @@ import { PAGE_SCRIPT_ID } from '../vite-plugin-scripts/index.js'; import { getStylesForURL } from './css.js'; import { getComponentMetadata } from './metadata.js'; import { createResolve } from './resolve.js'; -import { getScriptsForURL } from './scripts.js'; import { default404Page } from './response.js'; +import { getScriptsForURL } from './scripts.js'; export class DevPipeline extends Pipeline { // renderers are loaded on every request, @@ -138,7 +138,7 @@ export class DevPipeline extends Pipeline { async preload(filePath: URL) { const { loader } = this; if (filePath.href === new URL(DEFAULT_404_COMPONENT, this.config.root).href) { - return { default: default404Page } as any as ComponentInstance + return { default: default404Page } as any as ComponentInstance; } // Important: This needs to happen first, in case a renderer provides polyfills. diff --git a/packages/astro/src/vite-plugin-astro-server/plugin.ts b/packages/astro/src/vite-plugin-astro-server/plugin.ts index be0f6a8ed92b5..b08bcb4ebd57f 100644 --- a/packages/astro/src/vite-plugin-astro-server/plugin.ts +++ b/packages/astro/src/vite-plugin-astro-server/plugin.ts @@ -9,6 +9,7 @@ import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { patchOverlay } from '../core/errors/overlay.js'; import type { Logger } from '../core/logger/core.js'; import { createViteLoader } from '../core/module-loader/index.js'; +import { ensure404Route } from '../core/routing/astro-designed-error-pages.js'; import { createRouteManifest } from '../core/routing/index.js'; import { toRoutingStrategy } from '../i18n/utils.js'; import { baseMiddleware } from './base.js'; @@ -17,7 +18,6 @@ import { recordServerError } from './error.js'; import { DevPipeline } from './pipeline.js'; import { handleRequest } from './request.js'; import { setRouteError } from './server-state.js'; -import { ensure404Route } from '../core/routing/astro-designed-error-pages.js'; export interface AstroPluginOptions { settings: AstroSettings; @@ -36,10 +36,12 @@ export default function createVitePluginAstroServer({ const loader = createViteLoader(viteServer); const manifest = createDevelopmentManifest(settings); const pipeline = DevPipeline.create({ loader, logger, manifest, settings }); - let manifestData: ManifestData = ensure404Route(createRouteManifest({ settings, fsMod }, logger)); + let manifestData: ManifestData = ensure404Route( + createRouteManifest({ settings, fsMod }, logger) + ); const controller = createController({ loader }); const localStorage = new AsyncLocalStorage(); - + /** rebuild the route cache + manifest, as needed. */ function rebuildManifest(needsManifestRebuild: boolean) { pipeline.clearRouteCache(); diff --git a/packages/astro/src/vite-plugin-astro-server/response.ts b/packages/astro/src/vite-plugin-astro-server/response.ts index 6dccc753f00e7..bdf0e3c151bba 100644 --- a/packages/astro/src/vite-plugin-astro-server/response.ts +++ b/packages/astro/src/vite-plugin-astro-server/response.ts @@ -23,15 +23,16 @@ export async function handle404Response( writeHtmlResponse(res, 404, html); } -export async function default404Page( - { pathname }: { pathname: string } -) { - return new Response(notFoundTemplate({ - statusCode: 404, - title: 'Not found', - tabTitle: '404: Not Found', - pathname, - }), { status: 404, headers: { 'Content-Type': 'text/html; charset=utf-8' } }); +export async function default404Page({ pathname }: { pathname: string }) { + return new Response( + notFoundTemplate({ + statusCode: 404, + title: 'Not found', + tabTitle: '404: Not Found', + pathname, + }), + { status: 404, headers: { 'Content-Type': 'text/html; charset=utf-8' } } + ); } // mark the function as an AstroComponentFactory for the rendering internals default404Page.isAstroComponentFactory = true; diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index a38130dcad17c..f10d9e1842ad4 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -1,6 +1,10 @@ import type http from 'node:http'; import type { ComponentInstance, ManifestData, RouteData } from '../@types/astro.js'; -import { DEFAULT_404_COMPONENT, REROUTE_DIRECTIVE_HEADER, clientLocalsSymbol } from '../core/constants.js'; +import { + DEFAULT_404_COMPONENT, + REROUTE_DIRECTIVE_HEADER, + clientLocalsSymbol, +} from '../core/constants.js'; import { AstroErrorData, isAstroError } from '../core/errors/index.js'; import { req } from '../core/messages.js'; import { loadMiddleware } from '../core/middleware/loadMiddleware.js'; @@ -94,18 +98,18 @@ export async function matchRoute( } const custom404 = getCustom404Route(manifestData); - + if (custom404 && custom404.component === DEFAULT_404_COMPONENT) { const component: ComponentInstance = { - default: default404Page - } + default: default404Page, + }; return { route: custom404, filePath: new URL(`file://${custom404.component}`), resolvedPathname: pathname, preloadedComponent: component, mod: component, - } + }; } if (custom404) { diff --git a/packages/astro/test/virtual-routes.test.js b/packages/astro/test/virtual-routes.test.js index 2c9286e8e2805..e0a64aefe6826 100644 --- a/packages/astro/test/virtual-routes.test.js +++ b/packages/astro/test/virtual-routes.test.js @@ -10,21 +10,21 @@ describe('virtual routes - dev', () => { fixture = await loadFixture({ root: './fixtures/virtual-routes/', }); - await fixture.build(); + await fixture.build(); }); - - it('should render a virtual route - dev', async () => { + + it('should render a virtual route - dev', async () => { const devServer = await fixture.startDevServer(); - const response = await fixture.fetch('/virtual'); - const html = await response.text(); - assert.equal(html.includes('Virtual!!'), true); + const response = await fixture.fetch('/virtual'); + const html = await response.text(); + assert.equal(html.includes('Virtual!!'), true); await devServer.stop(); - }); + }); - it('should render a virtual route - app', async () => { + it('should render a virtual route - app', async () => { const app = await fixture.loadTestAdapterApp(); - const response = await app.render(new Request('https://example.com/virtual')); - const html = await response.text(); - assert.equal(html.includes('Virtual!!'), true); - }); + const response = await app.render(new Request('https://example.com/virtual')); + const html = await response.text(); + assert.equal(html.includes('Virtual!!'), true); + }); }); diff --git a/packages/integrations/markdoc/CHANGELOG.md b/packages/integrations/markdoc/CHANGELOG.md index fcfb941e89768..a3451ebd6bbec 100644 --- a/packages/integrations/markdoc/CHANGELOG.md +++ b/packages/integrations/markdoc/CHANGELOG.md @@ -1,5 +1,12 @@ # @astrojs/markdoc +## 0.9.2 + +### Patch Changes + +- Updated dependencies [[`1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd`](https://github.com/withastro/astro/commit/1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd)]: + - @astrojs/internal-helpers@0.3.0 + ## 0.9.1 ### Patch Changes diff --git a/packages/integrations/markdoc/package.json b/packages/integrations/markdoc/package.json index 0d0917b58631b..2c91ef77ff4d6 100644 --- a/packages/integrations/markdoc/package.json +++ b/packages/integrations/markdoc/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/markdoc", "description": "Add support for Markdoc in your Astro site", - "version": "0.9.1", + "version": "0.9.2", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/mdx/CHANGELOG.md b/packages/integrations/mdx/CHANGELOG.md index f1da065f650ff..1a99e487d70c7 100644 --- a/packages/integrations/mdx/CHANGELOG.md +++ b/packages/integrations/mdx/CHANGELOG.md @@ -1,5 +1,23 @@ # @astrojs/mdx +## 2.2.0 + +### Minor Changes + +- [#10104](https://github.com/withastro/astro/pull/10104) [`a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18`](https://github.com/withastro/astro/commit/a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18) Thanks [@remcohaszing](https://github.com/remcohaszing)! - Changes Astro's internal syntax highlighting to use rehype plugins instead of remark plugins. This provides better interoperability with other [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) that deal with code blocks, in particular with third party syntax highlighting plugins and [`rehype-mermaid`](https://github.com/remcohaszing/rehype-mermaid). + + This may be a breaking change if you are currently using: + + - a remark plugin that relies on nodes of type `html` + - a rehype plugin that depends on nodes of type `raw`. + + Please review your rendered code samples carefully, and if necessary, consider using a rehype plugin that deals with the generated `element` nodes instead. You can transform the AST of raw HTML strings, or alternatively use [`hast-util-to-html`](https://github.com/syntax-tree/hast-util-to-html) to get a string from a `raw` node. + +### Patch Changes + +- Updated dependencies [[`c081adf998d30419fed97d8fccc11340cdc512e0`](https://github.com/withastro/astro/commit/c081adf998d30419fed97d8fccc11340cdc512e0), [`5a9528741fa98d017b269c7e4f013058028bdc5d`](https://github.com/withastro/astro/commit/5a9528741fa98d017b269c7e4f013058028bdc5d), [`a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18`](https://github.com/withastro/astro/commit/a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18)]: + - @astrojs/markdown-remark@4.3.0 + ## 2.1.1 ### Patch Changes diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index 26491a071fece..0433e6bbcb28a 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/mdx", "description": "Add support for MDX pages in your Astro site", - "version": "2.1.1", + "version": "2.2.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/react/CHANGELOG.md b/packages/integrations/react/CHANGELOG.md index 599ea231dd94b..eb1d9f7235cab 100644 --- a/packages/integrations/react/CHANGELOG.md +++ b/packages/integrations/react/CHANGELOG.md @@ -1,5 +1,31 @@ # @astrojs/react +## 3.1.0 + +### Minor Changes + +- [#10136](https://github.com/withastro/astro/pull/10136) [`9cd84bd19b92fb43ae48809f575ee12ebd43ea8f`](https://github.com/withastro/astro/commit/9cd84bd19b92fb43ae48809f575ee12ebd43ea8f) Thanks [@matthewp](https://github.com/matthewp)! - Changes the default behavior of `transition:persist` to update the props of persisted islands upon navigation. Also adds a new view transitions option `transition:persist-props` (default: `false`) to prevent props from updating as needed. + + Islands which have the `transition:persist` property to keep their state when using the `` router will now have their props updated upon navigation. This is useful in cases where the component relies on page-specific props, such as the current page title, which should update upon navigation. + + For example, the component below is set to persist across navigation. This component receives a `products` props and might have some internal state, such as which filters are applied: + + ```astro + + ``` + + Upon navigation, this component persists, but the desired `products` might change, for example if you are visiting a category of products, or you are performing a search. + + Previously the props would not change on navigation, and your island would have to handle updating them externally, such as with API calls. + + With this change the props are now updated, while still preserving state. + + You can override this new default behavior on a per-component basis using `transition:persist-props=true` to persist both props and state during navigation: + + ```astro + + ``` + ## 3.0.10 ### Patch Changes diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json index da59c319773b0..6d89ff7f5592a 100644 --- a/packages/integrations/react/package.json +++ b/packages/integrations/react/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/react", "description": "Use React components within Astro", - "version": "3.0.10", + "version": "3.1.0", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/integrations/vercel/CHANGELOG.md b/packages/integrations/vercel/CHANGELOG.md index 1cace44fad110..8bcca58cb1e2b 100644 --- a/packages/integrations/vercel/CHANGELOG.md +++ b/packages/integrations/vercel/CHANGELOG.md @@ -1,5 +1,12 @@ # @astrojs/vercel +## 7.3.6 + +### Patch Changes + +- Updated dependencies [[`1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd`](https://github.com/withastro/astro/commit/1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd)]: + - @astrojs/internal-helpers@0.3.0 + ## 7.3.5 ### Patch Changes diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index 61af57e2c9918..f2ab0f818afab 100644 --- a/packages/integrations/vercel/package.json +++ b/packages/integrations/vercel/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/vercel", "description": "Deploy your site to Vercel", - "version": "7.3.5", + "version": "7.3.6", "type": "module", "author": "withastro", "license": "MIT", diff --git a/packages/internal-helpers/CHANGELOG.md b/packages/internal-helpers/CHANGELOG.md index 0bcb50284360a..8169ed1f84deb 100644 --- a/packages/internal-helpers/CHANGELOG.md +++ b/packages/internal-helpers/CHANGELOG.md @@ -1,5 +1,31 @@ # @astrojs/internal-helpers +## 0.3.0 + +### Minor Changes + +- [#10189](https://github.com/withastro/astro/pull/10189) [`1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd`](https://github.com/withastro/astro/commit/1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd) Thanks [@peng](https://github.com/peng)! - Adds the option to pass an object to `build.assetsPrefix`. This allows for the use of multiple CDN prefixes based on the target file type. + + When passing an object to `build.assetsPrefix`, you must also specify a `fallback` domain to be used for all other file types not specified. + + Specify a file extension as the key (e.g. 'js', 'png') and the URL serving your assets of that file type as the value: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + build: { + assetsPrefix: { + js: 'https://js.cdn.example.com', + mjs: 'https://js.cdn.example.com', // if you have .mjs files, you must add a new entry like this + png: 'https://images.cdn.example.com', + fallback: 'https://generic.cdn.example.com', + }, + }, + }); + ``` + ## 0.2.1 ### Patch Changes diff --git a/packages/internal-helpers/package.json b/packages/internal-helpers/package.json index 650665bfe5fc3..9d69e0cd9754d 100644 --- a/packages/internal-helpers/package.json +++ b/packages/internal-helpers/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/internal-helpers", "description": "Internal helpers used by core Astro packages.", - "version": "0.2.1", + "version": "0.3.0", "type": "module", "author": "withastro", "license": "MIT", diff --git a/packages/markdown/remark/CHANGELOG.md b/packages/markdown/remark/CHANGELOG.md index 550830e081ce4..a005bb4abf998 100644 --- a/packages/markdown/remark/CHANGELOG.md +++ b/packages/markdown/remark/CHANGELOG.md @@ -1,5 +1,22 @@ # @astrojs/markdown-remark +## 4.3.0 + +### Minor Changes + +- [#9960](https://github.com/withastro/astro/pull/9960) [`c081adf998d30419fed97d8fccc11340cdc512e0`](https://github.com/withastro/astro/commit/c081adf998d30419fed97d8fccc11340cdc512e0) Thanks [@StandardGage](https://github.com/StandardGage)! - Allows passing any props to the `` component + +- [#10130](https://github.com/withastro/astro/pull/10130) [`5a9528741fa98d017b269c7e4f013058028bdc5d`](https://github.com/withastro/astro/commit/5a9528741fa98d017b269c7e4f013058028bdc5d) Thanks [@bluwy](https://github.com/bluwy)! - Migrates `shikiji` to `shiki` 1.0 + +- [#10104](https://github.com/withastro/astro/pull/10104) [`a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18`](https://github.com/withastro/astro/commit/a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18) Thanks [@remcohaszing](https://github.com/remcohaszing)! - Changes Astro's internal syntax highlighting to use rehype plugins instead of remark plugins. This provides better interoperability with other [rehype plugins](https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins) that deal with code blocks, in particular with third party syntax highlighting plugins and [`rehype-mermaid`](https://github.com/remcohaszing/rehype-mermaid). + + This may be a breaking change if you are currently using: + + - a remark plugin that relies on nodes of type `html` + - a rehype plugin that depends on nodes of type `raw`. + + Please review your rendered code samples carefully, and if necessary, consider using a rehype plugin that deals with the generated `element` nodes instead. You can transform the AST of raw HTML strings, or alternatively use [`hast-util-to-html`](https://github.com/syntax-tree/hast-util-to-html) to get a string from a `raw` node. + ## 4.2.1 ### Patch Changes diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index 3e07f49d15d9a..afa2d881f9e2d 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/markdown-remark", - "version": "4.2.1", + "version": "4.3.0", "type": "module", "author": "withastro", "license": "MIT", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f9f8f4904b868..09a318477f4f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -134,13 +134,13 @@ importers: examples/basics: dependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/blog: dependencies: '@astrojs/mdx': - specifier: ^2.1.1 + specifier: ^2.2.0 version: link:../../packages/integrations/mdx '@astrojs/rss': specifier: ^4.0.5 @@ -149,13 +149,13 @@ importers: specifier: ^3.1.1 version: link:../../packages/integrations/sitemap astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/framework-alpine: @@ -170,7 +170,7 @@ importers: specifier: ^3.13.3 version: 3.13.3 astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/framework-lit: @@ -182,7 +182,7 @@ importers: specifier: ^0.2.1 version: 0.2.1 astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro lit: specifier: ^3.1.2 @@ -194,7 +194,7 @@ importers: specifier: ^3.1.1 version: link:../../packages/integrations/preact '@astrojs/react': - specifier: ^3.0.10 + specifier: ^3.1.0 version: link:../../packages/integrations/react '@astrojs/solid-js': specifier: ^4.0.1 @@ -206,7 +206,7 @@ importers: specifier: ^4.0.8 version: link:../../packages/integrations/vue astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -236,7 +236,7 @@ importers: specifier: ^1.2.1 version: 1.2.1(preact@10.19.3) astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -245,7 +245,7 @@ importers: examples/framework-react: dependencies: '@astrojs/react': - specifier: ^3.0.10 + specifier: ^3.1.0 version: link:../../packages/integrations/react '@types/react': specifier: ^18.2.37 @@ -254,7 +254,7 @@ importers: specifier: ^18.2.15 version: 18.2.18 astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro react: specifier: ^18.2.0 @@ -269,7 +269,7 @@ importers: specifier: ^4.0.1 version: link:../../packages/integrations/solid astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro solid-js: specifier: ^1.8.5 @@ -281,7 +281,7 @@ importers: specifier: ^5.2.0 version: link:../../packages/integrations/svelte astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -293,7 +293,7 @@ importers: specifier: ^4.0.8 version: link:../../packages/integrations/vue astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro vue: specifier: ^3.3.8 @@ -305,13 +305,13 @@ importers: specifier: ^8.2.3 version: link:../../packages/integrations/node astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/middleware: @@ -320,7 +320,7 @@ importers: specifier: ^8.2.3 version: link:../../packages/integrations/node astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -333,19 +333,19 @@ importers: examples/minimal: dependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/ssr: @@ -357,7 +357,7 @@ importers: specifier: ^5.2.0 version: link:../../packages/integrations/svelte astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -366,7 +366,7 @@ importers: examples/starlog: dependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro sass: specifier: ^1.69.5 @@ -384,25 +384,25 @@ importers: specifier: ^5.1.0 version: link:../../packages/integrations/tailwind astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/with-markdoc: dependencies: '@astrojs/markdoc': - specifier: ^0.9.1 + specifier: ^0.9.2 version: link:../../packages/integrations/markdoc astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/with-markdown-plugins: dependencies: '@astrojs/markdown-remark': - specifier: ^4.2.1 + specifier: ^4.3.0 version: link:../../packages/markdown/remark astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro hast-util-select: specifier: ^6.0.2 @@ -423,19 +423,19 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro examples/with-mdx: dependencies: '@astrojs/mdx': - specifier: ^2.1.1 + specifier: ^2.2.0 version: link:../../packages/integrations/mdx '@astrojs/preact': specifier: ^3.1.1 version: link:../../packages/integrations/preact astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -450,7 +450,7 @@ importers: specifier: ^0.5.0 version: 0.5.0(nanostores@0.9.5)(preact@10.19.3) astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro nanostores: specifier: ^0.9.5 @@ -462,7 +462,7 @@ importers: examples/with-tailwindcss: dependencies: '@astrojs/mdx': - specifier: ^2.1.1 + specifier: ^2.2.0 version: link:../../packages/integrations/mdx '@astrojs/tailwind': specifier: ^5.1.0 @@ -471,7 +471,7 @@ importers: specifier: ^1.6.3 version: 1.6.4 astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro autoprefixer: specifier: ^10.4.15 @@ -489,7 +489,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^4.4.15 + specifier: ^4.5.0 version: link:../../packages/astro vitest: specifier: ^1.3.1