本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2821

dom-size

できること

このスキルは、ページに含まれるHTMLの要素の数と、そのネストの深さを確認します。ページが遅く、重く感じられる開発者向けです。

使う場面

  • ✓長いリストのあるページのスクロールが遅くなったとき。
  • ✓ブラウザの監査が、非常に大きなページの構造を報告しているとき。
  • ✓何も役立たないラッパーの要素が多いとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/dom-size/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/dom-size/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のページのHTMLの要素が多すぎないか、確認してもらえますか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、ブラウザのツールで要素の総数とネストの深さを測ります。その後、不要なラッパーを取り除き、長いリストを小さな部分に分けて表示することを提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Reduce DOM size and complexity

An excessive DOM size increases memory usage, slows down style calculations, and makes layout reflows more expensive, leading to poor interaction performance.

Quick Reference

  • Keep total DOM nodes below 1,500
  • Avoid deep nesting (maximum depth < 32)
  • Use virtualization for long lists of elements

Check

Check the total number of DOM nodes and the maximum DOM depth using Lighthouse or Chrome DevTools.

Fix

Simplify the HTML structure, remove unnecessary wrapper elements, and implement virtualization for large lists.

Explain

Explain the performance impact of a large DOM tree on memory and rendering speed.

Code Review

Review the routes, assets, and loading behavior that affect Reduce DOM size and complexity. Flag exact files, requests, or rendering steps that add unnecessary network, CPU, or layout cost, and describe the measurement method used to confirm the issue.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/performance/dom-size

よくある質問

要素がどのくらいになると多すぎますか?

合計を約1,500要素未満に保ち、ネストは約32階層以内に抑えることを、このスキルは提案しています。

仮想化とは何ですか?

画面に見えるリストの項目だけを表示することで、ページを軽く保つ方法です。

問題はどう測定されますか?

LighthouseまたはChrome DevToolsを提案しています。

詳細

作者による元の説明

Use when auditing slow page loads, heavy assets, or rendering delays related to Reduce DOM size and complexity. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2821
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル