Skip to content

Commit 70aad97

Browse files
committed
doc: update skills
1 parent 52aed50 commit 70aad97

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

skills/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ See [WebF Integration Guide](https://openwebf.com/en/docs/developer-guide/integr
8888
**Use when**: Planning features, debugging why APIs don't work, or finding alternatives for unsupported features
8989

9090
**What it covers**:
91-
- JavaScript API compatibility (fetch ✅, IndexedDB ❌, WebGL ❌)
91+
- JavaScript API compatibility (fetch ✅, EventSource ✅, IndexedDB ❌, WebGL ❌)
9292
- CSS feature support (Flexbox ✅, float ❌, Grid ⏳)
9393
- Framework compatibility (React, Vue, Svelte, Tailwind CSS)
9494
- Native plugin alternatives (@openwebf/webf-share, custom plugins)

skills/webf-api-compatibility/SKILL.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ When asked about a specific API or CSS feature, I will:
3232
#### Networking
3333
- `fetch()` - Full support with async/await
3434
- `XMLHttpRequest` - For legacy code
35-
- `WebSocket` - Real-time communication
35+
- `WebSocket` - Real-time bidirectional communication
36+
- `EventSource` - Server-Sent Events (SSE) for real-time server push
3637
- `URL` and `URLSearchParams` - URL manipulation
3738

3839
#### Storage
@@ -398,6 +399,15 @@ JavaScript in WebF already runs on a **dedicated thread**, separate from the Flu
398399
- ✅ TanStack Query
399400
- ✅ Apollo Client (if using fetch)
400401

402+
### "Can I use AI streaming APIs (OpenAI, etc.)?"
403+
404+
**Yes!** WebF supports both `EventSource` (SSE) and `fetch()` streaming, which are the two main approaches used by AI SDKs:
405+
406+
- ✅ OpenAI streaming (uses SSE)
407+
- ✅ Vercel AI SDK (uses SSE / fetch streaming)
408+
- ✅ Any SSE-based streaming API
409+
-`EventSource` with named events, auto-reconnect, and `lastEventId`
410+
401411
### "What about CSS-in-JS libraries?"
402412

403413
Most work fine as they generate standard CSS:
@@ -461,7 +471,9 @@ Need graphics?
461471
462472
Need networking?
463473
├─ HTTP requests → fetch ✅
464-
├─ Real-time → WebSockets ✅
474+
├─ Real-time (bidirectional) → WebSocket ✅
475+
├─ Real-time (server push) → EventSource (SSE) ✅
476+
├─ AI streaming → EventSource or fetch ✅
465477
└─ GraphQL → fetch-based clients ✅
466478
467479
Need native features?

skills/webf-api-compatibility/reference.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Complete compatibility tables for quick reference when building WebF application
2828
|-----|--------|-------|
2929
| `fetch()` || Full async/await support |
3030
| `XMLHttpRequest` || For legacy code |
31-
| `WebSocket` || Real-time communication |
31+
| `WebSocket` || Real-time bidirectional communication |
32+
| `EventSource` || Server-Sent Events (SSE) — server push, auto-reconnect, named events |
3233
| `URL` || URL parsing and manipulation |
3334
| `URLSearchParams` || Query string handling |
3435

@@ -272,13 +273,15 @@ Complete compatibility tables for quick reference when building WebF application
272273
| Recoil || Full support |
273274
| MobX || Full support |
274275

275-
### Data Fetching
276+
### Data Fetching & Streaming
276277
| Library | Support | Notes |
277278
|---------|---------|-------|
278279
| React Query (TanStack Query) || Full support |
279280
| SWR || Full support |
280281
| Axios || Full support |
281282
| Apollo Client || Works if using fetch transport |
283+
| Vercel AI SDK || SSE streaming via EventSource |
284+
| OpenAI SDK (streaming) || SSE streaming supported |
282285

283286
### CSS-in-JS
284287
| Library | Support | Notes |
@@ -323,6 +326,7 @@ const webfFeatures = {
323326
// Networking
324327
fetch: typeof fetch !== 'undefined',
325328
websocket: typeof WebSocket !== 'undefined',
329+
eventSource: typeof EventSource !== 'undefined',
326330

327331
// Workers
328332
webWorkers: typeof Worker !== 'undefined', // Will be false

0 commit comments

Comments
 (0)