Frontend Weekly 2023-10-13
Chrome 118
https://developer.chrome.com/blog/new-in-chrome-118/
Chrome 118 がリリース。
- ブラウザ拡張によって登録された Service Worker から、WebUSB API を利用できるように変更
Payment Request
及びSecure Payment Confirmation
から user activation requirement が削除
https://github.com/w3c/secure-payment-confirmation/issues/216
CSS @scope ルールの追加
@scope
ルールを使用すると、スタイルの範囲を特定のスコープに制限することが出来る。
https://developer.chrome.com/articles/at-scope/
次のように利用できる。
<style> @scope (.first-container) { .main-title { color: grey; } } @scope (.second-container) { .main-title { color: mediumturquoise; } }</style><div class="first-container"> <h1 class="main-title">I'm the main title</h1></div><div class="second-container"> <h1 class="main-title">I'm the main title, but somewhere else</h1></div>
@scope (.component) to (.click-here, .link-here) { div { color: purple; text-align: center; font-family: sans-serif; }}
サンプルコード:https://stackblitz.com/edit/js-wyuqib?file=index.html
Rollup 4.0.0
https://github.com/rollup/rollup/releases/tag/v4.0.0
Rollup 4.0.0 がリリース。
- Node.js 14/16 のサポート終了
- Acorn の代わりに SWC をパーサに使うように変更
ViteConf 2023
https://viteconf.org/23/replay/welcome
ViteConf が開催された。
https://viteconf.org/23/replay/vite_keynote
ESBuild と Rollup で差分が発生してしまう問題に対処するため、Rollup 互換のバンドラRolldown
を Rust で再実装するとのこと。
pnpm 8.9.0
https://github.com/pnpm/pnpm/releases/tag/v8.9.0
pnpm v8.9.0 がリリース。
macOS および Windows Dev Drive で、デフォルトでハードリンクではなく reflink を利用するようになったキャッシュからのインストール速度が改善する。
Bun - v1.0.6
https://bun.sh/blog/bun-v1.0.5
https://bun.sh/blog/bun-v1.0.6
Bun v1.0.5 及び Bun v1.0.6 がリリース。
- npm の
overrides
及び yarrn のresolutions
の対応 peerDependencies
を自動でインストールするように変更
Auto-install – Runtime | Bun Docs
https://bun.sh/docs/runtime/autoimport
Bun では、自動で依存関係をインストールする機能の実装を予定している。
Lit 3.0
https://lit.dev/blog/2023-10-10-lit-3.0/
Lit 3.0 がリリース。
- IE11 のサポート終了
- パッケージ ES2021 として配布するように変更
- 非推奨 API の削除
- Stage 3 Decorator のサポート
- 新しい Lit テンプレートコンパイラー@lit-labs/compiler の公開
- Preact Signals を統合するパッケージ@lit-labs/preact-signals の公開
- Lit コンポーネントをラップした React コンポーネントを作れる@lit-labs/react や、@lit-labs/task はラボを卒業し@lit/react と@lit/task に移行。
文字の視認性とコントラストに関する新基準 APCA を学ぼう
https://gihyo.jp/list/group/文字の視認性とコントラストに関する新基準 APCA を学ぼう#rt:/article/2023/08/apca-02
WCAG3 にて現行のコントラストに代わる基準として開発・検討されている APCA についての解説記事。APCA では、コントラストを色の明るさの知覚的な差を表す Lc 値で表す。そのため APCA では、コントラストの基準が背景色とテキスト色などだけでなくフォントサイズやウェイトを加えたテーブルで表現される。これにより、十分なコントラストがあるように見えるが視認性が足りなく見えるといったケースをケアできる。
Next.js 13 vs Remix: An In-depth case study
https://prateeksurana.me/blog/nextjs-13-vs-remix-an-in-depth-case-study/
Next.js と Remix で同じアプリを作りながら比較する記事。レイアウト、データ取得、ストリーミング、データ変更、キャッシュなどについて比較している。
Biome と ESLint の lint ルールの互換性
https://zenn.dev/cybozu_frontend/articles/biome-eslint-compatibility
ESLint でよく利用される recommended ルールと Biome のルールの対応表。8 割以上は Biome でも実装されている。一方、Biome では TypeScript の型情報を扱えないため、型情報が必要なルールはサポートしていない。