Closed slimsag closed 5 years ago
It will likely be a few more weeks before I have time to begin working on this again and finish the remaining bits / merge it.
Looks like the ecosystem is maturing a bit so we're pretty closer to being able to merge this. Notable things that have happened recently:
syscall/js
support (thanks to @hajimehoshi) so we no longer need to use gopherwasm in examples and can unify our DOM implementations between GopherJS/WASM.Remaining work:
syscall/js
support / unify DOM implementations.wasmserve
has a bug only affecting example/markdown
where it returns:
(index):4 GET http://localhost:8080/main.wasm net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
No other errors, logs, etc. Unsure why. Doesn't affect other examples. cc @hajimehoshi if you have any ideas, otherwise I'll find more minimal case and file/fix upstream.
(Just checkout this branch and cd example/markdown && wasmserve
if you are keen to reproduce)
I don't think the reflect support in TinyGo is good enough: it still doesn't support inspecting structs for example. However, I have been working on a better map implementation which is a prerequisite to js.FuncOf
support so there is still progress.
wasmserve has a bug only affecting example/markdown where it returns:
That's a strange error message I've never seen. I'll take a look later, but now I'm on a business trip, so I cannot guarantee when :-)
Confirmed the wasmserve issue is actually a bug in WSL not wasmserve: https://github.com/hajimehoshi/wasmserve/issues/5
What is the status of this? I think vecty could move to using syscall/js
for both WebAssembly and GopherJS now that GopherJS has syscall/js
too. What do you think?
Merging #232 into master will increase coverage by
1.77%
. The diff coverage is57.89%
.
@@ Coverage Diff @@
## master #232 +/- ##
==========================================
+ Coverage 57.64% 59.41% +1.77%
==========================================
Files 3 4 +1
Lines 654 653 -1
==========================================
+ Hits 377 388 +11
+ Misses 219 208 -11
+ Partials 58 57 -1
Impacted Files | Coverage Δ | |
---|---|---|
markup.go | 70.96% <ø> (ø) |
:arrow_up: |
dom_native.go | 53.84% <53.84%> (ø) |
|
dom.go | 57.45% <60%> (+2.16%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 216758a...9cf66b5. Read the comment docs.
Good news! It's finally time for this to be merged: Vecty now has WebAssembly support! 😃 🎉
Prior to this PR, Vecty was only usable with GopherJS which would compile Go to JS code.
After this PR, Vecty can be used with:
All examples in the
example
directory work under both GopherJS and WebAssembly, and a README is added to describe how to compile for each.TinyGo future support
In the future, Vecty will automatically gain support for TinyGo once it supports the subset of reflection and
syscall/js
that we make use of.See https://github.com/aykevl/tinygo/issues/93 for more discussion around this.
Prior work
Supersedes the prior PR for this by using build tags instead of exposing a
gopherwasm
API directly. See https://github.com/gopherjs/vecty/pull/215#issuecomment-455829781 for discussion around this.Fixes #211