Overview
Moving the editor “brain” to Rust does not remove browser editing quirks: composition, clipboard normalization, selection APIs, and undo interaction remain host concerns unless you replace the surface entirely (e.g. canvas with a custom input stack—then you inherit different costs).
These pages focus on architecture and boundaries: where editing happens, how IME relates to your Rust model, how data crosses the JS↔WASM line, and how collaboration layers (CRDT) often sit next to WASM modules.
For language-agnostic editor design (schema, transactions, HTML mapping), use Editor . Here we assume a Rust core + browser host.
Why a whole section?
- Editing model choices (DOM vs canvas vs hybrid) change who implements caret, IME, and accessibility.
- IME is not “implemented in Rust” in the browser: you integrate with composition events and reconcile to your model.
- FFI: every keystroke or paste can accidentally copy whole documents across the boundary—design matters as much as algorithms.
- Collaboration often uses Rust CRDT crates with WASM bindings while the visible editor remains JS-hosted.
How this fits the rest of the site
Scenarios and Cases document real browser behavior (IME, paste, selection). WASM teams hit the same phenomena; these guides explain how they connect to a Rust core.
Guides
Editing approaches
contenteditable + WASM: source of truth, event order, DOM↔model loop, normalization, and when to call Rust.
IME & composition
composition events, syncing a Rust document model, and why the browser still owns the IME.
JS ↔ WASM boundary
Strings, copies, batched ops, async vs input events, and keeping the hot path cheap.
Clipboard & input routing
beforeinput, paste, routing decisions in JS vs sanitization in WASM.
Tooling, bundle & workers
wasm-pack, wasm-opt, code splitting, Web Workers, COOP/COEP and threads.
Collaboration & CRDT (WASM)
Yrs/y-crdt, bridging to Yjs, snapshots vs update streams with an editor host.
Selection, Range & offsets
UTF-16 vs UTF-8 indices, Selection/Range in JS, mapping to a Rust model and getTargetRanges.
Undo & redo model
Browser undo stack vs model history, programmatic DOM, and WASM-hosted transactions.
Accessibility (WASM host)
Roles, focus, screen readers when the editable surface is still the browser.
Testing & debugging
E2E, profiling the JS↔WASM boundary, reproducing IME and paste in CI.
Security & deployment
CSP, SRI, module integrity, and hosting WASM next to contenteditable.