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

2023-10-03のJS: Node v20.8.0、Vitest v1.0.0-beta.0、instant.dev(Rails-inspired ORM/Migrations) #1123

Merged
merged 18 commits into from
Oct 3, 2023
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
---
title: "2023-10-03のJS: Node v20.8.0、Vitest v1.0.0-beta.0、instant.dev(Rails-inspired ORM/Migrations)"
author: "azu"
layout: post
date : 2023-10-03T13:10:21.794Z
category: JSer
tags:
- nodejs
- UI
- npm
- cloudflare
- API

---

JSer.info #663 - Node.js 20.8.0がリリースされました。

- [Node v20.8.0 (Current) | Node.js](https://nodejs.org/en/blog/release/v20.8.0)

`stream`に関するフラグをビットマップで管理することでメモリ消費量とパフォーマンスが改善されています。

- [stream: use bitmap in readable state by benjamingr · Pull Request #49745 · nodejs/node](https://github.com/nodejs/node/pull/49745)

`vm`に`importModuleDynamically`オプションを追加、主にJestなどで起きていた`vm`のメモリリークの問題を修正なども含まれています。

Node.jsのアップデートが起因でJestのメモリリークが起きる問題としては、次のIssueがあります。
こちらのIssueは、Node.js 20.8.0ではまだ修正されていません。

- [[Bug]: Memory consumption issues on Node JS 16.11.0+ · Issue #11956 · jestjs/jest](https://github.com/jestjs/jest/issues/11956#issuecomment-1740360337)

こちらの問題は、次のPull Requestで解決されるようです。

- [vm: use default host-defined options when importModuleDynamically is not set by joyeecheung · Pull Request #49950 · nodejs/node](https://github.com/nodejs/node/pull/49950)

📝 Node.js 20.x は2023-10-24からLTSとなります。

- [nodejs/Release: Node.js Release Working Group](https://github.com/nodejs/release#release-schedule)

---

Vitest v1.0.0-beta.0がリリースされました。

- [Release v1.0.0-beta.0 · vitest-dev/vitest](https://github.com/vitest-dev/vitest/releases/tag/v1.0.0-beta.0)

今までは`node:worker_threads`を使った並列実行のみがサポートされていましたが、今回`node:child_process`を使った並列実行をサポートが追加されています。
これは、`node:worker_threads`ではnative moduleを含むコードを実行すると、Segmentation faultになるケースがあるためです。次のIssueで詳しく解説されています。

- [Feature: Support `child_process` runtime · Issue #64 · tinylibs/tinypool](https://github.com/tinylibs/tinypool/issues/64)

この変更により、`--threads`などのフラグが廃止され、代わりとなる`--pool`と`--poolOptions`フラグが追加されています。

---

RailsをインスパイアしたORMマッパーとマイグレーション管理ツールである instant.dev が公開されています。

- [instant-dev/instant: Build APIs with a Rails-inspired JavaScript ORM and Migrations for Postgres](https://github.com/instant-dev/instant)

モデルの生成やマイグレーションの管理を行うInstant CLIと、ORMである[Instant ORM](https://github.com/instant-dev/orm)からなつツールになっています。


----

{% include inline-support.html %}

----

<h1 class="site-genre">ヘッドライン</h1>

----

## Node v20.8.0 (Current) | Node.js
[nodejs.org/en/blog/release/v20.8.0](https://nodejs.org/en/blog/release/v20.8.0 "Node v20.8.0 (Current) | Node.js")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">nodejs</span> <span class="jser-tag">ReleaseNote</span></p>

Node.js v20.8.0リリース。
Streamのパフォーマンス改善、`vm`に`importModuleDynamically`オプションを追加、主にJestなどで起きていた`vm`のメモリリークの問題を修正など


----

## Lit 3.0 Prerelease 2 and more! – Lit
[lit.dev/blog/2023-09-27-lit-3.0-prerelease-2/](https://lit.dev/blog/2023-09-27-lit-3.0-prerelease-2/ "Lit 3.0 Prerelease 2 and more! – Lit")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">UI</span> <span class="jser-tag">library</span> <span class="jser-tag">ReleaseNote</span></p>

Lit 3.0.0-pre.1リリース。
Lit 3.0では、IE11のサポート終了、ECMAScript Proposal Stage 3のDecoratorの対応などが含まれる。

- [Release [email protected] · lit/lit](https://github.com/lit/lit/releases/tag/lit%403.0.0-pre.1 "Release [email protected] · lit/lit")

----

## npm provenance general availability - The GitHub Blog
[github.blog/changelog/2023-09-26-npm-provenance-general-availability/](https://github.blog/changelog/2023-09-26-npm-provenance-general-availability/ "npm provenance general availability - The GitHub Blog")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">npm</span> <span class="jser-tag">news</span></p>

npm provenanceを使ってパッケージを公開できるようになった。
CI/CDからパッケージを公開する際に、コミットとパッケージを紐づけて公開できるようになる。


----

## Release 3.33.0 - 2023.10.02 · zloirock/core-js
[github.com/zloirock/core-js/releases/tag/v3.33.0](https://github.com/zloirock/core-js/releases/tag/v3.33.0 "Release 3.33.0 - 2023.10.02 · zloirock/core-js")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">polyfill</span> <span class="jser-tag">ReleaseNote</span></p>

core-js v3.33.0リリース。
`RegExp.escape`の追加、compat dataのアップデートなど


----

## Release v1.0.0-beta.0 · vitest-dev/vitest
[github.com/vitest-dev/vitest/releases/tag/v1.0.0-beta.0](https://github.com/vitest-dev/vitest/releases/tag/v1.0.0-beta.0 "Release v1.0.0-beta.0 · vitest-dev/vitest")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">testing</span> <span class="jser-tag">library</span> <span class="jser-tag">ReleaseNote</span></p>

vitest v1.0.0-beta.0リリース。
`node:child_process`を使った並列実行をサポート、`pool`と`poolOptions`をサポートし関連する古いフラグを削除など

- [Feature: Support \`child\_process\` runtime · Issue #64 · tinylibs/tinypool](https://github.com/tinylibs/tinypool/issues/64 "Feature: Support \&#x60;child\_process\&#x60; runtime · Issue #64 · tinylibs/tinypool")

----

## Bun v1.0.4 | Bun Blog
[bun.sh/blog/bun-v1.0.4](https://bun.sh/blog/bun-v1.0.4 "Bun v1.0.4 | Bun Blog")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">Bun</span> <span class="jser-tag">ReleaseNote</span></p>

Bun v1.0.4リリース。
`Bun.serve()`のメモリ消費量の削減、`server.requestIP()`の追加、`Bun.plugin`でのvirtual modulesのサポート。
Fetchのtimeoutのデフォルト値を30秒から5分へ変更、DNS解決のバグを修正など


----
<h1 class="site-genre">アーティクル</h1>

----

## A Socket API that works across JavaScript runtimes — announcing a WinterCG spec and Node.js implementation of connect()
[blog.cloudflare.com/socket-api-works-javascript-runtimes-wintercg-polyfill-connect/](https://blog.cloudflare.com/socket-api-works-javascript-runtimes-wintercg-polyfill-connect/ "A Socket API that works across JavaScript runtimes — announcing a WinterCG spec and Node.js implementation of connect()")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">nodejs</span> <span class="jser-tag">cloudflare</span> <span class="jser-tag">API</span> <span class="jser-tag">article</span></p>

WinterCGで策定しているSocket APIについて

- [Sockets API](https://sockets-api.proposal.wintercg.org/ "Sockets API")

----
<h1 class="site-genre">ソフトウェア、ツール、ライブラリ関係</h1>

----

## runk/node-chardet: Character encoding detection tool for NodeJS
[github.com/runk/node-chardet](https://github.com/runk/node-chardet "runk/node-chardet: Character encoding detection tool for NodeJS")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">library</span></p>

文字コード判定ライブラリ


----

## instant-dev/instant: Build APIs with a Rails-inspired JavaScript ORM and Migrations for Postgres
[github.com/instant-dev/instant](https://github.com/instant-dev/instant "instant-dev/instant: Build APIs with a Rails-inspired JavaScript ORM and Migrations for Postgres")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">library</span> <span class="jser-tag">database</span></p>

Rails/ActiveRecordをインスパイアしたORMマッパー、マイグレーション管理ツール。


----

## aidenybai/pattycake: Zero-runtime pattern matching
[github.com/aidenybai/pattycake](https://github.com/aidenybai/pattycake "aidenybai/pattycake: Zero-runtime pattern matching")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">TypeScript</span> <span class="jser-tag">Tools</span> <span class="jser-tag">performance</span></p>

ts-patternのパターンマッチをインライン化して、Runtimeライブラリの依存をなくすツール。

- [gvergnaud/ts-pattern: 🎨 The exhaustive Pattern Matching library for TypeScript, with smart type inference.](https://github.com/gvergnaud/ts-pattern "gvergnaud/ts-pattern: 🎨 The exhaustive Pattern Matching library for TypeScript, with smart type inference.")

----

## tldraw/tldraw: a very good whiteboard
[github.com/tldraw/tldraw](https://github.com/tldraw/tldraw "tldraw/tldraw: a very good whiteboard")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">library</span> <span class="jser-tag">illust</span> <span class="jser-tag">diagram</span> <span class="jser-tag">communication</span></p>

共同編集できるホワイトボードライブラリ。


----
<h1 class="site-genre">書籍関係</h1>

----

## Learning Vue
[learning.oreilly.com/library/view/learning-vue/9781492098812/](https://learning.oreilly.com/library/view/learning-vue/9781492098812/ "Learning Vue")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">Vue</span> <span class="jser-tag">JavaScript</span> <span class="jser-tag">book</span></p>

2023年12月発売
Vueについての書籍


----