HexmosTech / Lama2

Free, Lightweight & Collaborative API Client
https://hexmos.com/lama2/index.html
GNU Affero General Public License v3.0
109 stars 6 forks source link

Wasm integration #47

Closed rogueloop closed 1 month ago

rogueloop commented 5 months ago

What type of MR is this? (check all applicable)

Web assembly integration for Lama2.

Modifying Golang to add support for building web assembly binary.

Important files to start review from in the order

  1. controller.cli.go

  2. Controller.wasm.go

  3. controller.go

other major changes :

# Build command for normal cli builds
go build -tags=cli -o build/l2 -ldflags "-X main.version=$(git tag --sort=-version:refname | head -n 1) -X main.lamawasm=cli " l2.go

# Build command for wasm builds
GOOS=js GOARCH=wasm go build -o build/l2.wasm -tags=wasm -ldflags "-X main.version=$(git tag --sort=-version:refname | head -n 1) -X main.lamawasm=lamawasm " l2.wasm.go
lovestaco commented 5 months ago

Too many files need an abstract PR description, like

  1. A wasm bin is generated
  2. The bin starts from funcname() from filename.ext
  3. Moves to blah for doing X
  4. Moves to blah2 for doing Y

It would be better to write in this way, so that when you're writing documentation you can reuse this and iterate on that.

Plus points if you put it in a mermaid diagram

It'll be more easy for you later on

Because if you do 1 month marketing, you only will forget the flow :D