Langsung ke konten
Skillpedia
Website & UI (frontend)75k · #2812

defer-async

Fungsinya

Skill ini memeriksa cara skrip dimuat di HTML halaman web. Cocok untuk pengembang yang menginginkan halaman tampil lebih cepat.

Kapan dipakai

  • ✓Saat halaman menampilkan layar kosong selagi skrip diunduh.
  • ✓Saat tag skrip di head halaman memperlambat tampilan pertama.
  • ✓Saat Anda menginginkan halaman mulai tampil lebih cepat pada koneksi yang lambat.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/defer-async/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Bisakah Anda memeriksa tag skrip halaman saya agar tidak memperlambat pemuatan?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menemukan tag skrip yang memblokir halaman dan menambahkan defer atau async jika aman. Agent juga bisa mengubah skrip yang sesuai menjadi tipe module.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Load scripts with defer, async, or type=module

A plain <script> tag in the document head blocks all HTML parsing until the script downloads, parses, and executes. On a slow network this can add seconds of white-screen time before any content renders. defer and async allow the browser to continue parsing HTML while the script downloads, reducing Time to First Contentful Paint dramatically.

Quick Reference

  • defer downloads in parallel and executes after HTML parsing, in order — use for most scripts
  • async downloads in parallel and executes immediately when ready — use for independent scripts
  • type=module always defers and enables ES module syntax
  • Never place scripts in <head> without defer or async

Check

Find all script tags in this HTML file. Flag any in the <head> without defer or async, and any at the bottom of <body> that could be in <head> with defer.

Fix

Add defer or async to script tags in the document head, or convert to type=module where ES modules are used.

Explain

Explain the difference between defer, async, and type=module script loading, and when to use each.

Code Review

Review templates, server-rendered HTML, and shared components that output markup related to Load scripts with defer, async, or type=module. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.


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

Rule page: https://frontendchecklist.io/rules/html/defer-async

Pertanyaan umum

Apa perbedaan antara defer dan async?

Defer menjalankan skrip secara berurutan setelah halaman dibaca. Async menjalankan setiap skrip begitu tiba, tanpa urutan tertentu.

Mana yang sebaiknya saya pakai?

Skill merekomendasikan defer untuk sebagian besar skrip dan async untuk skrip yang berdiri sendiri.

Apakah ini berlaku untuk situs framework?

Skill menyatakan agar HTML akhir yang diterima browser diperiksa, bukan hanya templat sumbernya.

Detail

Deskripsi asli dari pembuat

Use when reviewing templates, rendered HTML, or shared components related to Load scripts with defer, async, or type=module. Validate the final browser-facing markup, not just the source framework abstraction.

repo: thedaviddias/Front-End-Checklist

Popularitas

Bintang GitHub
75k
Peringkat
#2812
Lisensi
MIT
Diperbarui
31/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa