WASM Client

Provides a WebAssembly library and HTML host for an HTTP client

Technology

The wasmclient module provides WebAssembly (WASM) client capabilities for Project Forge applications. It enables you to compile portions of your Go application to WebAssembly and run it in web browsers, providing a bridge between server-side Go code and client-side execution.

Overview

This module extends Project Forge applications with:

Key Features

WebAssembly Integration

Development Experience

Performance

Package Structure

Core WASM Components

Build Infrastructure

HTML Host (with Sandbox Module)

Usage

Development Workflow

  1. Write Go code in app/wasm/main.go and app/wasm/funcs.go
  2. Export functions for JavaScript access using //export comments
  3. Build and test using the provided build scripts
  4. Deploy the generated WASM and JavaScript files

Integration with Sandbox

When the sandbox module is enabled, a complete testbed environment is created that provides: - HTML host page for your WASM application - JavaScript debugging console - Performance monitoring tools - Interactive testing interface

Configuration

The module works with standard Project Forge configuration and requires: - Go {{{ .GoMajorVersionSafe }}}+ with WebAssembly support - Modern web browser with WASM support - sandbox module (optional, for testbed environment)

Build Process

The WASM build process: 1. Compiles Go source to WebAssembly binary 2. Generates JavaScript bridge code 3. Optimizes binary size and performance 4. Creates deployment-ready assets

Source Code

See Also