Today we are happy to announce the release of GopherJS 1.8-1. You can get it on GitHub. It adds support for the recent release of Go 1.8. There have been significant performance improvements and enhancements since GopherJS 1.7-1.
The support for Go 1.8 means that GopherJS 1.8-1 requires Go 1.8 and no longer works with Go 1.7. It’s highly recommended to be using the latest version of Go and GopherJS, but if you cannot upgrade from Go 1.7 right away, you should continue to use GopherJS on the
Installation or upgrade steps remain the same as before. To get the latest official stable release of GopherJS, please follow the instructions in the README. You can confirm that you have the right version if
gopherjs version prints
GopherJS 1.8-1 continues to support nearly everything of the Go language specification, including goroutines. Please consult the package compatibility table to see which standard library packages are supported. Everything from the previous Go 1.7 version is still supported, as are many of the additions that are new to Go 1.8. If you run into any bugs or discrepancies with what the compatibility table says, please file an issue.
Some of the highlights of changes that have gone into the new release include:
- GopherJS now generates more optimized code for bounds checking. It has led to significant performance increases, up to 20–50% as measured by go1 benchmarks. It helps fmt, regexp, crypto and slice manipulation heavy code the most.
- A bug in combination of
deferand blocking code has been fixed.
- Examples (
ExampleFoo()) are now supported and executed during tests.
- Support for build tags and
--benchtimeparameter for the
gopherjs testcommand has been added.
- In package
net/http, request’s context is now used for request cancelation.
- Some situations where errors should be reported, but weren’t, are now fixed (e.g., string bounds checking and assignment to underscore).
- Various improvements to GopherJS error messages, exit codes, source maps, documentation, limitations, and contributing guidelines have been made.
Thank you to all contributors who have helped with this release, whether that’s by improving documentation, helping resolve issues, contributing code and maintaining bindings to browser APIs. It is greatly appreciated. We welcome all help; if you’d like to get involved, see the community section. If you have a good experience with GopherJS, tell your fellow gophers about it!
If you’d like to get started with GopherJS, here are some next steps you can take:
- Try it right now in your browser with the GopherJS Playground.
- Use the
gopherjs servecommand and execute your favorite Go package in the browser.
Happy surfing with Go 1.8 and GopherJS 1.8-1!