diff --git a/content/articles/2026/08/09.md b/content/articles/2026/08/09.md new file mode 100644 index 000000000..b5fe9aa98 --- /dev/null +++ b/content/articles/2026/08/09.md @@ -0,0 +1,99 @@ +--- +title: 2026/08/03〜2026/08/09の最新情報 +tags: + - Deno +categories: + - news +date: 2026-08-09 +description: > + Deno v2.9.5 (QuickJSバックエンド, `deno add --unscoped`, `deno task --members`, `Response#textStream()`/`Request#textStream()`/`Blob#textStream()`が実装, `node:test` - `tags`オプションがサポート, `node:v8` - `promiseHooks`が実装, `fetch()` - リダイレクト時のセキュリティ改善、など) +--- + +## Deno v2.9.5 + +[Deno v2.9.5](https://github.com/denoland/deno/releases/tag/v2.9.5)がリリースされています。 + +### QuickJSバックエンド + +QuickJSバックエンドの実験的実装が追加されています ([#36194](https://github.com/denoland/deno/pull/36194)) + +`deno compile`及び[`deno desktop`]({{< ref "articles/deno/v2.9.md" >}})コマンドに`--engine`オプションが追加されており、`--engine=quickjs`を指定すると、DenoがQuickJSランタイムを自動でダウンロードした上で、そのQuickJSランタイムをベースに実行可能ファイルを生成してくれます。 + +```bash +$ deno compile --engine quickjs main.js +``` + +公式ドキュメントも公開されています。 + +- [docs: document deno compile --engine quickjs (denoland/docs#3439)](https://github.com/denoland/docs/pull/3439) + +### `deno add` + +`--unscoped`オプションが追加されています ([#36319](https://github.com/denoland/deno/pull/36319))。スコープ付きパッケージをインストールする際にこのオプションを指定すると、`deno.json`にはスコープを取り除いた状態でそのパッケージに関するマッピングが追加されます。 + +```shell +$ deno add --unscoped jsr:@david/dax +$ cat deno.json | jq .imports.dax +"jsr:@david/dax@^0.49.0" +``` + +### `deno task` + +`--members`オプションが追加されています ([#35748](https://github.com/denoland/deno/pull/35748))。ワークスペースの各メンバーにおける指定したタスクを一括で実行することができます。`--recursive`や`--filter`オプションとの違いとして、ワークスペースルートのタスクの実行はスキップされます。 + +### `deno fmt` + +`deno fmt -`においてXMLとSVGのフォーマットがサポートされています ([#36149](https://github.com/denoland/deno/pull/36149))。`--ext`オプションに`xml`または`svg`を指定できます。 + +```shell +$ cat file.xml | deno fmt --ext=xml - +``` + +### Web API + +#### `textStream()` + +`Response#textStream()`/`Request#textStream()`/`Blob#textStream()`が実装されています ([#35616](https://github.com/denoland/deno/pull/35616)) + +```javascript +const stream = (await fetch(import.meta.url)).textStream(); +assert(stream instanceof ReadableStream); +let content = ""; +for await (const x of stream) { + assert(typeof x === "string"); + content += x; +} +console.info(content); +``` + +### Node.js互換性の改善 + +#### `node:test` + +`describe()`や`it()`などに対する`tags`の指定がサポートされています ([#36292](https://github.com/denoland/deno/pull/36292)) + +#### `node:v8` + +`promiseHooks` APIが実装されています ([#36281](https://github.com/denoland/deno/pull/36281)) + +#### `node:util` + +`diff()`が実装されています ([#36289](https://github.com/denoland/deno/pull/36289)) + +#### `node:fs` + +`writeFile()`/`appendFile()`/`createWriteStream()`の`flush`オプションがサポートされています ([#36290](https://github.com/denoland/deno/pull/36290)) + +### セキュリティ + +#### `fetch()` + +リダイレクトが発生した際に、リダイレクト元とリダイレクト先のOriginが異なる場合、リダイレクト先へのリクエストに対して`Authorization`や`Cookie`などのヘッダーが送信されないように挙動が修正されています ([#36361](https://github.com/denoland/deno/pull/36361)) + +#### `node:dns` + +`getServers()`が`--allow-sys=networkInterfaces`を要求するように挙動が変更されています ([#35941](https://github.com/denoland/deno/pull/35941)) + +#### `node:process` + +`constrainedMemory()`が`sys=systemMemoryInfo`パーミッションを要求するように挙動が変更されています ([#36218](https://github.com/denoland/deno/pull/36218))