Skip to content

Browser

The Browser platform provides optional adapters for browser-specific, non-isomorphic APIs using Web Streams.

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

@xmachines/browser (alias)

Convenience package that re-exports all browser adapters.

@xmachines/browser-dom

Stream-based DOM manipulation and observation.

@xmachines/browser-ws

WebSocket connections using Web Streams.

@xmachines/browser-worker

Web Worker communication via streams.

Installation

Terminal window
# Install specific adapter
npm install @xmachines/browser-dom
# Or install the convenience alias
npm install @xmachines/browser

Core Principles

1. Web Streams Are Canonical

All browser adapters use Web Streams API - no Node streams, no custom stream implementations.

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

Browser adapters don’t handle persistence or durability - that’s handled by the core runtime.

4. No Protocol Semantics

Adapters provide raw access to browser APIs. They don’t impose higher-level protocols or patterns.

Usage Examples

Coming soon - examples for DOM, WebSocket, and Worker adapters will be added as the packages are implemented.

Learn More

Status

Browser packages are in development. See the Browser RFC for design specifications.