|
| 1 | +--- |
| 2 | +title: "2021-03-23のJS: Node.js 15.12.0(fs.promisesのパフォーマンス改善)、strict CSP、CSS Auditing Tools" |
| 3 | +author: "azu" |
| 4 | +layout: post |
| 5 | +date : 2021-03-23T03:32:29.241Z |
| 6 | +category: JSer |
| 7 | +tags: |
| 8 | +- node.js |
| 9 | +- performance |
| 10 | +- Tools |
| 11 | +- testing |
| 12 | +- browser |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +JSer.info #532 - Node.js 15.12.0がリリースされました。 |
| 17 | + |
| 18 | +- [Node v15.12.0 (Current) | Node.js](https://nodejs.org/en/blog/release/v15.12.0/) |
| 19 | + |
| 20 | +`fs`の`readFile`/`writeFile`に対してPromise版の`fs.promises`の`readFile`/`writeFile`が遅くなるというIssueがあります。 |
| 21 | + |
| 22 | +- [fs.promises.readFile is 40% slower than fs.readFile · Issue #37583 · nodejs/node](https://github.com/nodejs/node/issues/37583) |
| 23 | + |
| 24 | +Node.js 15.12.0ではこのパフォーマンス問題の改善が含まれています。 |
| 25 | + |
| 26 | +- [fs: improve fsPromises readFile performance by Linkgoron · Pull Request #37608 · nodejs/node](https://github.com/nodejs/node/pull/37608) |
| 27 | +- [fs: improve fsPromises writeFile performance by Linkgoron · Pull Request #37610 · nodejs/node](https://github.com/nodejs/node/pull/37610) |
| 28 | + - writeに関してはコールバック版とほぼ同等になっている |
| 29 | + |
| 30 | +その他には`crypto.create{Public,Private}Key`がJWKオブジェクトをサポート、`AbortSignal.abort()`の実装、`worker`モジュールに`{get,set}EnvironmentData`が追加されています。 |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +[Mitigate cross-site scripting (XSS) with a strict Content Security Policy (CSP)](https://web.dev/strict-csp/)という記事では、Content Security Policy (CSP)を使ったXSSの影響を軽減するアプローチについて書かれています。 |
| 35 | + |
| 36 | +CSPには、特定のURLを許可リスト方式で扱う設定がありますが、許可したURLにJSONPなどのエンドポイントがあるとバイパスされる問題が知られています。 |
| 37 | + |
| 38 | +- [CSP Is Dead, Long Live Strict CSP! - DeepSec 2016 - Speaker Deck](https://speakerdeck.com/lweichselbaum/csp-is-dead-long-live-strict-csp-deepsec-2016?slide=15) |
| 39 | +- [Content Security Policy: A successful mess between hardening and mitigation - Speaker Deck](https://speakerdeck.com/mikispag/content-security-policy-a-successful-mess-between-hardening-and-mitigation) |
| 40 | + |
| 41 | +そのため、nonceベースかhashベースのstrictなCSP設定をすることで、CSPがバイパスされる可能性は低くなります。 |
| 42 | +この記事では、nonceベースとhashベースのstrict CSP設定をどのようにするかについて書かれています。 |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +[CSS Auditing Tools — Smashing Magazine](https://www.smashingmagazine.com/2021/03/css-auditing-tools/)という記事では、CSSのAuditツールについてまとめられています。 |
| 47 | + |
| 48 | +- [CSS Stats](https://cssstats.com/) |
| 49 | +- [Yellow Lab Tools - Page Speed audit](https://yellowlab.tools/) |
| 50 | +- [Specificity Visualizer](https://isellsoap.github.io/specificity-visualizer/) |
| 51 | +- [CSS Analytics - Project Wallace](https://www.projectwallace.com/) |
| 52 | +- [katiefenn/parker: Stylesheet analysis tool.](https://github.com/katiefenn/parker) |
| 53 | +- Chrome DevTools |
| 54 | + - [CSS Overview Panel - Chrome DevTools - Dev Tips](https://umaar.com/dev-tips/209-css-overview/) |
| 55 | + - [Find Unused JavaScript And CSS Code With The Coverage Tab In Chrome DevTools](https://developers.google.com/web/tools/chrome-devtools/coverage) |
| 56 | + |
| 57 | +それぞれのツールの紹介やどのような項目を調べられるのかについてまとめられています。 |
| 58 | + |
| 59 | +---- |
| 60 | + |
| 61 | +<h1 class="site-genre">ヘッドライン</h1> |
| 62 | + |
| 63 | +---- |
| 64 | + |
| 65 | +## Node v15.12.0 (Current) | Node.js |
| 66 | +[nodejs.org/en/blog/release/v15.12.0/](https://nodejs.org/en/blog/release/v15.12.0/ "Node v15.12.0 (Current) | Node.js") |
| 67 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">node.js</span> <span class="jser-tag">ReleaseNote</span></p> |
| 68 | + |
| 69 | +Node.js 15.12.0リリース。 |
| 70 | +`crypto.create{Public,Private}Key`がJWKオブジェクトをサポート、`fs.promises`のwriteFileとreadFileのパフォーマンス改善。 |
| 71 | +`AbortSignal.abort()`の実装、`worker`モジュールに`{get,set}EnvironmentData`を追加など |
| 72 | + |
| 73 | +- [fs.promises.readFile is 40% slower than fs.readFile · Issue #37583 · nodejs/node](https://github.com/nodejs/node/issues/37583 "fs.promises.readFile is 40% slower than fs.readFile · Issue #37583 · nodejs/node") |
| 74 | + |
| 75 | +---- |
| 76 | + |
| 77 | +## V8 release v9.0 · V8 |
| 78 | +[v8.dev/blog/v8-release-90](https://v8.dev/blog/v8-release-90 "V8 release v9.0 · V8") |
| 79 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">V8</span> <span class="jser-tag">ReleaseNote</span></p> |
| 80 | + |
| 81 | +V8 v9.0リリース。 |
| 82 | +`RegExp#insices`の実装、`super`のプロパティアクセスのパフォーマンス改善、JavaScriptからWasmの関数を呼ぶときのパフォーマンスを改善など |
| 83 | + |
| 84 | + |
| 85 | +---- |
| 86 | + |
| 87 | +## Release v7.3.0 · GoogleChrome/lighthouse |
| 88 | +[github.com/GoogleChrome/lighthouse/releases/tag/v7.3.0](https://github.com/GoogleChrome/lighthouse/releases/tag/v7.3.0 "Release v7.3.0 · GoogleChrome/lighthouse") |
| 89 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">performance</span> <span class="jser-tag">Tools</span> <span class="jser-tag">ReleaseNote</span> <span class="jser-tag">Chrome</span></p> |
| 90 | + |
| 91 | +Lighthouse 7.3.0リリース。 |
| 92 | +新しいauditとしてcsp-xssを試験的に追加。 |
| 93 | + |
| 94 | +- [new\_audit: csp-xss by adamraine · Pull Request #12044 · GoogleChrome/lighthouse](https://github.com/GoogleChrome/lighthouse/pull/12044 "new\_audit: csp-xss by adamraine · Pull Request #12044 · GoogleChrome/lighthouse") |
| 95 | + |
| 96 | +---- |
| 97 | + |
| 98 | +## jasmine/3.7.0.md at main · jasmine/jasmine |
| 99 | +[github.com/jasmine/jasmine/blob/main/release\_notes/3.7.0.md](https://github.com/jasmine/jasmine/blob/main/release_notes/3.7.0.md "jasmine/3.7.0.md at main · jasmine/jasmine") |
| 100 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">library</span> <span class="jser-tag">ReleaseNote</span> <span class="jser-tag">testing</span></p> |
| 101 | + |
| 102 | +Jasmine 3.7リリース。 |
| 103 | +Node.jsのSource Mapsに対応、Array.prototypeを拡張している際にテストが一部落ちる問題の修正、`.and.callFake`がGenerator関数をサポートなど |
| 104 | + |
| 105 | +- [Source maps in Node.js. Supporting the many flavors of… | by Node.js | Medium](https://nodejs.medium.com/source-maps-in-node-js-482872b56116 "Source maps in Node.js. Supporting the many flavors of… | by Node.js | Medium") |
| 106 | + |
| 107 | +---- |
| 108 | + |
| 109 | +## ECMAScript proposal updates @ 2021-03 | ECMAScript Daily |
| 110 | +[ecmascript-daily.github.io/ecmascript/2021/03/22/ecmascript-proposal-update](https://ecmascript-daily.github.io/ecmascript/2021/03/22/ecmascript-proposal-update "ECMAScript proposal updates @ 2021-03 | ECMAScript Daily") |
| 111 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">ECMAScript</span> <span class="jser-tag">news</span></p> |
| 112 | + |
| 113 | +2021年3月のTC39でECMAScript Proposalのステータス変更のまとめ。 |
| 114 | +Module FragmentsがStage 1へ、`Array#findLast`がStage2へ、TemporalがStage 3へ更新など |
| 115 | + |
| 116 | +- [JavaScript の Module Fragments について](https://sosukesuzuki.dev/posts/stage-0-module-fragments/ "JavaScript の Module Fragments について") |
| 117 | + |
| 118 | +---- |
| 119 | + |
| 120 | +## sinon/CHANGELOG.md at master · sinonjs/sinon |
| 121 | +[github.com/sinonjs/sinon/blob/master/CHANGELOG.md#1000--2021-03-22](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md#1000--2021-03-22 "sinon/CHANGELOG.md at master · sinonjs/sinon") |
| 122 | +<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> |
| 123 | + |
| 124 | +Sinon.js 10.0.0リリース。 |
| 125 | +IE 11、Legacy Edge、Legacy Safariのサポートを終了。 |
| 126 | + |
| 127 | + |
| 128 | +---- |
| 129 | +<h1 class="site-genre">アーティクル</h1> |
| 130 | + |
| 131 | +---- |
| 132 | + |
| 133 | +## Mitigate cross-site scripting (XSS) with a strict Content Security Policy (CSP) |
| 134 | +[web.dev/strict-csp/](https://web.dev/strict-csp/ "Mitigate cross-site scripting (XSS) with a strict Content Security Policy (CSP)") |
| 135 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">CSP</span> <span class="jser-tag">article</span> <span class="jser-tag">security</span></p> |
| 136 | + |
| 137 | +ドメインの許可リストのCSPよりも、strict設定のCSPを推奨するという話。 |
| 138 | +nonceとstrict-dynamicベースのCSP設定で防げるXSS、nonceベースとhashベースのCSPの設定、CSPの導入手順について |
| 139 | + |
| 140 | + |
| 141 | +---- |
| 142 | + |
| 143 | +## Supabseチームはどのようにフロントエンドの高速化に成功したのか - バンクーバーで考え中 |
| 144 | +[jp.taishikato.com/posts/making-the-supabase-dashboard-supa-fast](https://jp.taishikato.com/posts/making-the-supabase-dashboard-supa-fast "Supabseチームはどのようにフロントエンドの高速化に成功したのか - バンクーバーで考え中") |
| 145 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">performance</span> <span class="jser-tag">article</span></p> |
| 146 | + |
| 147 | +Making the Supabase Dashboard Supa-fastの翻訳記事。 |
| 148 | +ベースラインと目標設定、バンドルサイズの改善、パフォーマンス文化について |
| 149 | + |
| 150 | +- [Making the Supabase Dashboard Supa-fast](https://supabase.io/blog/2020/12/13/supabase-dashboard-performance "Making the Supabase Dashboard Supa-fast") |
| 151 | + |
| 152 | +---- |
| 153 | + |
| 154 | +## The #1 tip to familiarize with new JavaScript Codebases |
| 155 | +[www.kevinpeters.net/the-fastest-way-to-understand-new-code-bases](https://www.kevinpeters.net/the-fastest-way-to-understand-new-code-bases "The #1 tip to familiarize with new JavaScript Codebases") |
| 156 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">article</span></p> |
| 157 | + |
| 158 | +`code-complexity`を使ったコードの複雑度分析について。 |
| 159 | +ComplexityとChurnについて |
| 160 | + |
| 161 | +- [simonrenoult/code-complexity: Measure the churn/complexity ratio. Higher values mean hotspots where refactorings should happen.](https://github.com/simonrenoult/code-complexity "simonrenoult/code-complexity: Measure the churn/complexity ratio. Higher values mean hotspots where refactorings should happen.") |
| 162 | + |
| 163 | +---- |
| 164 | + |
| 165 | +## CSS Auditing Tools — Smashing Magazine |
| 166 | +[www.smashingmagazine.com/2021/03/css-auditing-tools/](https://www.smashingmagazine.com/2021/03/css-auditing-tools/ "CSS Auditing Tools — Smashing Magazine") |
| 167 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">CSS</span> <span class="jser-tag">article</span> <span class="jser-tag">Tools</span></p> |
| 168 | + |
| 169 | +CSSのAuditツールについての記事。 |
| 170 | +CSSセレクタの詳細度、複雑度の測定、Code Coverage、継続的な分析など |
| 171 | + |
| 172 | + |
| 173 | +---- |
| 174 | + |
| 175 | +## Next 10 years of Node.js — Understanding the needs of the Node.js constituencies | by Node.js | Mar, 2021 | Medium |
| 176 | +[nodejs.medium.com/next-10-years-of-node-js-understanding-the-needs-of-the-node-js-constituencies-2f95a1df6a6f](https://nodejs.medium.com/next-10-years-of-node-js-understanding-the-needs-of-the-node-js-constituencies-2f95a1df6a6f "Next 10 years of Node.js — Understanding the needs of the Node.js constituencies | by Node.js | Mar, 2021 | Medium") |
| 177 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">node.js</span> <span class="jser-tag">article</span></p> |
| 178 | + |
| 179 | +Node.jsの次の10年について |
| 180 | + |
| 181 | +- [nodejs/next-10: Repository for discussion on strategic directions for next 10 years of Node.js](https://github.com/nodejs/next-10 "nodejs/next-10: Repository for discussion on strategic directions for next 10 years of Node.js") |
| 182 | + |
| 183 | +---- |
| 184 | +<h1 class="site-genre">ソフトウェア、ツール、ライブラリ関係</h1> |
| 185 | + |
| 186 | +---- |
| 187 | + |
| 188 | +## 101arrowz/isoworker: Isomorphic workerization with context support |
| 189 | +[github.com/101arrowz/isoworker](https://github.com/101arrowz/isoworker "101arrowz/isoworker: Isomorphic workerization with context support") |
| 190 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">browser</span> <span class="jser-tag">node.js</span> <span class="jser-tag">library</span></p> |
| 191 | + |
| 192 | +WebWorkerと`worker_threds`に対応したWorkerライブラリ。 |
| 193 | +Inline CodeをWorkerコードを作成し、Workerに対してクラスや関数を含めたデータを渡して実行した結果を取得できる |
| 194 | + |
| 195 | + |
| 196 | +---- |
| 197 | + |
| 198 | +## taoqf/node-html-parser: A very fast HTML parser, generating a simplified DOM, with basic element query support. |
| 199 | +[github.com/taoqf/node-html-parser](https://github.com/taoqf/node-html-parser "taoqf/node-html-parser: A very fast HTML parser, generating a simplified DOM, with basic element query support.") |
| 200 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">HTML</span> <span class="jser-tag">DOM</span> <span class="jser-tag">library</span></p> |
| 201 | + |
| 202 | +HTMLパーサとDOM APIライブラリ。 |
| 203 | +パースした結果のオブジェクトでDOM APIライクな操作ができる。 |
| 204 | + |
| 205 | + |
| 206 | +---- |
| 207 | + |
| 208 | +## Hello from tRPC | tRPC |
| 209 | +[trpc.io/](https://trpc.io/ "Hello from tRPC | tRPC") |
| 210 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">browser</span> <span class="jser-tag">node.js</span> <span class="jser-tag">library</span> <span class="jser-tag">TypeScript</span> <span class="jser-tag">React</span> <span class="jser-tag">Next.js</span></p> |
| 211 | + |
| 212 | +HTTP通信のデータレイヤーライブラリ。 |
| 213 | +TypeScriptとyup/zodなどのバリデーターを使ったサーバ側のAPIエンドポイントを定義し、その型をクライアントからも利用できる。 |
| 214 | +React向けのHooks/SSR対応のクライアントライブラリも公開されている。 |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | +---- |
| 219 | + |
| 220 | +## Charts.css |
| 221 | +[chartscss.org/](https://chartscss.org/ "Charts.css") |
| 222 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">CSS</span> <span class="jser-tag">library</span></p> |
| 223 | + |
| 224 | +CSSを使ったグラフライブラリ。 |
| 225 | +様々な種類のチャートの表示に対応している。 |
| 226 | + |
| 227 | +---- |
| 228 | +<h1 class="site-genre">書籍関係</h1> |
| 229 | + |
| 230 | +---- |
| 231 | + |
| 232 | +## Learning TensorFlow.js |
| 233 | +[learning.oreilly.com/library/view/learning-tensorflowjs/9781492090786/](https://learning.oreilly.com/library/view/learning-tensorflowjs/9781492090786/ "Learning TensorFlow.js") |
| 234 | +<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">MachineLearning</span> <span class="jser-tag">book</span></p> |
| 235 | + |
| 236 | +2021年7月発売 |
| 237 | +TensorFlow.jsの入門書 |
| 238 | + |
| 239 | + |
| 240 | +---- |
0 commit comments