webf-api-compatibility

0
0
Source

Check Web API and CSS feature compatibility in WebF - determine what JavaScript APIs, DOM methods, CSS properties, and layout modes are supported. Use when planning features, debugging why APIs don't work, or finding alternatives for unsupported features like IndexedDB, WebGL, float layout, or CSS Grid.

Install

mkdir -p .claude/skills/webf-api-compatibility && curl -L -o skill.zip "https://mcp.directory/api/skills/download/6271" && unzip -o skill.zip -d .claude/skills/webf-api-compatibility && rm skill.zip

Installs to .claude/skills/webf-api-compatibility

About this skill

WebF API & CSS Compatibility

Note: WebF development is nearly identical to web development - you use the same tools (Vite, npm, Vitest), same frameworks (React, Vue, Svelte), and same deployment services (Vercel, Netlify). This skill covers one of the 3 key differences: checking API and CSS compatibility before implementation. The other two differences are async rendering and routing.

WebF is NOT a browser - it's a Flutter application runtime that implements W3C/WHATWG web standards. This means some browser APIs are not available, and some CSS features work differently.

This skill helps you quickly check what's supported and find alternatives for unsupported features.

Quick Compatibility Check

When asked about a specific API or CSS feature, I will:

  1. Check if it's in the supported list
  2. Provide the compatibility status (✅ Supported, ⏳ Coming Soon, ❌ Not Supported)
  3. Explain why it's not supported (if applicable)
  4. Suggest alternatives or workarounds

JavaScript & Web APIs

✅ Fully Supported

Timers & Animation

  • setTimeout(), clearTimeout()
  • setInterval(), clearInterval()
  • requestAnimationFrame(), cancelAnimationFrame()

Networking

  • fetch() - Full support with async/await
  • XMLHttpRequest - For legacy code
  • WebSocket - Real-time bidirectional communication
  • EventSource - Server-Sent Events (SSE) for real-time server push
  • URL and URLSearchParams - URL manipulation

Storage

  • localStorage - Persistent key-value storage
  • sessionStorage - Session-only storage

Graphics

  • Canvas 2D - Full 2D canvas API
  • SVG - SVG element rendering

DOM APIs

  • document, window, navigator
  • querySelector(), querySelectorAll()
  • addEventListener(), removeEventListener()
  • createElement(), appendChild(), etc.
  • MutationObserver - Watch DOM changes
  • Custom Elements - Define custom HTML elements

Events

  • click - Enabled by default
  • Other events via FlutterGestureDetector (double-tap, long-press, etc.)

⏳ Coming Soon

  • CSS Grid - Planned for future release
  • Tailwind CSS v4 - Planned for 2026

❌ NOT Supported

Storage

  • IndexedDB - Use native plugin instead
    • Alternative: sqflite, hive, or custom plugin

Graphics

  • WebGL - Not available, no alternative
  • Web Animations API (JavaScript) - CSS animations work, but not the JS API

Workers

  • Web Workers - Not needed
    • Why: JavaScript already runs on dedicated thread in WebF
    • No performance benefit from workers

DOM

  • Shadow DOM - Not used for component encapsulation
    • Use framework component systems instead (React, Vue, etc.)

Observers

  • IntersectionObserver - Use onscreen/offscreen events instead

CSS Compatibility

✅ Fully Supported Layout Modes

Standard Flow

  • block - Block-level elements
  • inline - Inline elements
  • inline-block - Inline elements with block properties

Flexbox (Recommended)

  • display: flex
  • All flex properties (justify-content, align-items, flex-direction, etc.)
  • This is the recommended layout approach

Positioned Layout

  • position: relative
  • position: absolute
  • position: fixed
  • position: sticky

Text & Direction

  • RTL (right-to-left) support
  • All text alignment and direction properties

❌ NOT Supported Layout Modes

Float Layout (Legacy)

  • float: left / float: right - NOT SUPPORTED
  • clear - NOT SUPPORTED
  • Why: Legacy layout model, use Flexbox instead

Table Layout

  • display: table - NOT SUPPORTED
  • display: table-row, display: table-cell - NOT SUPPORTED
  • Why: Use Flexbox or CSS Grid (when available)

⏳ Coming Soon

CSS Grid

  • display: grid - Planned
  • All grid properties - Planned
  • Use Flexbox until Grid is available

✅ Fully Supported CSS Features

Colors & Backgrounds

  • All color formats (hex, rgb, rgba, hsl, hsla, named)
  • background-color, background-image, background-size, etc.
  • Linear gradients, radial gradients

Borders & Shapes

  • border, border-radius, border-color, etc.
  • box-shadow, text-shadow

Transforms (Hardware Accelerated)

  • transform: translate(), rotate(), scale(), skew()
  • 2D and 3D transforms
  • Use for smooth animations

Animations & Transitions

  • transition - All transition properties
  • @keyframes and animation
  • CSS animations are fully supported

Layout & Sizing

  • width, height, min-width, max-width, etc.
  • margin, padding
  • box-sizing

Responsive Design

  • @media queries
  • Viewport units (vw, vh, vmin, vmax)
  • Some advanced units not supported (dvh, lvh, svh)

Advanced CSS

  • CSS variables (--custom-property)
  • Pseudo-classes (:hover, :active, :focus, etc.)
  • Pseudo-elements (::before, ::after)
  • Filters (blur, brightness, contrast, etc.)
  • z-index and stacking contexts

⚠️ Partially Supported

Tailwind CSS

  • v3 - ✅ Supported (some utilities may not work if they use unsupported features)
  • v4 - ❌ Not yet supported (planned for 2026)

❌ NOT Supported CSS Features

  • backdrop-filter - Not available
  • Advanced viewport units - dvh, lvh, svh

Architecture Differences

Understanding why some features aren't available:

AspectBrowserWebF
RuntimeV8 / SpiderMonkeyQuickJS (ES6+)
DOMBlink / GeckoCustom C++ + Dart
LayoutBrowser engineFlutter rendering
PurposeGeneral web browsingApp runtime

Key Insight: WebF implements core web standards for building apps, not for web browsing.

Finding Alternatives

For IndexedDB → Use Native Storage

// ❌ IndexedDB not available
// const db = await openDB('mydb', 1);

// ✅ Option 1: localStorage for simple key-value storage (RECOMMENDED for most cases)
localStorage.setItem('user', JSON.stringify({ name: 'Alice', age: 30 }));
const user = JSON.parse(localStorage.getItem('user'));

// ✅ Option 2: Request custom native plugin from Flutter team
// For complex database needs (SQL, large datasets, queries):
// - Flutter team creates native plugin using sqflite, Hive, or Isar
// - Plugin exposed to JavaScript via WebF module system
// - See: https://openwebf.com/en/docs/add-webf-to-flutter/bridge-modules

// Example of custom storage plugin (created by Flutter team):
// import { AppStorage } from '@yourapp/storage-plugin';
// await AppStorage.save('key', { complex: 'data' });
// const data = await AppStorage.get('key');

For WebGL → No Alternative

// ❌ WebGL not available
// const gl = canvas.getContext('webgl');

// ✅ Use Canvas 2D instead (limited graphics)
const ctx = canvas.getContext('2d');

// ✅ Or use Flutter's rendering for complex graphics
// Flutter team can render directly

For Float Layout → Use Flexbox

/* ❌ Float layout not supported */
.sidebar { float: left; width: 200px; }
.content { float: right; width: calc(100% - 200px); }

/* ✅ Use Flexbox instead */
.container { display: flex; }
.sidebar { width: 200px; flex-shrink: 0; }
.content { flex-grow: 1; }

For Table Layout → Use Flexbox

/* ❌ Table layout not supported */
.table { display: table; }
.row { display: table-row; }
.cell { display: table-cell; }

/* ✅ Use Flexbox instead */
.table { display: flex; flex-direction: column; }
.row { display: flex; }
.cell { flex: 1; }

For Native Device Features → Use WebF Plugins

Check available plugins: https://openwebf.com/en/native-plugins

WebF provides official npm packages for native features. When you need a native feature:

  1. First, check the available plugins list at https://openwebf.com/en/native-plugins
  2. Ask the user about their environment before providing setup instructions
  3. Follow the plugin's installation guide for their specific environment

Step 1: Determine Your Environment

IMPORTANT: Setup differs based on your development environment.

Question: "Are you testing in WebF Go, or working on a production app?"

Option 1: Testing in WebF Go (Most web developers)

  • ✅ Just install npm package
  • ✅ No additional setup needed
  • Example: npm install @openwebf/webf-share

Option 2: Production app with Flutter team

  • ⚠️ Your Flutter developer needs to add the Flutter plugin first
  • ⚠️ Once they've done that, you install the npm package
  • ⚠️ Coordinate with your Flutter team - give them the plugin documentation

Example: Native Share Plugin

If using WebF Go:

# Just install npm package
npm install @openwebf/webf-share

If integrating with Flutter app:

# 1. Add Flutter plugin first (in pubspec.yaml)
# See: https://openwebf.com/en/native-plugins/webf-share

# 2. Then install npm package
npm install @openwebf/webf-share

Usage in JavaScript:

import { WebFShare } from '@openwebf/webf-share';

// Check availability first
if (WebFShare.isAvailable()) {
  // Share text
  await WebFShare.shareText({
    text: 'Check this out!',
    url: 'https://example.com',
    title: 'My App'
  });
}

// Or use React hook
import { useWebFShare } from '@openwebf/webf-share';

function ShareButton() {
  const { share, isAvailable } = useWebFShare();

  if (!isAvailable) return null;

  return (
    <button onClick={() => share({ text: 'Hello!' })}>
      Share
    </button>
  );
}

Finding the Right Plugin

When looking for native features:

  1. Check plugin list: https://openwebf.com/en/native-plugins
  2. If plugin exists: Follow its installation guide
  3. If no plugin exists:
    • For WebF Go users: Feature may not be available
    • For Flutter integration: Create custom plugin using WebF Module System

How to Check Compatibility

1. Check the Compatibility Table

See reference.md in


Content truncated.

webf-native-plugins

openwebf

Install WebF native plugins to access platform capabilities like sharing, payment, camera, geolocation, and more. Use when building features that require native device APIs beyond standard web APIs.

20

webf-routing-setup

openwebf

Setup hybrid routing with native screen transitions in WebF - configure navigation using WebF routing instead of SPA routing. Use when setting up navigation, implementing multi-screen apps, or when react-router-dom/vue-router doesn't work as expected.

00

webf-async-rendering

openwebf

Understand and work with WebF's async rendering model - handle onscreen/offscreen events and element measurements correctly. Use when getBoundingClientRect returns zeros, computed styles are incorrect, measurements fail, or elements don't layout as expected.

10

webf-native-ui-dev

openwebf

Develop custom native UI libraries based on Flutter widgets for WebF. Create reusable component libraries that wrap Flutter widgets as web-accessible custom elements. Use when building UI libraries, wrapping Flutter packages, or creating native component systems.

00

webf-infinite-scrolling

openwebf

Create high-performance infinite scrolling lists with pull-to-refresh and load-more capabilities using WebFListView. Use when building feed-style UIs, product catalogs, chat messages, or any scrollable list that needs optimal performance with large datasets.

50

webf-quickstart

openwebf

Get started with WebF development - setup WebF Go, create a React/Vue/Svelte project with Vite, and load your first app. Use when starting a new WebF project, onboarding new developers, or setting up development environment.

40

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318398

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

451339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.