diff --git a/.changeset/hot-buckets-tie.md b/.changeset/hot-buckets-tie.md deleted file mode 100644 index 2870b31f5781..000000000000 --- a/.changeset/hot-buckets-tie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fix SharedImageService's types not properly reflecting that image services hooks can be async diff --git a/.changeset/khaki-chicken-pay.md b/.changeset/khaki-chicken-pay.md new file mode 100644 index 000000000000..02b8ca56d1f8 --- /dev/null +++ b/.changeset/khaki-chicken-pay.md @@ -0,0 +1,5 @@ +--- +'@astrojs/deno': minor +--- + +Update build target for Deno to esnext to allow supported language features on the runtime. diff --git a/.changeset/orange-badgers-fly.md b/.changeset/orange-badgers-fly.md deleted file mode 100644 index e9f997ec304c..000000000000 --- a/.changeset/orange-badgers-fly.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fix missing `referrerpolicy` on ScriptHTMLAttributes diff --git a/examples/basics/package.json b/examples/basics/package.json index 43fc7bb5f010..6065c20bec10 100644 --- a/examples/basics/package.json +++ b/examples/basics/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/blog/package.json b/examples/blog/package.json index 008b6663cd6f..4aa69b5c72fa 100644 --- a/examples/blog/package.json +++ b/examples/blog/package.json @@ -14,6 +14,6 @@ "@astrojs/mdx": "^0.19.7", "@astrojs/rss": "^2.4.3", "@astrojs/sitemap": "^2.0.1", - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/component/package.json b/examples/component/package.json index c41259384855..1c2f4ebb4dc3 100644 --- a/examples/component/package.json +++ b/examples/component/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^2.9.1" + "astro": "^2.9.2" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/deno/package.json b/examples/deno/package.json index 15bc06ae0518..67acfe62b50b 100644 --- a/examples/deno/package.json +++ b/examples/deno/package.json @@ -10,7 +10,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.9.1" + "astro": "^2.9.2" }, "devDependencies": { "@astrojs/deno": "^4.2.0" diff --git a/examples/framework-alpine/package.json b/examples/framework-alpine/package.json index 51c1b691d200..ac7f4d137f65 100644 --- a/examples/framework-alpine/package.json +++ b/examples/framework-alpine/package.json @@ -14,6 +14,6 @@ "@astrojs/alpinejs": "^0.2.2", "@types/alpinejs": "^3.7.1", "alpinejs": "^3.12.2", - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/framework-lit/package.json b/examples/framework-lit/package.json index bb73d8a645a6..3a2451116800 100644 --- a/examples/framework-lit/package.json +++ b/examples/framework-lit/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/lit": "^2.1.0", "@webcomponents/template-shadowroot": "^0.2.1", - "astro": "^2.9.1", + "astro": "^2.9.2", "lit": "^2.7.5" } } diff --git a/examples/framework-multiple/package.json b/examples/framework-multiple/package.json index 2428f65729cc..ebc45cddf478 100644 --- a/examples/framework-multiple/package.json +++ b/examples/framework-multiple/package.json @@ -16,7 +16,7 @@ "@astrojs/solid-js": "^2.2.0", "@astrojs/svelte": "^3.1.0", "@astrojs/vue": "^2.2.1", - "astro": "^2.9.1", + "astro": "^2.9.2", "preact": "^10.15.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/examples/framework-preact/package.json b/examples/framework-preact/package.json index cf874835a964..ca6f77dfd4d3 100644 --- a/examples/framework-preact/package.json +++ b/examples/framework-preact/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^2.2.1", "@preact/signals": "^1.1.3", - "astro": "^2.9.1", + "astro": "^2.9.2", "preact": "^10.15.1" } } diff --git a/examples/framework-react/package.json b/examples/framework-react/package.json index d4c040eeb536..b53bae808f6d 100644 --- a/examples/framework-react/package.json +++ b/examples/framework-react/package.json @@ -14,7 +14,7 @@ "@astrojs/react": "^2.2.1", "@types/react": "^18.2.13", "@types/react-dom": "^18.2.6", - "astro": "^2.9.1", + "astro": "^2.9.2", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/examples/framework-solid/package.json b/examples/framework-solid/package.json index 6f885273adde..2cc61ca7bd47 100644 --- a/examples/framework-solid/package.json +++ b/examples/framework-solid/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/solid-js": "^2.2.0", - "astro": "^2.9.1", + "astro": "^2.9.2", "solid-js": "^1.7.6" } } diff --git a/examples/framework-svelte/package.json b/examples/framework-svelte/package.json index 2a1e752c7918..195b47d39bef 100644 --- a/examples/framework-svelte/package.json +++ b/examples/framework-svelte/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/svelte": "^3.1.0", - "astro": "^2.9.1", + "astro": "^2.9.2", "svelte": "^3.59.1" } } diff --git a/examples/framework-vue/package.json b/examples/framework-vue/package.json index 80918e394b4a..b1cba96753f0 100644 --- a/examples/framework-vue/package.json +++ b/examples/framework-vue/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/vue": "^2.2.1", - "astro": "^2.9.1", + "astro": "^2.9.2", "vue": "^3.3.4" } } diff --git a/examples/hackernews/package.json b/examples/hackernews/package.json index cb584d8a1e46..b7c21742aa0a 100644 --- a/examples/hackernews/package.json +++ b/examples/hackernews/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/node": "^5.3.0", - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/integration/package.json b/examples/integration/package.json index deed3c5220dd..c7b879180063 100644 --- a/examples/integration/package.json +++ b/examples/integration/package.json @@ -15,7 +15,7 @@ ], "scripts": {}, "devDependencies": { - "astro": "^2.9.1" + "astro": "^2.9.2" }, "peerDependencies": { "astro": "^2.0.0-beta.0" diff --git a/examples/middleware/package.json b/examples/middleware/package.json index 4ad90afe7e81..625adf313265 100644 --- a/examples/middleware/package.json +++ b/examples/middleware/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@astrojs/node": "^5.3.0", - "astro": "^2.9.1", + "astro": "^2.9.2", "html-minifier": "^4.0.0" } } diff --git a/examples/minimal/package.json b/examples/minimal/package.json index ed4b0cfae424..33af4e6d1f12 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/non-html-pages/package.json b/examples/non-html-pages/package.json index fad73249ec8d..9dedeb75912a 100644 --- a/examples/non-html-pages/package.json +++ b/examples/non-html-pages/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/portfolio/package.json b/examples/portfolio/package.json index 8e4a3cfca52d..83199dcf3eb0 100644 --- a/examples/portfolio/package.json +++ b/examples/portfolio/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/ssr/package.json b/examples/ssr/package.json index bc2f89d4dd45..17e893fa75cb 100644 --- a/examples/ssr/package.json +++ b/examples/ssr/package.json @@ -14,7 +14,7 @@ "dependencies": { "@astrojs/node": "^5.3.0", "@astrojs/svelte": "^3.1.0", - "astro": "^2.9.1", + "astro": "^2.9.2", "svelte": "^3.59.1" } } diff --git a/examples/with-markdoc/package.json b/examples/with-markdoc/package.json index 3408b4169ae2..99dc7c01597d 100644 --- a/examples/with-markdoc/package.json +++ b/examples/with-markdoc/package.json @@ -12,6 +12,6 @@ }, "dependencies": { "@astrojs/markdoc": "^0.4.3", - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/with-markdown-plugins/package.json b/examples/with-markdown-plugins/package.json index fdaf2eeb918f..409ca0fd8f04 100644 --- a/examples/with-markdown-plugins/package.json +++ b/examples/with-markdown-plugins/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@astrojs/markdown-remark": "^2.2.1", - "astro": "^2.9.1", + "astro": "^2.9.2", "hast-util-select": "^5.0.5", "rehype-autolink-headings": "^6.1.1", "rehype-slug": "^5.1.0", diff --git a/examples/with-markdown-shiki/package.json b/examples/with-markdown-shiki/package.json index 0e1077a4c6ca..ab1a75225d03 100644 --- a/examples/with-markdown-shiki/package.json +++ b/examples/with-markdown-shiki/package.json @@ -11,6 +11,6 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.9.1" + "astro": "^2.9.2" } } diff --git a/examples/with-mdx/package.json b/examples/with-mdx/package.json index 6021881aa447..fb20d3fce29a 100644 --- a/examples/with-mdx/package.json +++ b/examples/with-mdx/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/mdx": "^0.19.7", "@astrojs/preact": "^2.2.1", - "astro": "^2.9.1", + "astro": "^2.9.2", "preact": "^10.15.1" } } diff --git a/examples/with-nanostores/package.json b/examples/with-nanostores/package.json index 9ba4b9a21a71..5b8813581872 100644 --- a/examples/with-nanostores/package.json +++ b/examples/with-nanostores/package.json @@ -13,7 +13,7 @@ "dependencies": { "@astrojs/preact": "^2.2.1", "@nanostores/preact": "^0.4.1", - "astro": "^2.9.1", + "astro": "^2.9.2", "nanostores": "^0.8.1", "preact": "^10.15.1" } diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index bbeda345067a..4967f9bd13c3 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -14,7 +14,7 @@ "@astrojs/mdx": "^0.19.7", "@astrojs/tailwind": "^4.0.0", "@types/canvas-confetti": "^1.6.0", - "astro": "^2.9.1", + "astro": "^2.9.2", "autoprefixer": "^10.4.14", "canvas-confetti": "^1.6.0", "postcss": "^8.4.24", diff --git a/examples/with-vite-plugin-pwa/package.json b/examples/with-vite-plugin-pwa/package.json index 78500a405954..43c4a910e0f9 100644 --- a/examples/with-vite-plugin-pwa/package.json +++ b/examples/with-vite-plugin-pwa/package.json @@ -11,7 +11,7 @@ "astro": "astro" }, "dependencies": { - "astro": "^2.9.1", + "astro": "^2.9.2", "vite-plugin-pwa": "0.14.7", "workbox-window": "^6.6.0" } diff --git a/examples/with-vitest/package.json b/examples/with-vitest/package.json index 99b6037ca01a..8bbfbae991b2 100644 --- a/examples/with-vitest/package.json +++ b/examples/with-vitest/package.json @@ -12,7 +12,7 @@ "test": "vitest" }, "dependencies": { - "astro": "^2.9.1", + "astro": "^2.9.2", "vitest": "^0.31.4" } } diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index c788638c98bc..6a5401f9f930 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -1,5 +1,17 @@ # astro +## 2.9.2 + +### Patch Changes + +- [#7777](https://github.com/withastro/astro/pull/7777) [`3567afac4`](https://github.com/withastro/astro/commit/3567afac4411c1054a5e999dd692e6d079825b4a) Thanks [@bluwy](https://github.com/bluwy)! - Fix rendering TextEncoder encoding error regression + +- [#7759](https://github.com/withastro/astro/pull/7759) [`1792737da`](https://github.com/withastro/astro/commit/1792737dae1b24e3d678f8c4780f3cd17710944f) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix SharedImageService's types not properly reflecting that image services hooks can be async + +- [#7766](https://github.com/withastro/astro/pull/7766) [`da7f1128b`](https://github.com/withastro/astro/commit/da7f1128bf749dab1d9bd43e50c29a67e8271746) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fix missing `referrerpolicy` on ScriptHTMLAttributes + +- [#7746](https://github.com/withastro/astro/pull/7746) [`0c9959704`](https://github.com/withastro/astro/commit/0c9959704fff703417eb4602965c668c7f7a3001) Thanks [@birkskyum](https://github.com/birkskyum)! - Update Vite to 4.4 + ## 2.9.1 ### Patch Changes diff --git a/packages/astro/e2e/fixtures/solid-circular/src/components/ContextProvider.tsx b/packages/astro/e2e/fixtures/solid-circular/src/components/ContextProvider.tsx index 191a4cf8c7ce..6e206eccb8a1 100644 --- a/packages/astro/e2e/fixtures/solid-circular/src/components/ContextProvider.tsx +++ b/packages/astro/e2e/fixtures/solid-circular/src/components/ContextProvider.tsx @@ -1,4 +1,5 @@ -import { Component, createContext } from 'solid-js'; +import { createContext } from 'solid-js'; +import type {Component} from 'solid-js'; import { SimpleDiv } from './SimpleDiv'; export const ApplicationContext = createContext([{ lng: 'en' }, {}]); diff --git a/packages/astro/e2e/fixtures/solid-circular/src/components/SimpleDiv.tsx b/packages/astro/e2e/fixtures/solid-circular/src/components/SimpleDiv.tsx index 0607149c4eeb..0e3c4878a628 100644 --- a/packages/astro/e2e/fixtures/solid-circular/src/components/SimpleDiv.tsx +++ b/packages/astro/e2e/fixtures/solid-circular/src/components/SimpleDiv.tsx @@ -1,4 +1,5 @@ -import { Component, useContext } from 'solid-js'; +import { useContext } from 'solid-js'; +import type {Component} from 'solid-js'; import { ApplicationContext } from './ContextProvider'; export const SimpleDiv: Component = () => { diff --git a/packages/astro/package.json b/packages/astro/package.json index 0aeccdcfe4d6..b6651a013858 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -1,6 +1,6 @@ { "name": "astro", - "version": "2.9.1", + "version": "2.9.2", "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.", "type": "module", "author": "withastro", @@ -168,7 +168,7 @@ "typescript": "*", "unist-util-visit": "^4.1.2", "vfile": "^5.3.7", - "vite": "^4.3.9", + "vite": "^4.4.6", "vitefu": "^0.2.4", "which-pm": "^2.0.0", "yargs-parser": "^21.1.1", diff --git a/packages/astro/src/runtime/server/render/common.ts b/packages/astro/src/runtime/server/render/common.ts index b2d41bd54bfe..206f138cc8b2 100644 --- a/packages/astro/src/runtime/server/render/common.ts +++ b/packages/astro/src/runtime/server/render/common.ts @@ -124,7 +124,8 @@ export function chunkToByteArray( if (ArrayBuffer.isView(chunk)) { return chunk as Uint8Array; } else { - // stringify chunk might return a HTMLString - return encoder.encode(stringifyChunk(result, chunk)); + // `stringifyChunk` might return a HTMLString, call `.toString()` to really ensure it's a string + const stringified = stringifyChunk(result, chunk); + return encoder.encode(stringified.toString()); } } diff --git a/packages/astro/src/vite-plugin-astro/compile.ts b/packages/astro/src/vite-plugin-astro/compile.ts index 0013676157b5..b8704c81b4e6 100644 --- a/packages/astro/src/vite-plugin-astro/compile.ts +++ b/packages/astro/src/vite-plugin-astro/compile.ts @@ -41,7 +41,6 @@ export async function cachedFullCompilation({ tsconfigRaw: { compilerOptions: { // Ensure client:only imports are treeshaken - // @ts-expect-error anticipate esbuild 0.18 feature verbatimModuleSyntax: false, importsNotUsedAsValues: 'remove', }, diff --git a/packages/astro/src/vite-plugin-jsx/index.ts b/packages/astro/src/vite-plugin-jsx/index.ts index eb5ea7631986..7aa7e7b1642b 100644 --- a/packages/astro/src/vite-plugin-jsx/index.ts +++ b/packages/astro/src/vite-plugin-jsx/index.ts @@ -160,7 +160,6 @@ export default function jsx({ settings, logging }: AstroPluginJSXOptions): Plugi tsconfigRaw: { compilerOptions: { // Ensure client:only imports are treeshaken - // @ts-expect-error anticipate esbuild 0.18 feature verbatimModuleSyntax: false, importsNotUsedAsValues: 'remove', }, diff --git a/packages/astro/test/ssr-prerender-get-static-paths.test.js b/packages/astro/test/ssr-prerender-get-static-paths.test.js index 08e3060f05c4..391e7485dd85 100644 --- a/packages/astro/test/ssr-prerender-get-static-paths.test.js +++ b/packages/astro/test/ssr-prerender-get-static-paths.test.js @@ -59,7 +59,11 @@ describe('Prerender', () => { await devServer.stop(); }); - it('only calls prerender getStaticPaths once', async () => { + it('only calls prerender getStaticPaths once', async function () { + // Sometimes this fail in CI as the chokidar watcher triggers an update and invalidates the route cache, + // causing getStaticPaths to be called twice. Workaround this with 2 retries for now. + this.retries(2); + let res = await fixture.fetch('/blog/a'); expect(res.status).to.equal(200); diff --git a/packages/integrations/cloudflare/package.json b/packages/integrations/cloudflare/package.json index 279b84c1d678..7e42c84557db 100644 --- a/packages/integrations/cloudflare/package.json +++ b/packages/integrations/cloudflare/package.json @@ -45,7 +45,7 @@ "tiny-glob": "^0.2.9" }, "peerDependencies": { - "astro": "workspace:^2.9.1" + "astro": "workspace:^2.9.2" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/deno/package.json b/packages/integrations/deno/package.json index bcea3045589e..522862a73d42 100644 --- a/packages/integrations/deno/package.json +++ b/packages/integrations/deno/package.json @@ -36,7 +36,7 @@ "esbuild": "^0.15.18" }, "peerDependencies": { - "astro": "workspace:^2.9.1" + "astro": "workspace:^2.9.2" }, "devDependencies": { "astro": "workspace:*", diff --git a/packages/integrations/deno/src/index.ts b/packages/integrations/deno/src/index.ts index 986449b18700..db645eb697d1 100644 --- a/packages/integrations/deno/src/index.ts +++ b/packages/integrations/deno/src/index.ts @@ -168,7 +168,7 @@ export default function createIntegration(args?: Options): AstroIntegration { const pth = fileURLToPath(entryUrl); await esbuild.build({ - target: 'es2020', + target: 'esnext', platform: 'browser', entryPoints: [pth], outfile: pth, diff --git a/packages/integrations/deno/test/basics.test.ts b/packages/integrations/deno/test/basics.test.ts index 5d3f116ddf1d..cdb0c616e212 100644 --- a/packages/integrations/deno/test/basics.test.ts +++ b/packages/integrations/deno/test/basics.test.ts @@ -67,6 +67,15 @@ Deno.test({ assertEquals(p!.innerText, varContent); }); + await t.step('Can use a module with top-level await', async () => { + const resp = await fetch(app.url); + const html = await resp.text(); + + const doc = new DOMParser().parseFromString(html, `text/html`); + const p = doc!.querySelector('p#module-value'); + assertEquals(p!.innerText, 'bar'); + }); + await t.step('Works with Markdown', async () => { const resp = await fetch(new URL('markdown', app.url)); const html = await resp.text(); diff --git a/packages/integrations/deno/test/fixtures/basics/src/pages/index.astro b/packages/integrations/deno/test/fixtures/basics/src/pages/index.astro index 29fce0190ea1..650f60062aba 100644 --- a/packages/integrations/deno/test/fixtures/basics/src/pages/index.astro +++ b/packages/integrations/deno/test/fixtures/basics/src/pages/index.astro @@ -1,4 +1,5 @@ --- +import { someData } from '../util/data'; import ReactComponent from '../components/React.jsx'; const envValue = import.meta.env.SOME_VARIABLE; --- @@ -10,6 +11,7 @@ const envValue = import.meta.env.SOME_VARIABLE;
{envValue}
+{someData.foo}