wasm

command
v0.0.0-...-b8c6245 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 8 Imported by: 0

README

Readme

can be used to build Single-Page Application (SPA) in Go in different ways:

  1. Building and enhancing a static HTML website
  2. Building and embedding Web Components on a stateless website
  3. Building a full SPA with state and API calls

This example illustrates how to use for building and enhancing a static HTML website:

  1. uses the go HTML templating package to build page content directly on the front-end.
  2. generates HTML content from an embedded markdown source, directly on the front-side.

The markdown source includes two components wich are rendered with the icecake markdown extension:

<ick-icecake-brand/>:

<ick-button/>:

Build

This example requires a simple build of the wasm code where the source is located in ./examples/example1/wasm/example1.go

To build it run the build_eample task as follow:

# from the icecake root directory:
EXAMPLE=example1 task -t ./build/Taskfile.yaml build_example

The build will be located in the ./examples/website ditectory.

Run

Because this is a static webpage, you can serve the ./examples/website directory with any webserver.

We've setup liveserver to serve it, see .vscode/settings.json.

Open localhost:5510/example1.html URL.

Documentation

Overview

this main package contains the web assembly source code for the icecake example1.

It's compiled into a '.wasm' file with the build_ex1 task

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL