2021-10-20のJS: Parcel v2、Node v17.0.0、Nuxt 3 beta #922
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ビルドツールのParcel v2がリリースされました。
Parcelは設定なしで動作することを目的にしているため、v1ではプラグインの仕組みは薄い形になっていました。
Parcel v2ではプラグインの仕組みを刷新し、様々なケースに対応できるようになっています。
また、Tree Shakingをデフォルト化、SWCベースのJavaScriptコンパイラに変更、ModernとLegacyビルドの出し分け、Image optimizerの追加されています。
その他にも、bundleのインライン化、ライブラリ向けのビルドのサポート、C++やRustでコアモジュールの一部を書き直し、ビルドパフォーマンスの改善なども含まれています。
Parcel v1からマイグレーションについてのドキュメントも公開されています。
Node.js 17.0.0がリリースされました。
Nodeの奇数バージョンはLTSとはなりませんが、
Currentバージョンが17.xとなります。現在のNodeのLTSは12と14ですが、2021-10-26にNode 16がLTSに追加されます。
Node.js 17では、
readlineモジュールのPromise対応、OpenSSL 3.0へのアップデート、V8 9.5へアップデート、npm 8.0.0へのアップデート、スタックトレースにNodeバージョンを表示などの変更が含まれています。またウェブ標準の
strcturedClone()とDOMExceptionをサポートが追加されています。structuredClone()は
postMessageなどで内部的に使われていた(DOMを含む)オブジェクトの複製のメカニズムを関数として公開したメソッドです。最近、WHATWG HTMLの仕様に追加され、FirefoxやDenoで実装され、Chrome、Safari、core-jsで実装が進められています。
この
structuredClone()はJSON.parse/JSON.strinfigyがサポートしていないオブジェクト(MapやRegExpなど)もサポートしていため、DOM以外の部分でも有用です。structuredClone()で複製ができない場合はDOMExceptionを例外として投げる仕様であるため、DOMExceptionも合わせて実装されています。Node 17にはNode 16の変更点も含まれるので、その他の変更は次の記事を参照してください。