Expand description
WASM Development Server
Real HTTP server implementation for serving WASM applications with hot reload. Implements GitHub issue #7: https://github.com/paiml/probar/issues/7
§Features
- HTTP server with correct MIME types for WASM
- WebSocket server for hot reload notifications
- File watcher with debouncing
wasm-packbuild integration
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ DevServer │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ HTTP Server │ │ WS Server │ │
│ │ (port 8080) │ │ (port 8081) │ │
│ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Static Files │ │ HotReload │◀───FileWatcher │
│ │ .wasm .js │ │ Messages │ │
│ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘Structs§
- DevServer
- WASM development server with HTTP and WebSocket support
- DevServer
Config - WASM development server configuration
- DevServer
Config Builder - Builder for
DevServerConfig - File
Watcher - File watcher for hot reload
- File
Watcher Builder - Builder for
FileWatcher - Import
Ref - Import reference found in HTML/JS files
- Import
Validation Error - Validation error for a single import
- Module
Validation Result - Result of validating all imports
- Module
Validator - Module validator for checking import resolution
Enums§
- File
Change Event - File change event types
- HotReload
Message - Hot reload message sent to connected clients (JSON serializable)
- Import
Type - Type of module import
Functions§
- get_
mime_ type - Get MIME type for a file path
- run_
wasm_ pack_ build - Run wasm-pack build