seam-engine 0.5.27

Pure-logic server engine for the SeamJS framework: page assembly, data structuring, i18n helpers
Documentation

seam-engine

Pure Rust engine for page assembly, i18n resolution, build output parsing, and JSON escaping. Single source of truth for logic shared across TS, Go, and WASM runtimes. See architecture overview.

Structure

  • src/render.rsrender_page top-level pipeline (inject + data script + meta + lang)
  • src/page.rs — Page data assembly: flatten_for_slots, build_seam_data, per-page asset slot generation (replace_asset_slots, strip_asset_slots), i18n helpers
  • src/build.rsparse_build_output, parse_i18n_config, parse_rpc_hash_map
  • src/escape.rsascii_escape_json for non-ASCII character escaping

Key Exports

Function Purpose
render_page Full page pipeline: asset slots + data slots + meta + lang
parse_build_output Parse route-manifest.json into page definitions
parse_i18n_config Extract i18n configuration from manifest
parse_rpc_hash_map Build reverse lookup from RPC hash map
ascii_escape_json Escape non-ASCII in JSON string values
i18n_query Look up translation keys from locale messages

Development

  • Build: cargo build -p seam-engine
  • Test: cargo test -p seam-engine

Notes

  • All functions take JSON strings in and return JSON strings out for WASM compatibility
  • Depends on seam-injector for template slot injection
  • Consumed by engine/wasm, which exposes these functions to JS and Go runtimes