Saltar al contenido
Skillpedia
Sitios e interfaces (frontend)75 mil · #2888

import-on-interaction

Qué hace

Esta skill revisa el código de una página en busca de funciones pesadas que se cargan antes de que alguien las use. Es para desarrolladores que quieren cargas iniciales más rápidas.

Cuándo usarla

  • ✓Cuando un widget de chat o un mapa se carga en cada visita, pero pocas personas lo usan.
  • ✓Cuando la primera carga de una página incluye un editor o una herramienta de exportación que nadie ha abierto.
  • ✓Cuando tu paquete de código inicial es mucho más grande de lo que necesita la primera vista.

Link de la skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/import-on-interaction/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/import-on-interaction/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Puedes cargar mi widget de chat solo cuando un visitante haga clic para abrirlo?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

El agente encuentra funciones que solo se necesitan tras un clic, un foco o un paso del ratón por encima, y sugiere cargarlas con un import dinámico. También sugiere mostrar una respuesta inmediata mientras se carga el código.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Load non-critical code on user interaction

Users should not pay the download, parse, and execution cost for features they may never use. Import-on-interaction shrinks initial JavaScript, reduces main-thread work during page load, and keeps the first view focused on content that matters immediately.

Quick Reference

  • Move non-essential code behind clicks, focus, hovers, or explicit user actions
  • Use dynamic import() so the code is absent from the initial route bundle
  • Show immediate UI feedback while the deferred chunk loads
  • Use this for chat widgets, editors, maps, filters, and export flows that are not needed on first paint

Check

Inspect this route or component for heavy modules, widgets, or third-party scripts that load on first render but are only needed after a user clicks, focuses, hovers, or opens a panel.

Fix

Move the non-critical dependency behind a user-triggered dynamic import(), add immediate loading feedback, and ensure the initial render still works without the deferred feature.

Explain

Explain import-on-interaction, why it improves initial performance, and which features are safe to defer until the user shows intent.

Code Review

Inspect event handlers, modal triggers, drawers, editors, maps, export actions, and third-party widgets. Flag code that is included in the initial bundle even though it is only needed after a user interaction, and verify the fix keeps the initial path lighter without degrading the triggered flow.


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

Rule page: https://frontendchecklist.io/rules/performance/import-on-interaction

Preguntas frecuentes

¿Qué es un import dinámico?

Carga un fragmento de código solo cuando se necesita, en lugar de hacerlo con la primera carga de la página.

¿Qué funciones se pueden aplazar sin problema?

La skill menciona widgets de chat, editores, mapas, filtros y flujos de exportación que no hacen falta en la primera vista.

¿La página sigue funcionando sin la función?

La skill dice que el render inicial debe seguir funcionando sin la función aplazada.

Detalles

Descripción original del autor

Use when reviewing slow initial loads caused by optional features. Prioritize code that is expensive to download or execute and not required for the first viewport, first input, or core task completion.

repo: thedaviddias/Front-End-Checklist

Popularidad

Estrellas en GitHub
75 mil
Posición en el ranking
#2888
Licencia
MIT
Actualizada
31/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas