Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TinyGo Support and Cloudflare Workers Example #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ben-krieger
Copy link
Member

@ben-krieger ben-krieger commented Oct 7, 2024

$ GOOS=js GOARCH=wasm go build -ldflags '-s -w' -o go-rv.wasm ./examples/wasm/main.go && du -h go-rv.wasm
12M    go-rv.wasm
$ tinygo build -target wasm -no-debug -gc leaking -o tinygo-rv.wasm ./examples/wasm/main.go && du -h tinygo-rv.wasm
1.5M    tinygo-rv.wasm

~88% size reduction before compression

Also, updated sqlite module to not use transactions, because Cloudflare D1 does not support them.

Tracking upstream PRs that need to be merged and released first:

Other tasks:

  • Remove usage of (*http.Request).PathValue in non-TinyGo code
  • Document required TinyGo version
  • Remove syumai/workers fork replace statement in examples/go.mod
  • Add TinyGo CI tests for at least ., ./cbor, and ./http
  • Investigate upsert in SetRVBlob setting rv to []byte{0x00}

http/util_tinygo.go Outdated Show resolved Hide resolved
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch from 1c3ecf0 to 580d17d Compare October 9, 2024 14:23
cbor/map.go Outdated Show resolved Hide resolved
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch 4 times, most recently from 8ff4280 to 452fad3 Compare October 24, 2024 05:11
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch 2 times, most recently from 0bd763a to 4d523b0 Compare October 28, 2024 02:14
@ben-krieger ben-krieger changed the title Add TinyGo support for {DI,TO0,TO1}Server TinyGo Support and Cloudflare Workers Example Oct 28, 2024
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch 17 times, most recently from 4bf7afa to d407a92 Compare October 31, 2024 02:19
@ben-krieger ben-krieger marked this pull request as ready for review October 31, 2024 02:28
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch 2 times, most recently from fb846f4 to 27edd33 Compare October 31, 2024 03:55
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch 3 times, most recently from 7c5d36f to 6ebf686 Compare October 31, 2024 16:43
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch from 6ebf686 to 67c909b Compare November 7, 2024 16:46
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch from 67c909b to 76838ba Compare November 11, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant