diff --git a/.changeset/big-shirts-travel.md b/.changeset/big-shirts-travel.md new file mode 100644 index 000000000000..2adfa3e4e6e4 --- /dev/null +++ b/.changeset/big-shirts-travel.md @@ -0,0 +1,5 @@ +--- +'@astrojs/svelte': patch +--- + +When using Svelte 5, slots can now be rendered as snippets diff --git a/.changeset/gorgeous-buttons-remember.md b/.changeset/gorgeous-buttons-remember.md new file mode 100644 index 000000000000..46a6059499c4 --- /dev/null +++ b/.changeset/gorgeous-buttons-remember.md @@ -0,0 +1,5 @@ +--- +'@astrojs/markdown-remark': patch +--- + +Fixes an issue where this package could not be installed alongside Astro 4.0. diff --git a/.changeset/neat-peaches-mate.md b/.changeset/neat-peaches-mate.md new file mode 100644 index 000000000000..f39840afde37 --- /dev/null +++ b/.changeset/neat-peaches-mate.md @@ -0,0 +1,8 @@ +--- +'@astrojs/svelte': patch +'@astrojs/node': patch +'@astrojs/mdx': patch +'@astrojs/vue': patch +--- + +Updates NPM package to refer to the stable Astro version instead of a beta. diff --git a/.changeset/strange-parrots-promise.md b/.changeset/strange-parrots-promise.md deleted file mode 100644 index 584d911eea0b..000000000000 --- a/.changeset/strange-parrots-promise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixed the log message to correctly display 'enabled' and 'disabled' when toggling 'Disable notifications' in the Toolbar. diff --git a/.changeset/young-spoons-rescue.md b/.changeset/young-spoons-rescue.md new file mode 100644 index 000000000000..6fbeded05974 --- /dev/null +++ b/.changeset/young-spoons-rescue.md @@ -0,0 +1,5 @@ +--- +'@astrojs/vercel': patch +--- + +Allows the edge middleware to be an async function. diff --git a/examples/basics/package.json b/examples/basics/package.json index 462235462498..d33671b1fb9f 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 3ece054ce403..0c42df70d5fb 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -12,8 +12,8 @@ }, "dependencies": { "@astrojs/mdx": "^2.0.0", - "@astrojs/rss": "^4.0.0", + "@astrojs/rss": "^4.0.1", "@astrojs/sitemap": "^3.0.3", - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/component/package.json b/examples/component/package.json index 9cac9645df69..3a72bb72e0bb 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.0.2" + "astro": "^4.0.3" }, "peerDependencies": { "astro": "^3.0.0" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index f9fc290954ba..d37a79bc0e55 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.3.1", "@types/alpinejs": "^3.13.5", "alpinejs": "^3.13.3", - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index 72a5bd0c45aa..96593eb37f47 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^3.0.3", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^4.0.2", + "astro": "^4.0.3", "lit": "^2.8.0" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index d83833e59bec..498b56f78207 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -16,7 +16,7 @@ "@astrojs/solid-js": "^3.0.2", "@astrojs/svelte": "^5.0.0", "@astrojs/vue": "^4.0.2", - "astro": "^4.0.2", + "astro": "^4.0.3", "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 08c3d7d875e1..5ed6833731ec 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.0.1", "@preact/signals": "^1.2.1", - "astro": "^4.0.2", + "astro": "^4.0.3", "preact": "^10.19.2" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index 6256dcb6b779..1732ec7906c4 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -14,7 +14,7 @@ "@astrojs/react": "^3.0.7", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", - "astro": "^4.0.2", + "astro": "^4.0.3", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 34d8bc50f6ba..709d10f81572 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^3.0.2", - "astro": "^4.0.2", + "astro": "^4.0.3", "solid-js": "^1.8.5" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index a9406838c3cf..c99ea913456f 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^5.0.0", - "astro": "^4.0.2", + "astro": "^4.0.3", "svelte": "^4.2.5" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index f7a42cd42bf5..3a4480862d1b 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^4.0.2", - "astro": "^4.0.2", + "astro": "^4.0.3", "vue": "^3.3.8" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index ca4ab4ef6030..28a3310acbcf 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^7.0.0", - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index 3708dfac7306..a92a888b46e6 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^4.0.2" + "astro": "^4.0.3" }, "peerDependencies": { "astro": "^3.0.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index 9f6393538781..9af03a263845 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^7.0.0", - "astro": "^4.0.2", + "astro": "^4.0.3", "html-minifier": "^4.0.0" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 7f37079799a5..4e4fb33d36ea 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index e7c51ad9cdbf..52b4c9fc71e2 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index c8b9e51946f3..01d5effb6220 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index f7af576ce892..5c6c5c20f62d 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -14,7 +14,7 @@ "dependencies": { "@astrojs/node": "^7.0.0", "@astrojs/svelte": "^5.0.0", - "astro": "^4.0.2", + "astro": "^4.0.3", "svelte": "^4.2.5" } } diff --git a/examples/view-transitions/package.json b/examples/view-transitions/package.json index 4e2839596e52..bb19a4f032a8 100644 --- a/examples/view-transitions/package.json +++ b/examples/view-transitions/package.json @@ -12,6 +12,6 @@ "devDependencies": { "@astrojs/tailwind": "^5.0.3", "@astrojs/node": "^7.0.0", - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 58f640c801e6..4d63d789ce6b 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^0.8.0", - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index 1dbbd8eda8bc..bd86abdde00d 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdown-remark": "^4.0.0", - "astro": "^4.0.2", + "astro": "^4.0.3", "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 b7c646508f27..56de8c8716ef 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^4.0.2" + "astro": "^4.0.3" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 67b1428e4e12..b0e08746819f 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/mdx": "^2.0.0", "@astrojs/preact": "^3.0.1", - "astro": "^4.0.2", + "astro": "^4.0.3", "preact": "^10.19.2" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 586b36bd8b6a..66bd31e66dff 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^3.0.1", "@nanostores/preact": "^0.5.0", - "astro": "^4.0.2", + "astro": "^4.0.3", "nanostores": "^0.9.5", "preact": "^10.19.2" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index f76fccaacb19..c62ad3343514 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -14,7 +14,7 @@ "@astrojs/mdx": "^2.0.0", "@astrojs/tailwind": "^5.0.3", "@types/canvas-confetti": "^1.6.3", - "astro": "^4.0.2", + "astro": "^4.0.3", "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 838d13d2e65a..54f7fdf99720 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^4.0.2", + "astro": "^4.0.3", "vitest": "^0.34.2" } } diff --git a/packages/astro-rss/CHANGELOG.md b/packages/astro-rss/CHANGELOG.md index 89179a9a7026..df205874890d 100644 --- a/packages/astro-rss/CHANGELOG.md +++ b/packages/astro-rss/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/rss +## 4.0.1 + +### Patch Changes + +- [#9299](https://github.com/withastro/astro/pull/9299) [`edfae50e6`](https://github.com/withastro/astro/commit/edfae50e6ea494f49c6d4fbf4bd4481870f994b1) Thanks [@cdvillard](https://github.com/cdvillard)! - Improves the `@astrojs/rss` error message thrown when the object passed to the `items` property is missing any of the three required keys or if one of those keys is mistyped. + ## 4.0.0 ### Major Changes diff --git a/packages/astro-rss/package.json b/packages/astro-rss/package.json index 9c9adb849903..c262452daf0b 100644 --- a/packages/astro-rss/package.json +++ b/packages/astro-rss/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/rss", "description": "Add RSS feeds to your Astro projects", - "version": "4.0.0", + "version": "4.0.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts index 48c5defe855c..c8cf19d6022e 100644 --- a/packages/astro-rss/src/index.ts +++ b/packages/astro-rss/src/index.ts @@ -109,9 +109,21 @@ async function validateRssOptions(rssOptions: RSSOptions) { const formattedError = new Error( [ `[RSS] Invalid or missing options:`, - ...parsedResult.error.errors.map( - (zodError) => `${zodError.message} (${zodError.path.join('.')})` - ), + ...parsedResult.error.errors.map((zodError) => { + const path = zodError.path.join('.'); + const message = `${zodError.message} (${path})`; + const code = zodError.code; + + if (path === 'items' && code === 'invalid_union') { + return [ + message, + `The \`items\` property requires properly typed \`title\`, \`pubDate\`, and \`link\` keys.`, + `Check your collection's schema, and visit https://docs.astro.build/en/guides/rss/#generating-items for more info.`, + ].join('\n'); + } + + return message; + }), ].join('\n') ); throw formattedError; diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index 5076fc126336..da96a03cb6be 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,17 @@ # astro +## 4.0.3 + +### Patch Changes + +- [#9342](https://github.com/withastro/astro/pull/9342) [`eb942942d`](https://github.com/withastro/astro/commit/eb942942d67508c07d7efaa859a7840f7c0223da) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix missing `is:inline` type for the `` element + +- [#9343](https://github.com/withastro/astro/pull/9343) [`ab0281aee`](https://github.com/withastro/astro/commit/ab0281aee419e58c6079ca393987fe1ff0541dd5) Thanks [@martrapp](https://github.com/martrapp)! - Adds source file properties to HTML elements only if devToolbar is enabled + +- [#9336](https://github.com/withastro/astro/pull/9336) [`c76901065`](https://github.com/withastro/astro/commit/c76901065545f6a8d3de3e44d1c8ee5456a8a77a) Thanks [@FredKSchott](https://github.com/FredKSchott)! - dev: fix issue where 404 and 500 responses were logged as 200 + +- [#9339](https://github.com/withastro/astro/pull/9339) [`0bb3d5322`](https://github.com/withastro/astro/commit/0bb3d532219fb90fc08bfb472fc981fab6543d16) Thanks [@morinokami](https://github.com/morinokami)! - Fixed the log message to correctly display 'enabled' and 'disabled' when toggling 'Disable notifications' in the Toolbar. + ## 4.0.2 ### Patch Changes diff --git a/packages/astro/astro-jsx.d.ts b/packages/astro/astro-jsx.d.ts index 3e8a86889282..3f73bcc613ee 100644 --- a/packages/astro/astro-jsx.d.ts +++ b/packages/astro/astro-jsx.d.ts @@ -36,6 +36,7 @@ declare namespace astroHTML.JSX { AstroDefineVarsAttribute; type AstroStyleAttributes = import('./dist/@types/astro.js').AstroStyleAttributes & AstroDefineVarsAttribute; + type AstroSlotAttributes = import('./dist/@types/astro.js').AstroSlotAttributes; // This is an unfortunate use of `any`, but unfortunately we can't make a type that works for every framework // without importing every single framework's types (which comes with its own set of problems). @@ -1415,7 +1416,7 @@ declare namespace astroHTML.JSX { ruby: HTMLAttributes; s: HTMLAttributes; samp: HTMLAttributes; - slot: SlotHTMLAttributes; + slot: SlotHTMLAttributes & AstroSlotAttributes; script: ScriptHTMLAttributes & AstroScriptAttributes; section: HTMLAttributes; select: SelectHTMLAttributes; diff --git a/packages/astro/package.json b/packages/astro/package.json index bfa7c54fdf04..c7dd43ae3d1f 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "4.0.2", + "version": "4.0.3", "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/@types/astro.ts b/packages/astro/src/@types/astro.ts index bbea8202523e..fa8c33920ac0 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -132,6 +132,10 @@ export interface AstroScriptAttributes { 'is:inline'?: boolean; } +export interface AstroSlotAttributes { + 'is:inline'?: boolean; +} + export interface AstroComponentMetadata { displayName: string; hydrate?: 'load' | 'idle' | 'visible' | 'media' | 'only'; diff --git a/packages/astro/src/core/compile/compile.ts b/packages/astro/src/core/compile/compile.ts index c2f58fb9f859..97625f021a55 100644 --- a/packages/astro/src/core/compile/compile.ts +++ b/packages/astro/src/core/compile/compile.ts @@ -10,10 +10,12 @@ import { AggregateError, CompilerError } from '../errors/errors.js'; import { AstroErrorData } from '../errors/index.js'; import { resolvePath } from '../util.js'; import { createStylePreprocessor } from './style.js'; +import type { AstroPreferences } from '../../preferences/index.js'; export interface CompileProps { astroConfig: AstroConfig; viteConfig: ResolvedConfig; + preferences: AstroPreferences; filename: string; source: string; } @@ -26,6 +28,7 @@ export interface CompileResult extends TransformResult { export async function compile({ astroConfig, viteConfig, + preferences, filename, source, }: CompileProps): Promise { @@ -48,7 +51,10 @@ export async function compile({ resultScopedSlot: true, transitionsAnimationURL: 'astro/components/viewtransitions.css', annotateSourceFile: - viteConfig.command === 'serve' && astroConfig.devToolbar && astroConfig.devToolbar.enabled, + viteConfig.command === 'serve' && + astroConfig.devToolbar && + astroConfig.devToolbar.enabled && + (await preferences.get('devToolbar.enabled')), preprocessStyle: createStylePreprocessor({ filename, viteConfig, diff --git a/packages/astro/src/core/messages.ts b/packages/astro/src/core/messages.ts index ebac2c51d611..b105e985cb05 100644 --- a/packages/astro/src/core/messages.ts +++ b/packages/astro/src/core/messages.ts @@ -37,7 +37,7 @@ export function req({ method?: string; reqTime?: number; }): string { - const color = statusCode >= 400 ? red : statusCode >= 300 ? yellow : blue; + const color = statusCode >= 500 ? red : statusCode >= 300 ? yellow : blue; return ( color(`[${statusCode}]`) + ` ` + diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index 92a7a8247a35..3196b951a796 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -332,7 +332,7 @@ export async function handleRoute({ req({ url: pathname, method: incomingRequest.method, - statusCode: response.status, + statusCode: status ?? response.status, reqTime: timeEnd - timeStart, }) ); @@ -356,24 +356,23 @@ export async function handleRoute({ } if (route.type === 'endpoint') { await writeWebResponse(incomingResponse, response); - } else { - if ( - // We are in a recursion, and it's possible that this function is called itself with a status code - // By default, the status code passed via parameters is computed by the matched route. - // - // By default, we should give priority to the status code passed, although it's possible that - // the `Response` emitted by the user is a redirect. If so, then return the returned response. - response.status < 400 && - response.status >= 300 - ) { - await writeSSRResult(request, response, incomingResponse); - return; - } else if (status && response.status !== status && (status === 404 || status === 500)) { - // Response.status is read-only, so a clone is required to override - response = new Response(response.body, { ...response, status }); - } + return; + } + // We are in a recursion, and it's possible that this function is called itself with a status code + // By default, the status code passed via parameters is computed by the matched route. + // + // By default, we should give priority to the status code passed, although it's possible that + // the `Response` emitted by the user is a redirect. If so, then return the returned response. + if (response.status < 400 && response.status >= 300) { await writeSSRResult(request, response, incomingResponse); + return; + } + // Apply the `status` override to the response object before responding. + // Response.status is read-only, so a clone is required to override. + if (status && response.status !== status && (status === 404 || status === 500)) { + response = new Response(response.body, { ...response, status }); } + await writeSSRResult(request, response, incomingResponse); } interface GetScriptsAndStylesParams { diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index 2aa6236ffe95..d02d78d6ae6a 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -139,6 +139,7 @@ export default function astro({ settings, logger }: AstroPluginOptions): vite.Pl const compileProps: CompileProps = { astroConfig: config, viteConfig: resolvedConfig, + preferences: settings.preferences, filename: normalizePath(parsedId.filename), source, }; @@ -179,6 +180,7 @@ export default function astro({ settings, logger }: AstroPluginOptions): vite.Pl cachedCompilation({ astroConfig: config, viteConfig: resolvedConfig, + preferences: settings.preferences, filename, source, }); diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index 45a47ae6cafe..4ebd6d9bc670 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -51,7 +51,7 @@ "vfile": "^6.0.1" }, "peerDependencies": { - "astro": "^4.0.0-beta.0" + "astro": "^4.0.0" }, "devDependencies": { "@types/chai": "^4.3.10", diff --git a/packages/integrations/node/package.json b/packages/integrations/node/package.json index c75b7a622273..7ae3b46bf1c4 100644 --- a/packages/integrations/node/package.json +++ b/packages/integrations/node/package.json @@ -37,7 +37,7 @@ "server-destroy": "^1.0.1" }, "peerDependencies": { - "astro": "^4.0.0-beta.0" + "astro": "^4.0.0" }, "devDependencies": { "@types/node": "^18.17.8", diff --git a/packages/integrations/svelte/client-v5.js b/packages/integrations/svelte/client-v5.js index b3d2e1964eb8..eaa06974c242 100644 --- a/packages/integrations/svelte/client-v5.js +++ b/packages/integrations/svelte/client-v5.js @@ -1,4 +1,8 @@ import { mount } from 'svelte'; +import { add_snippet_symbol } from 'svelte/internal'; + +// Allow a slot to be rendered as a snippet (dev validation only) +const tagSlotAsSnippet = import.meta.env.DEV ? add_snippet_symbol : (s) => s; export default (element) => { return async (Component, props, slotted) => { @@ -32,7 +36,7 @@ function createSlotDefinition(key, children) { /** * @param {Comment} $$anchor A comment node for slots in Svelte 5 */ - return ($$anchor, _$$slotProps) => { + const fn = ($$anchor, _$$slotProps) => { const parent = $$anchor.parentNode; const el = document.createElement('div'); el.innerHTML = `${children}`; parent.insertBefore(el.children[0], $$anchor); }; + return tagSlotAsSnippet(fn); } diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index 1dfec1977f83..e755bddeb91a 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -52,7 +52,7 @@ "vite": "^5.0.0" }, "peerDependencies": { - "astro": "^4.0.0-beta.0", + "astro": "^4.0.0", "svelte": "^4.0.0 || ^5.0.0-next.1" }, "engines": { diff --git a/packages/integrations/svelte/server-v5.js b/packages/integrations/svelte/server-v5.js index 105b843fb1bf..e1d246ff4e26 100644 --- a/packages/integrations/svelte/server-v5.js +++ b/packages/integrations/svelte/server-v5.js @@ -1,4 +1,8 @@ import { render } from 'svelte/server'; +import { add_snippet_symbol } from 'svelte/internal'; + +// Allow a slot to be rendered as a snippet (dev validation only) +const tagSlotAsSnippet = import.meta.env.DEV ? add_snippet_symbol : (s) => s; function check(Component) { // Svelte 5 generated components always accept these two props @@ -18,10 +22,10 @@ async function renderToStaticMarkup(Component, props, slotted, metadata) { let $$slots = undefined; for (const [key, value] of Object.entries(slotted)) { if (key === 'default') { - children = () => `<${tagName}>${value}`; + children = tagSlotAsSnippet(() => `<${tagName}>${value}`); } else { $$slots ??= {}; - $$slots[key] = () => `<${tagName} name="${key}">${value}`; + $$slots[key] = tagSlotAsSnippet(() => `<${tagName} name="${key}">${value}`); } } diff --git a/packages/integrations/vercel/CHANGELOG.md b/packages/integrations/vercel/CHANGELOG.md index aaec3b144866..abb304360da0 100644 --- a/packages/integrations/vercel/CHANGELOG.md +++ b/packages/integrations/vercel/CHANGELOG.md @@ -1,5 +1,11 @@ # @astrojs/vercel +## 6.0.1 + +### Patch Changes + +- [#9348](https://github.com/withastro/astro/pull/9348) [`1685cc42b`](https://github.com/withastro/astro/commit/1685cc42b51603eb98b5ba3e072cf2d3953339f2) Thanks [@matthewp](https://github.com/matthewp)! - Uses the latest astro as the peerDependency + ## 6.0.0 ### Major Changes diff --git a/packages/integrations/vercel/package.json b/packages/integrations/vercel/package.json index 730020c04762..db1b63a900e2 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": "6.0.0", + "version": "6.0.1", "type": "module", "author": "withastro", "license": "MIT", @@ -59,7 +59,7 @@ "web-vitals": "^3.4.0" }, "peerDependencies": { - "astro": "^4.0.0-beta.0" + "astro": "^4.0.2" }, "devDependencies": { "@types/set-cookie-parser": "^2.4.6", diff --git a/packages/integrations/vercel/src/serverless/middleware.ts b/packages/integrations/vercel/src/serverless/middleware.ts index a2e44722b20d..b3ada80d15bf 100644 --- a/packages/integrations/vercel/src/serverless/middleware.ts +++ b/packages/integrations/vercel/src/serverless/middleware.ts @@ -53,7 +53,7 @@ function edgeMiddlewareTemplate(middlewarePath: string, vercelEdgeMiddlewareHand if (existsSync(filePathEdgeMiddleware + '.js') || existsSync(filePathEdgeMiddleware + '.ts')) { const stringified = JSON.stringify(filePathEdgeMiddleware.replace(/\\/g, '/')); handlerTemplateImport = `import handler from ${stringified}`; - handlerTemplateCall = `handler({ request, context })`; + handlerTemplateCall = `await handler({ request, context })`; } else { } return ` diff --git a/packages/integrations/vue/package.json b/packages/integrations/vue/package.json index 9ed3417f64e8..1226795896fb 100644 --- a/packages/integrations/vue/package.json +++ b/packages/integrations/vue/package.json @@ -57,7 +57,7 @@ "vue": "^3.3.8" }, "peerDependencies": { - "astro": "^4.0.0-beta.0", + "astro": "^4.0.0", "vue": "^3.2.30" }, "engines": { diff --git a/packages/markdown/remark/package.json b/packages/markdown/remark/package.json index 05d55e0dbfe2..7cb9bbb64c81 100644 --- a/packages/markdown/remark/package.json +++ b/packages/markdown/remark/package.json @@ -27,9 +27,6 @@ "dev": "astro-scripts dev \"src/**/*.ts\"", "test": "mocha --exit --timeout 20000" }, - "peerDependencies": { - "astro": "^4.0.0-beta.0" - }, "dependencies": { "@astrojs/prism": "^3.0.0", "github-slugger": "^2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1dfa0f263c7d..9b42c6504f62 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -125,7 +125,7 @@ importers: examples/basics: dependencies: astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/blog: @@ -134,19 +134,19 @@ importers: specifier: ^2.0.0 version: link:../../packages/integrations/mdx '@astrojs/rss': - specifier: ^4.0.0 + specifier: ^4.0.1 version: link:../../packages/astro-rss '@astrojs/sitemap': specifier: ^3.0.3 version: link:../../packages/integrations/sitemap astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/component: devDependencies: astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/framework-alpine: @@ -161,7 +161,7 @@ importers: specifier: ^3.13.3 version: 3.13.3 astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/framework-lit: @@ -173,7 +173,7 @@ importers: specifier: ^0.2.1 version: 0.2.1 astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro lit: specifier: ^2.8.0 @@ -197,7 +197,7 @@ importers: specifier: ^4.0.2 version: link:../../packages/integrations/vue astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -227,7 +227,7 @@ importers: specifier: ^1.2.1 version: 1.2.1(preact@10.19.2) astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -245,7 +245,7 @@ importers: specifier: ^18.2.15 version: 18.2.15 astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro react: specifier: ^18.2.0 @@ -260,7 +260,7 @@ importers: specifier: ^3.0.2 version: link:../../packages/integrations/solid astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro solid-js: specifier: ^1.8.5 @@ -272,7 +272,7 @@ importers: specifier: ^5.0.0 version: link:../../packages/integrations/svelte astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -284,7 +284,7 @@ importers: specifier: ^4.0.2 version: link:../../packages/integrations/vue astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro vue: specifier: ^3.3.8 @@ -296,13 +296,13 @@ importers: specifier: ^7.0.0 version: link:../../packages/integrations/node astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/integration: devDependencies: astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/middleware: @@ -311,7 +311,7 @@ importers: specifier: ^7.0.0 version: link:../../packages/integrations/node astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro html-minifier: specifier: ^4.0.0 @@ -320,19 +320,19 @@ importers: examples/minimal: dependencies: astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/non-html-pages: dependencies: astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/portfolio: dependencies: astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/ssr: @@ -344,7 +344,7 @@ importers: specifier: ^5.0.0 version: link:../../packages/integrations/svelte astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro svelte: specifier: ^4.2.5 @@ -359,7 +359,7 @@ importers: specifier: ^5.0.3 version: link:../../packages/integrations/tailwind astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/with-markdoc: @@ -368,7 +368,7 @@ importers: specifier: ^0.8.0 version: link:../../packages/integrations/markdoc astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/with-markdown-plugins: @@ -377,7 +377,7 @@ importers: specifier: ^4.0.0 version: link:../../packages/markdown/remark astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro hast-util-select: specifier: ^6.0.2 @@ -398,7 +398,7 @@ importers: examples/with-markdown-shiki: dependencies: astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro examples/with-mdx: @@ -410,7 +410,7 @@ importers: specifier: ^3.0.1 version: link:../../packages/integrations/preact astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro preact: specifier: ^10.19.2 @@ -425,7 +425,7 @@ importers: specifier: ^0.5.0 version: 0.5.0(nanostores@0.9.5)(preact@10.19.2) astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro nanostores: specifier: ^0.9.5 @@ -446,7 +446,7 @@ importers: specifier: ^1.6.3 version: 1.6.3 astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro autoprefixer: specifier: ^10.4.15 @@ -464,7 +464,7 @@ importers: examples/with-vitest: dependencies: astro: - specifier: ^4.0.2 + specifier: ^4.0.3 version: link:../../packages/astro vitest: specifier: ^0.34.2