跳到正文
cccskills
免费在 GitHub 公开中文介绍

import-on-interaction

找出拖慢页面首次加载的地图、编辑器等可选功能,改为在点击或获得焦点等操作后加载所需代码,并补充加载状态提示,检查初始页面和操作后的功能。

原文查看原文说明

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.

AI 评分100分/ 100查看安装方法

适用场景

  • 打开面板时再加载地图
  • 操作编辑器时再加载代码
  • 检查拖慢首次加载的聊天功能
  • 操作后再加载导出代码

中文介绍

功能

检查页面首次显示时加载的较重功能,将其改为在用户操作后再获取所需代码。对象包括初始画面、首次输入或主要任务不需要的地图、编辑器、聊天、筛选和导出功能。使用按需加载代码的import(),减少首次发送的JavaScript以及首次加载时的执行工作。

适用场景

适合页面因提前加载只有部分用户会使用的功能而显示缓慢的情况。查找可以延后到点击、获得焦点、悬停或打开面板时再加载的依赖代码。补充能让用户了解等待状态的提示,并检查不使用延迟加载的功能时,初始页面仍能正常工作。

使用示例

  • “请找出这个页面首次显示时不需要加载的较重代码。”
  • “请在打开地图面板时通过import()加载地图,并添加等待期间的状态提示。”

注意事项

延迟加载的对象应当是初始画面、首次输入和主要任务不需要的功能。修改后,既要确认首次加载的负担有所减少,也要检查用户操作后,相应功能是否仍能正常使用。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

客观评估

AI 仅根据 SKILL.md 的内容,从 4 个方面进行了评估。星标数和热度不计入评估。

指令清晰度能否看出何时使用、做什么
A良好明确针对可选功能拖慢首次加载的情况,将代码加载延后至用户操作后。
步骤具体性步骤、输入输出和示例是否具体
A良好具体列出改用import()、添加加载提示及验证初始画面和操作后功能。
安全性发送数据、删除文件、执行命令等是否有说明
A良好将修改限定于主要任务不需要的代码,并要求检查初始显示和操作后行为。
安装难易度所需工具和 API 密钥是否少且有说明
A良好使用import(),未要求额外的API密钥或付费服务。

总分按每项 A=25 分、B=15 分、C=5 分相加。 由 AI(OpenAI Codex)于 2026年10月23日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(2)

  • SKILL.md2.1 KB
  • references/rule.md3.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

404-page

免费

Create and review custom 404 pages that help visitors recover from broken or moved links through search and navigation. Check the rendered page and HTTP response so missing content returns a proper 404 status.

中文简介正在准备中。当前显示英语简介。

  • Creating a helpful custom 404 page
  • Adding search and navigation for broken links
  • Checking missing pages that return HTTP 200
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

Audit or create a dedicated About page that explains a website’s purpose and identifies its people or organization. Review the rendered output and supporting information, including expertise and contact details, to find gaps.

中文简介正在准备中。当前显示英语简介。

  • Reviewing a website’s About page
  • Creating a page about the organization and its mission
  • Checking how operator information appears in rendered output
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

accessibility-testing

免费有简介AI 评分 80分

为页面和共用组件添加自动无障碍测试,检查现有测试的覆盖缺口,并将检查接入持续集成流程,以发现结构、属性问题及修改引入的新问题。

  • 检查共用组件的测试覆盖范围
  • 为页面交互测试添加无障碍检查
  • 在持续集成中运行无障碍检查
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

accessible-authentication

免费有简介AI 评分 90分

检查从登录、多因素认证到账户恢复的完整流程,找出禁止粘贴、验证码必须手动输入等使用障碍,并协助改进认证方式。

  • 检查完整登录流程的无障碍性
  • 确认验证码粘贴与自动填充
  • 检查密码重置与账户恢复流程
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

Review form errors, success messages, and live updates so screen reader users receive important notifications. Check the HTML delivered to the browser, announcement settings, display duration, and dismissal controls, then identify specific elements that need changes.

中文简介正在准备中。当前显示英语简介。

  • Reviewing form error announcements
  • Checking success message display duration
  • Auditing live update notifications
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

Review HTML tables so screen reader users can understand how headers and data relate. Check header markup, table descriptions, and merged cells, then identify specific fixes and ways to verify them.

中文简介正在准备中。当前显示英语简介。

  • Reviewing tables for screen reader accessibility
  • Checking header relationships in tables with merged cells
  • Reviewing table patterns in a design system
thedaviddias/Front-End-Checklist7.5万2026年10月6日 更新

查看 thedaviddias 的全部技能

报告此技能的问题