Skip to content

Releases: gopherjs/gopherjs

Gopherjs v1.18.0-beta2 (for Go 1.18.5)

25 Dec 19:17
Choose a tag to compare

In this release we have a whole lot of nice features contributed by our users. Special shout out to @visualfc who contributed support for the standard embed package (and a few other things!) and to @tomconnell-wf who rewrote the entire map implementation based on the faster ES 2015 native Map type.

In the mean time, the work on generics is still progressing (albeit slower than we hoped it would) and we are planning to make a new stable release as soon as it is completed.

What's Changed

New Contributors

Full Changelog: 1.18.0-beta1+go1.18.5...v1.18.0-beta2+go1.18.5

GopherJS 1.18.0 beta1 for Go 1.18.5

18 Aug 09:59
Choose a tag to compare

Hi Gophers!

This GopherJS release is one of the biggest in a long while, and we would like to give you a bit more details about it and the changes to come:

Go 1.18 support

First and foremost, this release brings compatibility with Go 1.18, with only one caveat generics are not supported yet. We know many of you are excited and want to be able to use them in your projects, so implementing generics is at the top of our todo list 📃

We debated whether to release GopherJS 1.18 now, or delay until generics are ready, and ultimately decided that for many of our users generics are not as important as being able to use a supported Go release. At the same time, we can't say that Go 1.18 is complete without generics, so we decided to mark this release as GopherJS 1.18.0-beta1, and we will publish a stable 1.18.0 release as soon as generics are ready for use.

We are also aware that Go 1.19 was recently released, and we will begin working on supporting it soon, stay tuned.

Changes to GOOS/GOARCH used by GopherJS.

Historically, GopherJS used GOARCH=js and GOOS=<your host system> (for example, linux) when building Go code. This led to numerous difficulties in maintenance (trying to make OS-specific code in the standard library compatible with the browser environment) and for the users (build errors on Mac OS and Windows machines).

Starting from 1.18, GopherJS will use GOOS=js and GOARCH=ecmascript when building code outside of the standard library and GOOS=js GOARCH=wasm when building the standard library itself. With this change come the following benefits:

  • Reusing more of the standard library code for WebAssembly environment, and thus less work required to support new Go releases.
  • Easier portability between Go WebAssembly and GopherJS, with more standard packages behaving in the same was on both platforms.
  • Official support for using GopherJS on Windows and Mac OS. Our CI workflows have been extended to cover Windows and Mac OS, in addition to Linux, reducing chances of a breakage.

In addition, now GopherJS always sets the gopherjs build tag, which you can also use to target GopherJS compiler specifically (not just any compiler that may compile Go to ECMAScript).

To make the transition easier, the build toolchain will accept different GOOS/GOARCH combinations when provided explicitly: GOOS=linux GOARCH=js gopherjs build ./.... This will be honored when building the code outside of the standard library, but the standard library itself will still be built with GOOS=js GOARCH=wasm. We plan to remove this override support on GopherJS 1.19 or 1.20.

node-syscall extension is now deprecated.

In the past NodeJS users needed to build a custom node-syscall extension to be able to access file system in GopherJS programs. Starting with GopherJS 1.18 this module is no longer necessary, we implemented file system access (and a few other OS interfaces) using Node's own fs and process APIs. It is also now possible to use file system in a browser environment using a shim like BrowserFS, which implements several different ways of emulating Node's fs APIs in the browser.

If your code relies on being able to make raw syscalls, you can use gopherjs build --tags legacy_syscall ... to re-enable it, see details in the documentation. We plan to remove node-syscall support completely in GopherJS 1.19 or 1.20.

ECMAScript 2015

GopherJS now targets ECMAScript 2015 compatibility for its generated code. Even though the generated code was syntactically compatible with ECMAScript 5, we've been already relying on some of the ES2015 APIs (such as typed arrays), and starting with GopherJS 1.18 we begin using ES2015 syntax in the generated JavaScript code.

Using more modern versions of ECMAScript unlocks new features and performance improvements. For example #1137 reduces the size of compiled code by 3% after minification and gzip compression.

As the time passes, we may begin targeting newer versions of ECMAScript in order to improve GopherJS's performance and features. ECMAScript version policy in our wiki defines our strategy for this.

What's Changed

New Contributors

Full Changelog: v1.17.2+go1.17.9...v1.18.0-beta1+go1.18.5

Gopherjs v1.17.2 (for Go 1.17.9)

19 Apr 15:38
Choose a tag to compare

Improvements and features

  • js: add MakeFullWrapper to expose exported methods and struct fields. by @myitcv and @JounQin in #1112
  • Command line options to control build cache by @nevkontakte in #1107
  • Better stack trace parsing in the browser by @flimzy in #1097
  • Disable test output buffering when testing only one package. by @nevkontakte in #1087
  • Detect unsupported GOOS by @inkeliz in #879
  • compiler/natives/src/strconv: Use js string conversion utilities to improve performance by @lologarithm in #1101
  • Orders source files before compilation to ensure reproducible output by @dave in #1100
  • Add flags to collect CPU and allocation profiles for GopherJS by @nevkontakte in #1114

Bug fixes

  • Improved build cache correctness by @nevkontakte in #1098 and #1105
  • Assume all functions without body are blocking. by @nevkontakte in #1086
  • Fix a typo in slice-to-array conversion tests. by @nevkontakte in #1089
  • Correctly handle built-ins and js.Object methods with go keyword. by @nevkontakte in #1090
  • compiler: fix variadic args not being nil when zero length. by @myitcv in #1096
  • Prevent non-blocking select from making function appear blocking. by @nevkontakte in #1108
  • Propagate blocking function information through function literal calls. by @FrankRehin in #1115


  • Clarify in which runtimes js.Module variable is available. by @nevkontakte in #1095

New Contributors

Full Changelog: 1.17.1+go1.17.3...v1.17.2+go1.17.9

GopherJS 1.17.1 (for Go 1.17.3)

08 Nov 21:16
Choose a tag to compare

Improvements and features

  • 64-bit integer arithmetic and math/big ~10x performance improvement by @nevkontakte in #1082
  • Support environments without process.argv by @tsavola in #1068
  • Source maps: preserve position information for top-level variable declarations. by @nevkontakte in #1070
  • Improve temporary file management in gopherjs test. by @nevkontakte in #1081

Bug fixes

New Contributors

Full Changelog: 1.17.0+go1.17.1...1.17.1+go1.17.3

GopherJS 1.17.0 (for Go 1.17.1)

20 Sep 11:30
Choose a tag to compare

Go 1.17 is now supported by GopherJS!! See the upstream Go 1.17 release notes for details. Noteable exceptions/differences with GopherJS:

This release is tested against the Go 1.17.1 standard library, although all versions of Go 1.17.x are expected to work.

GopherJS 1.16.4 (for Go 1.16.7)

22 Aug 11:49
Choose a tag to compare
  • Go Modules are fully supported by GopherJS! build, test and serve and other subcommands now work outside of GOPATH! 🎉
  • Release tested against Go 1.16.7 and Node 12.
  • It is now easier to install NodeJS dependencies for GopherJS. Simply run npm install in the root of the GopherJS working copy and all dependencies will be installed under node_modules.
  • Several minor fixes in the GopherJS runtime, compiler and syscall/js. Thanks to @benma for fixing an issue when using GopherJS within a Chrome extension!

GopherJS 1.16.3 (for Go 1.16.5)

19 Jun 14:11
Choose a tag to compare
  • Tested with Go 1.16.5
  • Fully up to date support for the 'syscall/js' including IsNull, IsUndefined, IsNaN, Delete and Equal methods and correct panic types.
  • Further fixes to the syscall package under MacOS/M1 (GOOS=darwin GOARCH=arm64).
  • Fixed incorrect deferral handling triggered by JS exceptions.

GopherJS 1.16.2 (for Go 1.16.4)

23 May 12:54
Choose a tag to compare
  • Tested with the latest go 1.16.4.
  • Fixed build errors in the syscall package under GOOS=darwin.
  • Fixed a panic in (although see a caveat).

GopherJS 1.16.1 (for Go 1.16.3)

21 Apr 09:52
Choose a tag to compare
  • syscall/js: Added support for CopyBytesToGo() and CopyBytesToJS (thanks @paralin and @findleyr).
  • Compiler: Fixed panics caused by untyped nils.
  • Compiler: Print additional debugging information if a panic happens during compilation.
  • Development: GOPHERJS_SKIP_VERSION_CHECK allows to use GopherJS with any Go version (no guarantees it'll work well! 😉)

The long-awaited Go 1.16 release!

06 Apr 12:24
Choose a tag to compare

GopherJS lives again! Now with Go 1.16 support!