Closed slimsag closed 4 years ago
Should it be the responsibility of libraries to do this? Is it harmless if user also does it?
An alternative to consider is documenting this.
If this is a short/medium-term workaround for GopherJS only, then perhaps it's fine to optimize for that.
(I'm not against this, just wanted to ask some questions.)
Closing as https://github.com/hexops/vecty/issues/264 removes explicit support for things such as this.
When calling
vecty.Rerender
in tight loops, it is possible for GopherJS to not give any run time to the internal Vecty rendering goroutine and as suchvecty.Rerender
looks like it does nothing.For example, see this conversation in Slack about updating a progress bar loader: https://gophers.slack.com/archives/C0LBM1R0C/p1536229658000100
We can avoid this by adding a call to
runtime.Gosched
implicitly invecty.Rerender
which would probably be fine (and scoped only to GopherJS implementation, not WebAssembly)