Text Sync
React editor sends text to Svelte preview in real-time via RPC.
Type in the React editor on the left — the text appears in the Svelte preview on the right in real-time. The host page relays RPC events between the two sandboxed apps:
React Editor ──content-change──▷ Host ──content-update──▷ Svelte PreviewInitializing Aiga framework...
How It Works
- Both apps run in
sandbox="strict"iframes from the pool - The React editor calls
rpcEmit('content-change', text)on every keystroke - The host listens on the left app's RPC channel and forwards to the right app
- The Svelte preview listens for
content-updateevents and renders the text
// Host relay
const leftRpc = reactEditor.rpcChannel;
const rightRpc = sveltePreview.rpcChannel;
leftRpc.on('content-change', (data) => {
rightRpc.emit('content-update', data);
});