Bring in web component library

This commit is contained in:
Jeremy Wall 2023-11-25 09:37:29 -05:00
parent 39456bb35d
commit 50eecf9a7c
3 changed files with 159 additions and 11 deletions

160
Cargo.lock generated
View File

@ -568,7 +568,7 @@ dependencies = [
"atty", "atty",
"bitflags", "bitflags",
"clap_lex", "clap_lex",
"indexmap", "indexmap 1.9.2",
"once_cell", "once_cell",
"strsim", "strsim",
"termcolor", "termcolor",
@ -832,6 +832,12 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "equivalent"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]] [[package]]
name = "errno" name = "errno"
version = "0.2.8" version = "0.2.8"
@ -1105,7 +1111,7 @@ dependencies = [
"futures-sink", "futures-sink",
"futures-util", "futures-util",
"http", "http",
"indexmap", "indexmap 1.9.2",
"slab", "slab",
"tokio", "tokio",
"tokio-util", "tokio-util",
@ -1127,13 +1133,19 @@ dependencies = [
"ahash", "ahash",
] ]
[[package]]
name = "hashbrown"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156"
[[package]] [[package]]
name = "hashlink" name = "hashlink"
version = "0.8.1" version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa"
dependencies = [ dependencies = [
"hashbrown", "hashbrown 0.12.3",
] ]
[[package]] [[package]]
@ -1324,7 +1336,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"hashbrown", "hashbrown 0.12.3",
]
[[package]]
name = "indexmap"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
dependencies = [
"equivalent",
"hashbrown 0.14.2",
] ]
[[package]] [[package]]
@ -1427,6 +1449,7 @@ dependencies = [
"chrono", "chrono",
"console_error_panic_hook", "console_error_panic_hook",
"js-sys", "js-sys",
"maud",
"recipes", "recipes",
"reqwasm", "reqwasm",
"serde", "serde",
@ -1438,6 +1461,7 @@ dependencies = [
"tracing-subscriber", "tracing-subscriber",
"tracing-web", "tracing-web",
"wasm-bindgen", "wasm-bindgen",
"wasm-web-component",
"web-sys", "web-sys",
] ]
@ -1559,6 +1583,28 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb"
[[package]]
name = "maud"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0bab19cef8a7fe1c18a43e881793bfc9d4ea984befec3ae5bd0415abf3ecf00"
dependencies = [
"itoa 1.0.5",
"maud_macros",
]
[[package]]
name = "maud_macros"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0be95d66c3024ffce639216058e5bae17a83ecaf266ffc6e4d060ad447c9eed2"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.5.0" version = "2.5.0"
@ -1592,7 +1638,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8603921e1f54ef386189335f288441af761e0fc61bcb552168d9cedfe63ebc70" checksum = "8603921e1f54ef386189335f288441af761e0fc61bcb552168d9cedfe63ebc70"
dependencies = [ dependencies = [
"hyper", "hyper",
"indexmap", "indexmap 1.9.2",
"ipnet", "ipnet",
"metrics", "metrics",
"metrics-util", "metrics-util",
@ -1638,7 +1684,7 @@ checksum = "f7d24dc2dbae22bff6f1f9326ffce828c9f07ef9cc1e8002e5279f845432a30a"
dependencies = [ dependencies = [
"crossbeam-epoch", "crossbeam-epoch",
"crossbeam-utils", "crossbeam-utils",
"hashbrown", "hashbrown 0.12.3",
"metrics", "metrics",
"num_cpus", "num_cpus",
"parking_lot 0.12.1", "parking_lot 0.12.1",
@ -1924,6 +1970,40 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "proc-macro-crate"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919"
dependencies = [
"once_cell",
"toml_edit",
]
[[package]]
name = "proc-macro-error"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
"version_check",
]
[[package]]
name = "proc-macro-error-attr"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2",
"quote",
"version_check",
]
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.49" version = "1.0.49"
@ -2406,7 +2486,7 @@ dependencies = [
"futures-util", "futures-util",
"hashlink", "hashlink",
"hex", "hex",
"indexmap", "indexmap 1.9.2",
"itoa 1.0.5", "itoa 1.0.5",
"libc", "libc",
"libsqlite3-sys", "libsqlite3-sys",
@ -2458,6 +2538,16 @@ dependencies = [
"futures-rustls", "futures-rustls",
] ]
[[package]]
name = "str_inflector"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0b848d5a7695b33ad1be00f84a3c079fe85c9278a325ff9159e6c99cef4ef7"
dependencies = [
"lazy_static",
"regex",
]
[[package]] [[package]]
name = "stringprep" name = "stringprep"
version = "0.1.2" version = "0.1.2"
@ -2487,7 +2577,7 @@ source = "git+https://github.com/sycamore-rs/sycamore/?rev=5d49777b4a66fb5730c40
dependencies = [ dependencies = [
"ahash", "ahash",
"futures", "futures",
"indexmap", "indexmap 1.9.2",
"js-sys", "js-sys",
"paste", "paste",
"sycamore-core", "sycamore-core",
@ -2538,7 +2628,7 @@ source = "git+https://github.com/sycamore-rs/sycamore/?rev=5d49777b4a66fb5730c40
dependencies = [ dependencies = [
"ahash", "ahash",
"bumpalo", "bumpalo",
"indexmap", "indexmap 1.9.2",
"serde", "serde",
"slotmap", "slotmap",
"smallvec", "smallvec",
@ -2584,7 +2674,7 @@ version = "0.8.2"
source = "git+https://github.com/sycamore-rs/sycamore/?rev=5d49777b4a66fb5730c40898fd2ee8cde15bcdc3#5d49777b4a66fb5730c40898fd2ee8cde15bcdc3" source = "git+https://github.com/sycamore-rs/sycamore/?rev=5d49777b4a66fb5730c40898fd2ee8cde15bcdc3#5d49777b4a66fb5730c40898fd2ee8cde15bcdc3"
dependencies = [ dependencies = [
"html-escape", "html-escape",
"indexmap", "indexmap 1.9.2",
"js-sys", "js-sys",
"once_cell", "once_cell",
"sycamore-core", "sycamore-core",
@ -2761,6 +2851,23 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "toml_datetime"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1"
[[package]]
name = "toml_edit"
version = "0.19.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
"indexmap 2.1.0",
"toml_datetime",
"winnow",
]
[[package]] [[package]]
name = "tower" name = "tower"
version = "0.4.13" version = "0.4.13"
@ -3141,6 +3248,30 @@ dependencies = [
"quote", "quote",
] ]
[[package]]
name = "wasm-web-component"
version = "0.2.0"
source = "git+https://github.com/zaphar/wasm-web-components.git?rev=v0.3.0#e3ba5170c0907da0c32af27447f1cd26fc6b6434"
dependencies = [
"js-sys",
"wasm-bindgen",
"wasm-bindgen-test",
"wasm-web-component-macros",
"web-sys",
]
[[package]]
name = "wasm-web-component-macros"
version = "0.2.0"
source = "git+https://github.com/zaphar/wasm-web-components.git?rev=v0.3.0#e3ba5170c0907da0c32af27447f1cd26fc6b6434"
dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
"str_inflector",
"syn",
]
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.60" version = "0.3.60"
@ -3300,6 +3431,15 @@ version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "winnow"
version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "zeroize" name = "zeroize"
version = "1.5.7" version = "1.5.7"

View File

@ -14,6 +14,7 @@ let
cargoDeps = (pkgs.rustPlatform.importCargoLock { inherit lockFile; outputHashes = { cargoDeps = (pkgs.rustPlatform.importCargoLock { inherit lockFile; outputHashes = {
# I'm maintaining some patches for these so the lockfile hashes are a little # I'm maintaining some patches for these so the lockfile hashes are a little
# incorrect. We override those here. # incorrect. We override those here.
"wasm-web-component-0.2.0" = "sha256-quuPgzGb2F96blHmD3BAUjsWQYbSyJGZl27PVrwL92k=";
"sycamore-0.8.2" = "sha256-D968+8C5EelGGmot9/LkAlULZOf/Cr+1WYXRCMwb1nQ="; "sycamore-0.8.2" = "sha256-D968+8C5EelGGmot9/LkAlULZOf/Cr+1WYXRCMwb1nQ=";
"sqlx-0.6.2" = "sha256-X/LFvtzRfiOIEZJiVzmFvvULPpjhqvI99pSwH7a//GM="; "sqlx-0.6.2" = "sha256-X/LFvtzRfiOIEZJiVzmFvvULPpjhqvI99pSwH7a//GM=";
}; };
@ -41,4 +42,4 @@ stdenv.mkDerivation {
cp -r index.html $out cp -r index.html $out
cp -r favicon.ico $out cp -r favicon.ico $out
''; '';
} }

View File

@ -25,6 +25,8 @@ async-trait = "0.1.57"
base64 = "0.21.0" base64 = "0.21.0"
sycamore-router = "0.8" sycamore-router = "0.8"
js-sys = "0.3.60" js-sys = "0.3.60"
wasm-web-component = { git = "https://github.com/zaphar/wasm-web-components.git", rev = "v0.3.0" }
maud = "*"
[dependencies.serde] [dependencies.serde]
version = "<=1.0.171" version = "<=1.0.171"
@ -52,9 +54,14 @@ version = "= 0.2.84"
version = "0.3" version = "0.3"
features = [ features = [
"Event", "Event",
"CustomEvent",
"EventTarget", "EventTarget",
"History", "History",
"HtmlAnchorElement", "HtmlAnchorElement",
"HtmlDivElement",
"HtmlSpanElement",
"HtmlInputElement",
"HtmlTextAreaElement",
"HtmlBaseElement", "HtmlBaseElement",
"HtmlDialogElement", "HtmlDialogElement",
"KeyboardEvent", "KeyboardEvent",