March Docs

Forge.GenIsland

Forge.GenIsland — forge bastion.gen.island <Name>

Generates an @island module stub in lib/islands/<snake_name>.march and creates/updates priv/static/islands/manifest.json with the source path.

Usage: forge bastion.gen.island Counter forge bastion.gen.island Counter --server forge bastion.gen.island Counter --compile

Options: --server Also generate a server-handler stub (for server-owned islands). --compile Immediately compile the island to WASM after generating.

The generated module uses the JSON-string interface: fn init() : String (initial state JSON) fn render(state_json : String) : String (HTML string) fn update(state_json, msg_json : String) : String (new state JSON)

The @island annotation tells forge bastion.build.islands to compile this module to wasm32-unknown-unknown.

Functions

fnmainmain()#
fnrunrun(args : List(String))#