Before All
-
Core Reference - Contributing Framework Bindings
-
Base branch: feat/websockets-client
-
Reference Implementation: React Bindings
-
Implemented Projects: Tic Tac Toe Real Time
Summary
Create a Svelte 5 adapter package @arkosjs/svelte-websockets that wraps @arkosjs/websockets-client with Svelte 5's reactivity primitives (runes, stores, or both).
Required Files (Only Example)
integrations/svelte-websockets/
├── src/
│ ├── context.ts # Context provider (initArkosClient, getArkosClient)
│ ├── use-gateway.ts # useGateway composable
│ └── index.ts # Public exports
├── ArkosProvider.svelte # Provider component
├── package.json
├── tsconfig.json
└── README.md
API Contract (must match React version idiomatically)
<!-- Root layout -->
<ArkosProvider manager={manager}>
<App />
</ArkosProvider>
<script>
const chat = useGateway("/chat");
chat.on("receive_message", (data) => { ... });
const sendMessage = chat.useEmit("send_message");
sendMessage.emit({ text: "hello" }, { ack: true });
</script>
<div>
Status: {$chat.status}
User: {$chat.user}
{#if $sendMessage.loading} Sending... {/if}
</div>
What needs testing (since this code is AI-generated)
Deliverables
- Working Svelte 5 adapter package
- Minimal example app demonstrating connect → emit → receive
- Tests (if framework allows)
Note: The code in the contributing document is AI-generated and untested by a real framework user. Your contribution will validate and fix it. Open PR to feat/websockets-client and create your branch from it.
Before All
Core Reference - Contributing Framework Bindings
Base branch:
feat/websockets-clientReference Implementation: React Bindings
Implemented Projects: Tic Tac Toe Real Time
Summary
Create a Svelte 5 adapter package
@arkosjs/svelte-websocketsthat wraps@arkosjs/websockets-clientwith Svelte 5's reactivity primitives (runes, stores, or both).Required Files (Only Example)
API Contract (must match React version idiomatically)
What needs testing (since this code is AI-generated)
client.destroy()called)loadingflips correctly on ack emitstatusupdates reactively on disconnect/reconnectuserpopulates when server emits"authenticated"Deliverables
Note: The code in the contributing document is AI-generated and untested by a real framework user. Your contribution will validate and fix it. Open PR to
feat/websockets-clientand create your branch from it.