import-on-visibility
यह क्या करती है
यह स्किल लंबे पेजों और feeds में ऐसे भारी हिस्से देखती है जो दिखने से पहले लोड होते हैं। यह सामग्री-भरे पेज बनाने वाले डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब लंबा पेज चार्ट या समीक्षाएँ लोड करे जिन तक ज़्यादातर विज़िटर स्क्रॉल नहीं करते।
- ✓जब feed या dashboard पेज के नीचे दूर बैठे panels के लिए कोड भेजे।
- ✓जब भारी हिस्से दिखने पर स्क्रॉलिंग झटकेदार लगे।
Skill का लिंक
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/import-on-visibility/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप मेरे पेज का समीक्षा हिस्सा तभी लोड कर सकते हैं जब विज़िटर उसके पास स्क्रॉल करें?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट उन स्क्रीन से बाहर के कॉम्पोनेंट्स खोजता है जो पहले से लोड होते हैं, और Intersection Observer से उन्हें व्यूपोर्ट के करीब आने पर लोड करने का सुझाव देता है। लेआउट न उछले इसके लिए placeholders भी सुझाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Load non-critical code when content approaches the viewport
Many pages ship JavaScript for offscreen sections that a user may never reach. Import-on-visibility keeps the initial route lighter while still loading content early enough to feel ready when users scroll to it.
Quick Reference
- Use Intersection Observer to start loading code before an offscreen section becomes visible
- Reserve space with placeholders or skeletons so deferred sections do not cause layout shift
- Tune
rootMarginso heavy content loads early enough without competing with above-the-fold work - Use this for charts, reviews, related products, embeds, and offscreen dashboards
Check
Identify components, widgets, or modules that load on first render even though they only appear after the user scrolls. Flag which ones can switch to visibility-based loading.
Fix
Use Intersection Observer or an equivalent framework primitive to load the offscreen component or dependency when it approaches the viewport, while preserving layout stability and a clear placeholder.
Explain
Explain import-on-visibility, how it differs from import-on-interaction, and how viewport-based loading helps large pages stay fast.
Code Review
Inspect scroll-triggered sections, embeds, charts, recommendation modules, and long landing pages. Flag code that is bundled eagerly even though the corresponding UI stays offscreen until later, and verify the deferred version still loads before the user reaches it.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/performance/import-on-visibility
अक्सर पूछे जाने वाले सवाल
Intersection Observer क्या है?
यह ब्राउज़र सुविधा है जो बताती है कि कोई एलिमेंट दिखने वाले क्षेत्र के करीब आया या उसमें प्रवेश किया।
यह क्लिक पर लोड करने से कैसे अलग है?
यह सामग्री स्क्रीन के करीब आने पर कोड लोड करता है, जबकि क्लिक पर लोड विज़िटर की कार्रवाई का इंतज़ार करता है।
placeholders क्यों इस्तेमाल करें?
स्किल कहती है कि placeholders लेआउट को स्थिर रखते हैं, ताकि टाले गए हिस्से लेआउट शिफ़्ट न करें।
जानकारी
लेखक का मूल विवरण
Use when reviewing long pages, dashboards, or content feeds with expensive offscreen modules. Balance early enough loading for smooth scrolling against keeping the initial route light.
लोकप्रियता
- GitHub स्टार
- 75k
- रैंकिंग में स्थान
- #2889
- लाइसेंस
- MIT
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
frontendchecklist
75kकमांड-लाइन टूल से फ़्रंटएंड कोड और लाइव पेजों को एक्सेसिबिलिटी, स्पीड, SEO और सिक्योरिटी के 380 से ज़्यादा नियमों से जाँचती है।
frontend-checklist-global
75kफ़्रंटएंड प्रोजेक्ट को Front-End Checklist के सभी 386 नियमों से ऑडिट करती है, और हर मिली समस्या का ठोस समाधान देती है।
404-page
75kजाँचती है कि आपका गुम पेज उपयोगी लिंक देता है और सही 404 स्टेटस लौटाता है, ताकि भटके हुए विज़िटर रास्ता ढूँढ सकें।
about-page
75kजाँचती है कि आपकी साइट पर एक साफ़ About पेज है जो बताता है कि उसे कौन चलाता है, ताकि विज़िटर और सर्च इंजन का भरोसा बढ़े।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।