Releases: gopherjs/gopherjs
GopherJS 1.19.0 beta1 for Go 1.19.13
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
- Use go:embed for prelude JS snippets by @flimzy in #1200
- Use esbuild to minify prelude by @flimzy in #1204
- Improve ordering of EscapingObjects by @flimzy in #1205
- Fix compiler panic when handling composite literals representing named pointer types. by @nevkontakte in #1208
- gofumpt the repo by @flimzy in #1207
- Bump semver from 7.3.5 to 7.5.3 in /node-syscall by @dependabot in #1209
- Rerun gofumpt with a modern version, to adapt the 1.19 GoDoc changes by @flimzy in #1210
- Use golangci-lint to run govet by @flimzy in #1213
- Perform a few automated ES6 transformations to our prelude by @flimzy in #1215
- Ability to call overridden functions from the std library by @flimzy in #1216
- Update golang.org/x/tools/go/gcexportdata by @flimzy in #1220
- compiler/natives/src/reflect: add func name.setPkgPath by @visualfc in #1223
- Bump xcode version used in CI by @flimzy in #1230
- natives: duplicate aliasing.go in x/crypto revisted by @benma in #1227
- support internalising structs by @naorzr in #1229
- Avoid build failures with Go 1.21.0 installed in the environment. by @makiuchi-d in #1232
- nosync: fix build for golang.org/x/tools/internal/tokeninternal by @visualfc in #1233
- compiler: discard metadata in VERSION file by @dmitshur in #1236
- v1.19 - Moving embedded bit from offset to name in reflect and reflectlite by @grantnelson-wf in #1250
- Updating deprecated method calls by @grantnelson-wf in #1251
- go1.19: Fix reflect by @grantnelson-wf in #1253
- Update FuncKey to handle generics by @grantnelson-wf in #1255
- Breakup parseAndAugment method by @grantnelson-wf in #1256
- Extending directive checking by @grantnelson-wf in #1257
- Add purge directive by @grantnelson-wf in #1258
- [go1.19] Update compiler by @grantnelson-wf in #1261
- [go1.19] Fix build issue and add override signature directive by @grantnelson-wf in #1260
- [go1.19] Updating natives by @grantnelson-wf in #1262
- [go1.19] Known fails and build issues fix by @grantnelson-wf in #1263
- [go1.19] Updating more natives for go1.19 by @grantnelson-wf in #1264
- [go1.19] Fixed chocolatey go version by @grantnelson-wf in #1266
- [go1.19] Limit augmentation to native files which need it by @grantnelson-wf in #1267
- Merge go1.19 branch to master by @nevkontakte in #1269
New Contributors
- @naorzr made their first contribution in #1229
- @makiuchi-d made their first contribution in #1232
- @grantnelson-wf made their first contribution in #1250
Full Changelog: v1.18.0-beta3...v1.19.0-beta1
GopherJS v1.18.0-beta3 (for Go 1.18.10)
What's Changed
- README: document the current GOOS and GOARCH values by @dmitshur in #1180
- Bump http-cache-semantics from 4.1.0 to 4.1.1 in /node-syscall by @dependabot in #1185
- Additional nil checks around NodeJS APIs. by @nevkontakte in #1187
- Fix externalization of certain nil values by @flimzy in #1194
- Fix two bugs related to type conversion by @nevkontakte in #1199
- Replace vfsgen with go:embed by @flimzy in #1197
- Remove some bits of unused code by @flimzy in #1196
- Update references to latest patch version of Go 1.18 in preparation for next beta release by @flimzy in #1198
Full Changelog: v1.18.0-beta2+go1.18.5...v1.18.0-beta3+go1.18.10
Gopherjs v1.18.0-beta2 (for Go 1.18.5)
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
- Use a Javascript Map for Go Maps. Improves performance of len() calls by orders of magnitude. 🗺️ by @tomconnell-wf in #1136
- README: suggest go install for installing by @dmitshur in #1146
- Pass nil slice when variadic arguments are omitted after regular args. by @nevkontakte in #1150
- compiler/natives: use embed package by @dmitshur in #1151
- build: support go:embed by @visualfc in #1153
- compiler/prelude: fix array type size by @visualfc in #1154
- compiler/natives/src/reflect: fix valueIntrface check struct copy by @visualfc in #1157
- compiler: go:linkname support method by @visualfc in #1152
- compiler/natives/src/reflect: compatible go reflect by @visualfc in #1160
- Replacing eval() calls in syscall/js by @matthewbelisle-wf in #1162
- compiler/natives/src/reflect: fix reflect.Value.Set kind Struct by flagIndir by @visualfc in #1164
- Make creation of source maps optional with a flag by @akolybelnikov in #1166
- Making syscall/js CSP compatible by @matthewbelisle-wf in #1168
- Bump minimatch from 3.0.4 to 3.1.2 in /node-syscall by @dependabot in #1174
New Contributors
- @tomconnell-wf made their first contribution in #1136
- @visualfc made their first contribution in #1153
- @matthewbelisle-wf made their first contribution in #1162
- @akolybelnikov made their first contribution in #1166
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
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
- Standardize on a single GOOS/GOARCH and deprecate node-syscall module. by @nevkontakte in #1111
- Do not panic in ‘os’ module if argv.Length() is 0 by @samhocevar in #1117
- Fix jsFS callback-related crashes by @samhocevar in #1118
- Support .inc.js files for standard library overlays. by @nevkontakte in #1119
- Improve nodejs stack size limit heuristic. by @nevkontakte in #1122
- Detect and execute fuzz targets as tests by @nevkontakte in #1132
- Add Go 1.18 support by @flimzy in #1116
- Use ES 2015 syntax to generate more compact code for blocking functions. by @nevkontakte in #1137
- fix some typos by @cuishuang in #1139
New Contributors
- @samhocevar made their first contribution in #1117
- @cuishuang made their first contribution in #1139
Full Changelog: v1.17.2+go1.17.9...v1.18.0-beta1+go1.18.5
Gopherjs v1.17.2 (for Go 1.17.9)
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
Documentation
- Clarify in which runtimes
js.Module
variable is available. by @nevkontakte in #1095
New Contributors
- @inkeliz made their first contribution in #879
- @JounQin made their first contribution in #1112
- @lologarithm made their first contribution in #1101
- @dave made their first contribution in #1100
- @FrankRehin made their first contribution in #1115
Full Changelog: 1.17.1+go1.17.3...v1.17.2+go1.17.9
GopherJS 1.17.1 (for Go 1.17.3)
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
- Fix two classes of "unreachable code" warnings in Firefox. by @nevkontakte in #1071
- sync/atomic: remove an unused type of code. by @nevkontakte in #1075
- Prevent event loop starvation by always scheduled goroutines. by @nevkontakte in #1079
- Fix two cases of incorrect stack unwinding after panic recovery. by @nevkontakte in #1084
New Contributors
- @tsavola made their first contribution in #1068
- @danielgtaylor made their first contribution in #1077
Full Changelog: 1.17.0+go1.17.1...1.17.1+go1.17.3
GopherJS 1.17.0 (for Go 1.17.1)
Go 1.17 is now supported by GopherJS!! See the upstream Go 1.17 release notes for details. Noteable exceptions/differences with GopherJS:
- The GopherJS toolchain has not been updated to support lazy module loading or version suffixes for
gopherjs run
- Slice to array conversion is not supported for subslices of non-linear types (https://github.com/gopherjs/gopherjs/blob/daae65060a401d321b01fef0ae7fb535230f239c/compiler/prelude/prelude.go#L178-L183)
- Outstanding compiler bugs found during the 1.17 release cycle:
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)
- Go Modules are fully supported by GopherJS!
build
,test
andserve
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 undernode_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)
- Tested with Go 1.16.5
- Fully up to date support for the 'syscall/js' including
IsNull
,IsUndefined
,IsNaN
,Delete
andEqual
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)
- Tested with the latest go 1.16.4.
- Fixed build errors in the
syscall
package underGOOS=darwin
. - Fixed a panic in
golang.org/x/crypto/chacha20poly1305
(although see a caveat).