Skip to content

Commit

Permalink
docs: add articles/2024/12/01 (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
uki00a authored Dec 1, 2024
1 parent 9faf5dd commit afd217a
Showing 1 changed file with 294 additions and 0 deletions.
294 changes: 294 additions & 0 deletions content/articles/2024/12/01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
---
title: 2024/11/25〜2024/12/01の最新情報
tags:
- Deno
- deno_std
- Bun
- deno_lint
- Prisma
categories:
- news
date: 2024-12-01
description: >
Deno v2.1.2 (WASMモジュールから提供される関数以外の要素の読み込みがサポート, deno checkで@importがサポート, TypeScriptのresolution-modeがサポート, SQLファイルに対するdeno fmt --checkが常に失敗する問題が修正, deno init --npmでscopedパッケージがサポート, deno lsp - import宣言の補完時にWASMモジュールが候補として含まれるよう改善, deno publishで`bun:`URLがサポート, OpenTelemetry向けにDeno.serveとfetch APIで計装が実施, `--unstable-detect-cjs`が再導入), @std/[email protected] (promptSelectが実装), @std/[email protected] (pax形式のアーカイブを展開できない問題の修正), deno lintへのJSX関連のルールの追加について, Prisma v6 (Deno v2との互換性が改善), SimpleWebAuthn v12 (JSRパッケージが公開)
---

## Deno v2.1.2

[Deno v2.1.2](https://github.com/denoland/deno/releases/tag/v2.1.2)がリリースされています。

### WASMモジュール

`.wasm`モジュールから提供される関数以外の要素の読み込みがサポートされています。

---

- [fix: support non-function exports in Wasm modules #26992](https://github.com/denoland/deno/pull/26992)

### TypeScript

#### `deno check`コマンドでJSDocの`@import`タグがサポート

`.js`ファイルにおける`@import`タグによる型チェックがサポートされています。

---

- [fix(check): support jsdoc `@import` tag #26991](https://github.com/denoland/deno/pull/26991)

#### `resolution-mode`属性のサポート

TypeScriptの[`resolution-mode`属性](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html#stable-support-resolution-mode-in-import-types)のサポートが追加されています。

---

- [fix(node): correct resolution of dynamic import of esm from cjs #27071](https://github.com/denoland/deno/pull/27071)

### `deno fmt --check` - `.sql`ファイルに対してエラーが発生する問題の修正

[`.sql`ファイル]({{< ref "articles/deno/v2.1.md" >}})に対して`deno fmt --check`を実行すると、常にエラーが発生する問題が修正されています。

---

- [fix(fmt): Return None if sql fmt result is the same #27014](https://github.com/denoland/deno/pull/27014)

### `deno init --npm`

#### scopedパッケージのサポート

[`deno init --npm`]({{< ref "articles/deno/v2.1.md" >}})でscopedパッケージがサポートされています (例: `deno init --npm @foo/bar`を実行すると、`@foo/create-bar`パッケージが実行されます)

---

- [fix(init): support scoped npm packages #27128](https://github.com/denoland/deno/pull/27128)

#### `node_modules`のセットアップ

[`deno init --npm`]({{< ref "articles/deno/v2.1.md" >}})の実行時に`node_modules`が作成されるよう挙動が改善されています。

---

- [fix(init): always force managed node modules #27047](https://github.com/denoland/deno/pull/27047)

### `deno lsp`

#### `.wasm`モジュールサポートの改善

`import`宣言の補完時に`.wasm`モジュールが候補として含まれるよう改善されています。

---

- [fix(lsp): wasm file import completions #27018](https://github.com/denoland/deno/pull/27018)

#### `deno task`のオブジェクト形式のタスクがサポート

`deno lsp``deno task`[オブジェクト形式のタスクの定義]({{< ref "articles/deno/v2.1.md" >}})を認識できるよう改善されています。

---

- [fix(lsp): support task object notation for tasks request #27076](https://github.com/denoland/deno/pull/27076)

### `deno compile --include`に関するバグ修正

#### `Deno.FsFile#read`などのサポート

埋め込まれたファイルの`Deno.FsFile#read`などでの読み込みが行えない問題が修正されています。

---

- [fix(compile): correct buffered reading of assets and files #27008](https://github.com/denoland/deno/pull/27008)

#### TypeScriptファイルを埋め込むとエラーが発生する問題が修正

TypeScriptファイルが埋め込まれた場合、実行可能ファイルの実行時にエラーが起きる問題も修正されています。

---

- [fix(compile): handle TypeScript file included as asset #27032](https://github.com/denoland/deno/pull/27032)

### `deno task` - `description`フィールドの取り扱いの改善

引数なしで`deno task`を実行した際に、[`description`]({{< ref "articles/deno/v2.1.md" >}})に改行やANSIエスケープコードなどが含まれる説明が適切に表示されるよう改善されています。

---

- [fix(task): handle multiline descriptions properly #27069](https://github.com/denoland/deno/pull/27069)
- [fix(task): handle carriage return in task description #27099](https://github.com/denoland/deno/pull/27099)
- [fix(task): strip ansi codes and control chars when printing tasks #27100](https://github.com/denoland/deno/pull/27100)

### `deno publish` - `bun:`のサポート

`bun:sqlite`などのBunの組み込みパッケージに依存したモジュールを`deno publish`で公開できるよう改善されています。

---

- [fix: support bun specifiers in JSR publish #24588](https://github.com/denoland/deno/pull/24588)

### `deno info` - ワークスペースサポートの改善

`deno info`コマンドでワークスペースのメンバーを参照するbare specifierが適切に解決されるよう改善されています。

---

- [fix(info): resolve bare specifier pointing to workspace member #27020](https://github.com/denoland/deno/pull/27020)

### Deno API

#### OpenTelemetry

`Deno.serve()``fetch()`に対する計装が実施されています。

---

- [feat: Instrument Deno.serve #26964](https://github.com/denoland/deno/pull/26964)
- [feat(unstable): Instrument fetch #27057](https://github.com/denoland/deno/pull/27057)

#### `Deno.upgradeWebSocket`のバグ修正

`Deno.upgradeWebSocket`を呼んだ後に`Request.bodyUsed`を参照するとエラーが発生する問題が修正されています。

---

- [fix(ext/fetch): don't throw when `bodyUsed` inspect after upgrade #27088](https://github.com/denoland/deno/pull/27088)

#### `Deno.watchFs`のバグ修正

対象ファイルが削除された際に、適切に`remove`イベントが発火されなくなっていた問題が修正されています。

---

- [fix(runtime/ops): Fix watchfs remove event #27041](https://github.com/denoland/deno/pull/27041)

### Web API

#### `WebSocket#send`の挙動の変更

すでに切断されている状態で`WebSocket#send`が呼ばれた際に、例外が発生しないよう挙動が修正されています。

---

- [fix(ext/websocket): don't throw exception when sending to closed socket #26932](https://github.com/denoland/deno/pull/26932)

#### `ReadableStream.from`の型定義の改善

`ReadableStream.from`の引数として文字列を渡せないよう型定義が改善されています。

---

- [fix(streams): reject `string` in `ReadableStream.from` type #25116](https://github.com/denoland/deno/pull/25116)

### Node.js互換性の改善

#### `--unstable-detect-cjs`の再導入

[Deno v2.1.0]({{< ref "articles/deno/v2.1.md" >}})で安定化された`--unstable-detect-cjs`が再導入されています。

このオプションを指定すると、`package.json`が存在しない場合 または `package.json``type`が定義されていない場合でも、`.js``.ts`などのモジュールをCommonJS形式として読み込めます。

---

- [feat(unstable): repurpose `--unstable-detect-cjs` to attempt loading more modules as cjs #27094](https://github.com/denoland/deno/pull/27094)

#### CommonJSサポートの改善

CommonJS形式モジュールからdynamic importが使われている場合、`package.json``exports.require`が常に読み込まれる問題が修正されています。

---

- [fix(node): correct resolution of dynamic import of esm from cjs #27071](https://github.com/denoland/deno/pull/27071)

#### `node:tls`

`connect()``socket`オプションを渡すとエラーが発生する問題が修正されています。

---

- [fix(ext/node): `tls.connect` socket upgrades #27125](https://github.com/denoland/deno/pull/27125)

#### `node:fs/promises`

`stat()``FileHandle#stat`が実装されています。

---

- [fix(ext/node): add `fs.promises.fstat` and `FileHandle#stat` #26719](https://github.com/denoland/deno/pull/26719)

#### `node:fs`

`stat()`で引数に対するバリデーションが適切に行われるよう改善されています。

---

- [fix(node/fs): add missing stat path argument validation #27086](https://github.com/denoland/deno/pull/27086)

#### `node:http`

`ServerResponse#hasHeader`において、与えられたヘッダー名を正規化してからヘッダーの存在を確認するように挙動が改善されています。

---

- [fix(node/http): casing ignored in ServerResponse.hasHeader() #27105](https://github.com/denoland/deno/pull/27105)

#### `node:timers`

`clearTimeout`/`clearInterval`の引数として`number`型の値がサポートされています。

---

- [fix(node/timers): error when passing id to clearTimeout/clearInterval #27130](https://github.com/denoland/deno/pull/27130)

## `deno_std`のリリース

`deno_std`でリリースが行われています:

- [release-2024.11.25](https://github.com/denoland/std/releases/tag/release-2024.11.25)

### `@std/[email protected]`

[@std/cli@1.0.7](https://jsr.io/@std/[email protected])がリリースされています。

#### `promptSelect()`が実装

新規APIとして`promptSelect()`が実装されています。ユーザーに対して、指定された値の一覧からの選択を促すことができます。

### `@std/[email protected]`

[@std/tar@0.1.4](https://jsr.io/@std/[email protected])がリリースされています。

#### `@std/tar/untar-stream`

[pax形式](https://ja.wikipedia.org/wiki/Pax)のアーカイブを展開できない問題が修正されています。

## `deno lint`へのJSX関連のルールの追加について

直近で[deno_lint](https://github.com/denoland/deno_lint)に対してJSX関連のルールの追加が実施されています:

|ルール|説明|
|:---:|:---:|
|[`jsx-key`](https://github.com/denoland/deno_lint/pull/1355)|iterableな値がJSXに出現した際に、`key`属性の指定を推奨するためのルール|
|[`no-danger`](https://github.com/denoland/deno_lint/pull/1351)|`dangerouslySetInnerHTML`の使用を検出してくれるルール|
|[`jsx-props-no-spread-multi`](https://github.com/denoland/deno_lint/pull/1358)|同一のスプレッド構文の二重使用を検出してくれるルール|
|[`jsx-no-children-prop`](https://github.com/denoland/deno_lint/pull/1359)|`props.children`に対する誤った指定を検出してくれるルール|
|[`jsx-curly-braces`](https://github.com/denoland/deno_lint/pull/1354)|JSXにおける中括弧の指定方法に関して一貫した作法を提供するルール|
|[`jsx-void-dom-elements-no-children`](https://github.com/denoland/deno_lint/pull/1347)|[空要素](https://developer.mozilla.org/en-US/docs/Glossary/Void_element)に対する`children`の指定を検出してくれるルール|
|[`jsx-boolean-value`](https://github.com/denoland/deno_lint/pull/1353)|`boolean`値の`props`に対して短縮記法の使用を推奨するためのルール|
|[`button-has-type`](https://github.com/denoland/deno_lint/pull/1350)|`<button>`要素に対する誤った`type`の指定を検出するルール|
|[`jsx-no-useless-fragment`](https://github.com/denoland/deno_lint/pull/1357)|効果のないFragment(`<>...</>`)の使用を検出するルール|
|[`jsx-no-danger-with-children`](https://github.com/denoland/deno_lint/pull/1349)|`dangerouslySetInnerHTML``children`の併用を検出するルール|

まだドラフト状態ですが、Deno本体に`deno_lint`をアップデートするPRが作成されており、今のところDeno v2.2.0でのリリースが検討されているようです:

- [chore: update `deno_lint` [WIP] #27162](https://github.com/denoland/deno/pull/27162)

## Prisma v6

[Prisma v6](https://github.com/prisma/prisma/releases/tag/6.0.0)がリリースされています。

[Deno v2との互換性の改善](https://github.com/prisma/prisma/pull/25734)が実施されているようです。

## SimpleWebAuthn v12

[SimpleWebAuthn v12](https://github.com/MasterKale/SimpleWebAuthn/releases/tag/v12.0.0)がリリースされています。

このリリースに伴い、JSRへパッケージが公開されています ([@simplewebauthn](https://jsr.io/@simplewebauthn))

[deno.land/x/simplewebauthn](https://deno.land/x/simplewebauthn)については今後サポートされないため、JSRへの移行が推奨されます。

0 comments on commit afd217a

Please sign in to comment.