Gopherjs Versions Save

A compiler from Go to JavaScript for running Go code in a browser

v1.19.0-beta1

2 months ago

Hi Gophers!

We know it's a bit overdue, but at last we are ready to present you a new GopherJS release updated for Go 1.19. Initially we intended to finish generics support before picking up 1.19, but thanks to @grantnelson-wf we were able to work on both in parallel. Please note that generics support is still not merged, but it is getting very close, honestly! πŸ˜… Like with 1.18, we will release 1.19 as a beta release until generics are ready for general use.

What's Changed

New Contributors

Full Changelog: https://github.com/gopherjs/gopherjs/compare/v1.18.0-beta3...v1.19.0-beta1

v1.18.0-beta3+go1.18.10

11 months ago

What's Changed

Full Changelog: https://github.com/gopherjs/gopherjs/compare/v1.18.0-beta2+go1.18.5...v1.18.0-beta3+go1.18.10

v1.18.0-beta2+go1.18.5

1 year ago

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: https://github.com/gopherjs/gopherjs/compare/1.18.0-beta1+go1.18.5...v1.18.0-beta2+go1.18.5

v1.18.0-beta1+go1.18.5

1 year ago

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 https://github.com/gopherjs/gopherjs/pull/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: https://github.com/gopherjs/gopherjs/compare/v1.17.2%2Bgo1.17.9...v1.18.0-beta1+go1.18.5

v1.17.2+go1.17.9

2 years ago

Improvements and features

Bug fixes

Documentation

New Contributors

Full Changelog: https://github.com/gopherjs/gopherjs/compare/1.17.1+go1.17.3...v1.17.2+go1.17.9

1.17.1+go1.17.3

2 years ago

Improvements and features

Bug fixes

New Contributors

Full Changelog: https://github.com/gopherjs/gopherjs/compare/1.17.0+go1.17.1...1.17.1+go1.17.3

1.17.0+go1.17.1

2 years ago

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.

1.16.4+go1.16.7

2 years ago
  • 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!

1.16.3+go1.16.5

2 years ago
  • 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.

1.16.2+go1.16.4

2 years ago
  • Tested with the latest go 1.16.4.
  • Fixed build errors in the syscall package under GOOS=darwin.
  • Fixed a panic in golang.org/x/crypto/chacha20poly1305 (although see a caveat).