diff --git a/.gitignore b/.gitignore index a6a6eb96f..dbc070797 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ target/ **/*.rs.bk *.lock +.direnv diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..428940564 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3300 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + +[[package]] +name = "arc-reactor" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 1.0.0", + "log", + "sauron", +] + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bstr" +version = "1.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +dependencies = [ + "memchr", + "regex-automata", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "4.5.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +dependencies = [ + "anstyle", + "clap_lex", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen", +] + +[[package]] +name = "console_log" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "console_log" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8aed40e4edbf4d3b4431ab260b63fdc40f5780a4766824329ea0f1eefe3c0f" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "counter" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", +] + +[[package]] +name = "counter-skip_diff" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "criterion" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +dependencies = [ + "anes", + "cast", + "ciborium", + "clap", + "criterion-plot", + "is-terminal", + "itertools", + "num-traits", + "once_cell", + "oorandom", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csr-tailwind-trunk" +version = "0.0.0" +dependencies = [ + "console_error_panic_hook", + "console_log 1.0.0", + "log", + "sauron", +] + +[[package]] +name = "css-color" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a254bc4cf4e80026fd4c6e2dc5e8ec7ab077f4970229507548a441265eaca282" +dependencies = [ + "lazy_static", + "lexical", +] + +[[package]] +name = "css-colors" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22c2bbfc5708f23437b074ba4e699b14fd6d7181a61695bccc8d944b78739236" + +[[package]] +name = "csv" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdc4883a9c96732e4733212c01447ebd805833b7275a73ca3ee080fd77afdaf" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" +dependencies = [ + "memchr", +] + +[[package]] +name = "data-encoding" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" + +[[package]] +name = "data-viewer" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "js-sys", + "log", + "restq", + "sauron", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "delay" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "futures", + "log", + "sauron", + "wasm-bindgen-futures", +] + +[[package]] +name = "derive-where" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "experimentals" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "js-sys", + "log", + "sauron", +] + +[[package]] +name = "fancy-ui" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "css-color", + "css-colors", + "log", + "sauron", + "wasm-bindgen-futures", + "wasm-bindgen-test", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fetch-data" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", + "serde", + "serde_json", + "wasm-bindgen-futures", +] + +[[package]] +name = "fetch-data-component" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", + "serde", + "serde_json", + "wasm-bindgen-futures", +] + +[[package]] +name = "fetch-data-macro-syntax" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "reqwest", + "sauron", + "serde", + "serde_json", + "wasm-bindgen-futures", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.2.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if 1.0.0", + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64 0.21.7", + "bytes", + "headers-core", + "http 0.2.12", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http 0.2.12", +] + +[[package]] +name = "hello" +version = "0.1.0" +dependencies = [ + "console_log 1.0.0", + "log", + "sauron", +] + +[[package]] +name = "hermit-abi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" + +[[package]] +name = "html-escape" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1ad449764d627e22bfd7cd5e8868264fc9236e07c752972b4080cd351cb476" +dependencies = [ + "utf8-width", +] + +[[package]] +name = "html5ever" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b7410cae13cbc75623c98ac4cbfd1f0bedddf3227afc24f370cf0f50a44a11c" +dependencies = [ + "log", + "mac", + "markup5ever", + "match_token", +] + +[[package]] +name = "htmlentity" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd54ae4f69adcc1a43637dcff230852832c3ad50df31a90e0cb5f001dd441359" +dependencies = [ + "anyhow", + "lazy_static", + "thiserror", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.2.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.8", + "http 1.2.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http 1.2.0", + "hyper 1.6.0", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "hyper 1.6.0", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "interactive" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "futures", + "js-sys", + "log", + "sauron", +] + +[[package]] +name = "interactive-macro-syntax" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "js-sys", + "log", + "sauron", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-framework-benchmark-sauron" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "getrandom 0.2.15", + "log", + "rand", + "sauron", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lexical" +version = "2.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9d189f82a78aa5c06e64f60cbd6f9ec37fe1cdb453dfd88ac2128c81157dc6c" +dependencies = [ + "cfg-if 0.1.10", + "lexical-core", + "rustc_version", +] + +[[package]] +name = "lexical-core" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34449d00c5d4066537f4dc72320b18e3aa421e8e92669250eecd664c618fefce" +dependencies = [ + "arrayvec", + "cfg-if 0.1.10", + "rustc_version", + "ryu", + "static_assertions", +] + +[[package]] +name = "libc" +version = "0.2.170" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" + +[[package]] +name = "linux-raw-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "longest-increasing-subsequence" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "markup5ever" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a7213d12e1864c0f002f52c2923d4556935a43dec5e71355c2760e0f6e7a18" +dependencies = [ + "log", + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "markup5ever_rcdom" +version = "0.5.0-unofficial" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9cb12459c4cab18dcc580159590f404ad78c0a9c5435ace80288ed43abdce31" +dependencies = [ + "html5ever", + "markup5ever", + "tendril", + "xml5ever", +] + +[[package]] +name = "match_token" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minicov" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" +dependencies = [ + "cc", + "walkdir", +] + +[[package]] +name = "minimal" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", +] + +[[package]] +name = "minimal-macro-syntax" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "more_fragments" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "futures", + "log", + "sauron", +] + +[[package]] +name = "multer" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http 0.2.12", + "httparse", + "log", + "memchr", + "mime", + "spin", + "version_check", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "now-you-see-me" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" + +[[package]] +name = "openssl" +version = "0.10.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "patch_dom_node" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 1.0.0", + "log", + "sauron-core", + "sauron-html-parser", + "web-sys", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "pom" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c972d8f86e943ad532d0b04e8965a749ad1d18bb981a9c7b3ae72fe7fd7744b" +dependencies = [ + "bstr", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[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", + "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]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proc-macro2-diagnostics" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "version_check", + "yansi", +] + +[[package]] +name = "quote" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.4.8", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.6.0", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "resize" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", +] + +[[package]] +name = "restq" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76dd872441ac3496066afbc1ad47e513acefa44202fbc3fa3abfe4cad9fe42c5" +dependencies = [ + "base64 0.22.1", + "chrono", + "csv", + "either", + "log", + "pom", + "serde", + "sqlparser", + "thiserror", + "uuid", +] + +[[package]] +name = "ring" +version = "0.17.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.15", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rphtml" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51594c0db5855eee2d5ffe39cdea7921c72065bd662759e53b9e1df3a3e758af" +dependencies = [ + "htmlentity", + "lazy_static", + "thiserror", +] + +[[package]] +name = "rstml" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe542870b8f59dd45ad11d382e5339c9a1047cde059be136a7016095bbdefa77" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", + "syn_derive", + "thiserror", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dade4812df5c384711475be5fcd8c162555352945401aed22a35bffeab61f657" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sauron" +version = "0.61.9" +dependencies = [ + "console_error_panic_hook", + "console_log 1.0.0", + "criterion", + "doc-comment", + "log", + "regex", + "sauron", + "sauron-core", + "sauron-html-parser", + "sauron-macro", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "web-sys", +] + +[[package]] +name = "sauron-core" +version = "0.61.9" +dependencies = [ + "cfg-if 1.0.0", + "console_error_panic_hook", + "console_log 1.0.0", + "derive-where", + "doc-comment", + "futures", + "indexmap", + "js-sys", + "log", + "longest-increasing-subsequence", + "once_cell", + "phf", + "sauron", + "serde-wasm-bindgen", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "web-sys", +] + +[[package]] +name = "sauron-html-parser" +version = "0.61.9" +dependencies = [ + "html-escape", + "html5ever", + "log", + "markup5ever", + "markup5ever_rcdom", + "rphtml", + "sauron-core", + "thiserror", + "xml5ever", +] + +[[package]] +name = "sauron-macro" +version = "0.61.9" +dependencies = [ + "once_cell", + "phf", + "proc-macro2", + "quote", + "rstml", + "sauron", + "sauron-core", + "syn", +] + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "serde" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "sqlparser" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaf9c7ff146298ffda83a200f8d5084f08dcee1edfc135fcc1d646a45d50ffd6" +dependencies = [ + "log", +] + +[[package]] +name = "ssr-forms" +version = "0.1.0" +dependencies = [ + "chrono", + "sauron", + "serde", + "serde_derive", + "tokio", + "warp", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" + +[[package]] +name = "string_cache" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938d512196766101d333398efde81bc1f37b00cb42c2f8350e5df639f040bbbe" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "svg-clock" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "js-sys", + "log", + "sauron", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "svg-clock-macro-syntax" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "js-sys", + "log", + "sauron", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "svg-graph" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", + "wasm-bindgen", +] + +[[package]] +name = "syn" +version = "2.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "getrandom 0.3.1", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "todomvc" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", + "serde", + "serde_derive", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "todomvc-macro-syntax" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", + "serde", + "serde_derive", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "tokio" +version = "1.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "log", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.2.0", + "httparse", + "log", + "rand", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" +dependencies = [ + "getrandom 0.3.1", + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "warp" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "headers", + "http 0.2.12", + "hyper 0.14.32", + "log", + "mime", + "mime_guess", + "multer", + "percent-encoding", + "pin-project", + "scoped-tls", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-tungstenite", + "tokio-util", + "tower-service", + "tracing", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66c8d5e33ca3b6d9fa3b4676d774c5778031d27a578c2b007f905acf816152c3" +dependencies = [ + "js-sys", + "minicov", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17d5042cc5fa009658f9a7333ef24291b1291a25b6382dd68862a7f3b969f69b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "window-tab-rows" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "console_log 0.2.2", + "log", + "sauron", + "wasm-bindgen", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "xml5ever" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2278b4bf33071ba8e30368a59436c65eec8e01c49d5c29b3dfeb0cdc45331383" +dependencies = [ + "log", + "mac", + "markup5ever", +] + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index cac380bcc..b35022391 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,8 @@ features = [ "InputEvent", "console", "Performance", + "Element", + "Window", ] diff --git a/README.md b/README.md index 461cdac1e..a3edc8aef 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Sauron is inspired by elm-lang and is following The Elm Architecture. - html syntax for writing views - elegant macro to write styles - batteries included +- standalone DOM/VirtualDOM patcher, see examples/patch_dom_node ### Devoid of unnecessary framework complexities - **no** framework specific cli needed diff --git a/crates/core/src/dom.rs b/crates/core/src/dom.rs index 882a420cc..2201a67e9 100644 --- a/crates/core/src/dom.rs +++ b/crates/core/src/dom.rs @@ -12,11 +12,32 @@ mod effects; use cfg_if::cfg_if; cfg_if! {if #[cfg(feature = "with-dom")] { + mod application; + mod dom_node; + mod dom_patch; + mod dom_attr; + mod http; + mod program; + mod raf; + mod ric; + mod window; + mod document; + mod time; + mod timeout; + + pub mod events; + pub mod dispatch; + pub mod util; + pub use application::{Application, Measurements, SkipDiff, skip_if, skip_diff, SkipPath}; pub use component::{stateful_component, StatefulComponent, StatefulModel, StatelessModel}; pub use component::component; - pub use dom_patch::{DomPatch, PatchVariant}; + pub use dispatch::Dispatch; + pub use document::Document; + pub use dom_patch::{DomPatch, PatchVariant, apply_dom_patches, convert_patches}; pub use dom_attr::{DomAttr, DomAttrValue, GroupedDomAttrValues}; + pub use dom_node::DomNode; + pub use dom_node::create_dom_node; pub use http::Http; pub use program::{MountAction, MountTarget, Program, MountProcedure}; pub use util::{ @@ -26,29 +47,10 @@ cfg_if! {if #[cfg(feature = "with-dom")] { pub use raf::{request_animation_frame, AnimationFrameHandle}; pub use ric::{request_idle_callback, IdleCallbackHandle, IdleDeadline}; pub use timeout::{delay, request_timeout_callback, TimeoutCallbackHandle}; - pub use dispatch::Dispatch; - use crate::dom::events::MountEvent; pub use window::Window; - pub use dom_node::DomNode; - pub use document::Document; pub use time::Time; - mod application; - pub mod dispatch; - mod dom_node; - mod dom_patch; - mod dom_attr; - pub mod events; - mod http; - mod program; - pub mod util; - mod raf; - mod ric; - mod window; - mod document; - mod time; - mod timeout; - + use crate::dom::events::MountEvent; /// Map the Event to DomEvent, which are browser events #[derive(Debug, Clone)] diff --git a/crates/core/src/dom/dom_node.rs b/crates/core/src/dom/dom_node.rs index 1fc903961..777bacdc7 100644 --- a/crates/core/src/dom/dom_node.rs +++ b/crates/core/src/dom/dom_node.rs @@ -1,26 +1,23 @@ -use crate::dom::component::StatelessModel; -use crate::dom::DomAttr; -use crate::dom::GroupedDomAttrValues; -use crate::dom::StatefulComponent; -use crate::dom::StatefulModel; -use crate::html::lookup; -use crate::vdom::TreePath; -use crate::{ - dom::document, - dom::events::MountEvent, - dom::{Application, Program}, - vdom, - vdom::{Attribute, Leaf}, +use std::{ + borrow::Cow, + cell::{Ref, RefCell}, + fmt, + rc::Rc, }; + use indexmap::IndexMap; -use std::borrow::Cow; -use std::cell::Ref; -use std::cell::RefCell; -use std::fmt; -use std::rc::Rc; use wasm_bindgen::{closure::Closure, JsCast, JsValue}; use web_sys::{self, Node}; +use crate::{ + dom::{ + component::StatelessModel, document, dom_patch, events::MountEvent, Application, DomAttr, + GroupedDomAttrValues, Program, StatefulComponent, StatefulModel, + }, + html::lookup, + vdom::{self, Attribute, Leaf, TreePath}, +}; + pub(crate) type EventClosure = Closure; pub type NamedEventClosures = IndexMap<&'static str, EventClosure>; @@ -33,6 +30,7 @@ pub type NamedEventClosures = IndexMap<&'static str, EventClosure>; pub struct DomNode { pub(crate) inner: DomInner, } + #[derive(Clone)] pub enum DomInner { /// a reference to an element node @@ -648,149 +646,133 @@ where { /// Create a dom node pub fn create_dom_node(&self, node: &vdom::Node) -> DomNode { - match node { - vdom::Node::Element(elm) => self.create_element_node(elm), - vdom::Node::Leaf(leaf) => self.create_leaf_node(leaf), - } + let ev_callback = self.create_ev_callback(); + create_dom_node(node, ev_callback) } - fn create_element_node(&self, elm: &vdom::Element) -> DomNode { - let document = document(); - let element = if let Some(namespace) = elm.namespace() { - document - .create_element_ns(Some(intern(namespace)), intern(elm.tag())) - .expect("Unable to create element") - } else { - document - .create_element(intern(elm.tag())) - .expect("create element") + pub(crate) fn create_ev_callback(&self) -> impl Fn(APP::MSG) + Clone { + let program = self.downgrade(); + let ev_callback = move |msg| { + let mut program = program.upgrade().expect("must upgrade"); + program.dispatch(msg); }; - // TODO: dispatch the mount event recursively after the dom node is mounted into - // the root node - let attrs = Attribute::merge_attributes_of_same_name(elm.attributes().iter()); - - let dom_node = DomNode { - inner: DomInner::Element { - element, - listeners: Rc::new(RefCell::new(None)), - children: Rc::new(RefCell::new(vec![])), - has_mount_callback: elm.has_mount_callback(), - }, - }; - let dom_attrs = attrs.iter().map(|a| self.convert_attr(a)); - dom_node.set_dom_attrs(dom_attrs).expect("set dom attrs"); - let children: Vec = elm - .children() - .iter() - .map(|child| self.create_dom_node(child)) - .collect(); - dom_node.append_children(children); - dom_node - } - - fn create_leaf_node(&self, leaf: &vdom::Leaf) -> DomNode { - match leaf { - Leaf::Text(txt) => DomNode { - inner: DomInner::Text(document().create_text_node(txt)), - }, - Leaf::Symbol(symbol) => DomNode { - inner: DomInner::Symbol(symbol.clone()), - }, - Leaf::Comment(comment) => DomNode { - inner: DomInner::Comment(document().create_comment(comment)), - }, - Leaf::Fragment(nodes) => self.create_fragment_node(nodes), - // NodeList that goes here is only possible when it is the root_node, - // since node_list as children will be unrolled into as child_elements of the parent - // We need to wrap this node_list into doc_fragment since root_node is only 1 element - Leaf::NodeList(nodes) => self.create_fragment_node(nodes), - Leaf::StatefulComponent(comp) => { - //TODO: also put the children and attributes here - DomNode { - inner: DomInner::StatefulComponent { - comp: Rc::clone(&comp.comp), - dom_node: Rc::new(self.create_stateful_component(comp)), - }, - } - } - Leaf::StatelessComponent(comp) => self.create_stateless_component(comp), - Leaf::TemplatedView(view) => { - unreachable!("template view should not be created: {:#?}", view) - } - Leaf::DocType(_) => unreachable!("doc type is never converted"), - } + ev_callback } +} - fn create_fragment_node<'a>( - &self, - nodes: impl IntoIterator>, - ) -> DomNode { - let fragment = document().create_document_fragment(); - let dom_node = DomNode { - inner: DomInner::Fragment { - fragment, - children: Rc::new(RefCell::new(vec![])), - }, - }; - let children = nodes - .into_iter() - .map(|node| self.create_dom_node(node)) - .collect(); - dom_node.append_children(children); - dom_node +/// Create a dom node +pub fn create_dom_node(node: &vdom::Node, ev_callback: F) -> DomNode +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + match node { + vdom::Node::Element(elm) => create_element_node(elm, ev_callback), + vdom::Node::Leaf(leaf) => create_leaf_node(leaf, ev_callback), } } -/// A node along with all of the closures that were created for that -/// node's events and all of it's child node's events. -impl Program +fn create_element_node(elm: &vdom::Element, ev_callback: F) -> DomNode where - APP: Application, + Msg: 'static, + F: Fn(Msg) + 'static + Clone, { - /// TODO: register the template if not yet - /// pass a program to leaf component and mount itself and its view to the program - /// There are 2 types of children components of Stateful Component - /// - Internal children - /// - External children - /// Internal children is managed by the Stateful Component - /// while external children are managed by the top level program. - /// The external children can be diffed, and send the patches to the StatefulComponent - /// - The TreePath of the children starts at the external children location - /// The attributes affects the Stateful component state. - /// The attributes can be diff and send the patches to the StatefulComponent - /// - Changes to the attributes will call on attribute_changed of the StatefulComponent - fn create_stateful_component(&self, comp: &StatefulModel) -> DomNode { - let comp_node = self.create_dom_node(&crate::html::div( - [crate::html::attributes::class("component")] - .into_iter() - .chain(comp.attrs.clone()), - [], - )); + let document = document(); + let element = if let Some(namespace) = elm.namespace() { + document + .create_element_ns(Some(intern(namespace)), intern(elm.tag())) + .expect("Unable to create element") + } else { + document + .create_element(intern(elm.tag())) + .expect("create element") + }; + // TODO: dispatch the mount event recursively after the dom node is mounted into + // the root node + let attrs = Attribute::merge_attributes_of_same_name(elm.attributes().iter()); + + let dom_node = DomNode { + inner: DomInner::Element { + element, + listeners: Rc::new(RefCell::new(None)), + children: Rc::new(RefCell::new(vec![])), + has_mount_callback: elm.has_mount_callback(), + }, + }; + let dom_attrs = attrs + .iter() + .map(|a| dom_patch::convert_attr(a, ev_callback.clone())); + dom_node.set_dom_attrs(dom_attrs).expect("set dom attrs"); + let children: Vec = elm + .children() + .iter() + .map(|child| create_dom_node(child, ev_callback.clone())) + .collect(); + dom_node.append_children(children); + dom_node +} - let dom_attrs: Vec = comp.attrs.iter().map(|a| self.convert_attr(a)).collect(); - for dom_attr in dom_attrs.into_iter() { - log::info!("calling attribute changed.."); - comp.comp.borrow_mut().attribute_changed(dom_attr); +fn create_leaf_node(leaf: &vdom::Leaf, ev_callback: F) -> DomNode +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + match leaf { + Leaf::Text(txt) => DomNode { + inner: DomInner::Text(document().create_text_node(txt)), + }, + Leaf::Symbol(symbol) => DomNode { + inner: DomInner::Symbol(symbol.clone()), + }, + Leaf::Comment(comment) => DomNode { + inner: DomInner::Comment(document().create_comment(comment)), + }, + Leaf::Fragment(nodes) => create_fragment_node(nodes, ev_callback), + + // NodeList that goes here is only possible when it is the root_node, + // since node_list as children will be unrolled into as child_elements of the parent + // We need to wrap this node_list into doc_fragment since root_node is only 1 element + Leaf::NodeList(nodes) => create_fragment_node(nodes, ev_callback), + + Leaf::StatefulComponent(comp) => { + //TODO: also put the children and attributes here + DomNode { + inner: DomInner::StatefulComponent { + comp: Rc::clone(&comp.comp), + dom_node: Rc::new(create_stateful_component(comp, ev_callback)), + }, + } } + Leaf::StatelessComponent(comp) => create_stateless_component(comp, ev_callback), - // the component children is manually appended to the StatefulComponent - // here to allow the conversion of dom nodes with its event - // listener and removing the generics msg - let created_children = comp - .children - .iter() - .map(|child| self.create_dom_node(child)) - .collect(); - comp.comp.borrow_mut().append_children(created_children); - comp_node + Leaf::TemplatedView(view) => { + unreachable!("template view should not be created: {:#?}", view) + } + Leaf::DocType(_) => unreachable!("doc type is never converted"), } +} - #[allow(unused)] - pub(crate) fn create_stateless_component(&self, comp: &StatelessModel) -> DomNode { - let comp_view = &comp.view; - let real_comp_view = comp_view.unwrap_template_ref(); - self.create_dom_node(real_comp_view) - } +fn create_fragment_node<'a, Msg, F>( + nodes: impl IntoIterator>, + ev_callback: F, +) -> DomNode +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + let fragment = document().create_document_fragment(); + let dom_node = DomNode { + inner: DomInner::Fragment { + fragment, + children: Rc::new(RefCell::new(vec![])), + }, + }; + let children = nodes + .into_iter() + .map(|node| create_dom_node(node, ev_callback.clone())) + .collect(); + dom_node.append_children(children); + dom_node } /// render the underlying real dom node into string @@ -845,3 +827,67 @@ pub fn render_real_dom(node: &web_sys::Node, buffer: &mut dyn fmt::Write) -> fmt _ => todo!("for other else"), } } + +#[allow(unused)] +pub(crate) fn create_stateless_component( + comp: &StatelessModel, + ev_callback: F, +) -> DomNode +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + let comp_view = &comp.view; + let real_comp_view = comp_view.unwrap_template_ref(); + create_dom_node(real_comp_view, ev_callback) +} + +/// TODO: register the template if not yet +/// pass a program to leaf component and mount itself and its view to the program +/// There are 2 types of children components of Stateful Component +/// - Internal children +/// - External children +/// Internal children is managed by the Stateful Component +/// while external children are managed by the top level program. +/// The external children can be diffed, and send the patches to the StatefulComponent +/// - The TreePath of the children starts at the external children location +/// The attributes affects the Stateful component state. +/// The attributes can be diff and send the patches to the StatefulComponent +/// - Changes to the attributes will call on attribute_changed of the StatefulComponent +fn create_stateful_component(comp: &StatefulModel, ev_callback: F) -> DomNode +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + let comp_node = create_dom_node( + &crate::html::div( + [crate::html::attributes::class("component")] + .into_iter() + .chain(comp.attrs.clone()), + [], + ), + ev_callback.clone(), + ); + + let dom_attrs: Vec = comp + .attrs + .iter() + .map(|a| dom_patch::convert_attr(a, ev_callback.clone())) + .collect(); + + for dom_attr in dom_attrs.into_iter() { + log::info!("calling attribute changed.."); + comp.comp.borrow_mut().attribute_changed(dom_attr); + } + + // the component children is manually appended to the StatefulComponent + // here to allow the conversion of dom nodes with its event + // listener and removing the generics msg + let created_children = comp + .children + .iter() + .map(|child| create_dom_node(child, ev_callback.clone())) + .collect(); + comp.comp.borrow_mut().append_children(created_children); + comp_node +} diff --git a/crates/core/src/dom/dom_patch.rs b/crates/core/src/dom/dom_patch.rs index 94f05032a..61b1cd30e 100644 --- a/crates/core/src/dom/dom_patch.rs +++ b/crates/core/src/dom/dom_patch.rs @@ -1,18 +1,19 @@ -use crate::dom; -use crate::dom::dom_node; -use crate::dom::dom_node::DomInner; -use crate::dom::DomAttr; -use crate::dom::DomAttrValue; -use crate::dom::DomNode; -use crate::dom::{Application, Program}; -use crate::vdom::ComponentEventCallback; -use crate::vdom::EventCallback; -use crate::vdom::TreePath; -use crate::vdom::{Attribute, AttributeValue, Patch, PatchType}; +use std::{cell::RefCell, rc::Rc}; + use indexmap::IndexMap; use wasm_bindgen::closure::Closure; use wasm_bindgen::JsValue; +use crate::{ + dom::{ + self, dom_node, dom_node::DomInner, Application, DomAttr, DomAttrValue, DomNode, Program, + }, + vdom::{ + Attribute, AttributeValue, ComponentEventCallback, EventCallback, Patch, PatchType, + TreePath, + }, +}; + /// a Patch where the virtual nodes are all created in the document. /// This is necessary since the created Node doesn't contain references /// as opposed to Patch which contains reference to the vdom, which makes it hard @@ -146,97 +147,15 @@ impl Program where APP: Application + 'static, { - pub(crate) fn convert_attr(&self, attr: &Attribute) -> DomAttr { - DomAttr { - namespace: attr.namespace, - name: attr.name, - value: attr - .value - .iter() - .filter_map(|v| self.convert_attr_value(v)) - .collect(), - } - } - - fn convert_attr_value(&self, attr_value: &AttributeValue) -> Option { - match attr_value { - AttributeValue::Simple(v) => Some(DomAttrValue::Simple(v.clone())), - AttributeValue::Style(v) => Some(DomAttrValue::Style(v.clone())), - AttributeValue::EventListener(v) => { - Some(DomAttrValue::EventListener(self.convert_event_listener(v))) - } - AttributeValue::ComponentEventListener(v) => Some(DomAttrValue::EventListener( - self.convert_component_event_listener(v), - )), - AttributeValue::Empty => None, - } - } - - fn convert_event_listener( - &self, - event_listener: &EventCallback, - ) -> Closure { - let program = self.downgrade(); - let event_listener = event_listener.clone(); - let closure: Closure = - Closure::new(move |event: web_sys::Event| { - let msg = event_listener.emit(dom::Event::from(event)); - let mut program = program.upgrade().expect("must upgrade"); - program.dispatch(msg); - }); - closure - } - - fn convert_component_event_listener( - &self, - component_callback: &ComponentEventCallback, - ) -> Closure { - let component_callback = component_callback.clone(); - let closure: Closure = - Closure::new(move |event: web_sys::Event| { - component_callback.emit(dom::Event::from(event)); - }); - closure - } /// get the real DOM target node and make a DomPatch object for each of the Patch pub(crate) fn convert_patches( &self, target_node: &DomNode, patches: &[Patch], ) -> Result, JsValue> { - let nodes_to_find: Vec<(&TreePath, Option<&&'static str>)> = patches - .iter() - .map(|patch| (patch.path(), patch.tag())) - .chain( - patches - .iter() - .flat_map(|patch| patch.node_paths()) - .map(|path| (path, None)), - ) - .collect(); - - let nodes_lookup = target_node.find_all_nodes(&nodes_to_find); - - let dom_patches:Vec = patches.iter().map(|patch|{ - let patch_path = patch.path(); - let patch_tag = patch.tag(); - if let Some((target_node, target_parent)) = nodes_lookup.get(patch_path) { - let target_tag = target_node.tag(); - if let (Some(patch_tag), Some(target_tag)) = (patch_tag, target_tag) { - if **patch_tag != target_tag{ - panic!( - "expecting a tag: {patch_tag:?}, but found: {target_tag:?}" - ); - } - } - self.convert_patch(&nodes_lookup, target_node, target_parent, patch) - } else { - unreachable!("Getting here means we didn't find the element of next node that we are supposed to patch, patch_path: {:?}, with tag: {:?}", patch_path, patch_tag); - } - }).collect(); - - Ok(dom_patches) + convert_patches(target_node, patches, self.create_ev_callback()) } + /// convert a virtual DOM Patch into a created DOM node Patch pub fn convert_patch( &self, @@ -245,244 +164,382 @@ where target_parent: &DomNode, patch: &Patch, ) -> DomPatch { - let target_element = target_element.clone(); - let target_parent = target_parent.clone(); - let Patch { - patch_path, - patch_type, - .. - } = patch; + convert_patch( + nodes_lookup, + target_element, + target_parent, + patch, + self.create_ev_callback(), + ) + } +} - let patch_path = patch_path.clone(); +/// get the real DOM target node and make a DomPatch object for each of the Patch +pub fn convert_patches( + target_node: &DomNode, + patches: &[Patch], + ev_callback: F, +) -> Result, JsValue> +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + let nodes_to_find: Vec<(&TreePath, Option<&&'static str>)> = patches + .iter() + .map(|patch| (patch.path(), patch.tag())) + .chain( + patches + .iter() + .flat_map(|patch| patch.node_paths()) + .map(|path| (path, None)), + ) + .collect(); - match patch_type { - PatchType::InsertBeforeNode { nodes } => { - let nodes = nodes - .iter() - .map(|for_insert| self.create_dom_node(for_insert)) - .collect(); - DomPatch { - patch_path, - target_element, - target_parent, - patch_variant: PatchVariant::InsertBeforeNode { nodes }, - } - } - PatchType::InsertAfterNode { nodes } => { - let nodes = nodes - .iter() - .map(|for_insert| self.create_dom_node(for_insert)) - .collect(); - DomPatch { - patch_path, - target_element, - target_parent, - patch_variant: PatchVariant::InsertAfterNode { nodes }, + let nodes_lookup = target_node.find_all_nodes(&nodes_to_find); + + let dom_patches:Vec = patches.iter().map(|patch|{ + let patch_path = patch.path(); + let patch_tag = patch.tag(); + if let Some((target_node, target_parent)) = nodes_lookup.get(patch_path) { + let target_tag = target_node.tag(); + if let (Some(patch_tag), Some(target_tag)) = (patch_tag, target_tag) { + if **patch_tag != target_tag{ + panic!( + "expecting a tag: {patch_tag:?}, but found: {target_tag:?}" + ); } } + convert_patch(&nodes_lookup, target_node, target_parent, patch, ev_callback.clone()) + } else { + unreachable!("Getting here means we didn't find the element of next node that we are supposed to patch, patch_path: {:?}, with tag: {:?}", patch_path, patch_tag); + } + }).collect(); - PatchType::AddAttributes { attrs } => { - // we merge the attributes here prior to conversion - let attrs = Attribute::merge_attributes_of_same_name(attrs.iter().copied()); - DomPatch { - patch_path, - target_element, - target_parent, - patch_variant: PatchVariant::AddAttributes { - attrs: attrs.iter().map(|a| self.convert_attr(a)).collect(), - }, - } + Ok(dom_patches) +} + +/// convert a virtual DOM Patch into a created DOM node Patch +pub fn convert_patch( + nodes_lookup: &IndexMap, + target_element: &DomNode, + target_parent: &DomNode, + patch: &Patch, + ev_callback: F, +) -> DomPatch +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + let target_element = target_element.clone(); + let target_parent = target_parent.clone(); + let Patch { + patch_path, + patch_type, + .. + } = patch; + + let patch_path = patch_path.clone(); + + match patch_type { + PatchType::InsertBeforeNode { nodes } => { + let nodes = nodes + .iter() + .map(|for_insert| dom::create_dom_node(for_insert, ev_callback.clone())) + .collect(); + DomPatch { + patch_path, + target_element, + target_parent, + patch_variant: PatchVariant::InsertBeforeNode { nodes }, } - PatchType::RemoveAttributes { attrs } => DomPatch { + } + PatchType::InsertAfterNode { nodes } => { + let nodes = nodes + .iter() + .map(|for_insert| dom::create_dom_node(for_insert, ev_callback.clone())) + .collect(); + DomPatch { patch_path, target_element, target_parent, - patch_variant: PatchVariant::RemoveAttributes { - attrs: attrs.iter().map(|a| self.convert_attr(a)).collect(), + patch_variant: PatchVariant::InsertAfterNode { nodes }, + } + } + + PatchType::AddAttributes { attrs } => { + // we merge the attributes here prior to conversion + let attrs = Attribute::merge_attributes_of_same_name(attrs.iter().copied()); + DomPatch { + patch_path, + target_element, + target_parent, + patch_variant: PatchVariant::AddAttributes { + attrs: attrs + .iter() + .map(|a| convert_attr(a, ev_callback.clone())) + .collect(), }, + } + } + PatchType::RemoveAttributes { attrs } => DomPatch { + patch_path, + target_element, + target_parent, + patch_variant: PatchVariant::RemoveAttributes { + attrs: attrs + .iter() + .map(|a| convert_attr(a, ev_callback.clone())) + .collect(), }, + }, - PatchType::ReplaceNode { replacement } => { - let replacement = replacement - .iter() - .map(|node| self.create_dom_node(node)) - .collect(); - DomPatch { - patch_path, - target_element, - target_parent, - patch_variant: PatchVariant::ReplaceNode { replacement }, - } - } - PatchType::RemoveNode => DomPatch { + PatchType::ReplaceNode { replacement } => { + let replacement = replacement + .iter() + .map(|node| dom::create_dom_node(node, ev_callback.clone())) + .collect(); + DomPatch { patch_path, target_element, target_parent, - patch_variant: PatchVariant::RemoveNode, - }, - PatchType::ClearChildren => DomPatch { + patch_variant: PatchVariant::ReplaceNode { replacement }, + } + } + PatchType::RemoveNode => DomPatch { + patch_path, + target_element, + target_parent, + patch_variant: PatchVariant::RemoveNode, + }, + PatchType::ClearChildren => DomPatch { + patch_path, + target_element, + target_parent, + patch_variant: PatchVariant::ClearChildren, + }, + PatchType::MoveBeforeNode { nodes_path } => { + let for_moving = nodes_path + .iter() + .map(|path| { + let (node, _) = nodes_lookup.get(path).expect("must have found the node"); + node.clone() + }) + .collect(); + DomPatch { patch_path, target_element, target_parent, - patch_variant: PatchVariant::ClearChildren, - }, - PatchType::MoveBeforeNode { nodes_path } => { - let for_moving = nodes_path - .iter() - .map(|path| { - let (node, _) = nodes_lookup.get(path).expect("must have found the node"); - node.clone() - }) - .collect(); - DomPatch { - patch_path, - target_element, - target_parent, - patch_variant: PatchVariant::MoveBeforeNode { for_moving }, - } + patch_variant: PatchVariant::MoveBeforeNode { for_moving }, } - PatchType::MoveAfterNode { nodes_path } => { - let for_moving = nodes_path - .iter() - .map(|path| { - let (node, _) = nodes_lookup.get(path).expect("must have found the node"); - node.clone() - }) - .collect(); - DomPatch { - patch_path, - target_element, - target_parent, - patch_variant: PatchVariant::MoveAfterNode { for_moving }, - } + } + PatchType::MoveAfterNode { nodes_path } => { + let for_moving = nodes_path + .iter() + .map(|path| { + let (node, _) = nodes_lookup.get(path).expect("must have found the node"); + node.clone() + }) + .collect(); + DomPatch { + patch_path, + target_element, + target_parent, + patch_variant: PatchVariant::MoveAfterNode { for_moving }, } - PatchType::AppendChildren { children } => { - let children = children - .iter() - .map(|for_insert| self.create_dom_node(for_insert)) - .collect(); + } + PatchType::AppendChildren { children } => { + let children = children + .iter() + .map(|for_insert| dom::create_dom_node(for_insert, ev_callback.clone())) + .collect(); - DomPatch { - patch_path, - target_element, - target_parent, - patch_variant: PatchVariant::AppendChildren { children }, - } + DomPatch { + patch_path, + target_element, + target_parent, + patch_variant: PatchVariant::AppendChildren { children }, } } } +} - /// TODO: this should not have access to root_node, so it can generically - /// apply patch to any dom node - pub(crate) fn apply_dom_patches( - &self, - dom_patches: impl IntoIterator, - ) -> Result<(), JsValue> { - for dom_patch in dom_patches { - self.apply_dom_patch(dom_patch)?; - } - Ok(()) +pub(crate) fn convert_attr(attr: &Attribute, ev_callback: F) -> DomAttr +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + DomAttr { + namespace: attr.namespace, + name: attr.name, + value: attr + .value + .iter() + .filter_map(|v| convert_attr_value(v, ev_callback.clone())) + .collect(), } +} - /// apply a dom patch to this root node, - /// return a new root_node if it would replace the original root_node - /// TODO: this should have no access to root_node, so it can be used in general sense - pub(crate) fn apply_dom_patch(&self, dom_patch: DomPatch) -> Result<(), JsValue> { - let DomPatch { - patch_path, - target_element, - target_parent, - patch_variant, - } = dom_patch; +fn convert_attr_value( + attr_value: &AttributeValue, + ev_callback: F, +) -> Option +where + Msg: 'static, + F: Fn(Msg) + 'static, +{ + match attr_value { + AttributeValue::Simple(v) => Some(DomAttrValue::Simple(v.clone())), + AttributeValue::Style(v) => Some(DomAttrValue::Style(v.clone())), + AttributeValue::EventListener(v) => Some(DomAttrValue::EventListener( + convert_event_listener(v, ev_callback), + )), + AttributeValue::ComponentEventListener(v) => Some(DomAttrValue::EventListener( + convert_component_event_listener(v), + )), + AttributeValue::Empty => None, + } +} - match patch_variant { - PatchVariant::InsertBeforeNode { nodes } => { - target_parent.insert_before(&target_element, nodes); - } +fn convert_event_listener( + event_listener: &EventCallback, + callback: F, +) -> Closure +where + Msg: 'static, + F: Fn(Msg) + 'static, +{ + let event_listener = event_listener.clone(); + let closure: Closure = Closure::new(move |event: web_sys::Event| { + let msg = event_listener.emit(dom::Event::from(event)); + callback(msg); + }); + closure +} - PatchVariant::InsertAfterNode { nodes } => { - target_parent.insert_after(&target_element, nodes); - } - PatchVariant::AppendChildren { children } => { - target_element.append_children(children); - } +/// TODO: this should not have access to root_node, so it can generically +/// apply patch to any dom node +pub fn apply_dom_patches( + root_node: Rc>>, + mount_node: Rc>>, + dom_patches: impl IntoIterator, +) -> Result<(), JsValue> { + for dom_patch in dom_patches { + apply_dom_patch(Rc::clone(&root_node), Rc::clone(&mount_node), dom_patch)?; + } + Ok(()) +} - PatchVariant::AddAttributes { attrs } => { - target_element.set_dom_attrs(attrs).unwrap(); - } - PatchVariant::RemoveAttributes { attrs } => { - for attr in attrs.iter() { - for att_value in attr.value.iter() { - match att_value { - DomAttrValue::Simple(_) => { - target_element.remove_dom_attr(attr)?; - } - // it is an event listener - DomAttrValue::EventListener(_) => { - let DomInner::Element { listeners, .. } = &target_element.inner - else { - unreachable!("must be an element"); - }; - if let Some(listener) = listeners.borrow_mut().as_mut() { - listener.retain(|event, _| *event != attr.name) - } - } - DomAttrValue::Style(_) => { - target_element.remove_dom_attr(attr)?; +/// apply a dom patch to this root node, +/// return a new root_node if it would replace the original root_node +/// TODO: this should have no access to root_node, so it can be used in general sense +pub(crate) fn apply_dom_patch( + root_node: Rc>>, + mount_node: Rc>>, + dom_patch: DomPatch, +) -> Result<(), JsValue> { + let DomPatch { + patch_path, + target_element, + target_parent, + patch_variant, + } = dom_patch; + + match patch_variant { + PatchVariant::InsertBeforeNode { nodes } => { + target_parent.insert_before(&target_element, nodes); + } + + PatchVariant::InsertAfterNode { nodes } => { + target_parent.insert_after(&target_element, nodes); + } + PatchVariant::AppendChildren { children } => { + target_element.append_children(children); + } + + PatchVariant::AddAttributes { attrs } => { + target_element.set_dom_attrs(attrs).unwrap(); + } + PatchVariant::RemoveAttributes { attrs } => { + for attr in attrs.iter() { + for att_value in attr.value.iter() { + match att_value { + DomAttrValue::Simple(_) => { + target_element.remove_dom_attr(attr)?; + } + // it is an event listener + DomAttrValue::EventListener(_) => { + let DomInner::Element { listeners, .. } = &target_element.inner else { + unreachable!("must be an element"); + }; + if let Some(listener) = listeners.borrow_mut().as_mut() { + listener.retain(|event, _| *event != attr.name) } - DomAttrValue::Empty => (), } + DomAttrValue::Style(_) => { + target_element.remove_dom_attr(attr)?; + } + DomAttrValue::Empty => (), } } } + } - // This also removes the associated closures and event listeners to the node being replaced - // including the associated closures of the descendant of replaced node - // before it is actully replaced in the DOM - // TODO: make root node a Vec - PatchVariant::ReplaceNode { mut replacement } => { - let first_node = replacement.remove(0); + // This also removes the associated closures and event listeners to the node being replaced + // including the associated closures of the descendant of replaced node + // before it is actully replaced in the DOM + // TODO: make root node a Vec + PatchVariant::ReplaceNode { mut replacement } => { + let first_node = replacement.remove(0); - if target_element.is_fragment() { - assert!( - patch_path.is_empty(), - "this should only happen to root node" - ); - let mut mount_node = self.mount_node.borrow_mut(); + if target_element.is_fragment() { + assert!( + patch_path.is_empty(), + "this should only happen to root node" + ); + let mut mount_node = mount_node.borrow_mut(); + let mount_node = mount_node.as_mut().expect("must have a mount node"); + mount_node.append_children(vec![first_node.clone()]); + mount_node.append_children(replacement); + } else { + if patch_path.path.is_empty() { + let mut mount_node = mount_node.borrow_mut(); let mount_node = mount_node.as_mut().expect("must have a mount node"); - mount_node.append_children(vec![first_node.clone()]); - mount_node.append_children(replacement); + mount_node.replace_child(&target_element, first_node.clone()); } else { - if patch_path.path.is_empty() { - let mut mount_node = self.mount_node.borrow_mut(); - let mount_node = mount_node.as_mut().expect("must have a mount node"); - mount_node.replace_child(&target_element, first_node.clone()); - } else { - target_parent.replace_child(&target_element, first_node.clone()); - } - //insert the rest - target_parent.insert_after(&first_node, replacement); - } - if patch_path.path.is_empty() { - *self.root_node.borrow_mut() = Some(first_node); + target_parent.replace_child(&target_element, first_node.clone()); } + //insert the rest + target_parent.insert_after(&first_node, replacement); } - PatchVariant::RemoveNode => { - target_parent.remove_children(&[&target_element]); - } - PatchVariant::ClearChildren => { - target_element.clear_children(); - } - PatchVariant::MoveBeforeNode { for_moving } => { - target_parent.remove_children(&for_moving.iter().collect::>()); - target_parent.insert_before(&target_element, for_moving); + if patch_path.path.is_empty() { + *root_node.borrow_mut() = Some(first_node); } + } + PatchVariant::RemoveNode => { + target_parent.remove_children(&[&target_element]); + } + PatchVariant::ClearChildren => { + target_element.clear_children(); + } + PatchVariant::MoveBeforeNode { for_moving } => { + target_parent.remove_children(&for_moving.iter().collect::>()); + target_parent.insert_before(&target_element, for_moving); + } - PatchVariant::MoveAfterNode { for_moving } => { - target_parent.remove_children(&for_moving.iter().collect::>()); - target_parent.insert_after(&target_element, for_moving); - } + PatchVariant::MoveAfterNode { for_moving } => { + target_parent.remove_children(&for_moving.iter().collect::>()); + target_parent.insert_after(&target_element, for_moving); } - Ok(()) } + Ok(()) +} + +fn convert_component_event_listener( + component_callback: &ComponentEventCallback, +) -> Closure { + let component_callback = component_callback.clone(); + let closure: Closure = Closure::new(move |event: web_sys::Event| { + component_callback.emit(dom::Event::from(event)); + }); + closure } diff --git a/crates/core/src/dom/program.rs b/crates/core/src/dom/program.rs index 283f7f354..61eea9daf 100644 --- a/crates/core/src/dom/program.rs +++ b/crates/core/src/dom/program.rs @@ -1,33 +1,30 @@ -use crate::dom::program::app_context::WeakContext; -#[cfg(feature = "with-raf")] -use crate::dom::request_animation_frame; -#[cfg(feature = "with-ric")] -use crate::dom::request_idle_callback; -use crate::dom::DomNode; -use crate::dom::SkipDiff; -use crate::dom::SkipPath; -use crate::dom::{document, now, IdleDeadline, Measurements}; -use crate::dom::{util::body, AnimationFrameHandle, Application, DomPatch, IdleCallbackHandle}; -use crate::html::{self, attributes::class, text}; -use crate::vdom; -use crate::vdom::diff; -use crate::vdom::diff_recursive; -use crate::vdom::Patch; -use std::collections::hash_map::DefaultHasher; -use std::collections::VecDeque; -use std::hash::{Hash, Hasher}; -use std::mem::ManuallyDrop; use std::{ any::TypeId, cell::{Ref, RefCell, RefMut}, + collections::{hash_map::DefaultHasher, VecDeque}, + hash::{Hash, Hasher}, + mem::ManuallyDrop, rc::Rc, rc::Weak, }; + use wasm_bindgen::{JsCast, JsValue}; -use web_sys; -pub(crate) use app_context::AppContext; -pub use mount_procedure::{MountAction, MountProcedure, MountTarget}; +use crate::{ + dom::{ + document, dom_patch, now, program::app_context::WeakContext, util::body, + AnimationFrameHandle, Application, DomNode, DomPatch, IdleCallbackHandle, IdleDeadline, + Measurements, SkipDiff, SkipPath, + }, + html::{self, attributes::class, text}, + vdom::{self, diff, diff_recursive, Patch}, +}; + +#[cfg(feature = "with-raf")] +use crate::dom::request_animation_frame; + +#[cfg(feature = "with-ric")] +use crate::dom::request_idle_callback; thread_local! { static CANCEL_CNT: RefCell = RefCell::new(0); @@ -38,7 +35,10 @@ thread_local! { } mod app_context; +use self::app_context::AppContext; + mod mount_procedure; +pub use self::mount_procedure::{MountAction, MountProcedure, MountTarget}; /// Program handle the lifecycle of the APP pub struct Program @@ -494,7 +494,13 @@ where ) .expect("must convert patches") } else { - self.create_dom_patch(&view) + let current_vdom = self.app_context.current_vdom(); + create_dom_patch( + &self.root_node, + ¤t_vdom, + &view, + self.create_ev_callback(), + ) }; let total_patches = dom_patches.len(); @@ -561,26 +567,7 @@ where new_vdom, &SkipPath::new(TreePath::root(), skip_diff.clone()), ) - } - - fn create_dom_patch(&self, new_vdom: &vdom::Node) -> Vec { - let current_vdom = self.app_context.current_vdom(); - let patches = diff(¤t_vdom, new_vdom); - - #[cfg(all(feature = "with-debug", feature = "log-patches"))] - { - log::debug!("There are {} patches", patches.len()); - log::debug!("patches: {patches:#?}"); - } - - self.convert_patches( - self.root_node - .borrow() - .as_ref() - .expect("must have a root node"), - &patches, - ) - .expect("must convert patches") + .unwrap() } #[cfg(feature = "with-raf")] @@ -601,7 +588,11 @@ where return Ok(()); } let dom_patches: Vec = self.pending_patches.borrow_mut().drain(..).collect(); - self.apply_dom_patches(dom_patches)?; + dom_patch::apply_dom_patches( + Rc::clone(&self.root_node), + Rc::clone(&self.mount_node), + dom_patches, + )?; Ok(()) } @@ -747,6 +738,44 @@ where pub fn dispatch(&mut self, msg: APP::MSG) { self.dispatch_multiple([msg]) } + + /// patch the DOM to reflect the App's view + /// + /// Note: This is in another function so as to allow tests to use this shared code + pub fn create_dom_patch(&self, new_vdom: &vdom::Node) -> Vec { + create_dom_patch( + &self.root_node, + &self.app_context.current_vdom(), + new_vdom, + self.create_ev_callback(), + ) + } +} + +pub fn create_dom_patch( + root_node: &Rc>>, + current_vdom: &vdom::Node, + new_vdom: &vdom::Node, + ev_callback: F, +) -> Vec +where + Msg: 'static, + F: Fn(Msg) + 'static + Clone, +{ + let patches = diff(¤t_vdom, new_vdom).unwrap(); + + #[cfg(all(feature = "with-debug", feature = "log-patches"))] + { + log::debug!("There are {} patches", patches.len()); + log::debug!("patches: {patches:#?}"); + } + + dom_patch::convert_patches( + root_node.borrow().as_ref().expect("must have a root node"), + &patches, + ev_callback, + ) + .expect("must convert patches") } impl Program @@ -762,6 +791,7 @@ where new_vdom: vdom::Node, ) -> Result { let dom_patches = self.create_dom_patch(&new_vdom); + let total_patches = dom_patches.len(); self.pending_patches.borrow_mut().extend(dom_patches); diff --git a/crates/core/src/html/attributes/attribute_macros.rs b/crates/core/src/html/attributes/attribute_macros.rs index 2777fad9e..23594df09 100644 --- a/crates/core/src/html/attributes/attribute_macros.rs +++ b/crates/core/src/html/attributes/attribute_macros.rs @@ -213,6 +213,7 @@ pub mod commons { srcset; start; step; + style; tabindex; target; title; diff --git a/crates/core/src/vdom/diff.rs b/crates/core/src/vdom/diff.rs index 1a0f47647..1ef527cef 100644 --- a/crates/core/src/vdom/diff.rs +++ b/crates/core/src/vdom/diff.rs @@ -13,6 +13,20 @@ static USE_SKIP_DIFF: bool = true; #[cfg(not(feature = "use-skipdiff"))] static USE_SKIP_DIFF: bool = false; +/// all the possible error when diffing Node(s) +#[derive(Debug, thiserror::Error, Clone, Copy)] +pub enum DiffError { + /// Node list must have already unrolled when creating an element + #[error("Node list must have already unrolled when creating an element")] + UnrollError, + /// Skip diff error + #[error("Skip diff error")] + SkipDiffError, + /// Invalid root node count of: {0} + #[error("Invalid root node count of: {0}")] + InvalidRootNodeCount(usize), +} + /// Return the patches needed for `old_node` to have the same DOM as `new_node` /// /// # Agruments @@ -40,7 +54,7 @@ static USE_SKIP_DIFF: bool = false; /// vec![element("div", vec![attr("key", "2")], vec![])], /// ); /// -/// let diff = diff(&old, &new); +/// let diff = diff(&old, &new).unwrap(); /// assert_eq!( /// diff, /// vec![Patch::remove_node( @@ -50,7 +64,10 @@ static USE_SKIP_DIFF: bool = false; /// ] /// ); /// ``` -pub fn diff<'a, MSG>(old_node: &'a Node, new_node: &'a Node) -> Vec> { +pub fn diff<'a, MSG>( + old_node: &'a Node, + new_node: &'a Node, +) -> Result>, DiffError> { diff_recursive( old_node, new_node, @@ -115,10 +132,10 @@ pub fn diff_recursive<'a, MSG>( old_node: &'a Node, new_node: &'a Node, path: &SkipPath, -) -> Vec> { +) -> Result>, DiffError> { if let Some(skip_diff) = path.skip_diff.as_ref() { if USE_SKIP_DIFF && skip_diff.shall_skip_node() { - return vec![]; + return Err(DiffError::SkipDiffError); } } @@ -136,16 +153,31 @@ pub fn diff_recursive<'a, MSG>( }; // skip diffing if the function evaluates to true if skip(old_node, new_node) { - return vec![]; + return Ok(vec![]); + } + + // multiple root nodes are not supported. this would be two root nodes "
" + // the diff will work but the result is wrong, so instead we bail out here + match new_node { + Node::Leaf(leaf) => match leaf { + Leaf::NodeList(list) => { + if list.len() > 1 { + log::error!("invalid root node cound: input needs exactly one root node and childs, not several root nodes"); + return Err(DiffError::InvalidRootNodeCount(list.len())); + } + } + _ => {} + }, + Node::Element(_) => {} } // replace node and return early if should_replace(old_node, new_node) { - return vec![Patch::replace_node( + return Ok(vec![Patch::replace_node( old_node.tag(), path.path.clone(), vec![new_node], - )]; + )]); } let mut patches = vec![]; @@ -169,10 +201,13 @@ pub fn diff_recursive<'a, MSG>( // we back track since Fragment is not a real node, but it would still // be traversed from the prior call let patch = diff_nodes(None, old_nodes, new_nodes, &path.backtrack()); - patches.extend(patch); + match patch { + Ok(patch) => patches.extend(patch), + Err(e) => return Err(e), + }; } (Leaf::NodeList(_old_elements), Leaf::NodeList(_new_elements)) => { - panic!("Node list must have already unrolled when creating an element"); + return Err(DiffError::UnrollError) } (Leaf::StatelessComponent(old_comp), Leaf::StatelessComponent(new_comp)) => { let new_path = SkipPath { @@ -192,7 +227,10 @@ pub fn diff_recursive<'a, MSG>( "new comp view should not be a template" ); let patch = diff_recursive(old_real_view, new_real_view, &new_path); - patches.extend(patch); + match patch { + Ok(patch) => patches.extend(patch), + Err(e) => return Err(e), + } } (Leaf::StatefulComponent(old_comp), Leaf::StatefulComponent(new_comp)) => { let attr_patches = create_attribute_patches( @@ -201,15 +239,26 @@ pub fn diff_recursive<'a, MSG>( &new_comp.attrs, path, ); - if !attr_patches.is_empty() { - log::info!("stateful component attr_patches: {attr_patches:#?}"); - } - patches.extend(attr_patches); - let patch = diff_nodes(None, &old_comp.children, &new_comp.children, path); - if !patch.is_empty() { - log::info!("stateful component patch: {patch:#?}"); + match attr_patches { + Ok(attr_patches) => { + if !attr_patches.is_empty() { + log::info!("stateful component attr_patches: {attr_patches:#?}"); + } + patches.extend(attr_patches); + let patch = + diff_nodes(None, &old_comp.children, &new_comp.children, path); + match patch { + Ok(patch) => { + if !patch.is_empty() { + log::info!("stateful component patch: {patch:#?}"); + } + patches.extend(patch); + } + Err(e) => return Err(e), + } + } + Err(e) => return Err(e), } - patches.extend(patch); } (Leaf::TemplatedView(_old_view), _) => { unreachable!("templated view should not be diffed..") @@ -238,7 +287,10 @@ pub fn diff_recursive<'a, MSG>( new_element.attributes(), path, ); - patches.extend(attr_patches); + match attr_patches { + Ok(attr_patches) => patches.extend(attr_patches), + Err(e) => return Err(e), + }; } let more_patches = diff_nodes( @@ -247,15 +299,17 @@ pub fn diff_recursive<'a, MSG>( new_element.children(), path, ); - - patches.extend(more_patches); + match more_patches { + Ok(more_patches) => patches.extend(more_patches), + Err(e) => return Err(e), + }; } _ => { unreachable!("Unequal variant discriminants should already have been handled"); } }; - patches + Ok(patches) } fn diff_nodes<'a, MSG>( @@ -263,12 +317,12 @@ fn diff_nodes<'a, MSG>( old_children: &'a [Node], new_children: &'a [Node], path: &SkipPath, -) -> Vec> { +) -> Result>, DiffError> { let diff_as_keyed = is_any_keyed(old_children) || is_any_keyed(new_children); if diff_as_keyed { let keyed_patches = diff_lis::diff_keyed_nodes(old_tag, old_children, new_children, path); - keyed_patches + Ok(keyed_patches) } else { let non_keyed_patches = diff_non_keyed_nodes(old_tag, old_children, new_children, path); non_keyed_patches @@ -290,14 +344,17 @@ fn diff_non_keyed_nodes<'a, MSG>( old_children: &'a [Node], new_children: &'a [Node], path: &SkipPath, -) -> Vec> { - let mut patches = vec![]; +) -> Result>, DiffError> { + let mut patches: Vec> = vec![]; let old_child_count = old_children.len(); let new_child_count = new_children.len(); // if there is no new children, then clear the children of this element if old_child_count > 0 && new_child_count == 0 { - return vec![Patch::clear_children(old_element_tag, path.path.clone())]; + return Ok(vec![Patch::clear_children( + old_element_tag, + path.path.clone(), + )]); } let min_count = cmp::min(old_child_count, new_child_count); @@ -309,7 +366,10 @@ fn diff_non_keyed_nodes<'a, MSG>( let new_child = &new_children.get(index).expect("No new child node"); let more_patches = diff_recursive(old_child, new_child, &child_path); - patches.extend(more_patches); + match more_patches { + Ok(more_patches) => patches.extend(more_patches), + Err(e) => return Err(e), + } } // If there are more new child than old_node child, we make a patch to append the excess element @@ -335,7 +395,7 @@ fn diff_non_keyed_nodes<'a, MSG>( patches.extend(remove_node_patches); } - patches + Ok(patches) } /// @@ -348,7 +408,7 @@ fn create_attribute_patches<'a, MSG>( old_attributes: &'a [Attribute], new_attributes: &'a [Attribute], path: &SkipPath, -) -> Vec> { +) -> Result>, DiffError> { let skip_indices = if let Some(skip_diff) = &path.skip_diff { if let SkipAttrs::Indices(skip_indices) = &skip_diff.skip_attrs { skip_indices.clone() @@ -365,7 +425,7 @@ fn create_attribute_patches<'a, MSG>( // return early if both attributes are empty if old_attributes.is_empty() && new_attributes.is_empty() { - return vec![]; + return Ok(vec![]); } let mut add_attributes: Vec<&Attribute> = vec![]; @@ -440,7 +500,7 @@ fn create_attribute_patches<'a, MSG>( remove_attributes, )); } - patches + Ok(patches) } /// returns true if all the elements in subset is in big_set diff --git a/crates/core/src/vdom/diff_lis.rs b/crates/core/src/vdom/diff_lis.rs index 8926a3d9b..b33f3973c 100644 --- a/crates/core/src/vdom/diff_lis.rs +++ b/crates/core/src/vdom/diff_lis.rs @@ -112,7 +112,7 @@ fn diff_keyed_ends<'a, MSG>( } let child_path = path.traverse(index); // diff the children and add to patches - let patches = diff_recursive(old, new, &child_path); + let patches = diff_recursive(old, new, &child_path).unwrap(); all_patches.extend(patches); old_index_matched.push(index); left_offset += 1; @@ -158,7 +158,7 @@ fn diff_keyed_ends<'a, MSG>( break; } let child_path = path.traverse(old_index); - let patches = diff_recursive(old, new, &child_path); + let patches: Vec> = diff_recursive(old, new, &child_path).unwrap(); all_patches.extend(patches); right_offset += 1; } @@ -281,11 +281,12 @@ fn diff_keyed_middle<'a, MSG>( } for idx in lis_sequence.iter() { - let patches = diff_recursive( + let patches: Vec> = diff_recursive( &old_children[new_index_to_old_index[*idx]], &new_children[*idx], path, - ); + ) + .unwrap(); all_patches.extend(patches); } @@ -301,7 +302,8 @@ fn diff_keyed_middle<'a, MSG>( if old_index == u32::MAX as usize { new_nodes.push(new_node); } else { - let patches = diff_recursive(&old_children[old_index], new_node, path); + let patches: Vec> = + diff_recursive(&old_children[old_index], new_node, path).unwrap(); all_patches.extend(patches); node_paths.push(path.traverse(left_offset + old_index).path); @@ -339,7 +341,8 @@ fn diff_keyed_middle<'a, MSG>( if old_index == u32::MAX as usize { new_nodes.push(new_node) } else { - let patches = diff_recursive(&old_children[old_index], new_node, path); + let patches: Vec> = + diff_recursive(&old_children[old_index], new_node, path).unwrap(); all_patches.extend(patches); } } @@ -363,7 +366,8 @@ fn diff_keyed_middle<'a, MSG>( if old_index == u32::MAX as usize { new_nodes.push(new_node); } else { - let patches = diff_recursive(&old_children[old_index], new_node, path); + let patches: Vec> = + diff_recursive(&old_children[old_index], new_node, path).unwrap(); all_patches.extend(patches); node_paths.push(path.traverse(left_offset + old_index).path); } diff --git a/crates/core/src/vdom/render.rs b/crates/core/src/vdom/render.rs index a757e512f..fe7cec22b 100644 --- a/crates/core/src/vdom/render.rs +++ b/crates/core/src/vdom/render.rs @@ -68,6 +68,7 @@ impl Node { pub fn render_to_string(&self) -> String { let mut buffer = String::new(); self.render_compressed(&mut buffer).expect("must render"); + //println!("render_to_string: {}", buffer); buffer } @@ -151,6 +152,8 @@ impl Element { let is_lone_child_text_node = children.len() == 1 && is_first_child_text_node; + let indent = indent + 1; + // do not indent if it is only text child node if is_lone_child_text_node { first_child @@ -159,8 +162,8 @@ impl Element { } else { // otherwise print all child nodes with each line and indented for child in self.children() { - maybe_indent(buffer, indent + 1, compressed)?; - child.render_with_indent(buffer, indent + 1, compressed)?; + maybe_indent(buffer, indent, compressed)?; + child.render_with_indent(buffer, indent, compressed)?; } } diff --git a/crates/html-parser/Cargo.toml b/crates/html-parser/Cargo.toml index 3fe9e8cfd..008b535df 100644 --- a/crates/html-parser/Cargo.toml +++ b/crates/html-parser/Cargo.toml @@ -16,3 +16,8 @@ sauron-core = { version = "0.61", path = "../core", features = ["with-lookup"] } log = "0.4" thiserror = "1.0.48" html-escape = "0.2.13" + +html5ever = "0.29.1" +markup5ever = "0.14.1" +xml5ever = "0.20.0" +markup5ever_rcdom = "0.5.0-unofficial" \ No newline at end of file diff --git a/crates/html-parser/src/lib.rs b/crates/html-parser/src/lib.rs index 2272928c7..aff32cdbc 100644 --- a/crates/html-parser/src/lib.rs +++ b/crates/html-parser/src/lib.rs @@ -1,36 +1,31 @@ #![deny(warnings)] -use rphtml::config::ParseOptions; -use rphtml::parser::Doc; -use rphtml::parser::NodeType; -use rphtml::types::BoxDynError; + +use markup5ever_rcdom::{NodeData, RcDom, SerializableHandle, Handle}; +use markup5ever::serialize::TraversalScope; +use html5ever::serialize::SerializeOpts; +use html5ever::{parse_fragment, serialize, QualName}; +use xml5ever::tendril::TendrilSink; +use markup5ever::{local_name, namespace_url, ns}; +// use std::rc::Rc; +// use std::cell::Cell; + use sauron_core::{ html::{attributes::*, lookup, *}, vdom::AttributeValue, vdom::Node, vdom::Value, }; -use std::fmt; -use std::io; -use std::ops::Deref; /// all the possible error when parsing html string #[derive(Debug, thiserror::Error)] pub enum ParseError { - /// io error - #[error("{0}")] - IoError(#[from] io::Error), - /// formatting error - #[error("{0}")] - FmtError(#[from] fmt::Error), - /// rphtml specific error - #[error("{0}")] - RpHtmlError(#[from] BoxDynError), - /// the tag is not a valid html #[error("Invalid tag: {0}")] InvalidTag(String), + #[error("Unable to find body tag in generated html document")] + NoBodyInParsedHtml, } -/// parse the html string and build a node tree +/// parse escaped html strings like "Hello world!" into "Hello world!" and then into a node tree pub fn raw_html(html: &str) -> Node { // decode html entitiesd back since it will be safely converted into text let html = html_escape::decode_html_entities(html); @@ -39,94 +34,129 @@ pub fn raw_html(html: &str) -> Node { .expect("must have a node") } -/// the document is not wrapped with html +/// parse none-escaped html strings as "Hello world!" into a node tree (see also raw_html(...)) pub fn parse_html(html: &str) -> Result>, ParseError> { - let doc = Doc::parse( - html, - ParseOptions { - case_sensitive_tagname: false, - allow_self_closing: true, - auto_fix_unclosed_tag: true, - auto_fix_unexpected_endtag: true, - auto_fix_unescaped_lt: true, - }, - )?; - process_node(doc.get_root_node().borrow().deref()) + let dom: RcDom = parse_fragment(RcDom::default(), Default::default(), + QualName::new(None, ns!(html), local_name!("div")), + vec![], +).one(html); + process_handle(&dom.document) + + // let dom: RcDom = parse_document(RcDom::default(), Default::default()).one(html); + // if let Some(body) = find_body(&dom.document) { + // let new_document = Rc::new(markup5ever_rcdom::Node { + // data: NodeData::Document, + // parent: Cell::new(None), + // children: body.children.clone(), + // }); + // process_handle(&new_document) + // } else { + // Err(ParseError::NoBodyInParsedHtml) + // } } +// Recursively find the element +// fn find_body(handle: &Handle) -> Option { +// match &handle.data { +// NodeData::Element { name, .. } if name.local.as_ref() == "body" => Some(handle.clone()), +// _ => { +// for child in handle.children.borrow().iter() { +// if let Some(body) = find_body(child) { +// return Some(body); +// } +// } +// None +// } +// } +// } + //TODO: This is not dealing with html symbols such as // `▲` // `▼` -fn process_node(node: &rphtml::parser::Node) -> Result>, ParseError> { - let content = if let Some(content) = &node.content { - let content = String::from_iter(content.iter()); - Some(content) - } else { - None - }; - - let mut child_nodes = if let Some(childs) = &node.childs { - childs - .iter() - .flat_map(|child| process_node(child.borrow().deref()).ok().flatten()) - .collect() - } else { - vec![] - }; +// similar to fn build_tree(&self, options: &RenderOptions, status: &mut RenderStatus, result: &mut Vec) { +fn process_handle(node: &Handle) -> Result>, ParseError> { + let children: Vec> = node + .children + .borrow() + .iter() + .filter_map(|child| process_handle(child).ok().flatten()) + .collect(); - match node.node_type { - NodeType::Tag => { - let tag = &node.meta.as_ref().expect("must have a tag"); - let tag_name = String::from_iter(tag.borrow().name.iter()); + match &node.data { + NodeData::Document => { + let child_nodes_len = children.len(); + match child_nodes_len { + 0 => Ok(Some(node_list([]))), + 1 => Ok(Some(children.into_iter().next().unwrap())), + _ => Ok(Some(node_list(children))), + } + } + NodeData::Text { contents } => { + let content = contents.borrow().to_string(); + Ok(Some(text(content))) + } + NodeData::Element { name, attrs, .. } => { + let tag_name = name.local.to_string(); + println!("tag_name: {}", tag_name); + + if tag_name == "pre".to_string() { + let mut buffer: Vec:: = vec![]; + let document: SerializableHandle = node.clone().into(); + let serialize_opts: SerializeOpts = SerializeOpts { + scripting_enabled: false, + traversal_scope: TraversalScope::ChildrenOnly(None), + create_missing_parent: false, + }; + + serialize(&mut buffer, &document, serialize_opts).expect("serialization failed"); + let writer_string = String::from_utf8(buffer).expect("Could not write buffer as string"); + println!("--- {} ---", writer_string); + let content: String = format!("
{}
", writer_string); + Ok(Some(text(content))) + } + else { if let Some(html_tag) = lookup::match_tag(&tag_name) { let is_self_closing = HTML_SC_TAGS.contains(&html_tag); - let attributes: Vec> = tag + let attributes: Vec> = attrs .borrow() - .attrs .iter() .filter_map(|attr| { - attr.key.as_ref().and_then(|key| { - let key = String::from_iter(key.content.iter()); - if let Some(attr_key) = lookup::match_attribute(&key) { - let value = if let Some(value) = &attr.value { - let value = String::from_iter(value.content.iter()); - AttributeValue::Simple(Value::from(value)) + let key = attr.name.local.to_string(); + if let Some(attr_key) = lookup::match_attribute(&key) { + let value = if key == "style" { + let raw_tokens: Vec = attr.value.split(';').map(|s| s.trim().to_string()).collect(); + let tokens: Vec