diff --git a/.changeset/brown-pets-clean.md b/.changeset/brown-pets-clean.md deleted file mode 100644 index 28cc4e98f5f8..000000000000 --- 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 8cb125d60ee7..000000000000 --- 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 3aa3ab5f0c7f..000000000000 --- 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/rotten-snakes-sip.md b/.changeset/rotten-snakes-sip.md deleted file mode 100644 index 294efd246daa..000000000000 --- a/.changeset/rotten-snakes-sip.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@astrojs/db": patch ---- - -Handle new schema API response format diff --git a/.changeset/slimy-avocados-sniff.md b/.changeset/slimy-avocados-sniff.md deleted file mode 100644 index 3cf85cd928be..000000000000 --- 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 0095974f6037..000000000000 --- 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 a018fd10f268..000000000000 --- 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 6d57166c12b9..000000000000 --- 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 beb330146021..000000000000 --- 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 ef9d3b5f9e03..000000000000 --- 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 0f3d0cbb2742..cbe2449c17b9 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 cc079bda391e..c8ccc99a1076 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 31dca9ecd0f3..922f3b047061 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 ec27e2973e45..dbb126883bf0 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 cc8f560dc69a..a0bdf01cd5f8 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 f2cbe95012cc..f207b9c0cad2 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 a28f3be95a76..a7e4eef2080f 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 99e914c14d40..8f5fe6a26e80 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 91b628994830..56432600236e 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 7a8109ee15a6..311fa4e40beb 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 5d9e1f274219..89ea16fb4d42 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 89930a13a8f8..8db1aba17ad3 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 0a0310ed797c..7e6b9d06c9c4 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 d4f7fa7f16be..d6bee1615752 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 419180170a53..7220c194c82b 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 cf25b8dc723c..b7ac752bc03e 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 3c9f4766f598..0ccdee3c81e0 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 ea5d05ff0a77..13e75fc005e3 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 d46d9729e0ab..a629a6460ed1 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 58c63411d983..5ac9ce8f41b0 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 16e5a5ecaf76..5c8f50c3a1f9 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 72438c077091..489eeef24a88 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 1069689aeb81..f229570120d6 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 17a8a433ba5e..04f80dfc4a96 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 337d0a67554e..d1497452500e 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 fcc6729db657..297bee91c895 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 5841c328fbd0..0e1ce0c11bb5 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 c041b15c2d76..56862626e819 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 d34955b18439..3673a95388ed 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/db/CHANGELOG.md b/packages/db/CHANGELOG.md index 8c257069ce68..3dcc37f8f4ee 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/db +## 0.7.1 + +### Patch Changes + +- [#10378](https://github.com/withastro/astro/pull/10378) [`41dca1e413c2f1e38f0326bd6241ccbf9b8ee0e4`](https://github.com/withastro/astro/commit/41dca1e413c2f1e38f0326bd6241ccbf9b8ee0e4) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Handle new schema API response format + ## 0.7.0 ### Minor Changes diff --git a/packages/db/package.json b/packages/db/package.json index 1b2fcd9001d4..86bc82cdf04d 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/db", - "version": "0.7.0", + "version": "0.7.1", "description": "", "license": "MIT", "type": "module", diff --git a/packages/integrations/markdoc/CHANGELOG.md b/packages/integrations/markdoc/CHANGELOG.md index fcfb941e8976..a3451ebd6bbe 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 0d0917b58631..2c91ef77ff4d 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 f1da065f650f..1a99e487d70c 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 26491a071fec..0433e6bbcb28 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 599ea231dd94..eb1d9f7235ca 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 da59c319773b..6d89ff7f5592 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 1cace44fad11..8bcca58cb1e2 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 61af57e2c991..f2ab0f818afa 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 0bcb50284360..8169ed1f84de 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 650665bfe5fc..9d69e0cd9754 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 550830e081ce..a005bb4abf99 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 3e07f49d15d9..afa2d881f9e2 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 f9f8f4904b86..09a318477f4f 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