From 14c1867810c85d186f788e3462a38dfce7a6a834 Mon Sep 17 00:00:00 2001
From: titaneric
Date: Sun, 21 Mar 2021 16:30:39 +0800
Subject: [PATCH 01/14] Update crates and wasm-pack
---
compiler/base/Cargo.toml | 448 ++++++++++++++----------
compiler/base/crate-information.json | 500 ++++++++++++++++-----------
compiler/base/postinstall.sh | 5 +
top-crates/crate-modifications.toml | 2 +-
4 files changed, 562 insertions(+), 393 deletions(-)
diff --git a/compiler/base/Cargo.toml b/compiler/base/Cargo.toml
index 352f0924f..dc838d202 100644
--- a/compiler/base/Cargo.toml
+++ b/compiler/base/Cargo.toml
@@ -11,11 +11,11 @@ codegen-units = 1
incremental = false
[dependencies.addr2line]
package = "addr2line"
-version = "=0.14.0"
+version = "=0.14.1"
[dependencies.adler]
package = "adler"
-version = "=0.2.3"
+version = "=1.0.2"
[dependencies.adler32]
package = "adler32"
@@ -23,7 +23,7 @@ version = "=1.2.0"
[dependencies.ahash]
package = "ahash"
-version = "=0.4.6"
+version = "=0.4.7"
[dependencies.aho_corasick]
package = "aho-corasick"
@@ -37,13 +37,21 @@ version = "=0.12.1"
package = "ansi_term"
version = "=0.11.0"
+[dependencies.anyhow]
+package = "anyhow"
+version = "=1.0.39"
+
+[dependencies.anymap]
+package = "anymap"
+version = "=0.12.1"
+
[dependencies.approx]
package = "approx"
version = "=0.4.0"
[dependencies.arc_swap]
package = "arc-swap"
-version = "=0.4.7"
+version = "=0.4.8"
[dependencies.arrayvec]
package = "arrayvec"
@@ -51,7 +59,7 @@ version = "=0.5.2"
[dependencies.async_trait]
package = "async-trait"
-version = "=0.1.42"
+version = "=0.1.48"
[dependencies.atty]
package = "atty"
@@ -63,23 +71,23 @@ version = "=1.0.1"
[dependencies.backtrace]
package = "backtrace"
-version = "=0.3.55"
-
-[dependencies.backtrace_sys]
-package = "backtrace-sys"
-version = "=0.1.37"
+version = "=0.3.56"
[dependencies.base64]
package = "base64"
version = "=0.13.0"
+[dependencies.bincode]
+package = "bincode"
+version = "=1.3.1"
+
[dependencies.bit_set]
package = "bit-set"
version = "=0.5.2"
[dependencies.bit_vec]
package = "bit-vec"
-version = "=0.6.2"
+version = "=0.6.3"
[dependencies.bitflags]
package = "bitflags"
@@ -89,30 +97,34 @@ version = "=1.2.1"
package = "block-buffer"
version = "=0.9.0"
+[dependencies.boolinator]
+package = "boolinator"
+version = "=2.4.0"
+
[dependencies.bstr]
package = "bstr"
-version = "=0.2.14"
+version = "=0.2.15"
+
+[dependencies.bumpalo]
+package = "bumpalo"
+version = "=3.6.1"
[dependencies.bytemuck]
package = "bytemuck"
-version = "=1.4.1"
+version = "=1.5.1"
features = ["derive", "extern_crate_alloc", "extern_crate_std", "zeroable_maybe_uninit"]
[dependencies.byteorder]
package = "byteorder"
-version = "=1.3.4"
+version = "=1.4.3"
[dependencies.bytes]
package = "bytes"
-version = "=0.6.0"
-
-[dependencies.bytes_0_5_6]
-package = "bytes"
-version = "=0.5.6"
+version = "=1.0.1"
[dependencies.cc]
package = "cc"
-version = "=1.0.65"
+version = "=1.0.67"
[dependencies.cfg_if]
package = "cfg-if"
@@ -122,6 +134,10 @@ version = "=1.0.0"
package = "cfg-if"
version = "=0.1.10"
+[dependencies.cfg_match]
+package = "cfg-match"
+version = "=0.2.1"
+
[dependencies.chrono]
package = "chrono"
version = "=0.4.19"
@@ -135,9 +151,13 @@ version = "=2.33.3"
package = "color_quant"
version = "=1.1.0"
+[dependencies.console_error_panic_hook]
+package = "console_error_panic_hook"
+version = "=0.1.6"
+
[dependencies.const_fn]
package = "const_fn"
-version = "=0.4.3"
+version = "=0.4.5"
[dependencies.cpuid_bool]
package = "cpuid-bool"
@@ -161,7 +181,7 @@ version = "=0.8.0"
[dependencies.crossbeam_epoch]
package = "crossbeam-epoch"
-version = "=0.9.1"
+version = "=0.9.3"
[dependencies.crossbeam_queue]
package = "crossbeam-queue"
@@ -169,15 +189,15 @@ version = "=0.3.1"
[dependencies.crossbeam_utils]
package = "crossbeam-utils"
-version = "=0.8.1"
+version = "=0.8.3"
[dependencies.crypto_mac]
package = "crypto-mac"
-version = "=0.9.1"
+version = "=0.10.0"
[dependencies.csv]
package = "csv"
-version = "=1.1.5"
+version = "=1.1.6"
[dependencies.csv_core]
package = "csv-core"
@@ -185,7 +205,7 @@ version = "=0.1.10"
[dependencies.data_encoding]
package = "data-encoding"
-version = "=2.3.1"
+version = "=2.3.2"
[dependencies.debug_unreachable]
package = "new_debug_unreachable"
@@ -195,13 +215,17 @@ version = "=1.0.4"
package = "deflate"
version = "=0.8.6"
+[dependencies.derivative]
+package = "derivative"
+version = "=2.2.0"
+
[dependencies.digest]
package = "digest"
version = "=0.9.0"
[dependencies.dtoa]
package = "dtoa"
-version = "=0.4.6"
+version = "=0.4.7"
[dependencies.either]
package = "either"
@@ -209,24 +233,16 @@ version = "=1.6.1"
[dependencies.encoding_rs]
package = "encoding_rs"
-version = "=0.8.26"
+version = "=0.8.28"
[dependencies.env_logger]
package = "env_logger"
-version = "=0.8.2"
+version = "=0.8.3"
[dependencies.error_chain]
package = "error-chain"
version = "=0.12.4"
-[dependencies.failure]
-package = "failure"
-version = "=0.1.8"
-
-[dependencies.failure_derive]
-package = "failure_derive"
-version = "=0.1.8"
-
[dependencies.fallible_iterator]
package = "fallible-iterator"
version = "=0.2.0"
@@ -237,7 +253,7 @@ version = "=0.1.9"
[dependencies.filetime]
package = "filetime"
-version = "=0.2.13"
+version = "=0.2.14"
[dependencies.fixedbitset]
package = "fixedbitset"
@@ -245,7 +261,7 @@ version = "=0.2.0"
[dependencies.flate2]
package = "flate2"
-version = "=1.0.19"
+version = "=1.0.20"
[dependencies.fnv]
package = "fnv"
@@ -261,7 +277,7 @@ version = "=0.1.1"
[dependencies.form_urlencoded]
package = "form_urlencoded"
-version = "=1.0.0"
+version = "=1.0.1"
[dependencies.futf]
package = "futf"
@@ -269,40 +285,40 @@ version = "=0.1.4"
[dependencies.futures]
package = "futures"
-version = "=0.3.8"
+version = "=0.3.13"
features = ["compat", "io-compat", "thread-pool"]
[dependencies.futures_channel]
package = "futures-channel"
-version = "=0.3.8"
+version = "=0.3.13"
[dependencies.futures_core]
package = "futures-core"
-version = "=0.3.8"
+version = "=0.3.13"
[dependencies.futures_executor]
package = "futures-executor"
-version = "=0.3.8"
+version = "=0.3.13"
[dependencies.futures_io]
package = "futures-io"
-version = "=0.3.8"
+version = "=0.3.13"
[dependencies.futures_macro]
package = "futures-macro"
-version = "=0.3.8"
+version = "=0.3.13"
[dependencies.futures_sink]
package = "futures-sink"
-version = "=0.3.8"
+version = "=0.3.13"
[dependencies.futures_task]
package = "futures-task"
-version = "=0.3.8"
+version = "=0.3.13"
[dependencies.futures_util]
package = "futures-util"
-version = "=0.3.8"
+version = "=0.3.13"
[dependencies.generic_array]
package = "generic-array"
@@ -310,11 +326,11 @@ version = "=0.14.4"
[dependencies.getrandom]
package = "getrandom"
-version = "=0.2.0"
+version = "=0.2.2"
-[dependencies.getrandom_0_1_15]
+[dependencies.getrandom_0_1_16]
package = "getrandom"
-version = "=0.1.15"
+version = "=0.1.16"
[dependencies.gif]
package = "gif"
@@ -328,9 +344,29 @@ version = "=0.23.0"
package = "glob"
version = "=0.3.0"
+[dependencies.gloo]
+package = "gloo"
+version = "=0.2.1"
+
+[dependencies.gloo_console_timer]
+package = "gloo-console-timer"
+version = "=0.1.0"
+
+[dependencies.gloo_events]
+package = "gloo-events"
+version = "=0.1.1"
+
+[dependencies.gloo_file]
+package = "gloo-file"
+version = "=0.1.0"
+
+[dependencies.gloo_timers]
+package = "gloo-timers"
+version = "=0.2.1"
+
[dependencies.h2]
package = "h2"
-version = "=0.2.7"
+version = "=0.3.1"
[dependencies.hashbrown]
package = "hashbrown"
@@ -342,7 +378,7 @@ version = "=0.6.0"
[dependencies.hmac]
package = "hmac"
-version = "=0.9.0"
+version = "=0.10.1"
[dependencies.html5ever]
package = "html5ever"
@@ -350,15 +386,15 @@ version = "=0.25.1"
[dependencies.http]
package = "http"
-version = "=0.2.1"
+version = "=0.2.3"
[dependencies.http_body]
package = "http-body"
-version = "=0.3.1"
+version = "=0.4.1"
[dependencies.httparse]
package = "httparse"
-version = "=1.3.4"
+version = "=1.3.5"
[dependencies.httpdate]
package = "httpdate"
@@ -366,31 +402,28 @@ version = "=0.3.2"
[dependencies.humantime]
package = "humantime"
-version = "=2.0.1"
-
-[dependencies.humantime_1_3_0]
-package = "humantime"
-version = "=1.3.0"
+version = "=2.1.0"
[dependencies.hyper]
package = "hyper"
-version = "=0.13.9"
+version = "=0.14.4"
+features = ["full"]
[dependencies.hyper_tls]
package = "hyper-tls"
-version = "=0.4.3"
+version = "=0.5.0"
[dependencies.idna]
package = "idna"
-version = "=0.2.0"
+version = "=0.2.2"
[dependencies.image]
package = "image"
-version = "=0.23.12"
+version = "=0.23.14"
[dependencies.indexmap]
package = "indexmap"
-version = "=1.6.0"
+version = "=1.6.2"
[dependencies.instant]
package = "instant"
@@ -406,15 +439,19 @@ version = "=2.3.0"
[dependencies.itertools]
package = "itertools"
-version = "=0.9.0"
+version = "=0.10.0"
[dependencies.itoa]
package = "itoa"
-version = "=0.4.6"
+version = "=0.4.7"
[dependencies.jpeg_decoder]
package = "jpeg-decoder"
-version = "=0.1.20"
+version = "=0.1.22"
+
+[dependencies.js_sys]
+package = "js-sys"
+version = "=0.3.49"
[dependencies.lazy_static]
package = "lazy_static"
@@ -422,7 +459,7 @@ version = "=1.4.0"
[dependencies.libc]
package = "libc"
-version = "=0.2.80"
+version = "=0.2.90"
[dependencies.libm]
package = "libm"
@@ -434,7 +471,7 @@ version = "=0.20.1"
[dependencies.linked_hash_map]
package = "linked-hash-map"
-version = "=0.5.3"
+version = "=0.5.4"
[dependencies.lock_api]
package = "lock_api"
@@ -442,11 +479,11 @@ version = "=0.4.2"
[dependencies.log]
package = "log"
-version = "=0.4.11"
+version = "=0.4.14"
[dependencies.log4rs]
package = "log4rs"
-version = "=0.13.0"
+version = "=1.0.0"
[dependencies.log_mdc]
package = "log-mdc"
@@ -470,7 +507,11 @@ version = "=0.1.8"
[dependencies.matrixmultiply]
package = "matrixmultiply"
-version = "=0.2.3"
+version = "=0.3.0"
+
+[dependencies.matrixmultiply_0_2_4]
+package = "matrixmultiply"
+version = "=0.2.4"
[dependencies.md5]
package = "md5"
@@ -492,13 +533,9 @@ version = "=0.6.1"
package = "mime"
version = "=0.3.16"
-[dependencies.mime_guess]
-package = "mime_guess"
-version = "=2.0.3"
-
[dependencies.miniz_oxide]
package = "miniz_oxide"
-version = "=0.4.3"
+version = "=0.4.4"
[dependencies.miniz_oxide_0_3_7]
package = "miniz_oxide"
@@ -506,20 +543,16 @@ version = "=0.3.7"
[dependencies.mio]
package = "mio"
-version = "=0.7.6"
+version = "=0.7.10"
features = ["net", "os-ext", "os-poll"]
-[dependencies.mio_0_6_23]
-package = "mio"
-version = "=0.6.23"
-
[dependencies.nalgebra]
package = "nalgebra"
-version = "=0.23.1"
+version = "=0.25.3"
[dependencies.native_tls]
package = "native-tls"
-version = "=0.2.6"
+version = "=0.2.7"
[dependencies.ndarray]
package = "ndarray"
@@ -527,18 +560,22 @@ version = "=0.14.0"
[dependencies.net2]
package = "net2"
-version = "=0.2.36"
+version = "=0.2.37"
[dependencies.num]
package = "num"
-version = "=0.3.1"
+version = "=0.4.0"
[dependencies.num_bigint]
package = "num-bigint"
-version = "=0.3.1"
+version = "=0.4.0"
[dependencies.num_complex]
package = "num-complex"
+version = "=0.4.0"
+
+[dependencies.num_complex_0_3_1]
+package = "num-complex"
version = "=0.3.1"
[dependencies.num_cpus]
@@ -555,6 +592,10 @@ version = "=0.1.42"
[dependencies.num_rational]
package = "num-rational"
+version = "=0.4.0"
+
+[dependencies.num_rational_0_3_2]
+package = "num-rational"
version = "=0.3.2"
[dependencies.num_traits]
@@ -563,11 +604,11 @@ version = "=0.2.14"
[dependencies.object]
package = "object"
-version = "=0.22.0"
+version = "=0.23.0"
[dependencies.once_cell]
package = "once_cell"
-version = "=1.5.2"
+version = "=1.7.2"
[dependencies.opaque_debug]
package = "opaque-debug"
@@ -575,7 +616,7 @@ version = "=0.3.0"
[dependencies.openssl]
package = "openssl"
-version = "=0.10.30"
+version = "=0.10.33"
[dependencies.openssl_probe]
package = "openssl-probe"
@@ -583,11 +624,11 @@ version = "=0.1.2"
[dependencies.openssl_sys]
package = "openssl-sys"
-version = "=0.9.58"
+version = "=0.9.61"
[dependencies.ordered_float]
package = "ordered-float"
-version = "=1.1.0"
+version = "=2.1.1"
[dependencies.parking_lot]
package = "parking_lot"
@@ -595,11 +636,11 @@ version = "=0.11.1"
[dependencies.parking_lot_core]
package = "parking_lot_core"
-version = "=0.8.0"
+version = "=0.8.3"
[dependencies.paste]
package = "paste"
-version = "=1.0.3"
+version = "=1.0.5"
[dependencies.percent_encoding]
package = "percent-encoding"
@@ -631,27 +672,15 @@ version = "=0.8.0"
[dependencies.pin_project]
package = "pin-project"
-version = "=1.0.2"
-
-[dependencies.pin_project_0_4_27]
-package = "pin-project"
-version = "=0.4.27"
+version = "=1.0.5"
[dependencies.pin_project_internal]
package = "pin-project-internal"
-version = "=1.0.2"
-
-[dependencies.pin_project_internal_0_4_27]
-package = "pin-project-internal"
-version = "=0.4.27"
+version = "=1.0.5"
[dependencies.pin_project_lite]
package = "pin-project-lite"
-version = "=0.2.0"
-
-[dependencies.pin_project_lite_0_1_11]
-package = "pin-project-lite"
-version = "=0.1.11"
+version = "=0.2.6"
[dependencies.pin_utils]
package = "pin-utils"
@@ -663,19 +692,19 @@ version = "=0.3.19"
[dependencies.png]
package = "png"
-version = "=0.16.7"
+version = "=0.16.8"
[dependencies.postgres]
package = "postgres"
-version = "=0.18.1"
+version = "=0.19.0"
[dependencies.postgres_protocol]
package = "postgres-protocol"
-version = "=0.5.3"
+version = "=0.6.0"
[dependencies.postgres_types]
package = "postgres-types"
-version = "=0.1.3"
+version = "=0.2.0"
[dependencies.ppv_lite86]
package = "ppv-lite86"
@@ -696,42 +725,56 @@ version = "=0.5.19"
[dependencies.proc_macro_nested]
package = "proc-macro-nested"
-version = "=0.1.6"
+version = "=0.1.7"
[dependencies.quick_error]
package = "quick-error"
version = "=2.0.0"
-[dependencies.quick_error_1_2_3]
-package = "quick-error"
-version = "=1.2.3"
-
[dependencies.quote]
package = "quote"
-version = "=1.0.7"
+version = "=1.0.9"
[dependencies.rand]
package = "rand"
+version = "=0.8.3"
+features = ["serde1", "small_rng"]
+
+[dependencies.rand_0_7_3]
+package = "rand"
version = "=0.7.3"
[dependencies.rand_chacha]
package = "rand_chacha"
+version = "=0.3.0"
+
+[dependencies.rand_chacha_0_2_2]
+package = "rand_chacha"
version = "=0.2.2"
[dependencies.rand_core]
package = "rand_core"
+version = "=0.6.2"
+features = ["alloc", "serde1", "std"]
+
+[dependencies.rand_core_0_5_1]
+package = "rand_core"
version = "=0.5.1"
[dependencies.rand_distr]
package = "rand_distr"
-version = "=0.3.0"
+version = "=0.4.0"
[dependencies.rand_hc]
package = "rand_hc"
-version = "=0.2.0"
+version = "=0.3.0"
[dependencies.rand_pcg]
package = "rand_pcg"
+version = "=0.3.0"
+
+[dependencies.rand_pcg_0_2_1]
+package = "rand_pcg"
version = "=0.2.1"
[dependencies.rawpointer]
@@ -748,7 +791,7 @@ version = "=1.9.0"
[dependencies.regex]
package = "regex"
-version = "=1.4.2"
+version = "=1.4.5"
[dependencies.regex_automata]
package = "regex-automata"
@@ -756,7 +799,7 @@ version = "=0.1.9"
[dependencies.regex_syntax]
package = "regex-syntax"
-version = "=0.6.21"
+version = "=0.6.23"
[dependencies.remove_dir_all]
package = "remove_dir_all"
@@ -764,16 +807,16 @@ version = "=0.5.3"
[dependencies.reqwest]
package = "reqwest"
-version = "=0.10.9"
-features = ["blocking", "cookies", "json"]
+version = "=0.11.2"
+features = ["blocking", "cookies", "json", "multipart"]
[dependencies.ring]
package = "ring"
-version = "=0.16.19"
+version = "=0.16.20"
[dependencies.rusqlite]
package = "rusqlite"
-version = "=0.24.1"
+version = "=0.24.2"
features = ["bundled-full"]
[dependencies.rustc_demangle]
@@ -782,7 +825,7 @@ version = "=0.1.18"
[dependencies.rustc_version]
package = "rustc_version"
-version = "=0.3.0"
+version = "=0.3.3"
[dependencies.ryu]
package = "ryu"
@@ -810,20 +853,20 @@ version = "=0.11.0"
[dependencies.semver_parser]
package = "semver-parser"
-version = "=0.10.1"
+version = "=0.10.2"
[dependencies.serde]
package = "serde"
-version = "=1.0.117"
+version = "=1.0.124"
features = ["derive", "rc"]
[dependencies.serde_derive]
package = "serde_derive"
-version = "=1.0.117"
+version = "=1.0.124"
[dependencies.serde_json]
package = "serde_json"
-version = "=1.0.60"
+version = "=1.0.64"
features = ["raw_value"]
[dependencies.serde_urlencoded]
@@ -832,23 +875,23 @@ version = "=0.7.0"
[dependencies.serde_value]
package = "serde-value"
-version = "=0.6.0"
+version = "=0.7.0"
[dependencies.serde_yaml]
package = "serde_yaml"
-version = "=0.8.14"
+version = "=0.8.17"
[dependencies.sha2]
package = "sha2"
-version = "=0.9.2"
+version = "=0.9.3"
[dependencies.simba]
package = "simba"
-version = "=0.3.1"
+version = "=0.4.0"
[dependencies.siphasher]
package = "siphasher"
-version = "=0.3.3"
+version = "=0.3.5"
[dependencies.slab]
package = "slab"
@@ -856,11 +899,15 @@ version = "=0.4.2"
[dependencies.smallvec]
package = "smallvec"
-version = "=1.5.0"
+version = "=1.6.1"
+
+[dependencies.smawk]
+package = "smawk"
+version = "=0.3.1"
[dependencies.socket2]
package = "socket2"
-version = "=0.3.17"
+version = "=0.3.19"
[dependencies.spin]
package = "spin"
@@ -868,7 +915,7 @@ version = "=0.5.2"
[dependencies.standback]
package = "standback"
-version = "=0.2.13"
+version = "=0.2.16"
[dependencies.string_cache]
package = "string_cache"
@@ -892,11 +939,11 @@ version = "=0.8.0"
[dependencies.subtle]
package = "subtle"
-version = "=2.3.0"
+version = "=2.4.0"
[dependencies.syn]
package = "syn"
-version = "=1.0.53"
+version = "=1.0.64"
features = ["extra-traits", "fold", "full", "visit", "visit-mut"]
[dependencies.synstructure]
@@ -905,15 +952,15 @@ version = "=0.12.4"
[dependencies.tar]
package = "tar"
-version = "=0.4.30"
+version = "=0.4.33"
[dependencies.tempfile]
package = "tempfile"
-version = "=3.1.0"
+version = "=3.2.0"
[dependencies.tendril]
package = "tendril"
-version = "=0.4.1"
+version = "=0.4.2"
[dependencies.termcolor]
package = "termcolor"
@@ -921,19 +968,27 @@ version = "=1.1.2"
[dependencies.textwrap]
package = "textwrap"
-version = "=0.12.1"
+version = "=0.13.4"
[dependencies.textwrap_0_11_0]
package = "textwrap"
version = "=0.11.0"
+[dependencies.thiserror]
+package = "thiserror"
+version = "=1.0.24"
+
+[dependencies.thiserror_impl]
+package = "thiserror-impl"
+version = "=1.0.24"
+
[dependencies.thread_id]
package = "thread-id"
version = "=3.3.0"
[dependencies.thread_local]
package = "thread_local"
-version = "=1.0.1"
+version = "=1.1.3"
[dependencies.threadpool]
package = "threadpool"
@@ -941,11 +996,11 @@ version = "=1.8.1"
[dependencies.tiff]
package = "tiff"
-version = "=0.6.0"
+version = "=0.6.1"
[dependencies.time]
package = "time"
-version = "=0.2.23"
+version = "=0.2.26"
[dependencies.time_0_1_44]
package = "time"
@@ -961,7 +1016,7 @@ version = "=0.1.1"
[dependencies.tinyvec]
package = "tinyvec"
-version = "=1.1.0"
+version = "=1.1.1"
features = ["alloc", "grab_spare_slice", "rustc_1_40", "serde"]
[dependencies.tinyvec_macros]
@@ -970,50 +1025,37 @@ version = "=0.1.0"
[dependencies.tokio]
package = "tokio"
-version = "=0.3.5"
-features = ["full"]
+version = "=1.4.0"
+features = ["full", "test-util"]
-[dependencies.tokio_0_2_23]
-package = "tokio"
-version = "=0.2.23"
-features = ["full"]
+[dependencies.tokio_native_tls]
+package = "tokio-native-tls"
+version = "=0.3.0"
[dependencies.tokio_postgres]
package = "tokio-postgres"
-version = "=0.6.0"
-
-[dependencies.tokio_tls]
-package = "tokio-tls"
-version = "=0.3.1"
+version = "=0.7.0"
[dependencies.tokio_util]
package = "tokio-util"
-version = "=0.4.0"
-
-[dependencies.tokio_util_0_3_1]
-package = "tokio-util"
-version = "=0.3.1"
+version = "=0.6.5"
[dependencies.toml]
package = "toml"
-version = "=0.5.7"
+version = "=0.5.8"
[dependencies.tower_service]
package = "tower-service"
-version = "=0.3.0"
+version = "=0.3.1"
[dependencies.tracing]
package = "tracing"
-version = "=0.1.22"
+version = "=0.1.25"
[dependencies.tracing_core]
package = "tracing-core"
version = "=0.1.17"
-[dependencies.tracing_futures]
-package = "tracing-futures"
-version = "=0.2.4"
-
[dependencies.traitobject]
package = "traitobject"
version = "=0.1.0"
@@ -1028,7 +1070,7 @@ version = "=0.3.3"
[dependencies.typenum]
package = "typenum"
-version = "=1.12.0"
+version = "=1.13.0"
[dependencies.ucd_trie]
package = "ucd-trie"
@@ -1044,7 +1086,7 @@ version = "=0.3.4"
[dependencies.unicode_normalization]
package = "unicode-normalization"
-version = "=0.1.16"
+version = "=0.1.17"
[dependencies.unicode_segmentation]
package = "unicode-segmentation"
@@ -1068,19 +1110,15 @@ version = "=0.7.1"
[dependencies.url]
package = "url"
-version = "=2.2.0"
+version = "=2.2.1"
[dependencies.utf8]
package = "utf-8"
version = "=0.7.5"
-[dependencies.utf8_ranges]
-package = "utf8-ranges"
-version = "=1.0.4"
-
[dependencies.uuid]
package = "uuid"
-version = "=0.8.1"
+version = "=0.8.2"
features = ["serde", "v1", "v3", "v4", "v5"]
[dependencies.vec_map]
@@ -1089,7 +1127,7 @@ version = "=0.8.2"
[dependencies.version_check]
package = "version_check"
-version = "=0.9.2"
+version = "=0.9.3"
[dependencies.walkdir]
package = "walkdir"
@@ -1099,9 +1137,37 @@ version = "=2.3.1"
package = "want"
version = "=0.3.0"
+[dependencies.wasm_bindgen]
+package = "wasm-bindgen"
+version = "=0.2.72"
+
+[dependencies.wasm_bindgen_backend]
+package = "wasm-bindgen-backend"
+version = "=0.2.72"
+
+[dependencies.wasm_bindgen_futures]
+package = "wasm-bindgen-futures"
+version = "=0.4.22"
+
+[dependencies.wasm_bindgen_macro]
+package = "wasm-bindgen-macro"
+version = "=0.2.72"
+
+[dependencies.wasm_bindgen_macro_support]
+package = "wasm-bindgen-macro-support"
+version = "=0.2.72"
+
+[dependencies.wasm_bindgen_shared]
+package = "wasm-bindgen-shared"
+version = "=0.2.72"
+
+[dependencies.web_sys]
+package = "web-sys"
+version = "=0.3.49"
+
[dependencies.weezl]
package = "weezl"
-version = "=0.1.3"
+version = "=0.1.4"
[dependencies.winapi]
package = "winapi"
@@ -1117,4 +1183,12 @@ version = "=0.16.1"
[dependencies.yaml_rust]
package = "yaml-rust"
-version = "=0.4.4"
+version = "=0.4.5"
+
+[dependencies.yew]
+package = "yew"
+version = "=0.17.4"
+
+[dependencies.yew_macro]
+package = "yew-macro"
+version = "=0.17.0"
diff --git a/compiler/base/crate-information.json b/compiler/base/crate-information.json
index fe950c0ef..0fcb64862 100644
--- a/compiler/base/crate-information.json
+++ b/compiler/base/crate-information.json
@@ -1,12 +1,12 @@
[
{
"name": "addr2line",
- "version": "0.14.0",
+ "version": "0.14.1",
"id": "addr2line"
},
{
"name": "adler",
- "version": "0.2.3",
+ "version": "1.0.2",
"id": "adler"
},
{
@@ -16,7 +16,7 @@
},
{
"name": "ahash",
- "version": "0.4.6",
+ "version": "0.4.7",
"id": "ahash"
},
{
@@ -34,6 +34,16 @@
"version": "0.11.0",
"id": "ansi_term_0_11_0"
},
+ {
+ "name": "anyhow",
+ "version": "1.0.39",
+ "id": "anyhow"
+ },
+ {
+ "name": "anymap",
+ "version": "0.12.1",
+ "id": "anymap"
+ },
{
"name": "approx",
"version": "0.4.0",
@@ -41,7 +51,7 @@
},
{
"name": "arc-swap",
- "version": "0.4.7",
+ "version": "0.4.8",
"id": "arc_swap"
},
{
@@ -51,7 +61,7 @@
},
{
"name": "async-trait",
- "version": "0.1.42",
+ "version": "0.1.48",
"id": "async_trait"
},
{
@@ -66,19 +76,19 @@
},
{
"name": "backtrace",
- "version": "0.3.55",
+ "version": "0.3.56",
"id": "backtrace"
},
- {
- "name": "backtrace-sys",
- "version": "0.1.37",
- "id": "backtrace_sys"
- },
{
"name": "base64",
"version": "0.13.0",
"id": "base64"
},
+ {
+ "name": "bincode",
+ "version": "1.3.1",
+ "id": "bincode"
+ },
{
"name": "bit-set",
"version": "0.5.2",
@@ -86,7 +96,7 @@
},
{
"name": "bit-vec",
- "version": "0.6.2",
+ "version": "0.6.3",
"id": "bit_vec"
},
{
@@ -99,34 +109,39 @@
"version": "0.9.0",
"id": "block_buffer"
},
+ {
+ "name": "boolinator",
+ "version": "2.4.0",
+ "id": "boolinator"
+ },
{
"name": "bstr",
- "version": "0.2.14",
+ "version": "0.2.15",
"id": "bstr"
},
+ {
+ "name": "bumpalo",
+ "version": "3.6.1",
+ "id": "bumpalo"
+ },
{
"name": "bytemuck",
- "version": "1.4.1",
+ "version": "1.5.1",
"id": "bytemuck"
},
{
"name": "byteorder",
- "version": "1.3.4",
+ "version": "1.4.3",
"id": "byteorder"
},
{
"name": "bytes",
- "version": "0.6.0",
+ "version": "1.0.1",
"id": "bytes"
},
- {
- "name": "bytes",
- "version": "0.5.6",
- "id": "bytes_0_5_6"
- },
{
"name": "cc",
- "version": "1.0.65",
+ "version": "1.0.67",
"id": "cc"
},
{
@@ -139,6 +154,11 @@
"version": "0.1.10",
"id": "cfg_if_0_1_10"
},
+ {
+ "name": "cfg-match",
+ "version": "0.2.1",
+ "id": "cfg_match"
+ },
{
"name": "chrono",
"version": "0.4.19",
@@ -154,9 +174,14 @@
"version": "1.1.0",
"id": "color_quant"
},
+ {
+ "name": "console_error_panic_hook",
+ "version": "0.1.6",
+ "id": "console_error_panic_hook"
+ },
{
"name": "const_fn",
- "version": "0.4.3",
+ "version": "0.4.5",
"id": "const_fn"
},
{
@@ -186,7 +211,7 @@
},
{
"name": "crossbeam-epoch",
- "version": "0.9.1",
+ "version": "0.9.3",
"id": "crossbeam_epoch"
},
{
@@ -196,17 +221,17 @@
},
{
"name": "crossbeam-utils",
- "version": "0.8.1",
+ "version": "0.8.3",
"id": "crossbeam_utils"
},
{
"name": "crypto-mac",
- "version": "0.9.1",
+ "version": "0.10.0",
"id": "crypto_mac"
},
{
"name": "csv",
- "version": "1.1.5",
+ "version": "1.1.6",
"id": "csv"
},
{
@@ -216,7 +241,7 @@
},
{
"name": "data-encoding",
- "version": "2.3.1",
+ "version": "2.3.2",
"id": "data_encoding"
},
{
@@ -224,6 +249,11 @@
"version": "0.8.6",
"id": "deflate"
},
+ {
+ "name": "derivative",
+ "version": "2.2.0",
+ "id": "derivative"
+ },
{
"name": "digest",
"version": "0.9.0",
@@ -231,7 +261,7 @@
},
{
"name": "dtoa",
- "version": "0.4.6",
+ "version": "0.4.7",
"id": "dtoa"
},
{
@@ -241,12 +271,12 @@
},
{
"name": "encoding_rs",
- "version": "0.8.26",
+ "version": "0.8.28",
"id": "encoding_rs"
},
{
"name": "env_logger",
- "version": "0.8.2",
+ "version": "0.8.3",
"id": "env_logger"
},
{
@@ -254,16 +284,6 @@
"version": "0.12.4",
"id": "error_chain"
},
- {
- "name": "failure",
- "version": "0.1.8",
- "id": "failure"
- },
- {
- "name": "failure_derive",
- "version": "0.1.8",
- "id": "failure_derive"
- },
{
"name": "fallible-iterator",
"version": "0.2.0",
@@ -276,7 +296,7 @@
},
{
"name": "filetime",
- "version": "0.2.13",
+ "version": "0.2.14",
"id": "filetime"
},
{
@@ -286,7 +306,7 @@
},
{
"name": "flate2",
- "version": "1.0.19",
+ "version": "1.0.20",
"id": "flate2"
},
{
@@ -306,7 +326,7 @@
},
{
"name": "form_urlencoded",
- "version": "1.0.0",
+ "version": "1.0.1",
"id": "form_urlencoded"
},
{
@@ -316,47 +336,47 @@
},
{
"name": "futures",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures"
},
{
"name": "futures-channel",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures_channel"
},
{
"name": "futures-core",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures_core"
},
{
"name": "futures-executor",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures_executor"
},
{
"name": "futures-io",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures_io"
},
{
"name": "futures-macro",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures_macro"
},
{
"name": "futures-sink",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures_sink"
},
{
"name": "futures-task",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures_task"
},
{
"name": "futures-util",
- "version": "0.3.8",
+ "version": "0.3.13",
"id": "futures_util"
},
{
@@ -366,13 +386,13 @@
},
{
"name": "getrandom",
- "version": "0.2.0",
+ "version": "0.2.2",
"id": "getrandom"
},
{
"name": "getrandom",
- "version": "0.1.15",
- "id": "getrandom_0_1_15"
+ "version": "0.1.16",
+ "id": "getrandom_0_1_16"
},
{
"name": "gif",
@@ -389,9 +409,34 @@
"version": "0.3.0",
"id": "glob"
},
+ {
+ "name": "gloo",
+ "version": "0.2.1",
+ "id": "gloo"
+ },
+ {
+ "name": "gloo-console-timer",
+ "version": "0.1.0",
+ "id": "gloo_console_timer"
+ },
+ {
+ "name": "gloo-events",
+ "version": "0.1.1",
+ "id": "gloo_events"
+ },
+ {
+ "name": "gloo-file",
+ "version": "0.1.0",
+ "id": "gloo_file"
+ },
+ {
+ "name": "gloo-timers",
+ "version": "0.2.1",
+ "id": "gloo_timers"
+ },
{
"name": "h2",
- "version": "0.2.7",
+ "version": "0.3.1",
"id": "h2"
},
{
@@ -406,7 +451,7 @@
},
{
"name": "hmac",
- "version": "0.9.0",
+ "version": "0.10.1",
"id": "hmac"
},
{
@@ -416,17 +461,17 @@
},
{
"name": "http",
- "version": "0.2.1",
+ "version": "0.2.3",
"id": "http"
},
{
"name": "http-body",
- "version": "0.3.1",
+ "version": "0.4.1",
"id": "http_body"
},
{
"name": "httparse",
- "version": "1.3.4",
+ "version": "1.3.5",
"id": "httparse"
},
{
@@ -436,37 +481,32 @@
},
{
"name": "humantime",
- "version": "2.0.1",
+ "version": "2.1.0",
"id": "humantime"
},
- {
- "name": "humantime",
- "version": "1.3.0",
- "id": "humantime_1_3_0"
- },
{
"name": "hyper",
- "version": "0.13.9",
+ "version": "0.14.4",
"id": "hyper"
},
{
"name": "hyper-tls",
- "version": "0.4.3",
+ "version": "0.5.0",
"id": "hyper_tls"
},
{
"name": "idna",
- "version": "0.2.0",
+ "version": "0.2.2",
"id": "idna"
},
{
"name": "image",
- "version": "0.23.12",
+ "version": "0.23.14",
"id": "image"
},
{
"name": "indexmap",
- "version": "1.6.0",
+ "version": "1.6.2",
"id": "indexmap"
},
{
@@ -486,19 +526,24 @@
},
{
"name": "itertools",
- "version": "0.9.0",
+ "version": "0.10.0",
"id": "itertools"
},
{
"name": "itoa",
- "version": "0.4.6",
+ "version": "0.4.7",
"id": "itoa"
},
{
"name": "jpeg-decoder",
- "version": "0.1.20",
+ "version": "0.1.22",
"id": "jpeg_decoder"
},
+ {
+ "name": "js-sys",
+ "version": "0.3.49",
+ "id": "js_sys"
+ },
{
"name": "lazy_static",
"version": "1.4.0",
@@ -506,7 +551,7 @@
},
{
"name": "libc",
- "version": "0.2.80",
+ "version": "0.2.90",
"id": "libc"
},
{
@@ -521,7 +566,7 @@
},
{
"name": "linked-hash-map",
- "version": "0.5.3",
+ "version": "0.5.4",
"id": "linked_hash_map"
},
{
@@ -531,7 +576,7 @@
},
{
"name": "log",
- "version": "0.4.11",
+ "version": "0.4.14",
"id": "log"
},
{
@@ -541,7 +586,7 @@
},
{
"name": "log4rs",
- "version": "0.13.0",
+ "version": "1.0.0",
"id": "log4rs"
},
{
@@ -566,9 +611,14 @@
},
{
"name": "matrixmultiply",
- "version": "0.2.3",
+ "version": "0.3.0",
"id": "matrixmultiply"
},
+ {
+ "name": "matrixmultiply",
+ "version": "0.2.4",
+ "id": "matrixmultiply_0_2_4"
+ },
{
"name": "md5",
"version": "0.7.0",
@@ -594,14 +644,9 @@
"version": "0.3.16",
"id": "mime"
},
- {
- "name": "mime_guess",
- "version": "2.0.3",
- "id": "mime_guess"
- },
{
"name": "miniz_oxide",
- "version": "0.4.3",
+ "version": "0.4.4",
"id": "miniz_oxide"
},
{
@@ -611,22 +656,17 @@
},
{
"name": "mio",
- "version": "0.7.6",
+ "version": "0.7.10",
"id": "mio"
},
- {
- "name": "mio",
- "version": "0.6.23",
- "id": "mio_0_6_23"
- },
{
"name": "nalgebra",
- "version": "0.23.1",
+ "version": "0.25.3",
"id": "nalgebra"
},
{
"name": "native-tls",
- "version": "0.2.6",
+ "version": "0.2.7",
"id": "native_tls"
},
{
@@ -636,7 +676,7 @@
},
{
"name": "net2",
- "version": "0.2.36",
+ "version": "0.2.37",
"id": "net2"
},
{
@@ -646,19 +686,24 @@
},
{
"name": "num",
- "version": "0.3.1",
+ "version": "0.4.0",
"id": "num"
},
{
"name": "num-bigint",
- "version": "0.3.1",
+ "version": "0.4.0",
"id": "num_bigint"
},
{
"name": "num-complex",
- "version": "0.3.1",
+ "version": "0.4.0",
"id": "num_complex"
},
+ {
+ "name": "num-complex",
+ "version": "0.3.1",
+ "id": "num_complex_0_3_1"
+ },
{
"name": "num-integer",
"version": "0.1.44",
@@ -671,9 +716,14 @@
},
{
"name": "num-rational",
- "version": "0.3.2",
+ "version": "0.4.0",
"id": "num_rational"
},
+ {
+ "name": "num-rational",
+ "version": "0.3.2",
+ "id": "num_rational_0_3_2"
+ },
{
"name": "num-traits",
"version": "0.2.14",
@@ -686,12 +736,12 @@
},
{
"name": "object",
- "version": "0.22.0",
+ "version": "0.23.0",
"id": "object"
},
{
"name": "once_cell",
- "version": "1.5.2",
+ "version": "1.7.2",
"id": "once_cell"
},
{
@@ -701,7 +751,7 @@
},
{
"name": "openssl",
- "version": "0.10.30",
+ "version": "0.10.33",
"id": "openssl"
},
{
@@ -711,12 +761,12 @@
},
{
"name": "openssl-sys",
- "version": "0.9.58",
+ "version": "0.9.61",
"id": "openssl_sys"
},
{
"name": "ordered-float",
- "version": "1.1.0",
+ "version": "2.1.1",
"id": "ordered_float"
},
{
@@ -726,12 +776,12 @@
},
{
"name": "parking_lot_core",
- "version": "0.8.0",
+ "version": "0.8.3",
"id": "parking_lot_core"
},
{
"name": "paste",
- "version": "1.0.3",
+ "version": "1.0.5",
"id": "paste"
},
{
@@ -771,34 +821,19 @@
},
{
"name": "pin-project",
- "version": "1.0.2",
+ "version": "1.0.5",
"id": "pin_project"
},
- {
- "name": "pin-project",
- "version": "0.4.27",
- "id": "pin_project_0_4_27"
- },
{
"name": "pin-project-internal",
- "version": "1.0.2",
+ "version": "1.0.5",
"id": "pin_project_internal"
},
- {
- "name": "pin-project-internal",
- "version": "0.4.27",
- "id": "pin_project_internal_0_4_27"
- },
{
"name": "pin-project-lite",
- "version": "0.2.0",
+ "version": "0.2.6",
"id": "pin_project_lite"
},
- {
- "name": "pin-project-lite",
- "version": "0.1.11",
- "id": "pin_project_lite_0_1_11"
- },
{
"name": "pin-utils",
"version": "0.1.0",
@@ -811,22 +846,22 @@
},
{
"name": "png",
- "version": "0.16.7",
+ "version": "0.16.8",
"id": "png"
},
{
"name": "postgres",
- "version": "0.18.1",
+ "version": "0.19.0",
"id": "postgres"
},
{
"name": "postgres-protocol",
- "version": "0.5.3",
+ "version": "0.6.0",
"id": "postgres_protocol"
},
{
"name": "postgres-types",
- "version": "0.1.3",
+ "version": "0.2.0",
"id": "postgres_types"
},
{
@@ -846,7 +881,7 @@
},
{
"name": "proc-macro-nested",
- "version": "0.1.6",
+ "version": "0.1.7",
"id": "proc_macro_nested"
},
{
@@ -859,46 +894,61 @@
"version": "2.0.0",
"id": "quick_error"
},
- {
- "name": "quick-error",
- "version": "1.2.3",
- "id": "quick_error_1_2_3"
- },
{
"name": "quote",
- "version": "1.0.7",
+ "version": "1.0.9",
"id": "quote"
},
{
"name": "rand",
- "version": "0.7.3",
+ "version": "0.8.3",
"id": "rand"
},
+ {
+ "name": "rand",
+ "version": "0.7.3",
+ "id": "rand_0_7_3"
+ },
{
"name": "rand_chacha",
- "version": "0.2.2",
+ "version": "0.3.0",
"id": "rand_chacha"
},
+ {
+ "name": "rand_chacha",
+ "version": "0.2.2",
+ "id": "rand_chacha_0_2_2"
+ },
{
"name": "rand_core",
- "version": "0.5.1",
+ "version": "0.6.2",
"id": "rand_core"
},
+ {
+ "name": "rand_core",
+ "version": "0.5.1",
+ "id": "rand_core_0_5_1"
+ },
{
"name": "rand_distr",
- "version": "0.3.0",
+ "version": "0.4.0",
"id": "rand_distr"
},
{
"name": "rand_hc",
- "version": "0.2.0",
+ "version": "0.3.0",
"id": "rand_hc"
},
{
"name": "rand_pcg",
- "version": "0.2.1",
+ "version": "0.3.0",
"id": "rand_pcg"
},
+ {
+ "name": "rand_pcg",
+ "version": "0.2.1",
+ "id": "rand_pcg_0_2_1"
+ },
{
"name": "rawpointer",
"version": "0.2.1",
@@ -916,7 +966,7 @@
},
{
"name": "regex",
- "version": "1.4.2",
+ "version": "1.4.5",
"id": "regex"
},
{
@@ -926,7 +976,7 @@
},
{
"name": "regex-syntax",
- "version": "0.6.21",
+ "version": "0.6.23",
"id": "regex_syntax"
},
{
@@ -936,17 +986,17 @@
},
{
"name": "reqwest",
- "version": "0.10.9",
+ "version": "0.11.2",
"id": "reqwest"
},
{
"name": "ring",
- "version": "0.16.19",
+ "version": "0.16.20",
"id": "ring"
},
{
"name": "rusqlite",
- "version": "0.24.1",
+ "version": "0.24.2",
"id": "rusqlite"
},
{
@@ -956,7 +1006,7 @@
},
{
"name": "rustc_version",
- "version": "0.3.0",
+ "version": "0.3.3",
"id": "rustc_version"
},
{
@@ -991,27 +1041,27 @@
},
{
"name": "semver-parser",
- "version": "0.10.1",
+ "version": "0.10.2",
"id": "semver_parser"
},
{
"name": "serde",
- "version": "1.0.117",
+ "version": "1.0.124",
"id": "serde"
},
{
"name": "serde-value",
- "version": "0.6.0",
+ "version": "0.7.0",
"id": "serde_value"
},
{
"name": "serde_derive",
- "version": "1.0.117",
+ "version": "1.0.124",
"id": "serde_derive"
},
{
"name": "serde_json",
- "version": "1.0.60",
+ "version": "1.0.64",
"id": "serde_json"
},
{
@@ -1021,22 +1071,22 @@
},
{
"name": "serde_yaml",
- "version": "0.8.14",
+ "version": "0.8.17",
"id": "serde_yaml"
},
{
"name": "sha2",
- "version": "0.9.2",
+ "version": "0.9.3",
"id": "sha2"
},
{
"name": "simba",
- "version": "0.3.1",
+ "version": "0.4.0",
"id": "simba"
},
{
"name": "siphasher",
- "version": "0.3.3",
+ "version": "0.3.5",
"id": "siphasher"
},
{
@@ -1046,12 +1096,17 @@
},
{
"name": "smallvec",
- "version": "1.5.0",
+ "version": "1.6.1",
"id": "smallvec"
},
+ {
+ "name": "smawk",
+ "version": "0.3.1",
+ "id": "smawk"
+ },
{
"name": "socket2",
- "version": "0.3.17",
+ "version": "0.3.19",
"id": "socket2"
},
{
@@ -1061,7 +1116,7 @@
},
{
"name": "standback",
- "version": "0.2.13",
+ "version": "0.2.16",
"id": "standback"
},
{
@@ -1091,12 +1146,12 @@
},
{
"name": "subtle",
- "version": "2.3.0",
+ "version": "2.4.0",
"id": "subtle"
},
{
"name": "syn",
- "version": "1.0.53",
+ "version": "1.0.64",
"id": "syn"
},
{
@@ -1106,17 +1161,17 @@
},
{
"name": "tar",
- "version": "0.4.30",
+ "version": "0.4.33",
"id": "tar"
},
{
"name": "tempfile",
- "version": "3.1.0",
+ "version": "3.2.0",
"id": "tempfile"
},
{
"name": "tendril",
- "version": "0.4.1",
+ "version": "0.4.2",
"id": "tendril"
},
{
@@ -1126,7 +1181,7 @@
},
{
"name": "textwrap",
- "version": "0.12.1",
+ "version": "0.13.4",
"id": "textwrap"
},
{
@@ -1134,6 +1189,16 @@
"version": "0.11.0",
"id": "textwrap_0_11_0"
},
+ {
+ "name": "thiserror",
+ "version": "1.0.24",
+ "id": "thiserror"
+ },
+ {
+ "name": "thiserror-impl",
+ "version": "1.0.24",
+ "id": "thiserror_impl"
+ },
{
"name": "thread-id",
"version": "3.3.0",
@@ -1141,7 +1206,7 @@
},
{
"name": "thread_local",
- "version": "1.0.1",
+ "version": "1.1.3",
"id": "thread_local"
},
{
@@ -1151,12 +1216,12 @@
},
{
"name": "tiff",
- "version": "0.6.0",
+ "version": "0.6.1",
"id": "tiff"
},
{
"name": "time",
- "version": "0.2.23",
+ "version": "0.2.26",
"id": "time"
},
{
@@ -1176,7 +1241,7 @@
},
{
"name": "tinyvec",
- "version": "1.1.0",
+ "version": "1.1.1",
"id": "tinyvec"
},
{
@@ -1186,47 +1251,37 @@
},
{
"name": "tokio",
- "version": "0.3.5",
+ "version": "1.4.0",
"id": "tokio"
},
{
- "name": "tokio",
- "version": "0.2.23",
- "id": "tokio_0_2_23"
+ "name": "tokio-native-tls",
+ "version": "0.3.0",
+ "id": "tokio_native_tls"
},
{
"name": "tokio-postgres",
- "version": "0.6.0",
+ "version": "0.7.0",
"id": "tokio_postgres"
},
- {
- "name": "tokio-tls",
- "version": "0.3.1",
- "id": "tokio_tls"
- },
{
"name": "tokio-util",
- "version": "0.4.0",
+ "version": "0.6.5",
"id": "tokio_util"
},
- {
- "name": "tokio-util",
- "version": "0.3.1",
- "id": "tokio_util_0_3_1"
- },
{
"name": "toml",
- "version": "0.5.7",
+ "version": "0.5.8",
"id": "toml"
},
{
"name": "tower-service",
- "version": "0.3.0",
+ "version": "0.3.1",
"id": "tower_service"
},
{
"name": "tracing",
- "version": "0.1.22",
+ "version": "0.1.25",
"id": "tracing"
},
{
@@ -1234,11 +1289,6 @@
"version": "0.1.17",
"id": "tracing_core"
},
- {
- "name": "tracing-futures",
- "version": "0.2.4",
- "id": "tracing_futures"
- },
{
"name": "traitobject",
"version": "0.1.0",
@@ -1256,7 +1306,7 @@
},
{
"name": "typenum",
- "version": "1.12.0",
+ "version": "1.13.0",
"id": "typenum"
},
{
@@ -1276,7 +1326,7 @@
},
{
"name": "unicode-normalization",
- "version": "0.1.16",
+ "version": "0.1.17",
"id": "unicode_normalization"
},
{
@@ -1306,7 +1356,7 @@
},
{
"name": "url",
- "version": "2.2.0",
+ "version": "2.2.1",
"id": "url"
},
{
@@ -1314,14 +1364,9 @@
"version": "0.7.5",
"id": "utf8"
},
- {
- "name": "utf8-ranges",
- "version": "1.0.4",
- "id": "utf8_ranges"
- },
{
"name": "uuid",
- "version": "0.8.1",
+ "version": "0.8.2",
"id": "uuid"
},
{
@@ -1331,7 +1376,7 @@
},
{
"name": "version_check",
- "version": "0.9.2",
+ "version": "0.9.3",
"id": "version_check"
},
{
@@ -1344,9 +1389,44 @@
"version": "0.3.0",
"id": "want"
},
+ {
+ "name": "wasm-bindgen",
+ "version": "0.2.72",
+ "id": "wasm_bindgen"
+ },
+ {
+ "name": "wasm-bindgen-backend",
+ "version": "0.2.72",
+ "id": "wasm_bindgen_backend"
+ },
+ {
+ "name": "wasm-bindgen-futures",
+ "version": "0.4.22",
+ "id": "wasm_bindgen_futures"
+ },
+ {
+ "name": "wasm-bindgen-macro",
+ "version": "0.2.72",
+ "id": "wasm_bindgen_macro"
+ },
+ {
+ "name": "wasm-bindgen-macro-support",
+ "version": "0.2.72",
+ "id": "wasm_bindgen_macro_support"
+ },
+ {
+ "name": "wasm-bindgen-shared",
+ "version": "0.2.72",
+ "id": "wasm_bindgen_shared"
+ },
+ {
+ "name": "web-sys",
+ "version": "0.3.49",
+ "id": "web_sys"
+ },
{
"name": "weezl",
- "version": "0.1.3",
+ "version": "0.1.4",
"id": "weezl"
},
{
@@ -1366,7 +1446,17 @@
},
{
"name": "yaml-rust",
- "version": "0.4.4",
+ "version": "0.4.5",
"id": "yaml_rust"
+ },
+ {
+ "name": "yew",
+ "version": "0.17.4",
+ "id": "yew"
+ },
+ {
+ "name": "yew-macro",
+ "version": "0.17.0",
+ "id": "yew_macro"
}
]
\ No newline at end of file
diff --git a/compiler/base/postinstall.sh b/compiler/base/postinstall.sh
index 09f1496f1..31b524249 100755
--- a/compiler/base/postinstall.sh
+++ b/compiler/base/postinstall.sh
@@ -20,8 +20,13 @@ function install_wasm_gc() {
cargo install wasm-gc
}
+function install_wasm_pack() {
+ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
+}
+
if [[ $1 == "nightly" ]]; then
(install_wasm_target)
(install_wasm2wat)
(install_wasm_gc)
+ (install_wasm_pack)
fi
diff --git a/top-crates/crate-modifications.toml b/top-crates/crate-modifications.toml
index e5c2962e0..4f6903adc 100644
--- a/top-crates/crate-modifications.toml
+++ b/top-crates/crate-modifications.toml
@@ -1,3 +1,3 @@
exclusions = []
-additions = []
+additions = ["web-sys", "wasm-bindgen", "yew"]
From f214af3cdeb6a130ef0dbc1580cd34ec19b40160 Mon Sep 17 00:00:00 2001
From: titaneric
Date: Mon, 22 Mar 2021 18:16:09 +0800
Subject: [PATCH 02/14] Prepare wasm-pack entry
---
ui/Cargo.toml | 1 +
ui/src/main.rs | 55 +++++++++++++++++++++++++
ui/src/sandbox.rs | 102 +++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 157 insertions(+), 1 deletion(-)
diff --git a/ui/Cargo.toml b/ui/Cargo.toml
index c12fcfff1..9c652444d 100644
--- a/ui/Cargo.toml
+++ b/ui/Cargo.toml
@@ -29,6 +29,7 @@ router = "0.6.0"
openssl-probe = "0.1.2"
dotenv = "0.15.0"
snafu = "0.6.0"
+base64 = "0.13.0"
[dependencies.playground-middleware]
git = "https://github.com/integer32llc/playground-middleware"
diff --git a/ui/src/main.rs b/ui/src/main.rs
index 2421bb8f2..89e70fbeb 100644
--- a/ui/src/main.rs
+++ b/ui/src/main.rs
@@ -85,6 +85,7 @@ fn main() {
mount.mount("/meta/version/miri", meta_version_miri);
mount.mount("/meta/gist", gist_router);
mount.mount("/evaluate.json", evaluate);
+ mount.mount("/wasm-pack", wasm_pack);
let mut chain = Chain::new(mount);
let file_logger = FileLogger::new(logfile).expect("Unable to create file logger");
@@ -281,6 +282,16 @@ fn evaluate(req: &mut Request<'_, '_>) -> IronResult {
})
}
+fn wasm_pack(req: &mut Request<'_, '_>) -> IronResult{
+ with_sandbox(req, |sandbox, req: WasmPackRequest| {
+ let req = req.try_into()?;
+ sandbox
+ .wasm_pack(&req)
+ .map(WasmPackResponse::from)
+ .context(WasmPack)
+ })
+}
+
fn with_sandbox(req: &mut Request<'_, '_>, f: F) -> IronResult
where
F: FnOnce(Sandbox, Req) -> Result,
@@ -488,6 +499,8 @@ pub enum Error {
Execution { source: sandbox::Error },
#[snafu(display("Evaluation operation failed: {}", source))]
Evaluation { source: sandbox::Error },
+ #[snafu(display("wasm-pack operation failed: {}", source))]
+ WasmPack { source: sandbox::Error },
#[snafu(display("Linting operation failed: {}", source))]
Linting { source: sandbox::Error },
#[snafu(display("Expansion operation failed: {}", source))]
@@ -691,6 +704,18 @@ struct EvaluateResponse {
error: Option,
}
+#[derive(Debug, Clone, Deserialize)]
+struct WasmPackRequest {
+ code: String
+}
+
+#[derive(Debug, Clone, Serialize)]
+struct WasmPackResponse {
+ wasm_js: Option,
+ wasm_bg: Option,
+ error: Option
+}
+
impl TryFrom for sandbox::CompileRequest {
type Error = Error;
@@ -927,6 +952,36 @@ impl From for EvaluateResponse {
}
}
+impl TryFrom for sandbox::WasmPackRequest {
+ type Error = Error;
+
+ fn try_from(me: WasmPackRequest) -> Result {
+ Ok(sandbox::WasmPackRequest {
+ code: me.code,
+ ..sandbox::WasmPackRequest::default()
+ })
+ }
+}
+
+impl From for WasmPackResponse {
+ fn from(me: sandbox::WasmPackResponse) -> Self {
+ if me.success {
+ WasmPackResponse {
+ wasm_bg: me.wasm_bg,
+ wasm_js: me.wasm_js,
+ error: None,
+ }
+ } else {
+ let result = me.stderr + &me.stdout;
+ WasmPackResponse {
+ wasm_bg: None,
+ wasm_js: None,
+ error: Some(result),
+ }
+ }
+ }
+}
+
fn parse_target(s: &str) -> Result {
Ok(match s {
"asm" => sandbox::CompileTarget::Assembly(sandbox::AssemblyFlavor::Att,
diff --git a/ui/src/sandbox.rs b/ui/src/sandbox.rs
index 2b529d088..17eca7a44 100644
--- a/ui/src/sandbox.rs
+++ b/ui/src/sandbox.rs
@@ -194,6 +194,40 @@ impl Sandbox {
})
}
+
+ pub fn wasm_pack(&self, req: &WasmPackRequest) -> Result {
+ self.write_source_code(&req.code)?;
+ let command = self.wasm_pack_command(req)?;
+
+ let output = run_command_with_timeout(command)?;
+
+ let (wasm_bg, wasm_js) = if output.status.success() {
+ let wasm_base64 = self.get_built_code_base64(format!("{}_bg.wasm", req.output_name.as_str()).as_str())?;
+ let js_base64 = self.get_built_code_base64(format!("{}.js", req.output_name.as_str()).as_str())?;
+ (Some(wasm_base64), Some(js_base64))
+ } else {
+ (None, None)
+ };
+
+ Ok(WasmPackResponse {
+ success: output.status.success(),
+ stdout: vec_to_str(output.stdout)?,
+ stderr: vec_to_str(output.stderr)?,
+ wasm_bg: wasm_bg,
+ wasm_js: wasm_js
+ })
+ }
+
+ fn get_built_code_base64(&self, file: &str) -> Result {
+ // pkg is default output directory of wasm-pack build
+ // https://rustwasm.github.io/wasm-pack/book/commands/build.html#output-directory
+ let file = self.scratch.path().join("yew-wasm-pack-minimal").join("pkg").join(file);
+ let mut wasm_file = fs::File::open(file).context(UnableToCreateSourceFile)?;
+ let mut buf = Vec::new();
+ wasm_file.read_to_end(&mut buf).context(UnableToReadOutput)?;
+ Ok(base64::encode(buf))
+ }
+
pub fn format(&self, req: &FormatRequest) -> Result {
self.write_source_code(&req.code)?;
let command = self.format_command(req);
@@ -352,6 +386,28 @@ impl Sandbox {
cmd
}
+ fn wasm_pack_command(&self, req: &WasmPackRequest) -> Result {
+ let source_dir = Path::new("/playground").join("yew-wasm-pack-minimal");
+ let source_dir = source_dir.as_os_str().to_str().unwrap();
+ let target_dir = self.scratch.path().join("yew-wasm-pack-minimal");
+ let target_dir = target_dir.as_os_str().to_str().unwrap();
+
+ let mut cmd = self.docker_command(Some(req.crate_type()));
+ let prepare_wasm_pack_cmd = build_prepare_wasm_pack_command(source_dir, target_dir);
+ let wasm_pack_cmd = build_wasm_pack_command(target_dir, req.output_name.as_str());
+ let combine_cmd = [vec!["pwd"], prepare_wasm_pack_cmd, wasm_pack_cmd];
+ let combine_cmd = combine_cmd.iter().map(|cmd| {
+ cmd.join(" ")
+ }).collect::>().join(" && ");
+ let bash_cmd = ["bash", "-c", &format!("\"{}\"", combine_cmd)];
+
+ cmd.arg(&Channel::Nightly.container_name()).args(&bash_cmd);
+
+ log::debug!("wasm-pack command is {:?}", cmd);
+
+ Ok(cmd)
+ }
+
fn format_command(&self, req: impl EditionRequest) -> Command {
let crate_type = CrateType::Binary;
@@ -512,11 +568,26 @@ fn build_execution_command(target: Option, channel: Channel, mode
Hir => cmd.push("-Zunpretty=hir"),
Wasm => { /* handled by cargo-wasm wrapper */ },
}
- }
+ }
cmd
}
+fn build_wasm_pack_command<'a>(path: &'a str, out_name: &'a str) -> Vec<&'a str> {
+ vec![
+ "wasm-pack", "build",
+ "--target", "web",
+ "--out-name", out_name,
+ path
+ ]
+}
+
+fn build_prepare_wasm_pack_command<'a>(source_dir: &'a str, target_dir: &'a str) -> Vec<&'a str> {
+ vec!["cp", "-r",
+ source_dir,
+ target_dir]
+}
+
fn set_execution_environment(cmd: &mut Command, target: Option, req: impl CrateTypeRequest + EditionRequest + BacktraceRequest) {
use self::CompileTarget::*;
@@ -924,6 +995,35 @@ pub struct MacroExpansionResponse {
pub stderr: String,
}
+#[derive(Debug, Clone)]
+pub struct WasmPackRequest {
+ pub code: String,
+ pub crate_type: CrateType,
+ pub output_name: String,
+}
+
+impl Default for WasmPackRequest {
+ fn default() -> Self {
+ WasmPackRequest {
+ code: String::from(""),
+ crate_type: CrateType::Library(LibraryType::Rlib),
+ output_name: "wasm".to_string(),
+ }
+ }
+}
+
+impl CrateTypeRequest for WasmPackRequest {
+ fn crate_type(&self) -> CrateType { self.crate_type }
+}
+
+#[derive(Debug, Clone)]
+pub struct WasmPackResponse {
+ pub wasm_js: Option,
+ pub wasm_bg: Option,
+ pub success: bool,
+ pub stdout: String,
+ pub stderr: String,
+}
#[cfg(test)]
mod test {
use super::*;
From 1bcc2f267432df2a264b315174f75a85663d6b7f Mon Sep 17 00:00:00 2001
From: titaneric
Date: Wed, 24 Mar 2021 21:31:10 +0800
Subject: [PATCH 03/14] Access wasm from entry successfully
---
compiler/base/wasm.Dockerfile | 31 +++++++++++++++++++++++
ui/src/sandbox.rs | 46 +++++++++++++++++++++++------------
2 files changed, 61 insertions(+), 16 deletions(-)
create mode 100644 compiler/base/wasm.Dockerfile
diff --git a/compiler/base/wasm.Dockerfile b/compiler/base/wasm.Dockerfile
new file mode 100644
index 000000000..3165dccb8
--- /dev/null
+++ b/compiler/base/wasm.Dockerfile
@@ -0,0 +1,31 @@
+FROM rust as planner
+WORKDIR /playground
+RUN rustup update && rustup toolchain install nightly && rustup default nightly && \
+ rustup target add wasm32-unknown-unknown --toolchain nightly
+
+RUN cargo +nightly install wasm-bindgen-cli && cargo +nightly install wasm-gc
+
+RUN cargo install wasm-pack cargo-chef
+
+RUN git clone https://github.com/yewstack/yew-wasm-pack-minimal.git .
+RUN cargo chef prepare --recipe-path recipe.json
+
+# We only pay the installation cost once,
+# it will be cached from the second build onwards
+# COPY . .
+FROM planner as cacher
+WORKDIR /playground
+RUN cargo install cargo-chef
+COPY --from=planner /playground/recipe.json recipe.json
+RUN cargo chef cook --release --recipe-path recipe.json
+
+FROM planner as builder
+WORKDIR /playground
+# COPY . .
+# RUN git clone https://github.com/yewstack/yew-wasm-pack-minimal.git .
+# Copy over the cached dependencies
+COPY --from=cacher /playground/target target
+COPY --from=cacher $CARGO_HOME $CARGO_HOME
+#RUN cargo build --release
+RUN wasm-pack build --target web --out-name wasm --mode no-install -- --offline
+
diff --git a/ui/src/sandbox.rs b/ui/src/sandbox.rs
index 17eca7a44..e75098896 100644
--- a/ui/src/sandbox.rs
+++ b/ui/src/sandbox.rs
@@ -201,6 +201,10 @@ impl Sandbox {
let output = run_command_with_timeout(command)?;
+ // log::info!("{:?}", std::fs::read_dir(&self.scratch.path().join("pkg")).context(UnableToStartCompiler)?.map(|res| res.map(|e| e.path())).collect::, std::io::Error>>());
+ log::debug!("{:?}", &output.status);
+
+ // let (wasm_bg, wasm_js) = (None, None);
let (wasm_bg, wasm_js) = if output.status.success() {
let wasm_base64 = self.get_built_code_base64(format!("{}_bg.wasm", req.output_name.as_str()).as_str())?;
let js_base64 = self.get_built_code_base64(format!("{}.js", req.output_name.as_str()).as_str())?;
@@ -221,7 +225,7 @@ impl Sandbox {
fn get_built_code_base64(&self, file: &str) -> Result {
// pkg is default output directory of wasm-pack build
// https://rustwasm.github.io/wasm-pack/book/commands/build.html#output-directory
- let file = self.scratch.path().join("yew-wasm-pack-minimal").join("pkg").join(file);
+ let file = self.output_dir.join("pkg").join(file);
let mut wasm_file = fs::File::open(file).context(UnableToCreateSourceFile)?;
let mut buf = Vec::new();
wasm_file.read_to_end(&mut buf).context(UnableToReadOutput)?;
@@ -387,21 +391,26 @@ impl Sandbox {
}
fn wasm_pack_command(&self, req: &WasmPackRequest) -> Result {
- let source_dir = Path::new("/playground").join("yew-wasm-pack-minimal");
- let source_dir = source_dir.as_os_str().to_str().unwrap();
- let target_dir = self.scratch.path().join("yew-wasm-pack-minimal");
- let target_dir = target_dir.as_os_str().to_str().unwrap();
+ // let source_dir = Path::new("/playground").join("yew-wasm-pack-minimal");
+ // let source_dir = source_dir.as_os_str().to_str().unwrap();
+ // let target_dir = self.scratch.as_path().join("yew-wasm-pack-minimal");
+ // let target_dir = target_dir.as_os_str().to_str().unwrap();
let mut cmd = self.docker_command(Some(req.crate_type()));
- let prepare_wasm_pack_cmd = build_prepare_wasm_pack_command(source_dir, target_dir);
- let wasm_pack_cmd = build_wasm_pack_command(target_dir, req.output_name.as_str());
- let combine_cmd = [vec!["pwd"], prepare_wasm_pack_cmd, wasm_pack_cmd];
- let combine_cmd = combine_cmd.iter().map(|cmd| {
- cmd.join(" ")
- }).collect::>().join(" && ");
- let bash_cmd = ["bash", "-c", &format!("\"{}\"", combine_cmd)];
+ // let prepare_wasm_pack_cmd = build_prepare_wasm_pack_command(source_dir, target_dir);
+ // let wasm_pack_cmd = build_wasm_pack_command(target_dir, req.output_name.as_str());
+ // let dummy_cmd = vec!["find", "/", "-regex", ".*/.*.wasm"];//, self.output_dir.as_os_str().to_str().unwrap()];
+ // let dummy_cmd = vec!["ls", "pkg"];//, self.output_dir.as_os_str().to_str().unwrap()];
+ let dummy_cmd = vec!["mv", "pkg", "/playground-result"];//, self.output_dir.as_os_str().to_str().unwrap()];
+
+ // let combine_cmd = [];//, prepare_wasm_pack_cmd, wasm_pack_cmd];
+ // // let combine_cmd = [wasm_pack_cmd];
+ // let combine_cmd = combine_cmd.iter().map(|cmd| {
+ // cmd.join(" ")
+ // }).collect::>().join(" && ");
+ // let bash_cmd = ["bash", "-c", &format!("\"{}\"", combine_cmd)];
- cmd.arg(&Channel::Nightly.container_name()).args(&bash_cmd);
+ cmd.arg(&Channel::Nightly.container_name()).args(&dummy_cmd);
log::debug!("wasm-pack command is {:?}", cmd);
@@ -475,10 +484,14 @@ impl Sandbox {
mount_output_dir.push(":");
mount_output_dir.push("/playground-result");
+ // let mut mount_output_wasm = self.scratch.as_path().join("pkg").as_os_str().to_os_string();
+ // mount_output_wasm.push(":");
+ // mount_output_wasm.push("/playground/pkg");
let mut cmd = basic_secure_docker_command();
cmd
.arg("--volume").arg(&mount_input_file)
+ // .arg("--volume").arg(&mount_output_wasm)
.arg("--volume").arg(&mount_output_dir);
cmd
@@ -575,10 +588,11 @@ fn build_execution_command(target: Option, channel: Channel, mode
fn build_wasm_pack_command<'a>(path: &'a str, out_name: &'a str) -> Vec<&'a str> {
vec![
- "wasm-pack", "build",
+ "wasm-pack",
+ "build",
"--target", "web",
"--out-name", out_name,
- path
+ // // path
]
}
@@ -737,7 +751,7 @@ impl Channel {
match *self {
Stable => "rust-stable",
Beta => "rust-beta",
- Nightly => "rust-nightly",
+ Nightly => "unique-nightly",
}
}
}
From 62e77d66f5cb67165fd76a0cb35a516064ce6305 Mon Sep 17 00:00:00 2001
From: TitanEric
Date: Sun, 11 Apr 2021 02:36:55 +0800
Subject: [PATCH 04/14] Add cargo-pack
---
compiler/base/wasm.Dockerfile | 31 ---------
compiler/wasm-pack/Cargo.toml | 24 +++++++
compiler/wasm-pack/cargo-pack | 27 ++++++++
compiler/wasm-pack/entrypoint.sh | 11 ++++
compiler/wasm-pack/src/lib.rs | 50 ++++++++++++++
compiler/wasm-pack/wasm.Dockerfile | 21 ++++++
ui/Cargo.lock | 2 -
ui/Cargo.toml | 1 -
ui/src/sandbox.rs | 102 ++++++++++-------------------
9 files changed, 168 insertions(+), 101 deletions(-)
delete mode 100644 compiler/base/wasm.Dockerfile
create mode 100644 compiler/wasm-pack/Cargo.toml
create mode 100755 compiler/wasm-pack/cargo-pack
create mode 100755 compiler/wasm-pack/entrypoint.sh
create mode 100644 compiler/wasm-pack/src/lib.rs
create mode 100644 compiler/wasm-pack/wasm.Dockerfile
diff --git a/compiler/base/wasm.Dockerfile b/compiler/base/wasm.Dockerfile
deleted file mode 100644
index 3165dccb8..000000000
--- a/compiler/base/wasm.Dockerfile
+++ /dev/null
@@ -1,31 +0,0 @@
-FROM rust as planner
-WORKDIR /playground
-RUN rustup update && rustup toolchain install nightly && rustup default nightly && \
- rustup target add wasm32-unknown-unknown --toolchain nightly
-
-RUN cargo +nightly install wasm-bindgen-cli && cargo +nightly install wasm-gc
-
-RUN cargo install wasm-pack cargo-chef
-
-RUN git clone https://github.com/yewstack/yew-wasm-pack-minimal.git .
-RUN cargo chef prepare --recipe-path recipe.json
-
-# We only pay the installation cost once,
-# it will be cached from the second build onwards
-# COPY . .
-FROM planner as cacher
-WORKDIR /playground
-RUN cargo install cargo-chef
-COPY --from=planner /playground/recipe.json recipe.json
-RUN cargo chef cook --release --recipe-path recipe.json
-
-FROM planner as builder
-WORKDIR /playground
-# COPY . .
-# RUN git clone https://github.com/yewstack/yew-wasm-pack-minimal.git .
-# Copy over the cached dependencies
-COPY --from=cacher /playground/target target
-COPY --from=cacher $CARGO_HOME $CARGO_HOME
-#RUN cargo build --release
-RUN wasm-pack build --target web --out-name wasm --mode no-install -- --offline
-
diff --git a/compiler/wasm-pack/Cargo.toml b/compiler/wasm-pack/Cargo.toml
new file mode 100644
index 000000000..2cd25602c
--- /dev/null
+++ b/compiler/wasm-pack/Cargo.toml
@@ -0,0 +1,24 @@
+[package]
+authors = [
+ "Kelly Thomas Kline ",
+ "Samuel Rounce "
+]
+categories = ["gui", "wasm", "web-programming"]
+description = "yew-wasm-pack-minimal demonstrates the minimum code and tooling necessary for a frontend web app with simple deployable artifacts consisting of one HTML file, one JavaScript file, and one WebAssembly file, using Yew, wasm-bindgen, and wasm-pack."
+edition = "2018"
+keywords = ["yew", "wasm", "wasm-bindgen", "web"]
+license = "MIT/Apache-2.0"
+name = "yew-wasm-pack-minimal"
+readme = "README.md"
+repository = "https://github.com/yewstack/yew-wasm-pack-minimal"
+version = "0.1.0"
+
+[lib]
+crate-type = ["cdylib"]
+
+[dependencies]
+wasm-bindgen = "^0.2"
+yew = "0.17"
+
+[package.metadata.wasm-pack.profile.release]
+wasm-opt = false
\ No newline at end of file
diff --git a/compiler/wasm-pack/cargo-pack b/compiler/wasm-pack/cargo-pack
new file mode 100755
index 000000000..8987ef0c2
--- /dev/null
+++ b/compiler/wasm-pack/cargo-pack
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+set -eu
+
+# Rewrite our arguments to be `cargo build` instead of `cargo wasm`;
+# this assumes that the command will always be `cargo wasm ...`. We
+# capture the output directory in order to place the result file.
+shift # Ignore "wasm"
+args=()
+while (( "$#" )); do
+ if [[ "$1" == "--" ]] ; then
+ : # Ignore
+ elif [[ "$1" == "-o" ]] ; then
+ shift
+ output="$1"
+ else
+ args+="$1"
+ fi
+
+ shift
+done
+
+wasm-pack build --target web --out-name package --dev
+
+cat pkg/package_bg.wasm | base64 > "${output}.wasm"
+cat pkg/package.js | base64 > "${output}.js"
+
diff --git a/compiler/wasm-pack/entrypoint.sh b/compiler/wasm-pack/entrypoint.sh
new file mode 100755
index 000000000..bd3da4e03
--- /dev/null
+++ b/compiler/wasm-pack/entrypoint.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -eu
+
+timeout=${PLAYGROUND_TIMEOUT:-10}
+
+modify-cargo-toml
+
+# Don't use `exec` here. The shell is what prints out the useful
+# "Killed" message
+timeout --signal=KILL ${timeout} "$@"
diff --git a/compiler/wasm-pack/src/lib.rs b/compiler/wasm-pack/src/lib.rs
new file mode 100644
index 000000000..3de6e66e8
--- /dev/null
+++ b/compiler/wasm-pack/src/lib.rs
@@ -0,0 +1,50 @@
+use wasm_bindgen::prelude::*;
+use yew::prelude::*;
+
+struct Model {
+ link: ComponentLink,
+ value: i64,
+}
+
+enum Msg {
+ AddOne,
+}
+
+impl Component for Model {
+ type Message = Msg;
+ type Properties = ();
+ fn create(_: Self::Properties, link: ComponentLink) -> Self {
+ Self {
+ link,
+ value: 0,
+ }
+ }
+
+ fn update(&mut self, msg: Self::Message) -> ShouldRender {
+ match msg {
+ Msg::AddOne => self.value += 1
+ }
+ true
+ }
+
+ fn change(&mut self, _props: Self::Properties) -> ShouldRender {
+ // Should only return "true" if new properties are different to
+ // previously received properties.
+ // This component has no properties so we will always return "false".
+ false
+ }
+
+ fn view(&self) -> Html {
+ html! {
+
+
+
{ self.value }
+
+ }
+ }
+}
+
+#[wasm_bindgen(start)]
+pub fn run_app() {
+ App::::new().mount_to_body();
+}
\ No newline at end of file
diff --git a/compiler/wasm-pack/wasm.Dockerfile b/compiler/wasm-pack/wasm.Dockerfile
new file mode 100644
index 000000000..2876a29aa
--- /dev/null
+++ b/compiler/wasm-pack/wasm.Dockerfile
@@ -0,0 +1,21 @@
+# syntax = docker/dockerfile:experimental
+
+FROM shepmaster/rust-nightly
+RUN cargo install wasm-pack
+ADD --chown=playground src/lib.rs /playground/src/lib.rs
+ADD --chown=playground Cargo.toml /playground/Cargo.toml
+# RUN --mount=target=/playground/target,type=cache,mode=0777 \
+# --mount=target=/playground/cargo-deps,type=cache,mode=0777 \
+RUN cargo vendor --no-delete --versioned-dirs ./cargo-deps > /playground/.cargo/config.toml \
+ && wasm-pack build --target web --out-name package --dev \
+ && wasm-pack build --target web --out-name package \
+ && cp --preserve=timestamps -r /playground/cargo-deps /playground/cargo-deps-cached \
+ && cp --preserve=timestamps -r /playground/target /playground/target-cached
+RUN rm -r /playground/cargo-deps && mv /playground/cargo-deps-cached /playground/cargo-deps
+RUN rm -r /playground/target && mv /playground/target-cached /playground/target
+# ADD --chown=playground config.toml /playground/.cargo/config.toml
+# RUN rm src/component.rs
+
+ADD --chown=playground cargo-pack /playground/.cargo/bin/
+ADD --chown=playground entrypoint.sh /playground/tools/
+ENTRYPOINT ["/playground/tools/entrypoint.sh"]
diff --git a/ui/Cargo.lock b/ui/Cargo.lock
index 4b8225a0e..c5c75ff2b 100644
--- a/ui/Cargo.lock
+++ b/ui/Cargo.lock
@@ -1,7 +1,5 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
-
[[package]]
name = "aho-corasick"
version = "0.7.15"
diff --git a/ui/Cargo.toml b/ui/Cargo.toml
index 9c652444d..c12fcfff1 100644
--- a/ui/Cargo.toml
+++ b/ui/Cargo.toml
@@ -29,7 +29,6 @@ router = "0.6.0"
openssl-probe = "0.1.2"
dotenv = "0.15.0"
snafu = "0.6.0"
-base64 = "0.13.0"
[dependencies.playground-middleware]
git = "https://github.com/integer32llc/playground-middleware"
diff --git a/ui/src/sandbox.rs b/ui/src/sandbox.rs
index e75098896..aa9c5a7c0 100644
--- a/ui/src/sandbox.rs
+++ b/ui/src/sandbox.rs
@@ -196,42 +196,47 @@ impl Sandbox {
pub fn wasm_pack(&self, req: &WasmPackRequest) -> Result {
- self.write_source_code(&req.code)?;
- let command = self.wasm_pack_command(req)?;
+ use CompileTarget::*;
+ use CrateType::*;
- let output = run_command_with_timeout(command)?;
+ let compile_req = CompileRequest{
+ backtrace: false,
+ channel: Channel::Nightly,
+ code: req.code.clone(),
+ crate_type: Library(LibraryType::Cdylib),
+ edition: Some(Edition::Rust2018),
+ mode: Mode::Debug,
+ target: WasmPack,
+ tests: false,
+ };
+ let res = self.compile(&compile_req)?;
+ let js_file =
+ fs::read_dir(&self.output_dir)
+ .context(UnableToReadOutput)?
+ .flat_map(|entry| entry)
+ .map(|entry| entry.path())
+ .find(|path| path.extension() == Some(OsStr::new("js")));
- // log::info!("{:?}", std::fs::read_dir(&self.scratch.path().join("pkg")).context(UnableToStartCompiler)?.map(|res| res.map(|e| e.path())).collect::, std::io::Error>>());
- log::debug!("{:?}", &output.status);
+ let js_code = match js_file {
+ Some(file) => read(&file)?.unwrap_or_else(String::new),
+ None => String::new() // TODO: return proper error?
+ };
- // let (wasm_bg, wasm_js) = (None, None);
- let (wasm_bg, wasm_js) = if output.status.success() {
- let wasm_base64 = self.get_built_code_base64(format!("{}_bg.wasm", req.output_name.as_str()).as_str())?;
- let js_base64 = self.get_built_code_base64(format!("{}.js", req.output_name.as_str()).as_str())?;
- (Some(wasm_base64), Some(js_base64))
+ let (wasm_bg, wasm_js) = if res.success {
+ (Some(res.code), Some(js_code))
} else {
(None, None)
};
Ok(WasmPackResponse {
- success: output.status.success(),
- stdout: vec_to_str(output.stdout)?,
- stderr: vec_to_str(output.stderr)?,
+ success: res.success,
+ stdout: res.stdout,
+ stderr: res.stderr,
wasm_bg: wasm_bg,
wasm_js: wasm_js
})
}
- fn get_built_code_base64(&self, file: &str) -> Result {
- // pkg is default output directory of wasm-pack build
- // https://rustwasm.github.io/wasm-pack/book/commands/build.html#output-directory
- let file = self.output_dir.join("pkg").join(file);
- let mut wasm_file = fs::File::open(file).context(UnableToCreateSourceFile)?;
- let mut buf = Vec::new();
- wasm_file.read_to_end(&mut buf).context(UnableToReadOutput)?;
- Ok(base64::encode(buf))
- }
-
pub fn format(&self, req: &FormatRequest) -> Result {
self.write_source_code(&req.code)?;
let command = self.format_command(req);
@@ -390,33 +395,6 @@ impl Sandbox {
cmd
}
- fn wasm_pack_command(&self, req: &WasmPackRequest) -> Result {
- // let source_dir = Path::new("/playground").join("yew-wasm-pack-minimal");
- // let source_dir = source_dir.as_os_str().to_str().unwrap();
- // let target_dir = self.scratch.as_path().join("yew-wasm-pack-minimal");
- // let target_dir = target_dir.as_os_str().to_str().unwrap();
-
- let mut cmd = self.docker_command(Some(req.crate_type()));
- // let prepare_wasm_pack_cmd = build_prepare_wasm_pack_command(source_dir, target_dir);
- // let wasm_pack_cmd = build_wasm_pack_command(target_dir, req.output_name.as_str());
- // let dummy_cmd = vec!["find", "/", "-regex", ".*/.*.wasm"];//, self.output_dir.as_os_str().to_str().unwrap()];
- // let dummy_cmd = vec!["ls", "pkg"];//, self.output_dir.as_os_str().to_str().unwrap()];
- let dummy_cmd = vec!["mv", "pkg", "/playground-result"];//, self.output_dir.as_os_str().to_str().unwrap()];
-
- // let combine_cmd = [];//, prepare_wasm_pack_cmd, wasm_pack_cmd];
- // // let combine_cmd = [wasm_pack_cmd];
- // let combine_cmd = combine_cmd.iter().map(|cmd| {
- // cmd.join(" ")
- // }).collect::>().join(" && ");
- // let bash_cmd = ["bash", "-c", &format!("\"{}\"", combine_cmd)];
-
- cmd.arg(&Channel::Nightly.container_name()).args(&dummy_cmd);
-
- log::debug!("wasm-pack command is {:?}", cmd);
-
- Ok(cmd)
- }
-
fn format_command(&self, req: impl EditionRequest) -> Command {
let crate_type = CrateType::Binary;
@@ -538,6 +516,7 @@ fn build_execution_command(target: Option, channel: Channel, mode
let mut cmd = vec!["cargo"];
match (target, req.crate_type(), tests) {
+ (Some(WasmPack), _, _) => cmd.push("pack"),
(Some(Wasm), _, _) => cmd.push("wasm"),
(Some(_), _, _) => cmd.push("rustc"),
(_, _, true) => cmd.push("test"),
@@ -580,27 +559,13 @@ fn build_execution_command(target: Option, channel: Channel, mode
Mir => cmd.push("--emit=mir"),
Hir => cmd.push("-Zunpretty=hir"),
Wasm => { /* handled by cargo-wasm wrapper */ },
+ WasmPack => { /* handled by cargo-wasmpack wrapper */ },
}
}
-
+ log::debug!("{:?}", &cmd);
cmd
}
-fn build_wasm_pack_command<'a>(path: &'a str, out_name: &'a str) -> Vec<&'a str> {
- vec![
- "wasm-pack",
- "build",
- "--target", "web",
- "--out-name", out_name,
- // // path
- ]
-}
-
-fn build_prepare_wasm_pack_command<'a>(source_dir: &'a str, target_dir: &'a str) -> Vec<&'a str> {
- vec!["cp", "-r",
- source_dir,
- target_dir]
-}
fn set_execution_environment(cmd: &mut Command, target: Option, req: impl CrateTypeRequest + EditionRequest + BacktraceRequest) {
use self::CompileTarget::*;
@@ -708,6 +673,7 @@ pub enum CompileTarget {
Mir,
Hir,
Wasm,
+ WasmPack,
}
impl CompileTarget {
@@ -718,6 +684,7 @@ impl CompileTarget {
CompileTarget::Mir => "mir",
CompileTarget::Hir => "hir",
CompileTarget::Wasm => "wat",
+ CompileTarget::WasmPack => "wasm",
};
OsStr::new(ext)
}
@@ -733,6 +700,7 @@ impl fmt::Display for CompileTarget {
Mir => "Rust MIR".fmt(f),
Hir => "Rust HIR".fmt(f),
Wasm => "WebAssembly".fmt(f),
+ WasmPack => "WasmPack".fmt(f),
}
}
}
@@ -751,7 +719,7 @@ impl Channel {
match *self {
Stable => "rust-stable",
Beta => "rust-beta",
- Nightly => "unique-nightly",
+ Nightly => "rust-nightly",
}
}
}
From 44a7db45da0ca7d84b66b2df656a8e38d4e50cd9 Mon Sep 17 00:00:00 2001
From: titaneric
Date: Mon, 12 Apr 2021 21:41:33 +0800
Subject: [PATCH 05/14] Rename dockerfile
---
compiler/wasm-pack/Cargo.toml | 4 +++
compiler/wasm-pack/Dockerfile | 14 ++++++++
compiler/wasm-pack/src/lib.rs | 57 +++++++-----------------------
compiler/wasm-pack/wasm.Dockerfile | 21 -----------
4 files changed, 31 insertions(+), 65 deletions(-)
create mode 100644 compiler/wasm-pack/Dockerfile
delete mode 100644 compiler/wasm-pack/wasm.Dockerfile
diff --git a/compiler/wasm-pack/Cargo.toml b/compiler/wasm-pack/Cargo.toml
index 2cd25602c..6a2a357b9 100644
--- a/compiler/wasm-pack/Cargo.toml
+++ b/compiler/wasm-pack/Cargo.toml
@@ -18,7 +18,11 @@ crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "^0.2"
+web-sys = "^0.3"
+js-sys = "^0.3"
+wasm-bindgen-futures = "^0.4"
yew = "0.17"
+seed = "0.8.0"
[package.metadata.wasm-pack.profile.release]
wasm-opt = false
\ No newline at end of file
diff --git a/compiler/wasm-pack/Dockerfile b/compiler/wasm-pack/Dockerfile
new file mode 100644
index 000000000..f490222b1
--- /dev/null
+++ b/compiler/wasm-pack/Dockerfile
@@ -0,0 +1,14 @@
+# syntax = docker/dockerfile:experimental
+
+FROM shepmaster/rust-nightly
+RUN cargo install wasm-pack
+ADD --chown=playground src/lib.rs /playground/src/lib.rs
+ADD --chown=playground Cargo.toml /playground/Cargo.toml
+RUN cargo vendor --no-delete --versioned-dirs ./cargo-deps > /playground/.cargo/config.toml \
+ && wasm-pack build --target web --out-name package --dev \
+ && wasm-pack build --target web --out-name package
+RUN rm src/lib.rs
+
+ADD --chown=playground cargo-pack /playground/.cargo/bin/
+ADD --chown=playground entrypoint.sh /playground/tools/
+ENTRYPOINT ["/playground/tools/entrypoint.sh"]
diff --git a/compiler/wasm-pack/src/lib.rs b/compiler/wasm-pack/src/lib.rs
index 3de6e66e8..8f6dcb2f2 100644
--- a/compiler/wasm-pack/src/lib.rs
+++ b/compiler/wasm-pack/src/lib.rs
@@ -1,50 +1,19 @@
use wasm_bindgen::prelude::*;
-use yew::prelude::*;
-struct Model {
- link: ComponentLink,
- value: i64,
-}
-
-enum Msg {
- AddOne,
-}
-
-impl Component for Model {
- type Message = Msg;
- type Properties = ();
- fn create(_: Self::Properties, link: ComponentLink) -> Self {
- Self {
- link,
- value: 0,
- }
- }
-
- fn update(&mut self, msg: Self::Message) -> ShouldRender {
- match msg {
- Msg::AddOne => self.value += 1
- }
- true
- }
+// Called by our JS entry point to run the example
+#[wasm_bindgen(start)]
+pub fn run() -> Result<(), JsValue> {
+ // Use `web_sys`'s global `window` function to get a handle on the global
+ // window object.
+ let window = web_sys::window().expect("no global `window` exists");
+ let document = window.document().expect("should have a document on window");
+ let body = document.body().expect("document should have a body");
- fn change(&mut self, _props: Self::Properties) -> ShouldRender {
- // Should only return "true" if new properties are different to
- // previously received properties.
- // This component has no properties so we will always return "false".
- false
- }
+ // Manufacture the element we're gonna append
+ let val = document.create_element("p")?;
+ val.set_text_content(Some("Hello from Rust!"));
- fn view(&self) -> Html {
- html! {
-
-
-
{ self.value }
-
- }
- }
-}
+ body.append_child(&val)?;
-#[wasm_bindgen(start)]
-pub fn run_app() {
- App::::new().mount_to_body();
+ Ok(())
}
\ No newline at end of file
diff --git a/compiler/wasm-pack/wasm.Dockerfile b/compiler/wasm-pack/wasm.Dockerfile
deleted file mode 100644
index 2876a29aa..000000000
--- a/compiler/wasm-pack/wasm.Dockerfile
+++ /dev/null
@@ -1,21 +0,0 @@
-# syntax = docker/dockerfile:experimental
-
-FROM shepmaster/rust-nightly
-RUN cargo install wasm-pack
-ADD --chown=playground src/lib.rs /playground/src/lib.rs
-ADD --chown=playground Cargo.toml /playground/Cargo.toml
-# RUN --mount=target=/playground/target,type=cache,mode=0777 \
-# --mount=target=/playground/cargo-deps,type=cache,mode=0777 \
-RUN cargo vendor --no-delete --versioned-dirs ./cargo-deps > /playground/.cargo/config.toml \
- && wasm-pack build --target web --out-name package --dev \
- && wasm-pack build --target web --out-name package \
- && cp --preserve=timestamps -r /playground/cargo-deps /playground/cargo-deps-cached \
- && cp --preserve=timestamps -r /playground/target /playground/target-cached
-RUN rm -r /playground/cargo-deps && mv /playground/cargo-deps-cached /playground/cargo-deps
-RUN rm -r /playground/target && mv /playground/target-cached /playground/target
-# ADD --chown=playground config.toml /playground/.cargo/config.toml
-# RUN rm src/component.rs
-
-ADD --chown=playground cargo-pack /playground/.cargo/bin/
-ADD --chown=playground entrypoint.sh /playground/tools/
-ENTRYPOINT ["/playground/tools/entrypoint.sh"]
From 9d2335db0efb6c78a0531fbb1da2a0f512d55937 Mon Sep 17 00:00:00 2001
From: titaneric
Date: Tue, 13 Apr 2021 13:02:41 +0800
Subject: [PATCH 06/14] Rewrite dockerfile and restore base dir
---
compiler/base/Cargo.toml | 68 +-----------------
compiler/base/crate-information.json | 104 +--------------------------
compiler/base/postinstall.sh | 5 --
compiler/wasm-pack/Cargo.toml | 15 +---
compiler/wasm-pack/Dockerfile | 15 ++--
compiler/wasm-pack/cargo-pack | 1 +
compiler/wasm-pack/entrypoint.sh | 11 ---
top-crates/crate-modifications.toml | 2 +-
8 files changed, 18 insertions(+), 203 deletions(-)
delete mode 100755 compiler/wasm-pack/entrypoint.sh
diff --git a/compiler/base/Cargo.toml b/compiler/base/Cargo.toml
index d82765e2a..cfc45cb3a 100644
--- a/compiler/base/Cargo.toml
+++ b/compiler/base/Cargo.toml
@@ -73,10 +73,6 @@ version = "=0.3.56"
package = "base64"
version = "=0.13.0"
-[dependencies.bincode]
-package = "bincode"
-version = "=1.3.1"
-
[dependencies.bit_set]
package = "bit-set"
version = "=0.5.2"
@@ -93,10 +89,6 @@ version = "=1.2.1"
package = "block-buffer"
version = "=0.9.0"
-[dependencies.boolinator]
-package = "boolinator"
-version = "=2.4.0"
-
[dependencies.bstr]
package = "bstr"
version = "=0.2.15"
@@ -126,10 +118,6 @@ version = "=1.0.0"
package = "cfg-if"
version = "=0.1.10"
-[dependencies.cfg_match]
-package = "cfg-match"
-version = "=0.2.1"
-
[dependencies.chrono]
package = "chrono"
version = "=0.4.19"
@@ -143,10 +131,6 @@ version = "=2.33.3"
package = "color_quant"
version = "=1.1.0"
-[dependencies.console_error_panic_hook]
-package = "console_error_panic_hook"
-version = "=0.1.6"
-
[dependencies.const_fn]
package = "const_fn"
version = "=0.4.5"
@@ -336,26 +320,6 @@ version = "=0.23.0"
package = "glob"
version = "=0.3.0"
-[dependencies.gloo]
-package = "gloo"
-version = "=0.2.1"
-
-[dependencies.gloo_console_timer]
-package = "gloo-console-timer"
-version = "=0.1.0"
-
-[dependencies.gloo_events]
-package = "gloo-events"
-version = "=0.1.1"
-
-[dependencies.gloo_file]
-package = "gloo-file"
-version = "=0.1.0"
-
-[dependencies.gloo_timers]
-package = "gloo-timers"
-version = "=0.2.1"
-
[dependencies.h2]
package = "h2"
version = "=0.3.1"
@@ -879,7 +843,7 @@ version = "=0.4.0"
[dependencies.siphasher]
package = "siphasher"
-version = "=0.3.5"
+version = "=0.3.3"
[dependencies.slab]
package = "slab"
@@ -1115,7 +1079,7 @@ version = "=0.8.2"
[dependencies.version_check]
package = "version_check"
-version = "=0.9.3"
+version = "=0.9.2"
[dependencies.walkdir]
package = "walkdir"
@@ -1125,34 +1089,6 @@ version = "=2.3.1"
package = "want"
version = "=0.3.0"
-[dependencies.wasm_bindgen]
-package = "wasm-bindgen"
-version = "=0.2.72"
-
-[dependencies.wasm_bindgen_backend]
-package = "wasm-bindgen-backend"
-version = "=0.2.72"
-
-[dependencies.wasm_bindgen_futures]
-package = "wasm-bindgen-futures"
-version = "=0.4.22"
-
-[dependencies.wasm_bindgen_macro]
-package = "wasm-bindgen-macro"
-version = "=0.2.72"
-
-[dependencies.wasm_bindgen_macro_support]
-package = "wasm-bindgen-macro-support"
-version = "=0.2.72"
-
-[dependencies.wasm_bindgen_shared]
-package = "wasm-bindgen-shared"
-version = "=0.2.72"
-
-[dependencies.web_sys]
-package = "web-sys"
-version = "=0.3.49"
-
[dependencies.weezl]
package = "weezl"
version = "=0.1.4"
diff --git a/compiler/base/crate-information.json b/compiler/base/crate-information.json
index eb85ec6ef..b3b411030 100644
--- a/compiler/base/crate-information.json
+++ b/compiler/base/crate-information.json
@@ -79,11 +79,6 @@
"version": "0.13.0",
"id": "base64"
},
- {
- "name": "bincode",
- "version": "1.3.1",
- "id": "bincode"
- },
{
"name": "bit-set",
"version": "0.5.2",
@@ -104,21 +99,11 @@
"version": "0.9.0",
"id": "block_buffer"
},
- {
- "name": "boolinator",
- "version": "2.4.0",
- "id": "boolinator"
- },
{
"name": "bstr",
"version": "0.2.15",
"id": "bstr"
},
- {
- "name": "bumpalo",
- "version": "3.6.1",
- "id": "bumpalo"
- },
{
"name": "bytemuck",
"version": "1.5.1",
@@ -149,11 +134,6 @@
"version": "0.1.10",
"id": "cfg_if_0_1_10"
},
- {
- "name": "cfg-match",
- "version": "0.2.1",
- "id": "cfg_match"
- },
{
"name": "chrono",
"version": "0.4.19",
@@ -169,11 +149,6 @@
"version": "1.1.0",
"id": "color_quant"
},
- {
- "name": "console_error_panic_hook",
- "version": "0.1.6",
- "id": "console_error_panic_hook"
- },
{
"name": "const_fn",
"version": "0.4.5",
@@ -404,31 +379,6 @@
"version": "0.3.0",
"id": "glob"
},
- {
- "name": "gloo",
- "version": "0.2.1",
- "id": "gloo"
- },
- {
- "name": "gloo-console-timer",
- "version": "0.1.0",
- "id": "gloo_console_timer"
- },
- {
- "name": "gloo-events",
- "version": "0.1.1",
- "id": "gloo_events"
- },
- {
- "name": "gloo-file",
- "version": "0.1.0",
- "id": "gloo_file"
- },
- {
- "name": "gloo-timers",
- "version": "0.2.1",
- "id": "gloo_timers"
- },
{
"name": "h2",
"version": "0.3.1",
@@ -534,11 +484,6 @@
"version": "0.1.22",
"id": "jpeg_decoder"
},
- {
- "name": "js-sys",
- "version": "0.3.49",
- "id": "js_sys"
- },
{
"name": "lazy_static",
"version": "1.4.0",
@@ -1081,7 +1026,7 @@
},
{
"name": "siphasher",
- "version": "0.3.5",
+ "version": "0.3.3",
"id": "siphasher"
},
{
@@ -1371,7 +1316,7 @@
},
{
"name": "version_check",
- "version": "0.9.3",
+ "version": "0.9.2",
"id": "version_check"
},
{
@@ -1384,41 +1329,6 @@
"version": "0.3.0",
"id": "want"
},
- {
- "name": "wasm-bindgen",
- "version": "0.2.72",
- "id": "wasm_bindgen"
- },
- {
- "name": "wasm-bindgen-backend",
- "version": "0.2.72",
- "id": "wasm_bindgen_backend"
- },
- {
- "name": "wasm-bindgen-futures",
- "version": "0.4.22",
- "id": "wasm_bindgen_futures"
- },
- {
- "name": "wasm-bindgen-macro",
- "version": "0.2.72",
- "id": "wasm_bindgen_macro"
- },
- {
- "name": "wasm-bindgen-macro-support",
- "version": "0.2.72",
- "id": "wasm_bindgen_macro_support"
- },
- {
- "name": "wasm-bindgen-shared",
- "version": "0.2.72",
- "id": "wasm_bindgen_shared"
- },
- {
- "name": "web-sys",
- "version": "0.3.49",
- "id": "web_sys"
- },
{
"name": "weezl",
"version": "0.1.4",
@@ -1443,15 +1353,5 @@
"name": "yaml-rust",
"version": "0.4.5",
"id": "yaml_rust"
- },
- {
- "name": "yew",
- "version": "0.17.4",
- "id": "yew"
- },
- {
- "name": "yew-macro",
- "version": "0.17.0",
- "id": "yew_macro"
}
]
\ No newline at end of file
diff --git a/compiler/base/postinstall.sh b/compiler/base/postinstall.sh
index 31b524249..09f1496f1 100755
--- a/compiler/base/postinstall.sh
+++ b/compiler/base/postinstall.sh
@@ -20,13 +20,8 @@ function install_wasm_gc() {
cargo install wasm-gc
}
-function install_wasm_pack() {
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
-}
-
if [[ $1 == "nightly" ]]; then
(install_wasm_target)
(install_wasm2wat)
(install_wasm_gc)
- (install_wasm_pack)
fi
diff --git a/compiler/wasm-pack/Cargo.toml b/compiler/wasm-pack/Cargo.toml
index 6a2a357b9..8b27f0c79 100644
--- a/compiler/wasm-pack/Cargo.toml
+++ b/compiler/wasm-pack/Cargo.toml
@@ -1,17 +1,8 @@
[package]
-authors = [
- "Kelly Thomas Kline ",
- "Samuel Rounce "
-]
-categories = ["gui", "wasm", "web-programming"]
-description = "yew-wasm-pack-minimal demonstrates the minimum code and tooling necessary for a frontend web app with simple deployable artifacts consisting of one HTML file, one JavaScript file, and one WebAssembly file, using Yew, wasm-bindgen, and wasm-pack."
-edition = "2018"
-keywords = ["yew", "wasm", "wasm-bindgen", "web"]
-license = "MIT/Apache-2.0"
-name = "yew-wasm-pack-minimal"
-readme = "README.md"
-repository = "https://github.com/yewstack/yew-wasm-pack-minimal"
+name = "hello_world"
version = "0.1.0"
+authors = ["The wasm-bindgen Developers"]
+edition = "2018"
[lib]
crate-type = ["cdylib"]
diff --git a/compiler/wasm-pack/Dockerfile b/compiler/wasm-pack/Dockerfile
index f490222b1..ae2dd8a55 100644
--- a/compiler/wasm-pack/Dockerfile
+++ b/compiler/wasm-pack/Dockerfile
@@ -1,14 +1,17 @@
# syntax = docker/dockerfile:experimental
-FROM shepmaster/rust-nightly
+# fetch dependencies to local
+FROM shepmaster/rust-nightly as sources
RUN cargo install wasm-pack
ADD --chown=playground src/lib.rs /playground/src/lib.rs
+# TODO support top 100 crates
ADD --chown=playground Cargo.toml /playground/Cargo.toml
-RUN cargo vendor --no-delete --versioned-dirs ./cargo-deps > /playground/.cargo/config.toml \
- && wasm-pack build --target web --out-name package --dev \
- && wasm-pack build --target web --out-name package
-RUN rm src/lib.rs
+RUN cargo fetch
+
+# build dependencies
+FROM sources
+RUN wasm-pack build --target web --out-name package --dev
+RUN rm src/*.rs
ADD --chown=playground cargo-pack /playground/.cargo/bin/
-ADD --chown=playground entrypoint.sh /playground/tools/
ENTRYPOINT ["/playground/tools/entrypoint.sh"]
diff --git a/compiler/wasm-pack/cargo-pack b/compiler/wasm-pack/cargo-pack
index 8987ef0c2..27db4e079 100755
--- a/compiler/wasm-pack/cargo-pack
+++ b/compiler/wasm-pack/cargo-pack
@@ -20,6 +20,7 @@ while (( "$#" )); do
shift
done
+# --dev disable the wasm-opt for optimization downloaded from networks
wasm-pack build --target web --out-name package --dev
cat pkg/package_bg.wasm | base64 > "${output}.wasm"
diff --git a/compiler/wasm-pack/entrypoint.sh b/compiler/wasm-pack/entrypoint.sh
deleted file mode 100755
index bd3da4e03..000000000
--- a/compiler/wasm-pack/entrypoint.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-set -eu
-
-timeout=${PLAYGROUND_TIMEOUT:-10}
-
-modify-cargo-toml
-
-# Don't use `exec` here. The shell is what prints out the useful
-# "Killed" message
-timeout --signal=KILL ${timeout} "$@"
diff --git a/top-crates/crate-modifications.toml b/top-crates/crate-modifications.toml
index 4f6903adc..e5c2962e0 100644
--- a/top-crates/crate-modifications.toml
+++ b/top-crates/crate-modifications.toml
@@ -1,3 +1,3 @@
exclusions = []
-additions = ["web-sys", "wasm-bindgen", "yew"]
+additions = []
From 0ee1dd0b112b4ac8688ed7a2b83d4254510377f7 Mon Sep 17 00:00:00 2001
From: titaneric
Date: Tue, 13 Apr 2021 13:14:32 +0800
Subject: [PATCH 07/14] Support rust-wasm-pack channel
---
compiler/wasm-pack/cargo-pack | 4 ++--
ui/src/sandbox.rs | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/compiler/wasm-pack/cargo-pack b/compiler/wasm-pack/cargo-pack
index 27db4e079..64f14c25e 100755
--- a/compiler/wasm-pack/cargo-pack
+++ b/compiler/wasm-pack/cargo-pack
@@ -19,8 +19,8 @@ while (( "$#" )); do
shift
done
-
-# --dev disable the wasm-opt for optimization downloaded from networks
+# Greatly inspired from https://gitlab.com/strwrite/seed-playground
+# --dev flag disables the wasm-opt for optimization downloaded from networks
wasm-pack build --target web --out-name package --dev
cat pkg/package_bg.wasm | base64 > "${output}.wasm"
diff --git a/ui/src/sandbox.rs b/ui/src/sandbox.rs
index aa9c5a7c0..802edc4ab 100644
--- a/ui/src/sandbox.rs
+++ b/ui/src/sandbox.rs
@@ -194,14 +194,14 @@ impl Sandbox {
})
}
-
+ // Greatly inspired from https://gitlab.com/strwrite/seed-playground
pub fn wasm_pack(&self, req: &WasmPackRequest) -> Result {
use CompileTarget::*;
use CrateType::*;
let compile_req = CompileRequest{
backtrace: false,
- channel: Channel::Nightly,
+ channel: Channel::WasmPack,
code: req.code.clone(),
crate_type: Library(LibraryType::Cdylib),
edition: Some(Edition::Rust2018),
@@ -710,6 +710,7 @@ pub enum Channel {
Stable,
Beta,
Nightly,
+ WasmPack,
}
impl Channel {
@@ -720,6 +721,7 @@ impl Channel {
Stable => "rust-stable",
Beta => "rust-beta",
Nightly => "rust-nightly",
+ WasmPack => "rust-wasm-pack",
}
}
}
From 4949c437174921094ab450b9280c403dcde56f3a Mon Sep 17 00:00:00 2001
From: titaneric
Date: Tue, 13 Apr 2021 19:13:56 +0800
Subject: [PATCH 08/14] Call wasm-pack route
---
ui/frontend/BuildMenu.tsx | 12 +++++
ui/frontend/Output.tsx | 11 +++-
ui/frontend/actions.ts | 72 ++++++++++++++++++++-----
ui/frontend/reducers/output/index.ts | 2 +
ui/frontend/reducers/output/wasmPack.ts | 35 ++++++++++++
ui/frontend/selectors/index.ts | 2 +
ui/frontend/types.ts | 2 +
7 files changed, 123 insertions(+), 13 deletions(-)
create mode 100644 ui/frontend/reducers/output/wasmPack.ts
diff --git a/ui/frontend/BuildMenu.tsx b/ui/frontend/BuildMenu.tsx
index 9a4ea349a..c75985868 100644
--- a/ui/frontend/BuildMenu.tsx
+++ b/ui/frontend/BuildMenu.tsx
@@ -26,6 +26,7 @@ const useDispatchAndClose = (action: () => void, close: () => void) => {
const BuildMenu: React.SFC = props => {
const isHirAvailable = useSelector(selectors.isHirAvailable);
const isWasmAvailable = useSelector(selectors.isWasmAvailable);
+ const isWasmPackAvailable = useSelector(selectors.isWasmPackAvailable);
const compile = useDispatchAndClose(actions.performCompile, props.close);
const compileToAssembly = useDispatchAndClose(actions.performCompileToAssembly, props.close);
@@ -33,6 +34,7 @@ const BuildMenu: React.SFC = props => {
const compileToMir = useDispatchAndClose(actions.performCompileToMir, props.close);
const compileToHir = useDispatchAndClose(actions.performCompileToNightlyHir, props.close);
const compileToWasm = useDispatchAndClose(actions.performCompileToNightlyWasm, props.close);
+ const compileToWasmPack = useDispatchAndClose(actions.performCompileToNightlyWasmPack, props.close);
const execute = useDispatchAndClose(actions.performExecute, props.close);
const test = useDispatchAndClose(actions.performTest, props.close);
@@ -67,6 +69,10 @@ const BuildMenu: React.SFC = props => {
Build a WebAssembly module for web browsers, in the .WAT textual representation.
{!isWasmAvailable && }
+
+ Build a WebAssembly frontend for web browsers. Rendering in Iframe
+ {!isWasmPackAvailable && }
+
);
};
@@ -85,4 +91,10 @@ const WasmAside: React.SFC = () => (
);
+const WasmPackAside: React.SFC = () => (
+
+ Note: WASM PACK currently requires using the Nightly channel, selecting this
+ option will switch to Nightly.
+
+);
export default BuildMenu;
diff --git a/ui/frontend/Output.tsx b/ui/frontend/Output.tsx
index ae5535e2d..e6d0ea27c 100644
--- a/ui/frontend/Output.tsx
+++ b/ui/frontend/Output.tsx
@@ -46,7 +46,10 @@ interface PaneWithCodeProps extends SimplePaneProps {
const Output: React.SFC = () => {
const somethingToShow = useSelector(selectors.getSomethingToShow);
- const { meta: { focus }, execute, format, clippy, miri, macroExpansion, assembly, llvmIr, mir, hir, wasm, gist } =
+ const { meta: { focus },
+ execute, format, clippy, miri,
+ macroExpansion, assembly, llvmIr, mir,
+ hir, wasm, gist, wasmPack } =
useSelector((state: State) => state.output);
const dispatch = useDispatch();
@@ -62,6 +65,7 @@ const Output: React.SFC = () => {
const focusHir = useCallback(() => dispatch(actions.changeFocus(Focus.Hir)), [dispatch]);
const focusWasm = useCallback(() => dispatch(actions.changeFocus(Focus.Wasm)), [dispatch]);
const focusGist = useCallback(() => dispatch(actions.changeFocus(Focus.Gist)), [dispatch]);
+ const focusWasmPack = useCallback(() => dispatch(actions.changeFocus(Focus.WasmPack)), [dispatch]);
if (!somethingToShow) {
return null;
@@ -88,6 +92,7 @@ const Output: React.SFC = () => {
{focus === Focus.Hir && }
{focus === Focus.Wasm && }
{focus === Focus.Gist && }
+ {focus === Focus.WasmPack && }
);
}
@@ -139,6 +144,10 @@ const Output: React.SFC = () => {
label="Share"
onClick={focusGist}
tabProps={gist} />
+
{close}
{body}
diff --git a/ui/frontend/actions.ts b/ui/frontend/actions.ts
index 8b2e30d2d..af374ffb0 100644
--- a/ui/frontend/actions.ts
+++ b/ui/frontend/actions.ts
@@ -38,6 +38,7 @@ const routes = {
clippy: { pathname: '/clippy' },
miri: { pathname: '/miri' },
macroExpansion: { pathname: '/macro-expansion' },
+ wasmPack: { pathname: '/wasm-pack' },
meta: {
crates: { pathname: '/meta/crates' },
version: {
@@ -92,6 +93,9 @@ export enum ActionType {
CompileWasmRequest = 'COMPILE_WASM_REQUEST',
CompileWasmSucceeded = 'COMPILE_WASM_SUCCEEDED',
CompileWasmFailed = 'COMPILE_WASM_FAILED',
+ CompileWasmPackRequest = 'COMPILE_WASM_PACK_REQUEST',
+ CompileWasmPackSucceeded = 'COMPILE_WASM_PACK_SUCCEEDED',
+ CompileWasmPackFailed = 'COMPILE_WASM_PACK_FAILED',
EditCode = 'EDIT_CODE',
AddMainFunction = 'ADD_MAIN_FUNCTION',
AddImport = 'ADD_IMPORT',
@@ -260,7 +264,7 @@ const performCommonExecute = (crateType, tests): ThunkAction => (dispatch, getSt
};
function performAutoOnly(): ThunkAction {
- return function(dispatch, getState) {
+ return function (dispatch, getState) {
const state = getState();
const crateType = getCrateType(state);
const tests = runAsTest(state);
@@ -282,7 +286,7 @@ interface CompileRequestBody extends ExecuteRequestBody {
function performCompileShow(target, { request, success, failure }): ThunkAction {
// TODO: Check a cache
- return function(dispatch, getState) {
+ return function (dispatch, getState) {
dispatch(request());
const state = getState();
@@ -406,7 +410,45 @@ const performCompileToNightlyWasmOnly = (): ThunkAction => dispatch => {
dispatch(changeChannel(Channel.Nightly));
dispatch(performCompileToWasm());
};
+interface WasmPackRequestBody {
+ code: string;
+}
+
+function performCompileToWasmPack({ request, success, failure }): ThunkAction {
+ // TODO: Check a cache
+ return function (dispatch, getState) {
+ dispatch(request());
+ const state = getState();
+ const { code } = state;
+ const body: WasmPackRequestBody = {
+ code,
+ };
+ return jsonPost(routes.wasmPack, body)
+ .then(json => dispatch(success(json)))
+ .catch(json => dispatch(failure(json)));
+ };
+}
+
+const requestCompileWasmPack = () =>
+ createAction(ActionType.CompileWasmPackRequest);
+
+const receiveCompileWasmPackSuccess = ({ wasm_js, wasm_bg, stdout, stderr }) =>
+ createAction(ActionType.CompileWasmPackSucceeded, { wasm_js, wasm_bg, stdout, stderr });
+
+const receiveCompileWasmPackFailure = ({ error }) =>
+ createAction(ActionType.CompileWasmPackFailed, { error });
+
+const performCompileToNightlyWasmPackOnly = (): ThunkAction => dispatch => {
+ dispatch(changeChannel(Channel.Nightly));
+ dispatch(performCompileToWasmPack(
+ {
+ request: requestCompileWasmPack,
+ success: receiveCompileWasmPackSuccess,
+ failure: receiveCompileWasmPackFailure,
+ }
+ ));
+};
const PRIMARY_ACTIONS: { [index in PrimaryAction]: () => ThunkAction } = {
[PrimaryActionCore.Asm]: performCompileToAssemblyOnly,
[PrimaryActionCore.Compile]: performCompileOnly,
@@ -417,6 +459,7 @@ const PRIMARY_ACTIONS: { [index in PrimaryAction]: () => ThunkAction } = {
[PrimaryActionCore.Hir]: performCompileToHirOnly,
[PrimaryActionCore.Mir]: performCompileToMirOnly,
[PrimaryActionCore.Wasm]: performCompileToNightlyWasmOnly,
+ [PrimaryActionCore.WasmPack]: performCompileToNightlyWasmPackOnly,
};
export const performPrimaryAction = (): ThunkAction => (dispatch, getState) => {
@@ -446,6 +489,8 @@ export const performCompileToNightlyHir =
performAndSwitchPrimaryAction(performCompileToNightlyHirOnly, PrimaryActionCore.Hir);
export const performCompileToNightlyWasm =
performAndSwitchPrimaryAction(performCompileToNightlyWasmOnly, PrimaryActionCore.Wasm);
+export const performCompileToNightlyWasmPack =
+ performAndSwitchPrimaryAction(performCompileToNightlyWasmPackOnly, PrimaryActionCore.WasmPack);
export const editCode = (code: string) =>
createAction(ActionType.EditCode, { code });
@@ -488,7 +533,7 @@ const receiveFormatFailure = (body: FormatResponseBody) =>
export function performFormat(): ThunkAction {
// TODO: Check a cache
- return function(dispatch, getState) {
+ return function (dispatch, getState) {
dispatch(requestFormat());
const body: FormatRequestBody = formatRequestSelector(getState());
@@ -522,7 +567,7 @@ const receiveClippyFailure = ({ error }) =>
export function performClippy(): ThunkAction {
// TODO: Check a cache
- return function(dispatch, getState) {
+ return function (dispatch, getState) {
dispatch(requestClippy());
const body: ClippyRequestBody = clippyRequestSelector(getState());
@@ -549,7 +594,7 @@ const receiveMiriFailure = ({ error }) =>
export function performMiri(): ThunkAction {
// TODO: Check a cache
- return function(dispatch, getState) {
+ return function (dispatch, getState) {
dispatch(requestMiri());
const { code, configuration: {
@@ -579,7 +624,7 @@ const receiveMacroExpansionFailure = ({ error }) =>
export function performMacroExpansion(): ThunkAction {
// TODO: Check a cache
- return function(dispatch, getState) {
+ return function (dispatch, getState) {
dispatch(requestMacroExpansion());
const { code, configuration: {
@@ -617,7 +662,7 @@ type PerformGistLoadProps =
Pick>;
export function performGistLoad({ id, channel, mode, edition }: PerformGistLoadProps): ThunkAction {
- return function(dispatch, _getState) {
+ return function (dispatch, _getState) {
dispatch(requestGistLoad());
const u = url.resolve(routes.meta.gist.pathname, id);
jsonGet(u)
@@ -636,7 +681,7 @@ const receiveGistSaveFailure = ({ error }) => // eslint-disable-line no-unused-v
createAction(ActionType.GistSaveFailed, { error });
export function performGistSave(): ThunkAction {
- return function(dispatch, getState) {
+ return function (dispatch, getState) {
dispatch(requestGistSave());
const { code, configuration: { channel, mode, edition }, output: { execute: { stdout, stderr } } } = getState();
@@ -654,7 +699,7 @@ const receiveCratesLoadSuccess = ({ crates }) =>
createAction(ActionType.CratesLoadSucceeded, { crates });
export function performCratesLoad(): ThunkAction {
- return function(dispatch) {
+ return function (dispatch) {
dispatch(requestCratesLoad());
return jsonGet(routes.meta.crates)
@@ -670,7 +715,7 @@ const receiveVersionsLoadSuccess = ({ stable, beta, nightly, rustfmt, clippy, mi
createAction(ActionType.VersionsLoadSucceeded, { stable, beta, nightly, rustfmt, clippy, miri });
export function performVersionsLoad(): ThunkAction {
- return function(dispatch) {
+ return function (dispatch) {
dispatch(requestVersionsLoad());
const stable = jsonGet(routes.meta.version.stable);
@@ -742,7 +787,7 @@ export function indexPageLoad({
mode: modeString = 'debug',
edition: editionString,
}): ThunkAction {
- return function(dispatch) {
+ return function (dispatch) {
const channel = parseChannel(version);
const mode = parseMode(modeString);
let edition = parseEdition(editionString);
@@ -783,7 +828,7 @@ export function helpPageLoad() {
}
export function showExample(code): ThunkAction {
- return function(dispatch) {
+ return function (dispatch) {
dispatch(navigateToIndex());
dispatch(editCode(code));
};
@@ -823,6 +868,9 @@ export type Action =
| ReturnType
| ReturnType
| ReturnType
+ | ReturnType
+ | ReturnType
+ | ReturnType
| ReturnType
| ReturnType
| ReturnType
diff --git a/ui/frontend/reducers/output/index.ts b/ui/frontend/reducers/output/index.ts
index 8942a967a..61ff8d4a7 100644
--- a/ui/frontend/reducers/output/index.ts
+++ b/ui/frontend/reducers/output/index.ts
@@ -12,6 +12,7 @@ import meta from './meta';
import mir from './mir';
import miri from './miri';
import wasm from './wasm';
+import wasmPack from './wasmPack';
const output = combineReducers({
meta,
@@ -26,6 +27,7 @@ const output = combineReducers({
wasm,
execute,
gist,
+ wasmPack,
});
export type State = ReturnType;
diff --git a/ui/frontend/reducers/output/wasmPack.ts b/ui/frontend/reducers/output/wasmPack.ts
new file mode 100644
index 000000000..58cb1db5b
--- /dev/null
+++ b/ui/frontend/reducers/output/wasmPack.ts
@@ -0,0 +1,35 @@
+import { Action, ActionType } from '../../actions';
+import { finish, start } from './sharedStateManagement';
+
+const DEFAULT: State = {
+ requestsInProgress: 0,
+ stdout: null,
+ stderr: null,
+ error: null,
+ wasm_js: null,
+ wasm_bg: null,
+};
+
+interface State {
+ requestsInProgress: number;
+ stdout?: string;
+ stderr?: string;
+ error?: string;
+ wasm_js?: string;
+ wasm_bg?: string;
+}
+
+export default function wasmPack(state = DEFAULT, action: Action) {
+ switch (action.type) {
+ case ActionType.CompileWasmPackRequest:
+ return start(DEFAULT, state);
+ case ActionType.CompileWasmPackSucceeded: {
+ const { stdout = '', stderr = '', wasm_js = '', wasm_bg = '' } = action;
+ return finish(state, { stdout, stderr, wasm_js, wasm_bg });
+ }
+ case ActionType.CompileWasmPackFailed:
+ return finish(state, { error: action.error });
+ default:
+ return state;
+ }
+}
diff --git a/ui/frontend/selectors/index.ts b/ui/frontend/selectors/index.ts
index 90e3e52ef..507613eef 100644
--- a/ui/frontend/selectors/index.ts
+++ b/ui/frontend/selectors/index.ts
@@ -75,6 +75,7 @@ const LABELS: { [index in PrimaryActionCore]: string } = {
[PrimaryActionCore.Mir]: 'Show MIR',
[PrimaryActionCore.Test]: 'Test',
[PrimaryActionCore.Wasm]: 'Show WASM',
+ [PrimaryActionCore.WasmPack]: 'Show WASM PACK',
};
export const getExecutionLabel = createSelector(primaryActionSelector, primaryAction => LABELS[primaryAction]);
@@ -108,6 +109,7 @@ export const isNightlyChannel = (state: State) => (
);
export const isWasmAvailable = isNightlyChannel;
export const isHirAvailable = isNightlyChannel;
+export const isWasmPackAvailable = isNightlyChannel;
export const getModeLabel = (state: State) => {
const { configuration: { mode } } = state;
diff --git a/ui/frontend/types.ts b/ui/frontend/types.ts
index a21518986..ac94847c5 100644
--- a/ui/frontend/types.ts
+++ b/ui/frontend/types.ts
@@ -78,6 +78,7 @@ export enum PrimaryActionCore {
Mir = 'mir',
Test = 'test',
Wasm = 'wasm',
+ WasmPack = 'wasm-pack',
}
export type PrimaryAction = PrimaryActionCore | PrimaryActionAuto;
@@ -115,6 +116,7 @@ export enum Focus {
Execute = 'execute',
Format = 'format',
Gist = 'gist',
+ WasmPack = 'wasm-pack',
}
export enum Notification {
From e9b303030577b2e9d3e680669cadc1a0aea70cc4 Mon Sep 17 00:00:00 2001
From: titaneric
Date: Wed, 14 Apr 2021 01:27:27 +0800
Subject: [PATCH 09/14] Create frontend to render wasmPack result
---
ui/frontend/Output.tsx | 3 ++-
ui/frontend/Output/IFrame.tsx | 26 ++++++++++++++++++++++++++
ui/frontend/reducers/output/meta.ts | 3 +++
ui/frontend/selectors/index.ts | 1 +
4 files changed, 32 insertions(+), 1 deletion(-)
create mode 100644 ui/frontend/Output/IFrame.tsx
diff --git a/ui/frontend/Output.tsx b/ui/frontend/Output.tsx
index e6d0ea27c..e78ced992 100644
--- a/ui/frontend/Output.tsx
+++ b/ui/frontend/Output.tsx
@@ -10,6 +10,7 @@ import Gist from './Output/Gist';
import Section from './Output/Section';
import SimplePane, { SimplePaneProps } from './Output/SimplePane';
import PaneWithMir from './Output/PaneWithMir';
+import Iframe from './Output/IFrame';
import * as selectors from './selectors';
const Tab: React.SFC = ({ kind, focus, label, onClick, tabProps }) => {
@@ -92,7 +93,7 @@ const Output: React.SFC = () => {
{focus === Focus.Hir && }
{focus === Focus.Wasm && }
{focus === Focus.Gist && }
- {focus === Focus.WasmPack && }
+ {focus === Focus.WasmPack && }
);
}
diff --git a/ui/frontend/Output/IFrame.tsx b/ui/frontend/Output/IFrame.tsx
new file mode 100644
index 000000000..b686d97f6
--- /dev/null
+++ b/ui/frontend/Output/IFrame.tsx
@@ -0,0 +1,26 @@
+import React from 'react';
+import { PrismCode } from 'react-prism';
+
+import Header from './Header';
+import SimplePane, { SimplePaneProps } from './SimplePane';
+
+interface PaneWithWasmPackProps extends SimplePaneProps {
+ wasm_js?: string;
+ wasm_bg?: string;
+}
+
+const Iframe: React.SFC = ({wasm_js, wasm_bg , ...rest }) => (
+
+
+
+
+
+ {wasm_js}
+ {wasm_bg}
+
+
+
+
+);
+
+export default Iframe;
diff --git a/ui/frontend/reducers/output/meta.ts b/ui/frontend/reducers/output/meta.ts
index 37689c903..f0423871b 100644
--- a/ui/frontend/reducers/output/meta.ts
+++ b/ui/frontend/reducers/output/meta.ts
@@ -35,6 +35,9 @@ export default function meta(state = DEFAULT, action: Action) {
case ActionType.CompileWasmRequest:
return { ...state, focus: Focus.Wasm };
+ case ActionType.CompileWasmPackRequest:
+ return { ...state, focus: Focus.WasmPack };
+
case ActionType.CompileAssemblyRequest:
return { ...state, focus: Focus.Asm };
diff --git a/ui/frontend/selectors/index.ts b/ui/frontend/selectors/index.ts
index 507613eef..370748896 100644
--- a/ui/frontend/selectors/index.ts
+++ b/ui/frontend/selectors/index.ts
@@ -151,6 +151,7 @@ const getOutputs = (state: State) => [
state.output.miri,
state.output.macroExpansion,
state.output.wasm,
+ state.output.wasmPack,
];
export const getSomethingToShow = createSelector(
From 2619a6f70a5c9ba90e84bb6af2f0986e40b3d2b8 Mon Sep 17 00:00:00 2001
From: titaneric
Date: Wed, 14 Apr 2021 18:48:17 +0800
Subject: [PATCH 10/14] Create IFrame component to render wasm result
---
ui/frontend/Output/Container.tsx | 32 ++++++++++++++++++
ui/frontend/Output/IFrame.tsx | 43 ++++++++++++++++++++-----
ui/frontend/Output/PaneWithWasmPack.tsx | 26 +++++++++++++++
ui/frontend/index.scss | 8 +++++
4 files changed, 101 insertions(+), 8 deletions(-)
create mode 100644 ui/frontend/Output/Container.tsx
create mode 100644 ui/frontend/Output/PaneWithWasmPack.tsx
diff --git a/ui/frontend/Output/Container.tsx b/ui/frontend/Output/Container.tsx
new file mode 100644
index 000000000..708841c98
--- /dev/null
+++ b/ui/frontend/Output/Container.tsx
@@ -0,0 +1,32 @@
+import React, { useState, useEffect } from 'react'
+import { createPortal } from 'react-dom'
+
+export const FunctionalIFrameComponent = ({
+ children,
+ url,
+ ...props
+}) => {
+ const [contentRef, setContentRef] = useState(null)
+ const mountNode =
+ contentRef?.contentWindow?.document?.body
+
+ useEffect(() => {
+ const script = document.createElement('script');
+
+ script.src = url;
+ script.type = 'module';
+ script.async = true;
+
+ mountNode && mountNode.appendChild(script);
+
+ return () => {
+
+ };
+ }, [contentRef, mountNode, url]);
+
+ return (
+
+ )
+}
diff --git a/ui/frontend/Output/IFrame.tsx b/ui/frontend/Output/IFrame.tsx
index b686d97f6..255fa3547 100644
--- a/ui/frontend/Output/IFrame.tsx
+++ b/ui/frontend/Output/IFrame.tsx
@@ -1,24 +1,51 @@
import React from 'react';
-import { PrismCode } from 'react-prism';
import Header from './Header';
import SimplePane, { SimplePaneProps } from './SimplePane';
+import { FunctionalIFrameComponent } from './Container';
interface PaneWithWasmPackProps extends SimplePaneProps {
wasm_js?: string;
wasm_bg?: string;
}
-const Iframe: React.SFC = ({wasm_js, wasm_bg , ...rest }) => (
+function base64ToByteArray(src) {
+ const decode = atob(src);
+ const byteNumbers = new Array(decode.length);
+ for (let i = 0; i < decode.length; i++) {
+ byteNumbers[i] = decode.charCodeAt(i);
+ }
+ return new Uint8Array(byteNumbers);
+}
+
+function createObjectURL(src: ArrayBuffer | string, mime: string) {
+ return URL.createObjectURL(new Blob([src], { type: mime }));
+}
+
+function createEntryJS(wasm_js, wasm_bg) {
+ // window.console.log(`${error}, ${wasm_js}`)
+ // if (error) {
+ // return null;
+ // }
+ const wasmJS = atob(wasm_js);
+ const bgWasm = base64ToByteArray(wasm_bg);
+ const wasmJSBlob = createObjectURL(wasmJS, 'application/javascript');
+ const bgWasmBlob = createObjectURL(bgWasm, 'application/wasm');
+
+ const entryJS = `
+ import init from '${wasmJSBlob}';
+ await init('${bgWasmBlob}');
+ `;
+
+ return createObjectURL(entryJS, 'application/javascript');
+}
+
+const Iframe: React.SFC = ({ wasm_js, wasm_bg, ...rest }) => (
-
-
- {wasm_js}
- {wasm_bg}
-
-
+
+
);
diff --git a/ui/frontend/Output/PaneWithWasmPack.tsx b/ui/frontend/Output/PaneWithWasmPack.tsx
new file mode 100644
index 000000000..7f5f67601
--- /dev/null
+++ b/ui/frontend/Output/PaneWithWasmPack.tsx
@@ -0,0 +1,26 @@
+import React from 'react';
+import { PrismCode } from 'react-prism';
+
+import Header from './Header';
+import SimplePane, { SimplePaneProps } from './SimplePane';
+
+interface PaneWithWasmPackProps extends SimplePaneProps {
+ wasm_js?: string;
+ wasm_bg?: string;
+}
+
+const PaneWithWasmPack: React.SFC = ({wasm_js, wasm_bg, error , ...rest }) => (
+
+
+
+
+
+ {wasm_js}
+ {wasm_bg}
+
+
+
+
+);
+
+export default PaneWithWasmPack;
diff --git a/ui/frontend/index.scss b/ui/frontend/index.scss
index e06a60f24..6e11bdecc 100644
--- a/ui/frontend/index.scss
+++ b/ui/frontend/index.scss
@@ -894,3 +894,11 @@ $header-transition: 0.2s ease-in-out;
cursor: pointer;
}
}
+
+.container {
+ height: 100%;
+ width: 100%;
+ margin: 0;
+ border: 0;
+ padding: 0;
+}
\ No newline at end of file
From 379c5972dc0643086bf7c4bdc0abfa10812e9741 Mon Sep 17 00:00:00 2001
From: titaneric
Date: Wed, 14 Apr 2021 20:23:33 +0800
Subject: [PATCH 11/14] Reset innerHTML of iframe
---
ui/frontend/Output/Container.tsx | 8 +++++---
ui/frontend/index.scss | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/ui/frontend/Output/Container.tsx b/ui/frontend/Output/Container.tsx
index 708841c98..e90c3f6da 100644
--- a/ui/frontend/Output/Container.tsx
+++ b/ui/frontend/Output/Container.tsx
@@ -20,12 +20,14 @@ export const FunctionalIFrameComponent = ({
mountNode && mountNode.appendChild(script);
return () => {
-
+ if (mountNode) {
+ mountNode.innerHTML = ''
+ }
};
- }, [contentRef, mountNode, url]);
+ }, [mountNode, url]);
return (
-