Browser
The Browser platform provides optional adapters for browser-specific, non-isomorphic APIs using Web Streams.
Overview
Section titled “Overview”Browser adapters are:
- Optional - Only install when you need browser-specific functionality
- Stream-based - All use Web Streams API for consistency
- Focused - Each adapter handles a specific browser API
- Non-prescriptive - No execution semantics or persistence
Packages
Section titled “Packages”@xmachines/browser (alias)
Section titled “@xmachines/browser (alias)”Convenience package that re-exports all browser adapters.
@xmachines/browser-dom
Section titled “@xmachines/browser-dom”Stream-based DOM manipulation and observation.
@xmachines/browser-ws
Section titled “@xmachines/browser-ws”WebSocket connections using Web Streams.
@xmachines/browser-worker
Section titled “@xmachines/browser-worker”Web Worker communication via streams.
Installation
Section titled “Installation”# Install specific adapternpm install @xmachines/browser-dom
# Or install the convenience aliasnpm install @xmachines/browserCore Principles
Section titled “Core Principles”1. Web Streams Are Canonical
Section titled “1. Web Streams Are Canonical”All browser adapters use Web Streams API - no Node streams, no custom stream implementations.
2. Optional Dependency
Section titled “2. Optional Dependency”Browser adapters are opt-in. If you don’t need browser-specific APIs, you don’t need these packages.
3. No Persistence
Section titled “3. No Persistence”Browser adapters don’t handle persistence or durability - that’s handled by the core runtime.
4. No Protocol Semantics
Section titled “4. No Protocol Semantics”Adapters provide raw access to browser APIs. They don’t impose higher-level protocols or patterns.
Usage Examples
Section titled “Usage Examples”Coming soon - examples for DOM, WebSocket, and Worker adapters will be added as the packages are implemented.
Learn More
Section titled “Learn More”- RFC: Browser v1 - Technical specification
- Platform Overview - Other platform options
- Core Concepts - XMachines fundamentals