One-click install
npx skills add https://github.com/maurodf0/anime-tracker --skill webf-async-rendering
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webf-async-rendering
Source: https://github.com/maurodf0/anime-tracker/tree/main/.claude/skills/webf-async-rendering
Command: npx skills add https://github.com/maurodf0/anime-tracker --skill webf-async-rendering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

WebF's asynchronous rendering batches DOM changes, causing element measurements to return zeros or stale values if read before layout. This Skill teaches you to wait for the onscreen lifecycle before reading layout data, ensuring accurate dimensions and computed styles.

Core Features & Use Cases

  • Wait for onscreen events before reading getBoundingClientRect or computed styles.
  • Use the useFlutterAttached React hook to run code after layout.
  • Handle cleanup with offscreen to release resources when elements are removed.
  • Ideal for measuring dynamic content, tooltips, and complex layouts that render in frames.

Quick Start

Create or select an element, append it to the DOM, and attach a one-time onscreen listener; once fired, read dimensions and proceed with layout-dependent logic. In React, adopt useFlutterAttached to run a callback after the element has been laid out.

Frequently Asked Questions about webf-async-rendering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does WebF return zero or stale values when reading element dimensions?

WebF's asynchronous rendering batches DOM changes, causing element measurements to return zeros or stale values if read before layout completes. You must wait for the onscreen lifecycle event before reading layout data to ensure accurate dimensions.

How do I get accurate getBoundingClientRect measurements in WebF for dynamic content?

To get accurate getBoundingClientRect measurements in WebF, append the element to the DOM and attach a one-time onscreen listener. Once the onscreen event fires, read the dimensions and proceed with your layout-dependent logic.

Can I use React hooks to run code after WebF layout completes?

Yes, you can use the useFlutterAttached React hook to run code after WebF layout completes. This ensures safe reads of computed styles and dimensions by executing callbacks only after the element has been fully laid out.

When should I use offscreen events in WebF async rendering?

You should use offscreen events in WebF for cleanup when elements are removed from the DOM. Handling the offscreen lifecycle releases resources properly after your dynamic content or tooltips have finished rendering.

Does WebF async rendering work for complex layouts and tooltips that render in frames?

Yes, WebF async rendering is ideal for measuring dynamic content, tooltips, and complex layouts that render in batches. Waiting for onscreen and offscreen events ensures accurate post-layout measurements for these widgets.