Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6e7e549
Support building `syscall` and `syscall/js` as `js/wasm`.
nevkontakte Oct 2, 2021
60f28c2
Fix `os` package test failures when built as `js/wasm`.
nevkontakte Oct 2, 2021
d6aec8e
Make sure GopherJS tests work correctly under when build as `js/wasm`.
nevkontakte Oct 3, 2021
7f838ba
Support `net` package when building for the target `js/wasm`.
nevkontakte Oct 17, 2021
1142005
Support `net/http` package when building for `js/wasm` target.
nevkontakte Oct 23, 2021
0ad407b
Only exclude std packages from CI if they are actually failing any te…
nevkontakte Nov 11, 2021
4170cbb
Drop GopherJS Fetch API-based http client implementation.
nevkontakte Feb 26, 2022
cdf693a
Convert prelude browser fs API stub into ES5 and reduce its size.
nevkontakte Mar 7, 2022
41de9e3
Use GOOS=js and GOARCH=ecmascript to build user code by default.
nevkontakte Mar 13, 2022
49f2893
Disable CGo when loading packages.
nevkontakte Mar 19, 2022
b94c4eb
Respect --tags flag in `gopherjs run` subcommand.
nevkontakte Mar 19, 2022
7d56422
Hide legacy `node-syscall` support behind a build tag.
nevkontakte Mar 20, 2022
305cb64
Remove unnecessary package tweaks for `crypto/rand`.
nevkontakte Mar 20, 2022
de83fe4
Remove unnecessary overlays and package tweaks for `internal/poll`.
nevkontakte Mar 20, 2022
f7681d2
Remove unnecessary standard library overlays.
nevkontakte Mar 20, 2022
59958da
Refactor TestNativesDontImportExtraPackages.
nevkontakte Mar 20, 2022
9813bf2
Remove GOROOT and GOPATH fields from `build.Options`.
nevkontakte Mar 20, 2022
9511320
Set `runtime.GOOS` and `GOARCH` to values chosen for GopherJS.
nevkontakte Mar 20, 2022
50f5dca
Fix compiler panics when building on Windows.
nevkontakte Mar 20, 2022
208100a
Catch and ignore the error if `fs` module can't be required.
nevkontakte Mar 27, 2022
3dfe12d
Set up a simple smoke test job on Windows and Mac OS.
nevkontakte Mar 27, 2022
adcfc77
Apply suggestions from code review
nevkontakte Apr 19, 2022
fe1dd62
Update VFS and minified prelude.
nevkontakte Apr 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Support net package when building for the target js/wasm.
  • Loading branch information
nevkontakte committed Apr 19, 2022
commit 7f838baa75b0bac7ccbb7209f27606f69bca94fd
1 change: 0 additions & 1 deletion .std_test_pkg_exclusions
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ internal/testlog
internal/trace
internal/x/net/nettest
log/syslog
net
net/http
net/http/cgi
net/http/httptest
Expand Down
11 changes: 11 additions & 0 deletions compiler/natives/src/net/fastrand.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//go:build js
// +build js

package net

import (
_ "unsafe" // For go:linkname
)

//go:linkname fastrand runtime.fastrand
func fastrand() uint32
4 changes: 2 additions & 2 deletions compiler/natives/src/net/net.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build js
// +build js
//go:build js && !wasm
// +build js,!wasm

package net

Expand Down
322 changes: 161 additions & 161 deletions doc/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,164 +4,164 @@ On each commit, Circle CI automatically compiles all supported packages with Gop

[![Circle CI](https://circleci.com/gh/gopherjs/gopherjs.svg?style=svg)](https://circleci.com/gh/gopherjs/gopherjs)

Name | Supported | Comment
------------------ | ------------ | ----------------------------------------------------------------------------------
archive | |
-- tar | ✅ yes |
-- zip | ✅ yes |
bufio | ✅ yes |
builtin | ✅ yes |
bytes | ✅ yes |
compress | |
-- bzip2 | ✅ yes |
-- flate | ✅ yes |
-- gzip | ✅ yes |
-- lzw | ✅ yes |
-- zlib | ✅ yes |
container | |
-- heap | ✅ yes |
-- list | ✅ yes |
-- ring | ✅ yes |
context | ✅ yes |
crypto | ✅ yes |
-- aes | ✅ yes |
-- cipher | ✅ yes |
-- des | ✅ yes |
-- dsa | ✅ yes |
-- ecdsa | ✅ yes |
-- ed25519 | ✅ yes |
-- elliptic | ✅ yes |
-- hmac | ✅ yes |
-- md5 | ✅ yes |
-- rand | ✅ yes |
-- rc4 | ✅ yes |
-- rsa | ✅ yes |
-- sha1 | ✅ yes |
-- sha256 | ✅ yes |
-- sha512 | ✅ yes |
-- subtle | ✅ yes |
-- tls | ❌ no |
-- x509 | ✅ yes |
-- -- pkix | ✅ yes |
database | |
-- sql | ✅ yes |
-- -- driver | ✅ yes |
debug | |
-- dwarf | ✅ yes |
-- elf | ✅ yes |
-- gosym | ☑️ partially | on binaries generated by gc
-- macho | ✅ yes |
-- pe | ✅ yes |
-- plan9obj | ✅ yes |
embed | ❌ no | Not implemented yet: https://github.com/gopherjs/gopherjs/issues/997.
encoding | |
-- ascii85 | ✅ yes |
-- asn1 | ✅ yes |
-- base32 | ✅ yes |
-- base64 | ✅ yes |
-- binary | ✅ yes |
-- csv | ✅ yes |
-- gob | ✅ yes |
-- hex | ✅ yes |
-- json | ✅ yes |
-- pem | ✅ yes |
-- xml | ✅ yes |
errors | ✅ yes |
expvar | ✅ yes |
flag | ✅ yes |
fmt | ✅ yes |
go | |
-- ast | ✅ yes |
-- build | ❌ no |
-- build/constraint | ✅ yes |
-- constant | ✅ yes |
-- doc | ✅ yes |
-- format | ✅ yes |
-- importer | ❌ no |
-- parser | ✅ yes |
-- printer | ✅ yes |
-- scanner | ✅ yes |
-- token | ✅ yes |
-- types | ❌ no |
hash | ✅ yes |
-- adler32 | ✅ yes |
-- crc32 | ✅ yes |
-- crc64 | ✅ yes |
-- fnv | ✅ yes |
-- maphash | ✅ yes |
html | ✅ yes |
-- template | ✅ yes |
image | ✅ yes |
-- color | ✅ yes |
-- -- palette | ✅ yes |
-- draw | ✅ yes |
-- gif | ✅ yes |
-- jpeg | ✅ yes |
-- png | ✅ yes |
index | |
-- suffixarray | ✅ yes |
io | ✅ yes |
-- fs | ✅ yes |
-- ioutil | ✅ yes |
log | ✅ yes |
-- syslog | ❌ no |
math | ✅ yes |
-- big | ✅ yes |
-- bits | ✅ yes |
-- cmplx | ✅ yes |
-- rand | ✅ yes |
mime | ✅ yes |
-- multipart | ✅ yes |
-- quotedprintable | ✅ yes |
net | ❌ no |
-- http | ☑️ partially | client only, emulated via Fetch/XMLHttpRequest APIs;<br>node.js requires polyfill
-- -- cgi | ❌ no |
-- -- cookiejar | ✅ yes |
-- -- fcgi | ✅ yes |
-- -- httptest | ☑️ partially |
-- -- httputil | ☑️ partially |
-- -- pprof | ❌ no |
-- mail | ✅ yes |
-- rpc | ☑️ partially | data structures only (no net)
-- -- jsonrpc | ✅ yes |
-- smtp | ☑️ partially | data structures only (no net)
-- textproto | ✅ yes |
-- url | ✅ yes |
os | ☑️ partially | node.js only
-- exec | ☑️ partially | node.js only
-- signal | ☑️ partially | node.js only
-- user | ☑️ partially | node.js only
path | ✅ yes |
-- filepath | ✅ yes |
plugin | ❌ no |
reflect | ✅ yes |
regexp | ✅ yes |
-- syntax | ✅ yes |
runtime | ☑️ partially | SetMutexProfileFraction, SetFinalizer, ReadMemStats unsupported
-- metrics | ☑️ partially | Same as runtime.
-- cgo | ❌ no |
-- debug | ❌ no |
-- pprof | ❌ no |
-- race | ❌ no |
-- trace | ❌ no |
sort | ✅ yes |
strconv | ✅ yes |
strings | ✅ yes |
sync | ✅ yes |
-- atomic | ✅ yes |
syscall | ☑️ partially | node.js only
testing | ☑️ partially | AllocsPerRun and T.Helper are unsupported.
-- iotest | ✅ yes |
-- fstest | ✅ yes |
-- quick | ✅ yes |
text | |
-- scanner | ✅ yes |
-- tabwriter | ✅ yes |
-- template | ✅ yes |
-- -- parse | ✅ yes |
time | ✅ yes | UTC and Local only (see [issue](https://github.com/gopherjs/gopherjs/issues/64))
-- tzdata | ✅ yes |
unicode | ✅ yes |
-- utf16 | ✅ yes |
-- utf8 | ✅ yes |
unsafe | ❌ no |
| Name | Supported | Comment |
| ------------------- | ------------ | --------------------------------------------------------------------------------- |
| archive | |
| -- tar | ✅ yes |
| -- zip | ✅ yes |
| bufio | ✅ yes |
| builtin | ✅ yes |
| bytes | ✅ yes |
| compress | |
| -- bzip2 | ✅ yes |
| -- flate | ✅ yes |
| -- gzip | ✅ yes |
| -- lzw | ✅ yes |
| -- zlib | ✅ yes |
| container | |
| -- heap | ✅ yes |
| -- list | ✅ yes |
| -- ring | ✅ yes |
| context | ✅ yes |
| crypto | ✅ yes |
| -- aes | ✅ yes |
| -- cipher | ✅ yes |
| -- des | ✅ yes |
| -- dsa | ✅ yes |
| -- ecdsa | ✅ yes |
| -- ed25519 | ✅ yes |
| -- elliptic | ✅ yes |
| -- hmac | ✅ yes |
| -- md5 | ✅ yes |
| -- rand | ✅ yes |
| -- rc4 | ✅ yes |
| -- rsa | ✅ yes |
| -- sha1 | ✅ yes |
| -- sha256 | ✅ yes |
| -- sha512 | ✅ yes |
| -- subtle | ✅ yes |
| -- tls | ❌ no |
| -- x509 | ✅ yes |
| -- -- pkix | ✅ yes |
| database | |
| -- sql | ✅ yes |
| -- -- driver | ✅ yes |
| debug | |
| -- dwarf | ✅ yes |
| -- elf | ✅ yes |
| -- gosym | ☑️ partially | on binaries generated by gc |
| -- macho | ✅ yes |
| -- pe | ✅ yes |
| -- plan9obj | ✅ yes |
| embed | ❌ no | Not implemented yet: https://github.com/gopherjs/gopherjs/issues/997. |
| encoding | |
| -- ascii85 | ✅ yes |
| -- asn1 | ✅ yes |
| -- base32 | ✅ yes |
| -- base64 | ✅ yes |
| -- binary | ✅ yes |
| -- csv | ✅ yes |
| -- gob | ✅ yes |
| -- hex | ✅ yes |
| -- json | ✅ yes |
| -- pem | ✅ yes |
| -- xml | ✅ yes |
| errors | ✅ yes |
| expvar | ✅ yes |
| flag | ✅ yes |
| fmt | ✅ yes |
| go | |
| -- ast | ✅ yes |
| -- build | ❌ no |
| -- build/constraint | ✅ yes |
| -- constant | ✅ yes |
| -- doc | ✅ yes |
| -- format | ✅ yes |
| -- importer | ❌ no |
| -- parser | ✅ yes |
| -- printer | ✅ yes |
| -- scanner | ✅ yes |
| -- token | ✅ yes |
| -- types | ❌ no |
| hash | ✅ yes |
| -- adler32 | ✅ yes |
| -- crc32 | ✅ yes |
| -- crc64 | ✅ yes |
| -- fnv | ✅ yes |
| -- maphash | ✅ yes |
| html | ✅ yes |
| -- template | ✅ yes |
| image | ✅ yes |
| -- color | ✅ yes |
| -- -- palette | ✅ yes |
| -- draw | ✅ yes |
| -- gif | ✅ yes |
| -- jpeg | ✅ yes |
| -- png | ✅ yes |
| index | |
| -- suffixarray | ✅ yes |
| io | ✅ yes |
| -- fs | ✅ yes |
| -- ioutil | ✅ yes |
| log | ✅ yes |
| -- syslog | ❌ no |
| math | ✅ yes |
| -- big | ✅ yes |
| -- bits | ✅ yes |
| -- cmplx | ✅ yes |
| -- rand | ✅ yes |
| mime | ✅ yes |
| -- multipart | ✅ yes |
| -- quotedprintable | ✅ yes |
| net | ☑️ partially | network is simulated, supports only localhost connections |
| -- http | ☑️ partially | client only, emulated via Fetch/XMLHttpRequest APIs;<br>node.js requires polyfill |
| -- -- cgi | ❌ no |
| -- -- cookiejar | ✅ yes |
| -- -- fcgi | ✅ yes |
| -- -- httptest | ☑️ partially |
| -- -- httputil | ☑️ partially |
| -- -- pprof | ❌ no |
| -- mail | ✅ yes |
| -- rpc | ☑️ partially | data structures only (no net) |
| -- -- jsonrpc | ✅ yes |
| -- smtp | ☑️ partially | data structures only (no net) |
| -- textproto | ✅ yes |
| -- url | ✅ yes |
| os | ☑️ partially | node.js only |
| -- exec | ☑️ partially | node.js only |
| -- signal | ☑️ partially | node.js only |
| -- user | ☑️ partially | node.js only |
| path | ✅ yes |
| -- filepath | ✅ yes |
| plugin | ❌ no |
| reflect | ✅ yes |
| regexp | ✅ yes |
| -- syntax | ✅ yes |
| runtime | ☑️ partially | SetMutexProfileFraction, SetFinalizer, ReadMemStats unsupported |
| -- metrics | ☑️ partially | Same as runtime. |
| -- cgo | ❌ no |
| -- debug | ❌ no |
| -- pprof | ❌ no |
| -- race | ❌ no |
| -- trace | ❌ no |
| sort | ✅ yes |
| strconv | ✅ yes |
| strings | ✅ yes |
| sync | ✅ yes |
| -- atomic | ✅ yes |
| syscall | ☑️ partially | node.js only |
| testing | ☑️ partially | AllocsPerRun and T.Helper are unsupported. |
| -- iotest | ✅ yes |
| -- fstest | ✅ yes |
| -- quick | ✅ yes |
| text | |
| -- scanner | ✅ yes |
| -- tabwriter | ✅ yes |
| -- template | ✅ yes |
| -- -- parse | ✅ yes |
| time | ✅ yes | UTC and Local only (see [issue](https://github.com/gopherjs/gopherjs/issues/64)) |
| -- tzdata | ✅ yes |
| unicode | ✅ yes |
| -- utf16 | ✅ yes |
| -- utf8 | ✅ yes |
| unsafe | ❌ no |