Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #23

Merged
merged 5 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/hot-buckets-tie.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/khaki-chicken-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/deno': minor
---

Update build target for Deno to esnext to allow supported language features on the runtime.
5 changes: 0 additions & 5 deletions .changeset/orange-badgers-fly.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.9.1"
"astro": "^2.9.2"
}
}
2 changes: 1 addition & 1 deletion examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^2.9.1"
"astro": "^2.9.2"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.9.1"
"astro": "^2.9.2"
},
"devDependencies": {
"@astrojs/deno": "^4.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-alpine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/framework-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/framework-multiple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/framework-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/framework-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/solid-js": "^2.2.0",
"astro": "^2.9.1",
"astro": "^2.9.2",
"solid-js": "^1.7.6"
}
}
2 changes: 1 addition & 1 deletion examples/framework-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/svelte": "^3.1.0",
"astro": "^2.9.1",
"astro": "^2.9.2",
"svelte": "^3.59.1"
}
}
2 changes: 1 addition & 1 deletion examples/framework-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/vue": "^2.2.1",
"astro": "^2.9.1",
"astro": "^2.9.2",
"vue": "^3.3.4"
}
}
2 changes: 1 addition & 1 deletion examples/hackernews/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/node": "^5.3.0",
"astro": "^2.9.1"
"astro": "^2.9.2"
}
}
2 changes: 1 addition & 1 deletion examples/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"scripts": {},
"devDependencies": {
"astro": "^2.9.1"
"astro": "^2.9.2"
},
"peerDependencies": {
"astro": "^2.0.0-beta.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/node": "^5.3.0",
"astro": "^2.9.1",
"astro": "^2.9.2",
"html-minifier": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.9.1"
"astro": "^2.9.2"
}
}
2 changes: 1 addition & 1 deletion examples/non-html-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.9.1"
"astro": "^2.9.2"
}
}
2 changes: 1 addition & 1 deletion examples/portfolio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.9.1"
"astro": "^2.9.2"
}
}
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"@astrojs/markdoc": "^0.4.3",
"astro": "^2.9.1"
"astro": "^2.9.2"
}
}
2 changes: 1 addition & 1 deletion examples/with-markdown-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-markdown-shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"astro": "astro"
},
"dependencies": {
"astro": "^2.9.1"
"astro": "^2.9.2"
}
}
2 changes: 1 addition & 1 deletion examples/with-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion examples/with-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vite-plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "vitest"
},
"dependencies": {
"astro": "^2.9.1",
"astro": "^2.9.2",
"vitest": "^0.31.4"
}
}
12 changes: 12 additions & 0 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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' }, {}]);
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions packages/astro/src/runtime/server/render/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
1 change: 0 additions & 1 deletion packages/astro/src/vite-plugin-astro/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/vite-plugin-jsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
6 changes: 5 additions & 1 deletion packages/astro/test/ssr-prerender-get-static-paths.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"tiny-glob": "^0.2.9"
},
"peerDependencies": {
"astro": "workspace:^2.9.1"
"astro": "workspace:^2.9.2"
},
"devDependencies": {
"astro": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"esbuild": "^0.15.18"
},
"peerDependencies": {
"astro": "workspace:^2.9.1"
"astro": "workspace:^2.9.2"
},
"devDependencies": {
"astro": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions packages/integrations/deno/test/basics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import { someData } from '../util/data';
import ReactComponent from '../components/React.jsx';
const envValue = import.meta.env.SOME_VARIABLE;
---
Expand All @@ -10,6 +11,7 @@ const envValue = import.meta.env.SOME_VARIABLE;
<body>
<h1>Basic App on Deno</h1>
<p id="env-value">{envValue}</p>
<p id="module-value">{someData.foo}</p>
<ReactComponent />
</body>
</html>
Loading