Bookmarks

Bookmarks

192 bookmarks
Newest
'use client' ディレクティブ – React
'use client' ディレクティブ – React
ファイルのトップに 'use client' を加えることで、当該モジュールとそれが連動してインポートしている依存モジュールがクライアントコードであるとマーク
クライアントコンポーネントとは、レンダーツリーの中の、クライアントでレンダーされるコンポーネントです。 サーバコンポーネントとは、レンダーツリーの中の、サーバでレンダーされるコンポーネントです。
サーバコンポーネントにより、クライアントに送信され実行されるコードの量を減らすことができます。バンドルされてクライアントで評価されるのはクライアントモジュールだけです。
サーバコンポーネントにはサーバ上で実行されることに伴う利点があります。ローカルファイルシステムにアクセスでき、データフェッチやネットワークリクエストのレイテンシが低い可能性があります。
サーバコンポーネントからクライアントコンポーネントに渡される props の値は、シリアライズ可能 (serializable) である必要があります。
サーバコンポーネントはユーザによるインタラクションをサポートできません。イベントハンドラはクライアントで登録されトリガされる必要があるためです。
クライアントコンポーネントとは、レンダーツリーの中の、クライアントでレンダーされるコンポーネントです。
コンポーネントモジュールに 'use client' ディレクティブが含まれている場合、そのコンポーネントは必ずクライアントコンポーネントであることが保証されます。
·ja.react.dev·
'use client' ディレクティブ – React
Design Docs
Design Docs
“When should you make a design document? ... If the change is large/cross-cutting, eg. will be spread over multiple PRs”
Writing forces clarity of thought. Think through major technical challenges before writing code.
Design docs are lightweight planning documents written before implementing code to solicit feedback, derive alignment, and create documentation.
·designdocs.dev·
Design Docs
JavaScriptのカスタムエラーはこれでOK | Wantedly Engineer Blog
JavaScriptのカスタムエラーはこれでOK | Wantedly Engineer Blog
それは、コードをminifyしたときに this.name の内容も一緒に変化してしまうからです。 最初に示したコード例のように名前を文字列リテラルとして明示することで、minifyされずにエラー名を保持することができます。強い難読化の必要がなければ、エラー名はそのまま保持するほうがよいでしょう。
·wantedly.com·
JavaScriptのカスタムエラーはこれでOK | Wantedly Engineer Blog
You Should Write
You Should Write
1. Writing is everywhere
Well-written content is like a personal assistant looking for opportunities for you 24/7. It showcases your knowledge, skills, and expertise to the readers and helps you draw more visibility to your products and services.
Writing forces you to step back, look at the bigger picture, and consider other perspectives. That helps you to spot gaps in your thinking, identify biases, and fix inaccurate assumptions.
·catalins.tech·
You Should Write
Migrate to v9.x - ESLint - Pluggable JavaScript Linter
Migrate to v9.x - ESLint - Pluggable JavaScript Linter
Make sure you upgrade to at least Node.js v18.18.0 when using ESLint v9.0.0.
Four new rules have been enabled in eslint:recommended:
Flat config. If you are using flat config, you can run npx eslint or eslint (if globally installed) and ESLint will assume you want to lint the current directory. Effectively, passing no patterns is equivalent to passing . .
·eslint.org·
Migrate to v9.x - ESLint - Pluggable JavaScript Linter