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

legacy-js

できること

このスキルは、サイトが古いトランスパイル済みのコードや余分なポリフィルを、それらを必要としないブラウザーに送っていないかを確認します。ビルド設定を管理する開発者向けです。

使う場面

  • ✓最新のブラウザーがすでに対応している機能のために、多くのポリフィルがバンドルに含まれているとき。
  • ✓ビルドが初期設定で非常に古いブラウザーを対象にしているとき。
  • ✓最新のブラウザー向けに、より小さく速いコードが欲しいとき。

スキルのリンク

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

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“最新のブラウザーがより軽いJavaScriptを受け取れるように、私のビルドを設定してください。”

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

仕組み

エージェントは出力内のビルドのターゲットとポリフィルを確認します。moduleとnomoduleのスクリプトを使った差分配信と、最新のコンパイルターゲットを提案します。

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

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

Avoid serving legacy JavaScript to modern browsers

Modern browsers can execute ES6+ code faster and more efficiently; serving them transpiled ES5 with polyfills adds unnecessary weight.

Quick Reference

  • Use differential serving (module/nomodule) to target modern and legacy browsers
  • Avoid heavy ES5 polyfills for browsers that support ES6+
  • Compile code to modern targets to reduce bundle size and improve execution speed

Check

Analyze the project's JavaScript output to see if modern browsers are being served unnecessary ES5 code and polyfills.

Fix

Update the build configuration to use differential serving and set a modern target for your primary JavaScript output.

Explain

Explain how serving ES6+ code to modern browsers improves performance and why transpiling everything to ES5 is no longer recommended.

Code Review

Review the routes, assets, and loading behavior that affect Avoid serving legacy JavaScript to modern browsers. 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/legacy-js

よくある質問

差分配信とは何ですか?

最新のブラウザーには最新のコードを送り、古いコードは必要なブラウザーにだけ送ることです。

全員にES5を配るべきではない理由は何ですか?

このスキルによると、最新のブラウザーはES6以降のコードをより速く効率的に実行します。

ターゲットはどこで設定されますか?

このスキルは、出力のターゲットを選ぶビルド設定を指しています。

詳細

作者による元の説明

Use when auditing slow page loads, heavy assets, or rendering delays related to Avoid serving legacy JavaScript to modern browsers. Verify the actual bottleneck in DevTools, Lighthouse, or field data before recommending changes.

repo: thedaviddias/Front-End-Checklist

人気

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

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

0

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

コメント

  • …

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

似ているスキル