You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to bump the tested Go version to 1.18.9, but it isn't available
in Chocolatey and causes Windows CI to fail. I ran the tests locally
though and there doesn't seem to be any incompatibility.
@@ -9,18 +8,18 @@ GopherJS compiles Go code ([go.dev](https://go.dev/)) to pure JavaScript code. I
9
8
10
9
### Help us make GopherJS better!
11
10
12
-
- ⤴️ **Help us make better decisions by filling a quick 15-question [GopherJS user survey](https://forms.gle/WEjZqZaPxTxjD9YP8)**.
13
-
- 📢 Report and discuss [issues](https://github.com/gopherjs/gopherjs/issues).
14
-
- 🎓 Share your knowledge and experience through [articles](https://github.com/gopherjs/gopherjs/wiki/Community-Tutorials-and-Blogs) and [documentation](https://github.com/gopherjs/gopherjs/tree/master/doc).
15
-
- 🛠️ Write GopherJS [bindings](https://github.com/gopherjs/gopherjs/wiki/Bindings) for other libraries or [contribute](https://github.com/gopherjs/gopherjs/wiki/Developer-Guidelines) to GopherJS itself.
11
+
- ⤴️ **Help us make better decisions by filling a quick 15-question [GopherJS user survey](https://forms.gle/WEjZqZaPxTxjD9YP8)**.
12
+
- 📢 Report and discuss [issues](https://github.com/gopherjs/gopherjs/issues).
13
+
- 🎓 Share your knowledge and experience through [articles](https://github.com/gopherjs/gopherjs/wiki/Community-Tutorials-and-Blogs) and [documentation](https://github.com/gopherjs/gopherjs/tree/master/doc).
14
+
- 🛠️ Write GopherJS [bindings](https://github.com/gopherjs/gopherjs/wiki/Bindings) for other libraries or [contribute](https://github.com/gopherjs/gopherjs/wiki/Developer-Guidelines) to GopherJS itself.
16
15
17
16
### What's new?
18
17
19
-
- 2022-08-18: Go 1.18 support is [available](https://github.com/gopherjs/gopherjs/releases/tag/v1.18.0-beta1%2Bgo1.18.5)!
20
-
- 2021-09-19: Go 1.17 support is available!
21
-
- 2021-08-23: Go Modules are now fully supported.
22
-
- 2021-06-19: Complete `syscall/js` package implementation compatible with the upstream Go 1.16.
23
-
- 2021-04-04: **Go 1.16 is now officially supported!** 🎉 🎉 🎉
18
+
- 2022-08-18: Go 1.18 support is [available](https://github.com/gopherjs/gopherjs/releases/tag/v1.18.0-beta2%2Bgo1.18.5)!
19
+
- 2021-09-19: Go 1.17 support is available!
20
+
- 2021-08-23: Go Modules are now fully supported.
21
+
- 2021-06-19: Complete `syscall/js` package implementation compatible with the upstream Go 1.16.
22
+
- 2021-04-04: **Go 1.16 is now officially supported!** 🎉 🎉 🎉
24
23
25
24
### Playground
26
25
@@ -38,7 +37,7 @@ version, you can use an [older GopherJS release](https://github.com/gopherjs/gop
38
37
Install GopherJS with `go install`:
39
38
40
39
```
41
-
go install github.com/gopherjs/gopherjs@v1.18.0-beta1 # Or replace 'v1.18.0-beta1' with another version.
40
+
go install github.com/gopherjs/gopherjs@v1.18.0-beta2 # Or replace 'v1.18.0-beta2' with another version.
42
41
```
43
42
44
43
If your local Go distribution as reported by `go version` is newer than Go 1.18, then you need to set the `GOPHERJS_GOROOT` environment variable to a directory that contains a Go 1.18 distribution. For example:
@@ -53,7 +52,7 @@ Now you can use `gopherjs build [package]`, `gopherjs build [files]` or `gopherj
53
52
54
53
`gopherjs` uses your platform's default `GOOS` value when generating code. Supported `GOOS` values are: `linux`, `darwin`. If you're on a different platform (e.g., Windows or FreeBSD), you'll need to set the `GOOS` environment variable to a supported value. For example, `GOOS=linux gopherjs build [package]`.
55
54
56
-
*Note: GopherJS will try to write compiled object files of the core packages to your $GOROOT/pkg directory. If that fails, it will fall back to $GOPATH/pkg.*
55
+
_Note: GopherJS will try to write compiled object files of the core packages to your $GOROOT/pkg directory. If that fails, it will fall back to $GOPATH/pkg._
57
56
58
57
#### gopherjs run, gopherjs test
59
58
@@ -79,11 +78,11 @@ If you include an argument, it will be the root from which everything is served.
79
78
80
79
There are some GopherJS-specific environment variables:
81
80
82
-
-`GOPHERJS_GOROOT` - if set, GopherJS uses this value as the default GOROOT
83
-
value, instead of using the system GOROOT as the default GOROOT value
84
-
-`GOPHERJS_SKIP_VERSION_CHECK` - if set to true, GopherJS will not check
85
-
Go version in the GOROOT for compatibility with the GopherJS release. This
86
-
is primarily useful for testing GopherJS against unreleased versions of Go.
81
+
-`GOPHERJS_GOROOT` - if set, GopherJS uses this value as the default GOROOT
82
+
value, instead of using the system GOROOT as the default GOROOT value
83
+
-`GOPHERJS_SKIP_VERSION_CHECK` - if set to true, GopherJS will not check
84
+
Go version in the GOROOT for compatibility with the GopherJS release. This
85
+
is primarily useful for testing GopherJS against unreleased versions of Go.
87
86
88
87
### Performance Tips
89
88
@@ -93,14 +92,17 @@ There are some GopherJS-specific environment variables:
93
92
- Use `float64` instead of `float32`.
94
93
95
94
### Community
95
+
96
96
-[#gopherjs Channel on Gophers Slack](https://gophers.slack.com/messages/gopherjs/) (invites to Gophers Slack are available [here](http://blog.gopheracademy.com/gophers-slack-community/#how-can-i-be-invited-to-join:2facdc921b2310f18cb851c36fa92369))
97
97
-[Bindings to JavaScript APIs and libraries](https://github.com/gopherjs/gopherjs/wiki/bindings)
98
98
-[GopherJS Blog](https://medium.com/gopherjs)
99
99
-[GopherJS on Twitter](https://twitter.com/GopherJS)
100
100
-[Examples, tutorials and blogs](https://github.com/gopherjs/gopherjs/wiki/Community-Tutorials-and-Blogs)
101
+
101
102
### Getting started
102
103
103
104
#### Interacting with the DOM
105
+
104
106
The package `github.com/gopherjs/gopherjs/js` (see [documentation](https://godoc.org/github.com/gopherjs/gopherjs/js)) provides functions for interacting with native JavaScript APIs. For example the line
You may also want use the [DOM bindings](http://dominik.honnef.co/go/js/dom), the [jQuery bindings](https://github.com/gopherjs/jquery) (see [TodoMVC Example](https://github.com/gopherjs/todomvc)) or the [AngularJS bindings](https://github.com/wvell/go-angularjs). Those are some of the [bindings to JavaScript APIs and libraries](https://github.com/gopherjs/gopherjs/wiki/bindings) by community members.
117
119
118
120
#### Providing library functions for use in other JavaScript code
121
+
119
122
Set a global variable to a map that contains the functions:
120
123
121
124
```go
@@ -151,6 +154,7 @@ For more details see [Jason Stone's blog post](http://legacytotheedge.blogspot.d
151
154
### Architecture
152
155
153
156
#### General
157
+
154
158
GopherJS emulates a 32-bit environment. This means that `int`, `uint` and `uintptr` have a precision of 32 bits. However, the explicit 64-bit integer types `int64` and `uint64` are supported. The `GOARCH` value of GopherJS is "js". You may use it as a build constraint: `// +build js,-wasm`.
155
159
156
160
#### Application Lifecycle
@@ -160,6 +164,7 @@ The `main` function is executed as usual after all `init` functions have run. Ja
160
164
In the browser, calling `os.Exit` (e.g. indirectly by `log.Fatal`) also does not terminate the execution of the program. For convenience, it calls `runtime.Goexit` to immediately terminate the calling goroutine.
161
165
162
166
#### Goroutines
167
+
163
168
Goroutines are fully supported by GopherJS. The only restriction is that you need to start a new goroutine if you want to use blocking code called from external JavaScript:
164
169
165
170
```go
@@ -179,4 +184,5 @@ JavaScript has no concept of concurrency (except web workers, but those are too
179
184
GopherJS does some heavy lifting to work around this restriction: Whenever an instruction is blocking (e.g. communicating with a channel that isn't ready), the whole stack will unwind (= all functions return) and the goroutine will be put to sleep. Then another goroutine which is ready to resume gets picked and its stack with all local variables will be restored.
180
185
181
186
### GopherJS Development
187
+
182
188
If you're looking to make changes to the GopherJS compiler, see [Developer Guidelines](https://github.com/gopherjs/gopherjs/wiki/Developer-Guidelines) for additional developer information.
0 commit comments