title | author | layout | date | category | tags | |||||
---|---|---|---|---|---|---|---|---|---|---|
2021-03-23のJS: Node.js 15.12.0(fs.promisesのパフォーマンス改善)、strict CSP、CSS Auditing Tools |
azu |
post |
2021-03-23 03:32:29 UTC |
JSer |
|
JSer.info #532 - Node.js 15.12.0がリリースされました。
fs
のreadFile
/writeFile
に対してPromise版のfs.promises
のreadFile
/writeFile
が遅くなるというIssueがあります。
Node.js 15.12.0ではこのパフォーマンス問題の改善が含まれています。
- fs: improve fsPromises readFile performance by Linkgoron · Pull Request #37608 · nodejs/node
- fs: improve fsPromises writeFile performance by Linkgoron · Pull Request #37610 · nodejs/node
- writeに関してはコールバック版とほぼ同等になっている
その他にはcrypto.create{Public,Private}Key
がJWKオブジェクトをサポート、AbortSignal.abort()
の実装、worker
モジュールに{get,set}EnvironmentData
が追加されています。
Mitigate cross-site scripting (XSS) with a strict Content Security Policy (CSP)という記事では、Content Security Policy (CSP)を使ったXSSの影響を軽減するアプローチについて書かれています。
CSPには、特定のURLを許可リスト方式で扱う設定がありますが、許可したURLにJSONPなどのエンドポイントがあるとバイパスされる問題が知られています。
- CSP Is Dead, Long Live Strict CSP! - DeepSec 2016 - Speaker Deck
- Content Security Policy: A successful mess between hardening and mitigation - Speaker Deck
そのため、nonceベースかhashベースのstrictなCSP設定をすることで、CSPがバイパスされる可能性は低くなります。 この記事では、nonceベースとhashベースのstrict CSP設定をどのようにするかについて書かれています。
CSS Auditing Tools — Smashing Magazineという記事では、CSSのAuditツールについてまとめられています。
- CSS Stats
- Yellow Lab Tools - Page Speed audit
- Specificity Visualizer
- CSS Analytics - Project Wallace
- katiefenn/parker: Stylesheet analysis tool.
- Chrome DevTools
それぞれのツールの紹介やどのような項目を調べられるのかについてまとめられています。
nodejs.org/en/blog/release/v15.12.0/
node.js ReleaseNote
Node.js 15.12.0リリース。
crypto.create{Public,Private}Key
がJWKオブジェクトをサポート、fs.promises
のwriteFileとreadFileのパフォーマンス改善。
AbortSignal.abort()
の実装、worker
モジュールに{get,set}EnvironmentData
を追加など
V8 ReleaseNote
V8 v9.0リリース。
RegExp#insices
の実装、super
のプロパティアクセスのパフォーマンス改善、JavaScriptからWasmの関数を呼ぶときのパフォーマンスを改善など
github.com/GoogleChrome/lighthouse/releases/tag/v7.3.0
performance Tools ReleaseNote Chrome
Lighthouse 7.3.0リリース。 新しいauditとしてcsp-xssを試験的に追加。
github.com/jasmine/jasmine/blob/main/release_notes/3.7.0.md
JavaScript library ReleaseNote testing
Jasmine 3.7リリース。
Node.jsのSource Mapsに対応、Array.prototypeを拡張している際にテストが一部落ちる問題の修正、.and.callFake
がGenerator関数をサポートなど
ecmascript-daily.github.io/ecmascript/2021/03/22/ecmascript-proposal-update
ECMAScript news
2021年3月のTC39でECMAScript Proposalのステータス変更のまとめ。
Module FragmentsがStage 1へ、Array#findLast
がStage2へ、TemporalがStage 3へ更新など
github.com/sinonjs/sinon/blob/master/CHANGELOG.md#1000--2021-03-22
JavaScript testing library ReleaseNote
Sinon.js 10.0.0リリース。 IE 11、Legacy Edge、Legacy Safariのサポートを終了。
CSP article security
ドメインの許可リストのCSPよりも、strict設定のCSPを推奨するという話。 nonceとstrict-dynamicベースのCSP設定で防げるXSS、nonceベースとhashベースのCSPの設定、CSPの導入手順について
jp.taishikato.com/posts/making-the-supabase-dashboard-supa-fast
performance article
Making the Supabase Dashboard Supa-fastの翻訳記事。 ベースラインと目標設定、バンドルサイズの改善、パフォーマンス文化について
www.kevinpeters.net/the-fastest-way-to-understand-new-code-bases
JavaScript article
code-complexity
を使ったコードの複雑度分析について。
ComplexityとChurnについて
www.smashingmagazine.com/2021/03/css-auditing-tools/
CSS article Tools
CSSのAuditツールについての記事。 CSSセレクタの詳細度、複雑度の測定、Code Coverage、継続的な分析など
Next 10 years of Node.js — Understanding the needs of the Node.js constituencies | by Node.js | Mar, 2021 | Medium
node.js article
Node.jsの次の10年について
github.com/101arrowz/isoworker
browser node.js library
WebWorkerとworker_threds
に対応したWorkerライブラリ。
Inline CodeをWorkerコードを作成し、Workerに対してクラスや関数を含めたデータを渡して実行した結果を取得できる
taoqf/node-html-parser: A very fast HTML parser, generating a simplified DOM, with basic element query support.
github.com/taoqf/node-html-parser
HTML DOM library
HTMLパーサとDOM APIライブラリ。 パースした結果のオブジェクトでDOM APIライクな操作ができる。
JavaScript browser node.js library TypeScript React Next.js
HTTP通信のデータレイヤーライブラリ。 TypeScriptとyup/zodなどのバリデーターを使ったサーバ側のAPIエンドポイントを定義し、その型をクライアントからも利用できる。 React向けのHooks/SSR対応のクライアントライブラリも公開されている。
CSS library
CSSを使ったグラフライブラリ。 様々な種類のチャートの表示に対応している。
learning.oreilly.com/library/view/learning-tensorflowjs/9781492090786/
JavaScript MachineLearning book
2021年7月発売 TensorFlow.jsの入門書