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

Merged
merged 4 commits into from
Dec 24, 2024

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 2 times, most recently from 67c909b to 76838ba Compare November 11, 2024 18:46
@ben-krieger
Copy link
Member Author

TinyGo 0.35.0 has been released, so this PR can now be tested and finalized!

@ben-krieger ben-krieger force-pushed the tinygo-server-support branch 5 times, most recently from 8199547 to f5e8236 Compare December 24, 2024 21:27
@ben-krieger ben-krieger force-pushed the tinygo-server-support branch from f5e8236 to 1784283 Compare December 24, 2024 21:30
@ben-krieger ben-krieger merged commit aa61724 into main Dec 24, 2024
10 checks passed
@ben-krieger ben-krieger deleted the tinygo-server-support branch December 24, 2024 21:39
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