hexops / vecty

Vecty lets you build responsive and dynamic web frontends in Go using WebAssembly, competing with modern web frameworks like React & VueJS.
BSD 3-Clause "New" or "Revised" License
2.79k stars 144 forks source link

Porting gopherjs js calls to use with vecty #295

Closed soypat closed 2 years ago

soypat commented 2 years ago

Hello there! I am looking to use some bindings I have been working on for use with gopherjs. Was wondering how much would it hurt to used them with vecty instead. These are the questions I have:

This is the binding's initialization procedure: https://github.com/soypat/three/blob/master/main.go

slimsag commented 2 years ago

See https://github.com/hexops/vecty/issues/264

From the looks of it, GopherJS recently added a syscall/js package compatible with the official Go standard library: https://github.com/gopherjs/gopherjs#whats-new

Pretty sure you just need to start using syscall/js instead of the (pretty much deprecated) github.com/gopherjs/gopherjs/js package.

Vecty just uses the official Go stdlib's JS support, it doesn't do anything fancy to support Go compilers that are not compatible with official Go. See https://github.com/hexops/vecty/pull/265 (but again note you probably just need to start using the new package and things likely just work in both gopherjs and vecty then.)

soypat commented 2 years ago

Thank you for the quick response! Alright so i'll just migrate to syscall/js!