satellite/console/wasm: reduce size to <9MB

Make changes so that we only import the necessary files from the console package so that the generated wasm code is as small as possible.

This change gets the compiled wasm code down to 8.6MB uncompressed and 2MB when compressed with `gzip --best`.

https://review.dev.storj.io/c/storj/storj/+/3396

Change-Id: Ifdd4be285810757b46bbbe43327c0d0139e5f8f7
This commit is contained in:
Jessica Grebenschikov 2020-12-14 08:33:33 -08:00 committed by Jess G
parent d955946f15
commit 3cc98de3ee
6 changed files with 8 additions and 7 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@
*.so
*.dylib
*.db
*.wasm
# Test binary, build with `go test -c`
*.test

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
package console
package consolewasm
import (
"crypto/sha256"

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
package console_test
package consolewasm_test
import (
"testing"
@ -10,7 +10,7 @@ import (
"storj.io/common/testcontext"
"storj.io/storj/private/testplanet"
"storj.io/storj/satellite/console"
console "storj.io/storj/satellite/console/consolewasm"
)
// TestGenerateAccessGrant confirms that the access grant produced by the wasm access code

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
package console
package consolewasm
import (
"time"

View File

@ -1,7 +1,7 @@
// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
package console_test
package consolewasm_test
import (
"testing"
@ -13,7 +13,7 @@ import (
"storj.io/common/rpc/rpcstatus"
"storj.io/common/testcontext"
"storj.io/storj/private/testplanet"
"storj.io/storj/satellite/console"
console "storj.io/storj/satellite/console/consolewasm"
"storj.io/uplink"
)

View File

@ -10,7 +10,7 @@ import (
"github.com/zeebo/errs"
"storj.io/storj/satellite/console"
console "storj.io/storj/satellite/console/consolewasm"
)
func main() {