From db98d45e89ee4432896726e062afb7f38b65cfc3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 07:16:49 +0000 Subject: [PATCH 01/51] Add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..39a2b6e --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +} From 1f844048698b69e4520f4ff61703b85e9e5bbd30 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:23:43 +0000 Subject: [PATCH 02/51] chore(deps): update rust crate indoc to 2.0.3 --- Cargo.lock | 4 ++-- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4114dfb..3aa53ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -875,9 +875,9 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "761cde40c27e2a9877f8c928fd248b7eec9dd48623dd514b256858ca593fbba7" +checksum = "2c785eefb63ebd0e33416dfcb8d6da0bf27ce752843a45632a67bf10d4d4b5c4" [[package]] name = "insta" diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 8a7288a..d4426ff 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -28,6 +28,6 @@ anyhow = "1.0.70" toml = "0.7.4" [dev-dependencies] -indoc = "2.0.1" +indoc = "2.0.3" insta = "1.28.0" quote = "1.0.26" \ No newline at end of file From 45a7816128988e345ee1c9eb47c1773dc14efe07 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:24:30 +0000 Subject: [PATCH 03/51] chore(deps): update rust-wasm-bindgen monorepo --- Cargo.lock | 12 ++++++------ Cargo.toml | 4 ++-- crates/hirola-core/Cargo.toml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4114dfb..eef6ded 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2044,9 +2044,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.32" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2085,9 +2085,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-bindgen-test" -version = "0.3.32" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513df541345bb9fcc07417775f3d51bbb677daf307d8035c0afafd87dc2e6599" +checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" dependencies = [ "console_error_panic_hook", "js-sys", @@ -2099,9 +2099,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.32" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6150d36a03e90a3cf6c12650be10626a9902d70c5270fd47d7a47e5389a10d56" +checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" dependencies = [ "proc-macro2 1.0.63", "quote 1.0.28", diff --git a/Cargo.toml b/Cargo.toml index 6830a0f..508cb68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,8 +39,8 @@ form = ["hirola-form"] [dev-dependencies] -wasm-bindgen-test = "0.3.0" -wasm-bindgen = { version = "0.2.79" } +wasm-bindgen-test = "0.3.37" +wasm-bindgen = { version = "0.2.87" } hirola = { path = ".", features = ["app", "dom"] } futures-util = "0.3" web-sys = { version = "0.3", features = ["Document", "Node", "Element"] } diff --git a/crates/hirola-core/Cargo.toml b/crates/hirola-core/Cargo.toml index eca62cd..2de2ca3 100644 --- a/crates/hirola-core/Cargo.toml +++ b/crates/hirola-core/Cargo.toml @@ -18,7 +18,7 @@ html-escape = { version = "0.2.7", optional = true } hirola-macros = { path = "../hirola-macros", version = "0.3.1" } wasm-bindgen = { version = "0.2", optional = true } matchit = { version = "0.7", optional = true } -wasm-bindgen-futures = { optional = true, version = "0.4.29" } +wasm-bindgen-futures = { optional = true, version = "0.4.37" } futures-signals = "0.3.32" futures-util = "0.3" discard = "1" From f80f95b8e719db80947b827a12f4b7d9964ec481 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 02:48:49 +0000 Subject: [PATCH 04/51] fix(deps): update rust crate anyhow to 1.0.75 --- Cargo.lock | 4 ++-- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4114dfb..0bba6e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,9 +68,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "atty" diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 8a7288a..def41de 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -24,7 +24,7 @@ serde = { version = "1.0.163", features = [ "derive" ] } clap = { version = "4.1.11", features = ["derive"] } rayon = "1.7.0" glob = "0.3.1" -anyhow = "1.0.70" +anyhow = "1.0.75" toml = "0.7.4" [dev-dependencies] From 4836a31367c997f24d9f43b4541e4c87d5494897 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 02:49:13 +0000 Subject: [PATCH 05/51] fix(deps): update rust crate html-escape to 0.2.13 --- crates/hirola-core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/hirola-core/Cargo.toml b/crates/hirola-core/Cargo.toml index eca62cd..9b9d1f5 100644 --- a/crates/hirola-core/Cargo.toml +++ b/crates/hirola-core/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["wasm", "html", "dom", "web"] [dependencies] -html-escape = { version = "0.2.7", optional = true } +html-escape = { version = "0.2.13", optional = true } hirola-macros = { path = "../hirola-macros", version = "0.3.1" } wasm-bindgen = { version = "0.2", optional = true } matchit = { version = "0.7", optional = true } From 294d9a2760c46d21ad98b02bdba9f23f85aa4442 Mon Sep 17 00:00:00 2001 From: Collins Muriuki Date: Tue, 5 Sep 2023 18:24:03 +0300 Subject: [PATCH 06/51] Fix fake api example; add missing feature --- examples/fake-api/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/fake-api/Cargo.toml b/examples/fake-api/Cargo.toml index 49b050c..5289fbb 100644 --- a/examples/fake-api/Cargo.toml +++ b/examples/fake-api/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] anyhow = "1" -hirola = { path = "../../" } +hirola = { path = "../../", features = ["dom"] } serde = { version = "1.0.80", features = ["derive"] } reqwasm = "0.5.0" From d3e0a9048d71ba00a970b24b0100f7e11d860cda Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 05:50:02 +0000 Subject: [PATCH 07/51] fix(deps): update rust crate log to 0.4.20 --- Cargo.lock | 4 ++-- crates/hirola-core/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4114dfb..ace24b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1014,9 +1014,9 @@ checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "matches" diff --git a/crates/hirola-core/Cargo.toml b/crates/hirola-core/Cargo.toml index eca62cd..b143619 100644 --- a/crates/hirola-core/Cargo.toml +++ b/crates/hirola-core/Cargo.toml @@ -22,7 +22,7 @@ wasm-bindgen-futures = { optional = true, version = "0.4.29" } futures-signals = "0.3.32" futures-util = "0.3" discard = "1" -log = "0.4.6" +log = "0.4.20" serde = { version = "1", optional = true, features = ["derive", "rc"] } [dependencies.web-sys] From 6a163f22fe37d2b0c86dc3c769d55c58af1f3d97 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 05:50:37 +0000 Subject: [PATCH 08/51] fix(deps): update rust crate proc-macro2 to 1.0.66 --- Cargo.lock | 44 ++++++++++++++++----------------- crates/hirola-kit/Cargo.toml | 2 +- crates/hirola-macros/Cargo.toml | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4114dfb..02bd310 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -235,7 +235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 2.0.23", ] @@ -606,7 +606,7 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 2.0.23", ] @@ -802,7 +802,7 @@ dependencies = [ "insta", "leptosfmt-pretty-printer", "leptosfmt-prettyplease", - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "rayon", "rstml", @@ -820,7 +820,7 @@ dependencies = [ "paste", "proc-macro-error", "proc-macro-hack", - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "rstml", "syn 2.0.23", @@ -975,7 +975,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "378f8543271c41684f968e6a7478eae7b573d62e6cf3a5042efc45f9a7b9c815" dependencies = [ "leptosfmt-pretty-printer", - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "syn 2.0.23", ] @@ -1143,7 +1143,7 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 1.0.109", ] @@ -1215,7 +1215,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 1.0.109", "version_check", @@ -1227,7 +1227,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "version_check", ] @@ -1249,9 +1249,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -1262,7 +1262,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 2.0.23", "version_check", @@ -1293,7 +1293,7 @@ version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", ] [[package]] @@ -1483,7 +1483,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7afcc74cab5d3118523b1f75900e1fcbeae7cac6c6cb800430621bf58add0bd" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "proc-macro2-diagnostics", "quote 1.0.28", "syn 2.0.23", @@ -1576,7 +1576,7 @@ version = "1.0.166" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 2.0.23", ] @@ -1672,7 +1672,7 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "unicode-ident", ] @@ -1683,7 +1683,7 @@ version = "2.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "unicode-ident", ] @@ -1695,7 +1695,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8128874d02f9a114ade6d9ad252078cb32d3cb240e26477ac73d7e9c495c605e" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 2.0.23", ] @@ -1765,7 +1765,7 @@ version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 2.0.23", ] @@ -1991,7 +1991,7 @@ checksum = "0d577dfb8ca9440a5c0b053d5a19b68f5c92ef57064bac87c8205c3f6072c20f" dependencies = [ "if_chain", "lazy_static", - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "regex", "syn 1.0.109", @@ -2036,7 +2036,7 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 2.0.23", "wasm-bindgen-shared", @@ -2070,7 +2070,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", "syn 2.0.23", "wasm-bindgen-backend", @@ -2103,7 +2103,7 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6150d36a03e90a3cf6c12650be10626a9902d70c5270fd47d7a47e5389a10d56" dependencies = [ - "proc-macro2 1.0.63", + "proc-macro2 1.0.66", "quote 1.0.28", ] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 8a7288a..be3f6d4 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -14,7 +14,7 @@ leptosfmt-pretty-printer = "0.1.6" rstml = "0.10.6" syn = { version = "2.0.18", features = [ "visit", "full", "extra-traits" ] } leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } -proc-macro2 = { version = "1.0.52", features = [ "span-locations" ] } +proc-macro2 = { version = "1.0.66", features = [ "span-locations" ] } thiserror = "1.0.40" crop = "0.3.0" serde = { version = "1.0.163", features = [ "derive" ] } diff --git a/crates/hirola-macros/Cargo.toml b/crates/hirola-macros/Cargo.toml index 20a4c5e..28cdd52 100644 --- a/crates/hirola-macros/Cargo.toml +++ b/crates/hirola-macros/Cargo.toml @@ -17,7 +17,7 @@ proc-macro = true [dependencies] -proc-macro2 = "1.0.47" +proc-macro2 = "1.0.66" quote = "1.0.21" syn = "2.0.15" rstml = "0.10" From abedd65128b3d5d53d7d36713609858839e50620 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Sep 2023 20:28:34 +0300 Subject: [PATCH 09/51] fix(deps): update rust crate quote to 1.0.33 (#27) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 42 ++++++++++++++++----------------- crates/hirola-kit/Cargo.toml | 2 +- crates/hirola-macros/Cargo.toml | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 376e447..f4df4b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -236,7 +236,7 @@ checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", ] @@ -607,7 +607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", ] @@ -803,7 +803,7 @@ dependencies = [ "leptosfmt-pretty-printer", "leptosfmt-prettyplease", "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "rayon", "rstml", "serde", @@ -821,7 +821,7 @@ dependencies = [ "proc-macro-error", "proc-macro-hack", "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "rstml", "syn 2.0.23", "trybuild", @@ -1144,7 +1144,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 1.0.109", ] @@ -1216,7 +1216,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 1.0.109", "version_check", ] @@ -1228,7 +1228,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "version_check", ] @@ -1263,7 +1263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", "version_check", "yansi", @@ -1289,9 +1289,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2 1.0.66", ] @@ -1485,7 +1485,7 @@ checksum = "d7afcc74cab5d3118523b1f75900e1fcbeae7cac6c6cb800430621bf58add0bd" dependencies = [ "proc-macro2 1.0.66", "proc-macro2-diagnostics", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", "syn_derive", "thiserror", @@ -1577,7 +1577,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", ] @@ -1673,7 +1673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "unicode-ident", ] @@ -1684,7 +1684,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "unicode-ident", ] @@ -1696,7 +1696,7 @@ checksum = "8128874d02f9a114ade6d9ad252078cb32d3cb240e26477ac73d7e9c495c605e" dependencies = [ "proc-macro-error", "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", ] @@ -1766,7 +1766,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", ] @@ -1992,7 +1992,7 @@ dependencies = [ "if_chain", "lazy_static", "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "regex", "syn 1.0.109", "validator", @@ -2037,7 +2037,7 @@ dependencies = [ "log", "once_cell", "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", "wasm-bindgen-shared", ] @@ -2060,7 +2060,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote 1.0.28", + "quote 1.0.33", "wasm-bindgen-macro-support", ] @@ -2071,7 +2071,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", "syn 2.0.23", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -2104,7 +2104,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" dependencies = [ "proc-macro2 1.0.66", - "quote 1.0.28", + "quote 1.0.33", ] [[package]] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index c483678..c95c6bd 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -30,4 +30,4 @@ toml = "0.7.4" [dev-dependencies] indoc = "2.0.3" insta = "1.28.0" -quote = "1.0.26" \ No newline at end of file +quote = "1.0.33" \ No newline at end of file diff --git a/crates/hirola-macros/Cargo.toml b/crates/hirola-macros/Cargo.toml index 28cdd52..9183fe1 100644 --- a/crates/hirola-macros/Cargo.toml +++ b/crates/hirola-macros/Cargo.toml @@ -18,7 +18,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0.66" -quote = "1.0.21" +quote = "1.0.33" syn = "2.0.15" rstml = "0.10" proc-macro-error = "1.0" From 25b4785dc1722641a1e799f64133338585453baf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Oct 2023 07:10:40 +0300 Subject: [PATCH 10/51] fix(deps): update rust crate serde to 1.0.189 (#28) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 36 +++++++++++++++++------------------ crates/hirola-form/Cargo.toml | 2 +- crates/hirola-kit/Cargo.toml | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f4df4b5..fc2aabb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -237,7 +237,7 @@ dependencies = [ "heck", "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", ] [[package]] @@ -608,7 +608,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", ] [[package]] @@ -807,7 +807,7 @@ dependencies = [ "rayon", "rstml", "serde", - "syn 2.0.23", + "syn 2.0.32", "thiserror", "toml 0.7.6", ] @@ -823,7 +823,7 @@ dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", "rstml", - "syn 2.0.23", + "syn 2.0.32", "trybuild", ] @@ -976,7 +976,7 @@ checksum = "378f8543271c41684f968e6a7478eae7b573d62e6cf3a5042efc45f9a7b9c815" dependencies = [ "leptosfmt-pretty-printer", "proc-macro2 1.0.66", - "syn 2.0.23", + "syn 2.0.32", ] [[package]] @@ -1264,7 +1264,7 @@ checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", "version_check", "yansi", ] @@ -1486,7 +1486,7 @@ dependencies = [ "proc-macro2 1.0.66", "proc-macro2-diagnostics", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", "syn_derive", "thiserror", ] @@ -1553,9 +1553,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.166" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] @@ -1572,13 +1572,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.166" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", ] [[package]] @@ -1679,9 +1679,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", @@ -1697,7 +1697,7 @@ dependencies = [ "proc-macro-error", "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", ] [[package]] @@ -1767,7 +1767,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", ] [[package]] @@ -2038,7 +2038,7 @@ dependencies = [ "once_cell", "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", "wasm-bindgen-shared", ] @@ -2072,7 +2072,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2 1.0.66", "quote 1.0.33", - "syn 2.0.23", + "syn 2.0.32", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/crates/hirola-form/Cargo.toml b/crates/hirola-form/Cargo.toml index 76fa9a0..bd59bfd 100644 --- a/crates/hirola-form/Cargo.toml +++ b/crates/hirola-form/Cargo.toml @@ -16,7 +16,7 @@ hirola-core = { path = "../hirola-core", features = [ "dom", ], version = "0.3.1" } wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } -serde = { version = "1.0.80", features = ["derive"] } +serde = { version = "1.0.189", features = ["derive"] } serde_json = "1" json_dotpath = "1.1.0" diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index c95c6bd..fabd00c 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -17,7 +17,7 @@ leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } proc-macro2 = { version = "1.0.66", features = [ "span-locations" ] } thiserror = "1.0.40" crop = "0.3.0" -serde = { version = "1.0.163", features = [ "derive" ] } +serde = { version = "1.0.189", features = [ "derive" ] } # Deps for cli From a3560ade31df4b3f8166df59e6bc09897f7226da Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Oct 2023 07:11:05 +0300 Subject: [PATCH 11/51] fix(deps): update rust crate futures-signals to 0.3.33 (#29) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/hirola-core/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc2aabb..b8b499c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -613,9 +613,9 @@ dependencies = [ [[package]] name = "futures-signals" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a12cb78961d5c0bc0e358599bba98ec09201090a22339cd8ea27e815c11b25" +checksum = "3b175f2f6600dd81d92d20cf10872b03ea9df6b2513ca7f672341260dacb1ab2" dependencies = [ "discard", "futures-channel", diff --git a/crates/hirola-core/Cargo.toml b/crates/hirola-core/Cargo.toml index 44843be..22873db 100644 --- a/crates/hirola-core/Cargo.toml +++ b/crates/hirola-core/Cargo.toml @@ -19,7 +19,7 @@ hirola-macros = { path = "../hirola-macros", version = "0.3.1" } wasm-bindgen = { version = "0.2", optional = true } matchit = { version = "0.7", optional = true } wasm-bindgen-futures = { optional = true, version = "0.4.37" } -futures-signals = "0.3.32" +futures-signals = "0.3.33" futures-util = "0.3" discard = "1" log = "0.4.20" From e2ada9d25f93ce2192c2c50952d5b9fb3c668e8e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:58:07 +0300 Subject: [PATCH 12/51] fix(deps): update rust crate syn to 2.0.39 (#30) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 72 ++++++++++++++++----------------- crates/hirola-kit/Cargo.toml | 2 +- crates/hirola-macros/Cargo.toml | 2 +- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8b499c..27f6337 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -235,9 +235,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -606,9 +606,9 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -802,12 +802,12 @@ dependencies = [ "insta", "leptosfmt-pretty-printer", "leptosfmt-prettyplease", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", "rayon", "rstml", "serde", - "syn 2.0.32", + "syn 2.0.39", "thiserror", "toml 0.7.6", ] @@ -820,10 +820,10 @@ dependencies = [ "paste", "proc-macro-error", "proc-macro-hack", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", "rstml", - "syn 2.0.32", + "syn 2.0.39", "trybuild", ] @@ -975,8 +975,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "378f8543271c41684f968e6a7478eae7b573d62e6cf3a5042efc45f9a7b9c815" dependencies = [ "leptosfmt-pretty-printer", - "proc-macro2 1.0.66", - "syn 2.0.32", + "proc-macro2 1.0.69", + "syn 2.0.39", ] [[package]] @@ -1143,7 +1143,7 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", "syn 1.0.109", ] @@ -1215,7 +1215,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", "syn 1.0.109", "version_check", @@ -1227,7 +1227,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", "version_check", ] @@ -1249,9 +1249,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -1262,9 +1262,9 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", "version_check", "yansi", ] @@ -1293,7 +1293,7 @@ version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", ] [[package]] @@ -1483,10 +1483,10 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7afcc74cab5d3118523b1f75900e1fcbeae7cac6c6cb800430621bf58add0bd" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "proc-macro2-diagnostics", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", "syn_derive", "thiserror", ] @@ -1576,9 +1576,9 @@ version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -1672,18 +1672,18 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.32" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", "unicode-ident", ] @@ -1695,9 +1695,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8128874d02f9a114ade6d9ad252078cb32d3cb240e26477ac73d7e9c495c605e" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -1765,9 +1765,9 @@ version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", ] [[package]] @@ -1991,7 +1991,7 @@ checksum = "0d577dfb8ca9440a5c0b053d5a19b68f5c92ef57064bac87c8205c3f6072c20f" dependencies = [ "if_chain", "lazy_static", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", "regex", "syn 1.0.109", @@ -2036,9 +2036,9 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", "wasm-bindgen-shared", ] @@ -2070,9 +2070,9 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", - "syn 2.0.32", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2103,7 +2103,7 @@ version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" dependencies = [ - "proc-macro2 1.0.66", + "proc-macro2 1.0.69", "quote 1.0.33", ] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index fabd00c..7926355 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -12,7 +12,7 @@ description = "A CLI for hirola" [dependencies] leptosfmt-pretty-printer = "0.1.6" rstml = "0.10.6" -syn = { version = "2.0.18", features = [ "visit", "full", "extra-traits" ] } +syn = { version = "2.0.39", features = [ "visit", "full", "extra-traits" ] } leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } proc-macro2 = { version = "1.0.66", features = [ "span-locations" ] } thiserror = "1.0.40" diff --git a/crates/hirola-macros/Cargo.toml b/crates/hirola-macros/Cargo.toml index 9183fe1..bb345e9 100644 --- a/crates/hirola-macros/Cargo.toml +++ b/crates/hirola-macros/Cargo.toml @@ -19,7 +19,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0.66" quote = "1.0.33" -syn = "2.0.15" +syn = "2.0.39" rstml = "0.10" proc-macro-error = "1.0" proc-macro-hack = "0.5" From 60092e7095d42830b14f3b55bd680c5a117abb7d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:35:39 +0300 Subject: [PATCH 13/51] fix(deps): update rust crate thiserror to 1.0.50 (#31) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 27f6337..93ad80f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1752,18 +1752,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2 1.0.69", "quote 1.0.33", diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 7926355..6ec14a6 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -15,7 +15,7 @@ rstml = "0.10.6" syn = { version = "2.0.39", features = [ "visit", "full", "extra-traits" ] } leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } proc-macro2 = { version = "1.0.66", features = [ "span-locations" ] } -thiserror = "1.0.40" +thiserror = "1.0.50" crop = "0.3.0" serde = { version = "1.0.189", features = [ "derive" ] } From c8a2c89501c9052a1f640e2a738c43c76901fce7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:35:56 +0300 Subject: [PATCH 14/51] fix(deps): update rust crate toml to 0.8.8 (#32) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 22 +++++++++++----------- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93ad80f..d339c5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -809,7 +809,7 @@ dependencies = [ "serde", "syn 2.0.39", "thiserror", - "toml 0.7.6", + "toml 0.8.8", ] [[package]] @@ -1594,9 +1594,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -1843,9 +1843,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", @@ -1855,18 +1855,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.12" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap 2.0.0", "serde", @@ -2282,9 +2282,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.9" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a2094c43cc94775293eaa0e499fbc30048a6d824ac82c0351a8c0bf9112529" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 6ec14a6..42d5f0d 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -25,7 +25,7 @@ clap = { version = "4.1.11", features = ["derive"] } rayon = "1.7.0" glob = "0.3.1" anyhow = "1.0.75" -toml = "0.7.4" +toml = "0.8.8" [dev-dependencies] indoc = "2.0.3" From e9a84539af72d5aeca10b1edae8ad6e2d1562db6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:37:03 +0300 Subject: [PATCH 15/51] chore(deps): update rust crate insta to 1.34.0 (#34) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d339c5a..d7f53b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -881,9 +881,9 @@ checksum = "2c785eefb63ebd0e33416dfcb8d6da0bf27ce752843a45632a67bf10d4d4b5c4" [[package]] name = "insta" -version = "1.30.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28491f7753051e5704d4d0ae7860d45fae3238d7d235bc4289dcd45c48d3cec3" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" dependencies = [ "console", "lazy_static", diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 42d5f0d..4ee3a3c 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -29,5 +29,5 @@ toml = "0.8.8" [dev-dependencies] indoc = "2.0.3" -insta = "1.28.0" +insta = "1.34.0" quote = "1.0.33" \ No newline at end of file From 6d180aef1d69ce99e7cd9ef4de431187b92a018e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:37:20 +0300 Subject: [PATCH 16/51] fix(deps): update rust crate clap to 4.4.8 (#35) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 90 ++++++++---------------------------- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 21 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7f53b4..989ee27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,16 +19,15 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] @@ -58,9 +57,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -78,7 +77,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi 0.1.17", + "hermit-abi", "libc", "winapi", ] @@ -206,20 +205,19 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.11" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.3.11" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ "anstream", "anstyle", @@ -230,9 +228,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2 1.0.69", @@ -242,9 +240,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "cloudabi" @@ -267,7 +265,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "482aa5695bca086022be453c700a40c02893f1ba7098a2c88351de55341ae894" dependencies = [ - "clap 4.3.11", + "clap 4.4.8", "entities", "memchr", "once_cell", @@ -737,12 +735,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - [[package]] name = "hirola" version = "0.3.1" @@ -795,7 +787,7 @@ name = "hirola-kit" version = "0.1.1" dependencies = [ "anyhow", - "clap 4.3.11", + "clap 4.4.8", "crop", "glob", "indoc", @@ -892,28 +884,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.2", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.3", - "windows-sys 0.48.0", -] - [[package]] name = "itertools" version = "0.10.3" @@ -1000,12 +970,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.3" @@ -1078,7 +1042,7 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi 0.1.17", + "hermit-abi", "libc", ] @@ -1491,20 +1455,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - [[package]] name = "rustix" version = "0.38.3" @@ -1514,7 +1464,7 @@ dependencies = [ "bitflags 2.3.3", "errno", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys", "windows-sys 0.48.0", ] @@ -1733,11 +1683,11 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.37.23", + "rustix", "windows-sys 0.48.0", ] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 4ee3a3c..f156909 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.189", features = [ "derive" ] } # Deps for cli -clap = { version = "4.1.11", features = ["derive"] } +clap = { version = "4.4.8", features = ["derive"] } rayon = "1.7.0" glob = "0.3.1" anyhow = "1.0.75" From bcf5dc968ffbb87edb73ec4682dc315bcddd4ded Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:37:37 +0300 Subject: [PATCH 17/51] fix(deps): update rust crate rstml to v0.11.2 (#36) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/hirola-kit/Cargo.toml | 2 +- crates/hirola-macros/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 989ee27..7b84e46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1443,9 +1443,9 @@ dependencies = [ [[package]] name = "rstml" -version = "0.10.6" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afcc74cab5d3118523b1f75900e1fcbeae7cac6c6cb800430621bf58add0bd" +checksum = "fe542870b8f59dd45ad11d382e5339c9a1047cde059be136a7016095bbdefa77" dependencies = [ "proc-macro2 1.0.69", "proc-macro2-diagnostics", diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index f156909..04bd3e9 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -11,7 +11,7 @@ description = "A CLI for hirola" [dependencies] leptosfmt-pretty-printer = "0.1.6" -rstml = "0.10.6" +rstml = "0.11.2" syn = { version = "2.0.39", features = [ "visit", "full", "extra-traits" ] } leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } proc-macro2 = { version = "1.0.66", features = [ "span-locations" ] } diff --git a/crates/hirola-macros/Cargo.toml b/crates/hirola-macros/Cargo.toml index bb345e9..0342546 100644 --- a/crates/hirola-macros/Cargo.toml +++ b/crates/hirola-macros/Cargo.toml @@ -20,7 +20,7 @@ proc-macro = true proc-macro2 = "1.0.66" quote = "1.0.33" syn = "2.0.39" -rstml = "0.10" +rstml = "0.11" proc-macro-error = "1.0" proc-macro-hack = "0.5" paste = { version = "1" } From 588936c5504fb87cd5cb06c4465776a60273f5b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:39:11 +0300 Subject: [PATCH 18/51] chore(deps): update rust-wasm-bindgen monorepo (#40) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 41 ++++++++++++++++++----------------- Cargo.toml | 4 ++-- crates/hirola-core/Cargo.toml | 4 ++-- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b84e46..7817eb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -907,9 +907,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -1967,9 +1967,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if 1.0.0", "serde", @@ -1979,9 +1979,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", @@ -1994,9 +1994,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2006,9 +2006,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote 1.0.33", "wasm-bindgen-macro-support", @@ -2016,9 +2016,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2 1.0.69", "quote 1.0.33", @@ -2029,15 +2029,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-bindgen-test" -version = "0.3.37" +version = "0.3.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" +checksum = "c6433b7c56db97397842c46b67e11873eda263170afeb3a2dc74a7cb370fee0d" dependencies = [ "console_error_panic_hook", "js-sys", @@ -2049,19 +2049,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.37" +version = "0.3.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" +checksum = "493fcbab756bb764fa37e6bee8cec2dd709eb4273d06d0c282a5e74275ded735" dependencies = [ "proc-macro2 1.0.69", "quote 1.0.33", + "syn 2.0.39", ] [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 508cb68..c194c52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,8 +39,8 @@ form = ["hirola-form"] [dev-dependencies] -wasm-bindgen-test = "0.3.37" -wasm-bindgen = { version = "0.2.87" } +wasm-bindgen-test = "0.3.38" +wasm-bindgen = { version = "0.2.88" } hirola = { path = ".", features = ["app", "dom"] } futures-util = "0.3" web-sys = { version = "0.3", features = ["Document", "Node", "Element"] } diff --git a/crates/hirola-core/Cargo.toml b/crates/hirola-core/Cargo.toml index 22873db..f5a92ba 100644 --- a/crates/hirola-core/Cargo.toml +++ b/crates/hirola-core/Cargo.toml @@ -18,7 +18,7 @@ html-escape = { version = "0.2.13", optional = true } hirola-macros = { path = "../hirola-macros", version = "0.3.1" } wasm-bindgen = { version = "0.2", optional = true } matchit = { version = "0.7", optional = true } -wasm-bindgen-futures = { optional = true, version = "0.4.37" } +wasm-bindgen-futures = { optional = true, version = "0.4.38" } futures-signals = "0.3.33" futures-util = "0.3" discard = "1" @@ -38,7 +38,7 @@ features = [ "Window", ] optional = true -version = "0.3.64" +version = "0.3.65" [dev-dependencies] criterion = { version = "0.3", features = ["html_reports"] } From 4d19d0d4a973c13a3772287baaea4f46d29ab897 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:39:30 +0300 Subject: [PATCH 19/51] fix(deps): update rust crate proc-macro2 to 1.0.69 (#41) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- crates/hirola-kit/Cargo.toml | 2 +- crates/hirola-macros/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 04bd3e9..64ffef0 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -14,7 +14,7 @@ leptosfmt-pretty-printer = "0.1.6" rstml = "0.11.2" syn = { version = "2.0.39", features = [ "visit", "full", "extra-traits" ] } leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } -proc-macro2 = { version = "1.0.66", features = [ "span-locations" ] } +proc-macro2 = { version = "1.0.69", features = [ "span-locations" ] } thiserror = "1.0.50" crop = "0.3.0" serde = { version = "1.0.189", features = [ "derive" ] } diff --git a/crates/hirola-macros/Cargo.toml b/crates/hirola-macros/Cargo.toml index 0342546..64785a1 100644 --- a/crates/hirola-macros/Cargo.toml +++ b/crates/hirola-macros/Cargo.toml @@ -17,7 +17,7 @@ proc-macro = true [dependencies] -proc-macro2 = "1.0.66" +proc-macro2 = "1.0.69" quote = "1.0.33" syn = "2.0.39" rstml = "0.11" From 89a2c71de54acee7b8ca05c3e18c1e9e9e738723 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 14:02:43 +0300 Subject: [PATCH 20/51] chore(deps): update rust crate indoc to 2.0.4 (#37) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7817eb3..0c51825 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -867,9 +867,9 @@ dependencies = [ [[package]] name = "indoc" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c785eefb63ebd0e33416dfcb8d6da0bf27ce752843a45632a67bf10d4d4b5c4" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" [[package]] name = "insta" diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 64ffef0..3f674d5 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -28,6 +28,6 @@ anyhow = "1.0.75" toml = "0.8.8" [dev-dependencies] -indoc = "2.0.3" +indoc = "2.0.4" insta = "1.34.0" quote = "1.0.33" \ No newline at end of file From 348bc0c0b541ed18a3656d2e2370c1afae0ef555 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 14:03:04 +0300 Subject: [PATCH 21/51] fix(deps): update rust crate serde to 1.0.192 (#42) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/hirola-form/Cargo.toml | 2 +- crates/hirola-kit/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c51825..994303f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1503,9 +1503,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] @@ -1522,9 +1522,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2 1.0.69", "quote 1.0.33", diff --git a/crates/hirola-form/Cargo.toml b/crates/hirola-form/Cargo.toml index bd59bfd..e2df7e3 100644 --- a/crates/hirola-form/Cargo.toml +++ b/crates/hirola-form/Cargo.toml @@ -16,7 +16,7 @@ hirola-core = { path = "../hirola-core", features = [ "dom", ], version = "0.3.1" } wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } -serde = { version = "1.0.189", features = ["derive"] } +serde = { version = "1.0.192", features = ["derive"] } serde_json = "1" json_dotpath = "1.1.0" diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 3f674d5..1131720 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -17,7 +17,7 @@ leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } proc-macro2 = { version = "1.0.69", features = [ "span-locations" ] } thiserror = "1.0.50" crop = "0.3.0" -serde = { version = "1.0.189", features = [ "derive" ] } +serde = { version = "1.0.192", features = [ "derive" ] } # Deps for cli From 9c521961b255e523acab95fddfaf5caae5be5de7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 14:14:57 +0300 Subject: [PATCH 22/51] fix(deps): update rust crate crop to 0.4.0 (#43) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 994303f..547bc1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -355,9 +355,9 @@ dependencies = [ [[package]] name = "crop" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "959e53a6ca6070e1819d23930c0147cfc0de843451a3b3d78827130c00fb33d2" +checksum = "57e7b88784eea5a7895d70cde2535b36030ae387adde16a1d5c962c5ec5f273f" dependencies = [ "str_indices", ] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 1131720..8b73b4e 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -16,7 +16,7 @@ syn = { version = "2.0.39", features = [ "visit", "full", "extra-traits" ] } leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } proc-macro2 = { version = "1.0.69", features = [ "span-locations" ] } thiserror = "1.0.50" -crop = "0.3.0" +crop = "0.4.0" serde = { version = "1.0.192", features = [ "derive" ] } From 86d9a4d52dc03d1e24711cd6881e05841b8a211c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 14:15:12 +0300 Subject: [PATCH 23/51] fix(deps): update rust crate rayon to 1.8.0 (#44) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 30 ++++-------------------------- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 547bc1f..39ad2a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -362,16 +362,6 @@ dependencies = [ "str_indices", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -1036,16 +1026,6 @@ dependencies = [ "autocfg 1.1.0", ] -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "once_cell" version = "1.18.0" @@ -1368,9 +1348,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -1378,14 +1358,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 8b73b4e..a777baf 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -22,7 +22,7 @@ serde = { version = "1.0.192", features = [ "derive" ] } # Deps for cli clap = { version = "4.4.8", features = ["derive"] } -rayon = "1.7.0" +rayon = "1.8.0" glob = "0.3.1" anyhow = "1.0.75" toml = "0.8.8" From d2067647c28465f96983d269325a020f7e71bba3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:03:59 +0300 Subject: [PATCH 24/51] chore(deps): update actions/checkout action to v4 (#45) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/browser.yml | 2 +- .github/workflows/preview.yml | 2 +- .github/workflows/production.yml | 2 +- .github/workflows/unit.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/browser.yml b/.github/workflows/browser.yml index 1271927..ba633b2 100644 --- a/.github/workflows/browser.yml +++ b/.github/workflows/browser.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 646bffe..951e12e 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -10,7 +10,7 @@ jobs: Deploy-Predom: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: profile: minimal diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index d1ec358..ce68183 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -10,7 +10,7 @@ jobs: Deploy-Prooduction: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: profile: minimal diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 055bb2b..aa6782c 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -6,7 +6,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: profile: minimal From 908664c28d9c38c29004fd90361860e8b3cc8911 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:04:19 +0300 Subject: [PATCH 25/51] fix(deps): update rust crate serde to 1.0.193 (#46) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/hirola-form/Cargo.toml | 2 +- crates/hirola-kit/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39ad2a9..1cefde3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1481,9 +1481,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] @@ -1500,9 +1500,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2 1.0.69", "quote 1.0.33", diff --git a/crates/hirola-form/Cargo.toml b/crates/hirola-form/Cargo.toml index e2df7e3..93f0cf6 100644 --- a/crates/hirola-form/Cargo.toml +++ b/crates/hirola-form/Cargo.toml @@ -16,7 +16,7 @@ hirola-core = { path = "../hirola-core", features = [ "dom", ], version = "0.3.1" } wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } -serde = { version = "1.0.192", features = ["derive"] } +serde = { version = "1.0.193", features = ["derive"] } serde_json = "1" json_dotpath = "1.1.0" diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index a777baf..eb1316a 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -17,7 +17,7 @@ leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } proc-macro2 = { version = "1.0.69", features = [ "span-locations" ] } thiserror = "1.0.50" crop = "0.4.0" -serde = { version = "1.0.192", features = [ "derive" ] } +serde = { version = "1.0.193", features = [ "derive" ] } # Deps for cli From f8adf51f1c0f44e1e3dd3a0600ced9b0e6a24588 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:04:39 +0300 Subject: [PATCH 26/51] fix(deps): update rust crate proc-macro2 to 1.0.70 (#47) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 44 ++++++++++++++++----------------- crates/hirola-kit/Cargo.toml | 2 +- crates/hirola-macros/Cargo.toml | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1cefde3..7e88042 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -233,7 +233,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", ] @@ -594,7 +594,7 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", ] @@ -784,7 +784,7 @@ dependencies = [ "insta", "leptosfmt-pretty-printer", "leptosfmt-prettyplease", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rayon", "rstml", @@ -802,7 +802,7 @@ dependencies = [ "paste", "proc-macro-error", "proc-macro-hack", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rstml", "syn 2.0.39", @@ -935,7 +935,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "378f8543271c41684f968e6a7478eae7b573d62e6cf3a5042efc45f9a7b9c815" dependencies = [ "leptosfmt-pretty-printer", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "syn 2.0.39", ] @@ -1087,7 +1087,7 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -1159,7 +1159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", "version_check", @@ -1171,7 +1171,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "version_check", ] @@ -1193,9 +1193,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -1206,7 +1206,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", "version_check", @@ -1237,7 +1237,7 @@ version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", ] [[package]] @@ -1425,7 +1425,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe542870b8f59dd45ad11d382e5339c9a1047cde059be136a7016095bbdefa77" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "proc-macro2-diagnostics", "quote 1.0.33", "syn 2.0.39", @@ -1504,7 +1504,7 @@ version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", ] @@ -1600,7 +1600,7 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "unicode-ident", ] @@ -1611,7 +1611,7 @@ version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "unicode-ident", ] @@ -1623,7 +1623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8128874d02f9a114ade6d9ad252078cb32d3cb240e26477ac73d7e9c495c605e" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", ] @@ -1693,7 +1693,7 @@ version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", ] @@ -1919,7 +1919,7 @@ checksum = "0d577dfb8ca9440a5c0b053d5a19b68f5c92ef57064bac87c8205c3f6072c20f" dependencies = [ "if_chain", "lazy_static", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "regex", "syn 1.0.109", @@ -1964,7 +1964,7 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", "wasm-bindgen-shared", @@ -1998,7 +1998,7 @@ version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", "wasm-bindgen-backend", @@ -2031,7 +2031,7 @@ version = "0.3.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "493fcbab756bb764fa37e6bee8cec2dd709eb4273d06d0c282a5e74275ded735" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 2.0.39", ] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index eb1316a..09bbf24 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -14,7 +14,7 @@ leptosfmt-pretty-printer = "0.1.6" rstml = "0.11.2" syn = { version = "2.0.39", features = [ "visit", "full", "extra-traits" ] } leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } -proc-macro2 = { version = "1.0.69", features = [ "span-locations" ] } +proc-macro2 = { version = "1.0.70", features = [ "span-locations" ] } thiserror = "1.0.50" crop = "0.4.0" serde = { version = "1.0.193", features = [ "derive" ] } diff --git a/crates/hirola-macros/Cargo.toml b/crates/hirola-macros/Cargo.toml index 64785a1..98e5629 100644 --- a/crates/hirola-macros/Cargo.toml +++ b/crates/hirola-macros/Cargo.toml @@ -17,7 +17,7 @@ proc-macro = true [dependencies] -proc-macro2 = "1.0.69" +proc-macro2 = "1.0.70" quote = "1.0.33" syn = "2.0.39" rstml = "0.11" From b0852daf722660e87ef323dbd8053480faadb5a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:05:02 +0300 Subject: [PATCH 27/51] chore(deps): update rust-wasm-bindgen monorepo (#48) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 40 +++++++++++++++++------------------ Cargo.toml | 4 ++-- crates/hirola-core/Cargo.toml | 4 ++-- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e88042..455f062 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -897,9 +897,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -1945,9 +1945,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if 1.0.0", "serde", @@ -1957,9 +1957,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", @@ -1972,9 +1972,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1984,9 +1984,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote 1.0.33", "wasm-bindgen-macro-support", @@ -1994,9 +1994,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2 1.0.70", "quote 1.0.33", @@ -2007,15 +2007,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-bindgen-test" -version = "0.3.38" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6433b7c56db97397842c46b67e11873eda263170afeb3a2dc74a7cb370fee0d" +checksum = "2cf9242c0d27999b831eae4767b2a146feb0b27d332d553e605864acd2afd403" dependencies = [ "console_error_panic_hook", "js-sys", @@ -2027,9 +2027,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.38" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "493fcbab756bb764fa37e6bee8cec2dd709eb4273d06d0c282a5e74275ded735" +checksum = "794645f5408c9a039fd09f4d113cdfb2e7eba5ff1956b07bcf701cf4b394fe89" dependencies = [ "proc-macro2 1.0.70", "quote 1.0.33", @@ -2038,9 +2038,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index c194c52..143e70c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,8 +39,8 @@ form = ["hirola-form"] [dev-dependencies] -wasm-bindgen-test = "0.3.38" -wasm-bindgen = { version = "0.2.88" } +wasm-bindgen-test = "0.3.39" +wasm-bindgen = { version = "0.2.89" } hirola = { path = ".", features = ["app", "dom"] } futures-util = "0.3" web-sys = { version = "0.3", features = ["Document", "Node", "Element"] } diff --git a/crates/hirola-core/Cargo.toml b/crates/hirola-core/Cargo.toml index f5a92ba..9f3c4c7 100644 --- a/crates/hirola-core/Cargo.toml +++ b/crates/hirola-core/Cargo.toml @@ -18,7 +18,7 @@ html-escape = { version = "0.2.13", optional = true } hirola-macros = { path = "../hirola-macros", version = "0.3.1" } wasm-bindgen = { version = "0.2", optional = true } matchit = { version = "0.7", optional = true } -wasm-bindgen-futures = { optional = true, version = "0.4.38" } +wasm-bindgen-futures = { optional = true, version = "0.4.39" } futures-signals = "0.3.33" futures-util = "0.3" discard = "1" @@ -38,7 +38,7 @@ features = [ "Window", ] optional = true -version = "0.3.65" +version = "0.3.66" [dev-dependencies] criterion = { version = "0.3", features = ["html_reports"] } From 1a17af97d6ab033c8851dbbe6804c18148d15f02 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 22:05:23 +0300 Subject: [PATCH 28/51] fix(deps): update rust crate clap to 4.4.11 (#49) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 455f062..13e5415 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive", @@ -215,9 +215,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", @@ -265,7 +265,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "482aa5695bca086022be453c700a40c02893f1ba7098a2c88351de55341ae894" dependencies = [ - "clap 4.4.8", + "clap 4.4.11", "entities", "memchr", "once_cell", @@ -777,7 +777,7 @@ name = "hirola-kit" version = "0.1.1" dependencies = [ "anyhow", - "clap 4.4.8", + "clap 4.4.11", "crop", "glob", "indoc", diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index 09bbf24..e287a17 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.193", features = [ "derive" ] } # Deps for cli -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.11", features = ["derive"] } rayon = "1.8.0" glob = "0.3.1" anyhow = "1.0.75" From d6b181133ccf7e54bd215f6f2c6f20e6028a9335 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 07:30:55 +0300 Subject: [PATCH 29/51] fix(deps): update rust crate crop to 0.4.1 (#50) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/hirola-kit/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13e5415..6eb0eef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -355,9 +355,9 @@ dependencies = [ [[package]] name = "crop" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e7b88784eea5a7895d70cde2535b36030ae387adde16a1d5c962c5ec5f273f" +checksum = "0f7cba78cdac608a5e2e645de47e566c0f63e1b6110318736581ec97d5669767" dependencies = [ "str_indices", ] diff --git a/crates/hirola-kit/Cargo.toml b/crates/hirola-kit/Cargo.toml index e287a17..c161267 100644 --- a/crates/hirola-kit/Cargo.toml +++ b/crates/hirola-kit/Cargo.toml @@ -16,7 +16,7 @@ syn = { version = "2.0.39", features = [ "visit", "full", "extra-traits" ] } leptosfmt-prettyplease = { features = [ "verbatim" ], version = "0.2.11" } proc-macro2 = { version = "1.0.70", features = [ "span-locations" ] } thiserror = "1.0.50" -crop = "0.4.0" +crop = "0.4.1" serde = { version = "1.0.193", features = [ "derive" ] } From 6418692be62bcfdeb4e0769b1d93e22af67bec86 Mon Sep 17 00:00:00 2001 From: Geoffrey Mureithi <95377562+geofmureithi@users.noreply.github.com> Date: Sat, 9 Dec 2023 10:55:53 +0300 Subject: [PATCH 30/51] refactor crates and api (#51) * refactor: improve the api * refactor: major changes in the codebase * improvements: in api * improvements: in the api * add: fix failing tests * docs: improve docs * fix: updated api * fix: missing doc imports * fix: missing field * fix: add fixes and examples * fix: failing compilation * clippy: lint * clippy: even more * fix: templating * fix: refactor atribute signal --- .github/workflows/browser.yml | 12 +- .github/workflows/unit.yml | 6 +- Cargo.lock | 1483 +++++++++++------ Cargo.toml | 34 +- README.md | 4 +- crates/hirola-core/Cargo.toml | 56 +- crates/hirola-core/src/callback.rs | 58 +- crates/hirola-core/src/dom.rs | 163 -- crates/hirola-core/src/effect.rs | 8 +- crates/hirola-core/src/generic_node.rs | 57 +- .../hirola-core/src/generic_node/dom_node.rs | 189 --- crates/hirola-core/src/lib.rs | 132 +- crates/hirola-core/src/mixin.rs | 79 + crates/hirola-core/src/mixins.rs | 133 -- crates/hirola-core/src/render.rs | 163 +- crates/hirola-core/src/templating/flow.rs | 70 +- crates/hirola-core/src/templating/mod.rs | 1 - crates/hirola-core/src/templating/suspense.rs | 50 +- crates/hirola-core/src/templating/switch.rs | 44 +- crates/hirola-core/tests/.DS_Store | Bin 6148 -> 0 bytes crates/hirola-core/tests/ssr/main.rs | 51 - crates/hirola-dom/Cargo.toml | 34 + .../src/app/mod.rs | 103 +- .../src/app/router.rs | 88 +- crates/hirola-dom/src/lib.rs | 365 ++++ crates/hirola-dom/src/mixins.rs | 51 + .../noderef.rs => hirola-dom/src/node_ref.rs} | 33 +- .../tests/integration/keyed.rs | 0 .../tests/integration/main.rs | 9 +- .../tests/integration/non_keyed.rs | 16 +- .../tests/integration/router.rs | 20 +- crates/hirola-form/Cargo.toml | 5 +- crates/hirola-form/src/bind.rs | 7 +- crates/hirola-form/src/lib.rs | 26 +- crates/hirola-kit/src/formatter/format/mod.rs | 1 + crates/hirola-macros/Cargo.toml | 3 +- crates/hirola-macros/src/component.rs | 18 +- crates/hirola-macros/src/lib.rs | 187 ++- crates/hirola-macros/tests/component.rs | 14 +- crates/hirola-macros/tests/lib.rs | 4 +- crates/hirola-ssr/Cargo.toml | 15 + .../ssr_node.rs => hirola-ssr/src/lib.rs} | 104 +- examples/axum/Cargo.toml | 13 + examples/axum/src/layout.rs | 113 ++ examples/axum/src/main.rs | 86 + examples/canvas/Cargo.toml | 5 +- examples/canvas/src/main.rs | 6 +- examples/canvas/src/tool.rs | 9 +- examples/counter/Cargo.toml | 19 +- examples/counter/src/main.rs | 23 +- examples/docs/Cargo.toml | 5 +- examples/docs/src/components/logo.rs | 4 +- examples/docs/src/components/side_bar.rs | 4 +- examples/docs/src/main.rs | 17 +- examples/docs/src/pages/index.md | 9 +- examples/fake-api/src/main.rs | 5 +- examples/form/Cargo.toml | 3 +- examples/form/src/main.rs | 46 +- examples/mixin/Cargo.toml | 11 +- examples/mixin/src/main.rs | 52 +- examples/{todo => todo-mvc}/.gitignore | 0 examples/todo-mvc/Cargo.toml | 17 + examples/todo-mvc/index.html | 13 + examples/todo-mvc/src/main.rs | 275 +++ examples/todo-mvc/src/todo.rs | 174 ++ examples/todo/.DS_Store | Bin 6148 -> 0 bytes examples/todo/Cargo.toml | 19 - examples/todo/index.html | 12 - examples/todo/src/main.rs | 191 --- examples/x-for/Cargo.toml | 4 +- examples/x-for/src/main.rs | 56 +- src/lib.rs | 21 +- tests/browser.rs | 18 +- 73 files changed, 3014 insertions(+), 2112 deletions(-) delete mode 100644 crates/hirola-core/src/dom.rs delete mode 100644 crates/hirola-core/src/generic_node/dom_node.rs create mode 100644 crates/hirola-core/src/mixin.rs delete mode 100644 crates/hirola-core/src/mixins.rs delete mode 100644 crates/hirola-core/tests/.DS_Store delete mode 100644 crates/hirola-core/tests/ssr/main.rs create mode 100644 crates/hirola-dom/Cargo.toml rename crates/{hirola-core => hirola-dom}/src/app/mod.rs (79%) rename crates/{hirola-core => hirola-dom}/src/app/router.rs (89%) create mode 100644 crates/hirola-dom/src/lib.rs create mode 100644 crates/hirola-dom/src/mixins.rs rename crates/{hirola-core/src/templating/noderef.rs => hirola-dom/src/node_ref.rs} (68%) rename crates/{hirola-core => hirola-dom}/tests/integration/keyed.rs (100%) rename crates/{hirola-core => hirola-dom}/tests/integration/main.rs (92%) rename crates/{hirola-core => hirola-dom}/tests/integration/non_keyed.rs (90%) rename crates/{hirola-core => hirola-dom}/tests/integration/router.rs (88%) create mode 100644 crates/hirola-ssr/Cargo.toml rename crates/{hirola-core/src/generic_node/ssr_node.rs => hirola-ssr/src/lib.rs} (79%) create mode 100644 examples/axum/Cargo.toml create mode 100644 examples/axum/src/layout.rs create mode 100644 examples/axum/src/main.rs rename examples/{todo => todo-mvc}/.gitignore (100%) create mode 100644 examples/todo-mvc/Cargo.toml create mode 100644 examples/todo-mvc/index.html create mode 100644 examples/todo-mvc/src/main.rs create mode 100644 examples/todo-mvc/src/todo.rs delete mode 100644 examples/todo/.DS_Store delete mode 100644 examples/todo/Cargo.toml delete mode 100644 examples/todo/index.html delete mode 100644 examples/todo/src/main.rs diff --git a/.github/workflows/browser.yml b/.github/workflows/browser.yml index ba633b2..d20b7c0 100644 --- a/.github/workflows/browser.yml +++ b/.github/workflows/browser.yml @@ -11,9 +11,9 @@ jobs: - name: Install run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - run: wasm-pack test --headless --chrome --features dom,app - working-directory: crates/hirola-core - - run: wasm-pack test --headless --firefox --features dom,app - working-directory: crates/hirola-core - - run: wasm-pack test --headless --chrome --features dom,app - - run: wasm-pack test --headless --firefox --features dom,app + - run: wasm-pack test --headless --chrome + working-directory: crates/hirola-dom + - run: wasm-pack test --headless --firefox + working-directory: crates/hirola-dom + - run: wasm-pack test --headless --chrome + - run: wasm-pack test --headless --firefox diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index aa6782c..b4323e6 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -12,10 +12,14 @@ jobs: profile: minimal toolchain: stable override: true - - run: cargo test --features dom,app + - run: cargo test working-directory: crates/hirola-core - run: cargo test working-directory: crates/hirola-macros + - run: cargo test + working-directory: crates/hirola-dom + - run: cargo test + working-directory: crates/hirola-ssr - run: cargo test working-directory: crates/hirola-kit - run: cargo test diff --git a/Cargo.lock b/Cargo.lock index 6eb0eef..08f1913 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -10,18 +19,18 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -33,36 +42,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -71,34 +80,127 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "async-trait" +version = "0.1.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] [[package]] name = "autocfg" -version = "0.1.7" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "autocfg" -version = "1.1.0" +name = "axum" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "202651474fe73c62d9e0a56c6133f7a0ff1dc1c8cf7a5b03381af2a26553ac9d" +dependencies = [ + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77cb22c689c44d4c07b0ab44ebc25d69d8ae601a2f28fb8d672d344178fa17aa" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-example" +version = "0.1.0" +dependencies = [ + "axum", + "hirola", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "base64" -version = "0.21.2" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + +[[package]] +name = "basic-toml" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" +dependencies = [ + "serde", +] [[package]] name = "bincode" @@ -132,27 +234,21 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] -name = "bstr" -version = "0.2.15" +name = "bumpalo" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata 0.1.10", - "serde", -] +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] -name = "bumpalo" -version = "3.13.0" +name = "bytes" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "canvas" @@ -172,15 +268,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "0.1.10" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -233,8 +326,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", ] @@ -244,15 +337,6 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "colorchoice" version = "1.0.0" @@ -292,11 +376,11 @@ dependencies = [ [[package]] name = "console_error_panic_hook" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "wasm-bindgen", ] @@ -304,8 +388,10 @@ dependencies = [ name = "counter" version = "0.1.0" dependencies = [ + "gloo-timers", "hirola", "wasm-bindgen-test", + "web-sys", ] [[package]] @@ -314,7 +400,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -368,7 +454,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -379,8 +465,8 @@ version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ - "autocfg 1.1.0", - "cfg-if 1.0.0", + "autocfg", + "cfg-if", "crossbeam-utils", "memoffset", "scopeguard", @@ -392,42 +478,44 @@ version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] name = "csv" -version = "1.1.6" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" dependencies = [ - "bstr", "csv-core", - "itoa 0.4.8", + "itoa", "ryu", "serde", ] [[package]] name = "csv-core" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" dependencies = [ "memchr", ] [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +dependencies = [ + "powerfmt", +] [[package]] name = "deunicode" -version = "0.4.4" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95203a6a50906215a502507c0f879a0ce7ff205a6111e2db2a5ef8e4bb92e43" +checksum = "6a1abaf4d861455be59f64fd2b55606cb151fce304ede7165f410243ce96bde6" [[package]] name = "discard" @@ -448,15 +536,18 @@ dependencies = [ [[package]] name = "document-features" -version = "0.2.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d99bbe945402eb228b85cdfc7020cf7422574976861c642b28255d0a49606d79" +checksum = "e493c573fce17f00dcab13b6ac057994f3ce17d1af4dc39bfd482b83c6eb6157" +dependencies = [ + "litrs", +] [[package]] name = "either" -version = "1.6.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encode_unicode" @@ -472,29 +563,18 @@ checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -520,9 +600,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -539,6 +619,7 @@ name = "form" version = "0.1.0" dependencies = [ "hirola", + "hirola-form", "serde", "serde_json", "validator", @@ -549,11 +630,10 @@ dependencies = [ [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "matches", "percent-encoding", ] @@ -567,35 +647,29 @@ dependencies = [ "serde_yaml", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", ] @@ -617,21 +691,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-core", "futures-macro", @@ -643,16 +717,33 @@ dependencies = [ [[package]] name = "gensym" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb328fe25cbf075818a3e57bb5ee39b49b4f26c94d685356426154c5962cccd" +checksum = "913dce4c5f06c2ea40fc178c06f777ac89fc6b1383e90c254fafb1abe4ba3c82" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "quote", + "syn 2.0.39", "uuid", ] +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + [[package]] name = "glob" version = "0.3.1" @@ -679,6 +770,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "gloo-utils" version = "0.1.7" @@ -692,6 +795,25 @@ dependencies = [ "web-sys", ] +[[package]] +name = "h2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d308f63daf4181410c242d34c11f928dcb3aa105852019e043c9d1f4e4368a" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "1.8.2" @@ -706,9 +828,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -718,13 +840,19 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + [[package]] name = "hirola" version = "0.3.1" @@ -733,8 +861,9 @@ dependencies = [ "futures-util", "hirola", "hirola-core", - "hirola-form", + "hirola-dom", "hirola-macros", + "hirola-ssr", "wasm-bindgen", "wasm-bindgen-test", "web-sys", @@ -745,15 +874,22 @@ name = "hirola-core" version = "0.3.1" dependencies = [ "criterion", - "discard", "futures-signals", "futures-util", "hirola", - "hirola-macros", - "html-escape", + "wasm-bindgen-test", + "web-sys", +] + +[[package]] +name = "hirola-dom" +version = "0.3.1" +dependencies = [ + "discard", + "hirola", + "hirola-core", "log", "matchit", - "serde", "wasm-bindgen", "wasm-bindgen-futures", "wasm-bindgen-test", @@ -765,6 +901,7 @@ name = "hirola-form" version = "0.3.1" dependencies = [ "hirola-core", + "hirola-dom", "json_dotpath", "serde", "serde_json", @@ -784,14 +921,14 @@ dependencies = [ "insta", "leptosfmt-pretty-printer", "leptosfmt-prettyplease", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "rayon", "rstml", "serde", "syn 2.0.39", "thiserror", - "toml 0.8.8", + "toml", ] [[package]] @@ -799,16 +936,27 @@ name = "hirola-macros" version = "0.3.1" dependencies = [ "hirola", + "hirola-ssr", "paste", "proc-macro-error", "proc-macro-hack", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "rstml", "syn 2.0.39", "trybuild", ] +[[package]] +name = "hirola-ssr" +version = "0.3.1" +dependencies = [ + "hirola", + "hirola-core", + "html-escape", + "wasm-bindgen-test", +] + [[package]] name = "html-escape" version = "0.2.13" @@ -818,6 +966,91 @@ dependencies = [ "utf8-width", ] +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403f9214f3e703236b221f1a9cd88ec8b4adfa5296de01ab96216361f4692f56" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca339002caeb0d159cc6e023dff48e199f081e42fa039895c7c6f38b37f2e9d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", +] + [[package]] name = "idna" version = "0.2.3" @@ -829,6 +1062,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "if_chain" version = "1.0.2" @@ -841,18 +1084,18 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "autocfg 1.1.0", + "autocfg", "hashbrown 0.12.3", ] [[package]] name = "indexmap" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.3", ] [[package]] @@ -876,24 +1119,18 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] name = "itoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" - -[[package]] -name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" @@ -924,26 +1161,26 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "leptosfmt-pretty-printer" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc570d5bcaa4786e36be800c3b1a243e98e228ba0ca9493f022f4dea03d5b041" +checksum = "a0475000ed93fad1551072993d00c776266397188a0319abf2bdfad1734cd647" [[package]] name = "leptosfmt-prettyplease" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "378f8543271c41684f968e6a7478eae7b573d62e6cf3a5042efc45f9a7b9c815" +checksum = "db565cf80f894a9435f045fe1c1211051f97d3e9f074635538a2cf689b29191f" dependencies = [ "leptosfmt-pretty-printer", - "proc-macro2 1.0.70", + "proc-macro2", "syn 2.0.39", ] [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "line-wrap" @@ -962,33 +1199,58 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] -name = "log" -version = "0.4.20" +name = "litrs" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "f9275e0933cf8bb20f008924c0cb07a0692fe54d8064996520bf998de9eb79aa" [[package]] -name = "matches" -version = "0.1.9" +name = "lock_api" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matchit" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -996,9 +1258,15 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1008,6 +1276,17 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + [[package]] name = "mixin" version = "0.1.0" @@ -1017,20 +1296,49 @@ dependencies = [ "web-sys", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "autocfg 1.1.0", + "hermit-abi 0.3.3", + "libc", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "onig" @@ -1060,43 +1368,72 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + [[package]] name = "paste" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 2.0.39", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1112,12 +1449,12 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plist" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdc0001cfea3db57a2e24bc0d818e9e20e554b5f97fabb9bc231dc240269ae06" +checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64", - "indexmap 1.9.3", + "indexmap 2.1.0", "line-wrap", "quick-xml", "serde", @@ -1126,9 +1463,9 @@ dependencies = [ [[package]] name = "plotters" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9428003b84df1496fb9d6eeee9c5f8145cb41ca375eb0dad204328888832811f" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ "num-traits", "plotters-backend", @@ -1139,19 +1476,25 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] name = "plotters-svg" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0918736323d1baff32ee0eade54984f6f201ad7e97d5cfb5d6ab4a358529615" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" dependencies = [ "plotters-backend", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1159,8 +1502,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", "version_check", ] @@ -1171,8 +1514,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "version_check", ] @@ -1182,15 +1525,6 @@ version = "0.5.20+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid", -] - [[package]] name = "proc-macro2" version = "1.0.70" @@ -1202,12 +1536,12 @@ dependencies = [ [[package]] name = "proc-macro2-diagnostics" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", "version_check", "yansi", @@ -1215,135 +1549,20 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.70", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha", - "rand_core 0.4.2", - "rand_hc", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", + "proc-macro2", ] [[package]] @@ -1367,24 +1586,24 @@ dependencies = [ ] [[package]] -name = "rdrand" -version = "0.4.0" +name = "redox_syscall" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "rand_core 0.3.1", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.4", - "regex-syntax", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -1392,23 +1611,38 @@ name = "regex-automata" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] [[package]] name = "regex-automata" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.2", ] [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwasm" @@ -1425,32 +1659,44 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe542870b8f59dd45ad11d382e5339c9a1047cde059be136a7016095bbdefa77" dependencies = [ - "proc-macro2 1.0.70", + "proc-macro2", "proc-macro2-diagnostics", - "quote 1.0.33", + "quote", "syn 2.0.39", "syn_derive", "thiserror", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustix" -version = "0.38.3" +version = "0.38.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +checksum = "bfeae074e687625746172d639330f1de242a178bf3189b51e35a7a21573513ac" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safemem" @@ -1469,15 +1715,15 @@ dependencies = [ [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" @@ -1504,22 +1750,32 @@ version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ - "itoa 1.0.9", + "itoa", "ryu", "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.4" @@ -1529,6 +1785,18 @@ dependencies = [ "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 = "serde_yaml" version = "0.8.26" @@ -1541,41 +1809,76 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shell-words" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + [[package]] name = "similar" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] name = "slug" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" +checksum = "3bd94acec9c8da640005f8e135a39fc0372e74535e6b368b7a04b875f784c8c4" dependencies = [ "deunicode", + "wasm-bindgen", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", ] [[package]] name = "str_indices" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f026164926842ec52deb1938fae44f83dfdb82d0a5b0270c5bd5935ab74d6dd" +checksum = "e9557cb6521e8d009c51a8666f09356f4b817ba9ba0981a305bd86aee47bd35c" [[package]] name = "strsim" @@ -1584,14 +1887,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] -name = "syn" -version = "0.15.44" +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid", + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.39", ] [[package]] @@ -1600,8 +1914,8 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "unicode-ident", ] @@ -1611,23 +1925,29 @@ version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "unicode-ident", ] [[package]] name = "syn_derive" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8128874d02f9a114ade6d9ad252078cb32d3cb240e26477ac73d7e9c495c605e" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "syntect" version = "5.1.0" @@ -1642,7 +1962,7 @@ dependencies = [ "once_cell", "onig", "plist", - "regex-syntax", + "regex-syntax 0.7.5", "serde", "serde_json", "thiserror", @@ -1652,9 +1972,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -1693,19 +2013,30 @@ version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", ] +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" -version = "0.3.25" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", - "itoa 1.0.9", + "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -1713,15 +2044,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -1747,26 +2078,64 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] -name = "todo" +name = "todo-mvc" version = "0.1.0" dependencies = [ "hirola", + "serde", + "serde_json", + "strum", "wasm-bindgen", "web-sys", ] [[package]] -name = "toml" -version = "0.5.9" +name = "tokio" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" dependencies = [ - "serde", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", ] [[package]] @@ -1796,26 +2165,116 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + [[package]] name = "trybuild" -version = "1.0.63" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764b9e244b482a9b81bde596aa37aa6f1347bf8007adab25e59f901b32b4e0a0" +checksum = "196a58260a906cedb9bf6d8034b6379d0c11f552416960452f267402ceeddff1" dependencies = [ + "basic-toml", "glob", "once_cell", "serde", "serde_derive", "serde_json", "termcolor", - "toml 0.5.9", ] [[package]] @@ -1826,36 +2285,30 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "unicode-xid" -version = "0.1.0" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode_categories" @@ -1865,21 +2318,20 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "url" -version = "2.2.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", - "matches", + "idna 0.5.0", "percent-encoding", ] [[package]] name = "utf8-width" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "utf8parse" @@ -1889,11 +2341,11 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "0.7.4" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ - "rand", + "getrandom", ] [[package]] @@ -1902,7 +2354,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e60fadf92c22236de4028ceb0b8af50ed3430d41ad43d7a7d63b6bd1a8f47c38" dependencies = [ - "idna", + "idna 0.2.3", "lazy_static", "regex", "serde", @@ -1919,13 +2371,19 @@ checksum = "0d577dfb8ca9440a5c0b053d5a19b68f5c92ef57064bac87c8205c3f6072c20f" dependencies = [ "if_chain", "lazy_static", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "regex", "syn 1.0.109", "validator", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "version_check" version = "0.9.4" @@ -1934,22 +2392,27 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", - "winapi", "winapi-util", ] +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "wasm-bindgen" version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "serde", "serde_json", "wasm-bindgen-macro", @@ -1964,8 +2427,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", "wasm-bindgen-shared", ] @@ -1976,7 +2439,7 @@ version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -1988,7 +2451,7 @@ version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ - "quote 1.0.33", + "quote", "wasm-bindgen-macro-support", ] @@ -1998,8 +2461,8 @@ version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -2031,8 +2494,8 @@ version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "794645f5408c9a039fd09f4d113cdfb2e7eba5ff1956b07bcf701cf4b394fe89" dependencies = [ - "proc-macro2 1.0.70", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 2.0.39", ] @@ -2064,9 +2527,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -2092,7 +2555,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -2112,17 +2584,32 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -2133,9 +2620,15 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -2145,9 +2638,15 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -2157,9 +2656,15 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -2169,9 +2674,15 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -2181,9 +2692,15 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -2193,9 +2710,15 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -2205,15 +2728,21 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" dependencies = [ "memchr", ] @@ -2244,6 +2773,6 @@ dependencies = [ [[package]] name = "yansi" -version = "0.5.1" +version = "1.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" diff --git a/Cargo.toml b/Cargo.toml index 143e70c..093748f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,35 +13,24 @@ edition = "2021" [dependencies] hirola-core = { path = "crates/hirola-core", version = "0.3.1" } hirola-macros = { path = "crates/hirola-macros", version = "0.3.1" } -hirola-form = { path = "crates/hirola-form", version = "0.3.1", optional = true } - +hirola-dom = { path = "crates/hirola-dom", version = "0.3.1", optional = true } +hirola-ssr = { path = "crates/hirola-ssr", version = "0.3.1", optional = true } [features] -default = ["hirola-core/default"] - - -## Enables dom based rendering -dom = ["hirola-core/dom"] +default = ["dom"] +## Enables browser based rendering including websys and wasmbindgen +dom = ["hirola-dom"] -# ## Enables serialization of state -serde = ["hirola-core/serde"] - -## Enables server side reendering -ssr = ["hirola-core/ssr"] - -## Enables app features like isomorphic routing -app = ["hirola-core/app"] +## Enables server side rendering +ssr = ["hirola-ssr"] docsrs = ["document-features"] -## Enables form mixins and utilities -form = ["hirola-form"] - [dev-dependencies] wasm-bindgen-test = "0.3.39" wasm-bindgen = { version = "0.2.89" } -hirola = { path = ".", features = ["app", "dom"] } +hirola = { path = "." } futures-util = "0.3" web-sys = { version = "0.3", features = ["Document", "Node", "Element"] } @@ -51,8 +40,11 @@ members = [ "crates/hirola-macros", "crates/hirola-form", "crates/hirola-kit", + "crates/hirola-ssr", + "crates/hirola-dom", + "examples/axum", "examples/counter", - "examples/todo", + "examples/todo-mvc", "examples/canvas", "examples/fake-api", "examples/chartjs", @@ -71,7 +63,7 @@ optional = true # defines the configuration attribute `docsrs` rustdoc-args = ["--cfg", "docsrs"] default-target = "wasm32-unknown-unknown" -features = ["app", "dom", "serde", "docsrs"] +features = ["docsrs"] [profile.release] diff --git a/README.md b/README.md index 25d6ecf..44f4e5c 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Lets add some code to `src/main.rs` ```rust,no_run use hirola::prelude::*; -use hirola::signal::Mutable; +use hirola::dom::Dom; fn counter() -> Dom { let count = Mutable::new(0i32); @@ -60,7 +60,7 @@ fn counter() -> Dom { } } fn main() { - let root = render(counter()).unwrap(); + let root = hirola::dom::render(counter()).unwrap(); std::mem::forget(root); } ``` diff --git a/crates/hirola-core/Cargo.toml b/crates/hirola-core/Cargo.toml index 9f3c4c7..d07edfe 100644 --- a/crates/hirola-core/Cargo.toml +++ b/crates/hirola-core/Cargo.toml @@ -14,31 +14,9 @@ keywords = ["wasm", "html", "dom", "web"] [dependencies] -html-escape = { version = "0.2.13", optional = true } -hirola-macros = { path = "../hirola-macros", version = "0.3.1" } -wasm-bindgen = { version = "0.2", optional = true } -matchit = { version = "0.7", optional = true } -wasm-bindgen-futures = { optional = true, version = "0.4.39" } -futures-signals = "0.3.33" +futures-signals = "0.3.32" futures-util = "0.3" -discard = "1" -log = "0.4.20" -serde = { version = "1", optional = true, features = ["derive", "rc"] } -[dependencies.web-sys] -features = [ - "Comment", - "Document", - "DocumentFragment", - "Element", - "Event", - "HtmlElement", - "Node", - "Text", - "Window", -] -optional = true -version = "0.3.66" [dev-dependencies] criterion = { version = "0.3", features = ["html_reports"] } @@ -47,32 +25,18 @@ hirola = { path = "../../" } web-sys = { version = "0.3", features = ["DomTokenList", "Element", "Window"] } -[features] -default = [] -dom = ["web-sys", "wasm-bindgen", "wasm-bindgen-futures"] -ssr = ["html-escape"] -app = [ - "matchit", - "web-sys/History", - "web-sys/Location", - "web-sys/HtmlLinkElement", -] -serde = ["dep:serde"] +# [[bench]] +# harness = false +# name = "reactivity" -[[bench]] -harness = false -name = "reactivity" +# [[bench]] +# harness = false +# name = "ssr" -[[bench]] -harness = false -name = "ssr" - -[[test]] -name = "ssr" -required-features = ["ssr"] +# [[test]] +# name = "ssr" +# required-features = ["ssr"] [package.metadata.docs.rs] -all-features = true default-target = "wasm32-unknown-unknown" -features = ["dom", "app"] diff --git a/crates/hirola-core/src/callback.rs b/crates/hirola-core/src/callback.rs index c6fc3cb..c08619b 100644 --- a/crates/hirola-core/src/callback.rs +++ b/crates/hirola-core/src/callback.rs @@ -1,34 +1,13 @@ use futures_signals::{signal::Mutable, signal_vec::MutableVec}; -use web_sys::Event; -pub trait Callback { - /// Pass a callback that allows interacting with the inner value and the dom event +/// Allows a shorthand for creating event listeners. +/// Mainly useful in event emitting nodes +pub trait Callback : Clone + 'static { + /// Pass a callback that allows interacting with the inner value and the event /// This method returns the new value and this updates the signal. - fn callback_with(&self, f: F) -> Box + fn callback_with(&self, f: F) -> Box where - F: Fn(&Self, Event) + 'static; - /// Pass a callback that allows interacting with self and the dom event - fn callback(&self, f: F) -> Box - where - F: Fn(&Self) + 'static, - Self: Sized; -} - -impl Callback for Mutable { - fn callback(&self, f: F) -> Box - where - F: Fn(&Self) + 'static, - { - let state = self.clone(); - let cb = move |_| { - f(&state); - }; - Box::new(cb) - } - - fn callback_with(&self, f: F) -> Box - where - F: Fn(&Self, Event) + 'static, + F: Fn(&Self, E) + 'static, { let state = self.clone(); let cb = move |e| { @@ -36,28 +15,23 @@ impl Callback for Mutable { }; Box::new(cb) } -} - -impl Callback for MutableVec { - fn callback(&self, f: F) -> Box + /// Pass a callback that allows interacting with self and the event + fn callback(&self, f: F) -> Box where F: Fn(&Self) + 'static, { let state = self.clone(); let cb = move |_| { - (f(&state)); + f(&state); }; Box::new(cb) } +} + +impl Callback for Mutable { + +} + +impl Callback for MutableVec { - fn callback_with(&self, f: F) -> Box - where - F: Fn(&Self, Event) + 'static, - { - let state = self.clone(); - let cb = move |e: Event| { - f(&state, e); - }; - Box::new(cb) - } } diff --git a/crates/hirola-core/src/dom.rs b/crates/hirola-core/src/dom.rs deleted file mode 100644 index 54bb302..0000000 --- a/crates/hirola-core/src/dom.rs +++ /dev/null @@ -1,163 +0,0 @@ -use crate::{ - generic_node::{DomType, GenericNode}, - render::{Error, Render}, - spawn, BoxedLocal, -}; -use discard::{Discard, DiscardOnDrop}; -use futures_signals::CancelableFutureHandle; -use std::{cell::RefCell, future::Future, rc::Rc}; -#[cfg(feature = "dom")] -use wasm_bindgen::JsCast; -#[cfg(feature = "dom")] -use web_sys::HtmlElement; - -#[cfg(feature = "dom")] -use wasm_bindgen::prelude::Closure; - -#[cfg(feature = "dom")] -use crate::generic_node::EventListener; - -pub enum DomSideEffect { - UnMounted(BoxedLocal<()>), - Mounted(CancelableFutureHandle), -} - -#[derive(Clone)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct Dom { - node: DomType, - #[cfg_attr(feature = "serde", serde(skip))] - pub side_effects: Rc>>, - #[cfg(feature = "dom")] - #[cfg_attr(feature = "serde", serde(skip))] - event_handlers: Rc>>>, - children: RefCell>, -} - -impl Dom { - pub fn new() -> Dom { - Dom::new_from_node(&DomType::fragment()) - } - - pub fn element(tag: &str) -> Dom { - Dom::new_from_node(&DomType::element(tag)) - } - - pub fn text(tag: &str) -> Dom { - Dom::new_from_node(&DomType::text_node(tag)) - } - - pub fn append_child(&self, child: Dom) -> Result<(), Error> { - self.node.append_child(&child.node); - self.children.borrow_mut().push(child); - Ok(()) - } - - pub fn children(&self) -> &RefCell> { - &self.children - } - - pub fn node(&self) -> &DomType { - &self.node - } - - pub fn new_from_node(node: &DomType) -> Dom { - Self { - node: node.clone(), - children: Default::default(), - #[cfg(feature = "dom")] - event_handlers: Default::default(), - side_effects: Default::default(), - } - } - - #[cfg(feature = "dom")] - #[inline] - pub fn event(&self, name: &str, handler: Box) { - let closure = self.node.event(name, handler); - if let Some(closure) = closure { - self.event_handlers.borrow_mut().push(closure); - } - } - - #[inline] - pub fn attribute(&self, name: &str, value: &str) { - self.node.set_attribute(name, value); - } - #[inline] - pub fn effect(&self, future: impl Future + 'static) { - self.side_effects - .borrow_mut() - .push(DomSideEffect::Mounted(DiscardOnDrop::leak(spawn(future)))); - } - - pub fn append_render(&self, render: impl Render + 'static) { - Box::new(render).render_into(&self).unwrap(); - } - - #[inline] - pub fn discard(&mut self) { - #[cfg(feature = "dom")] - { - let _cleanup: Vec<()> = self - .event_handlers - .take() - .into_iter() - .map(|c| c.forget()) - .collect(); - } - let _cleanup: Vec<()> = self - .side_effects - .take() - .into_iter() - .map(|e| match e { - DomSideEffect::Mounted(e) => e.discard(), - DomSideEffect::UnMounted(_) => { - log::warn!("Dropping a side effect that was not mounted") - } - }) - .collect(); - } - - pub fn mount(self, node: &DomType) -> Result { - let dom = Dom::new_from_node(node); - Box::new(self).render_into(&dom)?; - Ok(dom) - } - - pub fn inner_html(&self) -> String { - #[cfg(feature = "dom")] - { - let window = web_sys::window().unwrap(); - let document = window.document().unwrap(); - let element = document.create_element("div").unwrap(); - - let dom = crate::render_to(self.clone(), &element.try_into().unwrap()).unwrap(); - return dom - .node() - .inner_element() - .dyn_ref::() - .unwrap() - .inner_html(); - } - - #[cfg(feature = "ssr")] - #[allow(unreachable_code)] - { - return crate::render_to_string(self.clone()); - } - } -} - -impl Drop for Dom { - fn drop(&mut self) { - self.discard() - } -} - -impl Render for Dom { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { - parent.append_child(*self)?; - Ok(()) - } -} diff --git a/crates/hirola-core/src/effect.rs b/crates/hirola-core/src/effect.rs index 1225c9b..1c3d9fb 100644 --- a/crates/hirola-core/src/effect.rs +++ b/crates/hirola-core/src/effect.rs @@ -57,10 +57,7 @@ pub trait SideEffect { fn effect(self) -> BoxedLocal<()>; } -impl SideEffect for F -where - F: Future, -{ +impl> SideEffect for F { /// Converts the provided future into a boxed future of `()` as a side effect. /// /// This implementation allows any future that produces `()` as its output to be converted @@ -75,10 +72,11 @@ where /// ```no_run /// use std::future::ready; /// use hirola::prelude::*; + /// use hirola::dom::Dom; /// // Create a future that produces `()` as its output /// let my_future = ready(()); /// - /// let render = html! { + /// let render: Dom = html! { ///
/// }; /// ``` diff --git a/crates/hirola-core/src/generic_node.rs b/crates/hirola-core/src/generic_node.rs index b5a6ad7..9b52d9b 100644 --- a/crates/hirola-core/src/generic_node.rs +++ b/crates/hirola-core/src/generic_node.rs @@ -1,33 +1,8 @@ -#[cfg(feature = "dom")] -pub mod dom_node; -#[cfg(feature = "ssr")] -pub mod ssr_node; +use std::{cell::RefCell, future::Future}; -#[cfg(feature = "dom")] -pub use dom_node::*; -#[cfg(feature = "ssr")] -pub use ssr_node::*; +use crate::prelude::Render; -#[cfg(feature = "dom")] -use wasm_bindgen::prelude::Closure; - -use std::fmt; - -#[cfg(feature = "dom")] -use web_sys::Event; - -#[cfg(feature = "ssr")] -pub type Event = (); - -pub type EventListener = dyn Fn(Event); - -#[cfg(feature = "dom")] -pub type DomType = dom_node::DomNode; - -#[cfg(feature = "ssr")] -pub type DomType = ssr_node::SsrNode; - -pub trait GenericNode: fmt::Debug + Clone + PartialEq + std::cmp::Eq + 'static { +pub trait GenericNode: std::fmt::Debug + Clone + PartialEq + std::cmp::Eq + 'static { /// Create a new element node. fn element(tag: &str) -> Self; @@ -70,15 +45,29 @@ pub trait GenericNode: fmt::Debug + Clone + PartialEq + std::cmp::Eq + 'static { /// Remove this node from the tree. fn remove_self(&self); - #[cfg(feature = "dom")] - /// Add a [`EventListener`] to the event `name`. - fn event(&self, _name: &str, _handler: Box) -> Option> { - None - } - /// Update inner text of the node. If the node has elements, all the elements are replaced with a new text node. fn update_inner_text(&self, text: &str); /// Replace all the children in a node with a new node fn replace_children_with(&self, node: &Self); + + fn effect(&self, future: impl Future + 'static); + + fn children(&self) -> RefCell>; + + fn append_render(&self, render: impl Render + 'static) { + Box::new(render).render_into(self).unwrap(); + } +} + +pub trait EventListener { + type Handler; + fn event(&self, name: &str, handler: Self::Handler); +} + +/// Allows you to acquire a node during template processing +pub trait NodeReference { + type Target; + fn try_get(&self) -> Option; + fn set(&self, node: Self::Target); } diff --git a/crates/hirola-core/src/generic_node/dom_node.rs b/crates/hirola-core/src/generic_node/dom_node.rs deleted file mode 100644 index 587da9a..0000000 --- a/crates/hirola-core/src/generic_node/dom_node.rs +++ /dev/null @@ -1,189 +0,0 @@ -use super::{EventListener, GenericNode}; -use wasm_bindgen::{prelude::*, JsCast}; -use web_sys::{Element, Event, Node, Text}; - -/// Rendering backend for the DOM. -/// -/// The `DomNode` struct represents a node in the Document Object Model (DOM) and serves as the -/// rendering backend for the frontend application. It allows interacting with DOM nodes directly -/// and provides utility methods for type conversion and cloning. -/// -/// _This API requires the following crate features to be activated: `dom`_ -/// -#[derive(Debug, Clone, PartialEq, Eq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] -pub struct DomNode { - // TODO: Is there a better way to do this? - #[cfg_attr(feature = "serde", serde(skip, default = "unreachable_node"))] - pub node: Node, -} - -#[allow(unused)] -fn unreachable_node() -> Node { - unreachable!("It is currently not possible to serialize Browser dom nodes") -} - -impl DomNode { - /// Retrieves the inner DOM node contained within the `DomNode`. - /// - /// # Returns - /// - /// The underlying DOM node represented by this `DomNode`. - pub fn inner_element(&self) -> Node { - self.node.clone() - } - /// Converts the `DomNode` into a specified type using unchecked casting. - /// - /// This method allows converting the `DomNode` into a specific type, without performing a - /// runtime type check. It can be used when you are confident about the type of the DOM node, - /// and it avoids the overhead of dynamic type checking. - /// - /// # Type Parameters - /// - /// * `T` - The target type to convert the `DomNode` into. It should implement the `JsCast` - /// trait, which provides the unchecked casting functionality. - /// - /// # Returns - /// - /// The converted `DomNode` as the target type `T`. - pub fn unchecked_into(self) -> T { - self.node.unchecked_into() - } - /// Attempts to dynamically cast the `DomNode` into a specified type. - /// - /// This method performs a runtime type check to determine if the `DomNode` can be converted - /// into the desired type. If the conversion succeeds, it returns the converted value; - /// otherwise, it returns an error containing the original `DomNode`. - /// - /// # Type Parameters - /// - /// * `T` - The target type to cast the `DomNode` into. It should implement the `JsCast` - /// trait, which provides the dynamic type casting functionality. - /// - /// # Returns - /// - /// - `Ok(T)` if the `DomNode` was successfully cast into the target type `T`. - /// - `Err(Node)` if the `DomNode` could not be cast into the target type `T`. - - pub fn dyn_into(self) -> Result { - self.node.dyn_into() - } -} - -impl AsRef for DomNode { - fn as_ref(&self) -> &JsValue { - self.node.as_ref() - } -} - -impl From for JsValue { - fn from(node: DomNode) -> Self { - node.node.into() - } -} - -fn document() -> web_sys::Document { - web_sys::window().unwrap().document().unwrap() -} - -impl GenericNode for DomNode { - fn element(tag: &str) -> Self { - DomNode { - node: document().create_element(tag).unwrap().dyn_into().unwrap(), - } - } - - fn text_node(text: &str) -> Self { - DomNode { - node: document().create_text_node(text).into(), - } - } - - fn fragment() -> Self { - DomNode { - node: document().create_document_fragment().dyn_into().unwrap(), - } - } - - fn marker() -> Self { - DomNode { - node: document().create_comment("").into(), - } - } - - fn set_attribute(&self, name: &str, value: &str) { - self.node - .unchecked_ref::() - .set_attribute(name, value) - .unwrap(); - } - - fn append_child(&self, child: &Self) { - match self.node.append_child(&child.node) { - Err(e) => log::warn!("Could not append child: {e:?}"), - _ => {} - } - } - - fn insert_child_before(&self, new_node: &Self, reference_node: Option<&Self>) { - match self - .node - .insert_before(&new_node.node, reference_node.map(|n| &n.node)) - { - Ok(_) => {} - Err(e) => log::warn!("Failed to insert child: {e:?}"), - } - } - - fn remove_child(&self, child: &Self) { - match self.node.remove_child(&child.node) { - Ok(_) => {} - Err(e) => log::warn!("Failed to remove child: {e:?}"), - }; - } - - fn replace_child(&self, old: &Self, new: &Self) { - match self.node.replace_child(&old.node, &new.node) { - Ok(_) => {} - Err(e) => log::warn!("Failed to replace child: {e:?}"), - }; - } - - fn insert_sibling_before(&self, child: &Self) { - self.node - .unchecked_ref::() - .before_with_node_1(&child.node) - .unwrap(); - } - - fn parent_node(&self) -> Option { - self.node.parent_node().map(|node| Self { node }) - } - - fn next_sibling(&self) -> Option { - self.node.next_sibling().map(|node| Self { node }) - } - - fn remove_self(&self) { - self.node.unchecked_ref::().remove(); - } - - fn event(&self, name: &str, handler: Box) -> Option> { - let closure = Closure::wrap(handler); - self.node - .add_event_listener_with_callback(name, closure.as_ref().unchecked_ref()) - .unwrap(); - Some(closure) - } - - fn update_inner_text(&self, text: &str) { - self.node - .dyn_ref::() - .unwrap() - .set_text_content(Some(text)); - } - fn replace_children_with(&self, node: &Self) { - let element = self.node.unchecked_ref::(); - element.replace_children_with_node_1(&node.inner_element()) - } -} diff --git a/crates/hirola-core/src/lib.rs b/crates/hirola-core/src/lib.rs index 670b380..928ea69 100644 --- a/crates/hirola-core/src/lib.rs +++ b/crates/hirola-core/src/lib.rs @@ -4,7 +4,8 @@ //! ```rust,no_run //! use hirola::prelude::*; //! use hirola::signal::Mutable; -//! +//! use hirola::dom::Dom; +//! //! fn counter() -> Dom { //! let count = Mutable::new(0i32); //! let decrement = count.callback(|s| *s.lock_mut() -= 1); @@ -18,152 +19,37 @@ //! } //! } //! -//! fn main() { -//! let root = render(counter()).unwrap(); -//! std::mem::forget(root); -//! } //! ``` -//! ## Features -//! - `dom` (_default_) - Enables rendering templates to DOM nodes. Only useful on `wasm32-unknown-unknown` target. -//! - `ssr` - Enables rendering templates to static strings (useful for Server Side Rendering / Server side Generation). -//! - `serde` - Enables serializing and deserializing `Signal`s and other wrapper types using `serde`. #![allow(non_snake_case)] #![warn(clippy::clone_on_ref_ptr)] #![warn(clippy::rc_buffer)] #![deny(clippy::trait_duplication_in_bounds)] #![deny(clippy::type_repetition_in_bounds)] -use crate::dom::*; -use discard::DiscardOnDrop; -use futures_signals::{cancelable_future, CancelableFutureHandle}; -pub use hirola_macros::html; use std::{future::Future, pin::Pin}; - pub type BoxedLocal = Pin + 'static>>; -#[cfg(feature = "app")] -pub mod app; -#[cfg(feature = "dom")] pub mod callback; -pub mod dom; pub mod effect; pub mod generic_node; -pub mod mixins; +pub mod mixin; pub mod render; pub mod templating; -#[cfg(feature = "dom")] -use crate::generic_node::DomNode; - -/// Render a [`Dom`] into the DOM. -/// Alias for [`render_to`] with `parent` being the `` tag. -/// -/// _This API requires the following crate features to be activated: `dom`_ -#[cfg(feature = "dom")] -pub fn render(dom: Dom) -> Result { - let window = web_sys::window().unwrap(); - let document = window.document().unwrap(); - - render_to(dom, &document.body().unwrap()) -} - -/// Render a [`Dom`] under a `parent` node. -/// For rendering under the `` tag, use [`render()`] instead. -/// -/// _This API requires the following crate features to be activated: `dom`_ -#[cfg(feature = "dom")] -pub fn render_to(dom: dom::Dom, parent: &web_sys::Node) -> Result { - dom.mount(&DomNode { - node: parent.clone(), - }) -} - -/// Render a [`Dom`] into a static [`String`]. Useful for rendering to a string on the server side. -/// -/// _This API requires the following crate features to be activated: `ssr`_ -#[cfg(feature = "ssr")] -pub fn render_to_string(dom: Dom) -> String { - use crate::generic_node::GenericNode; - use crate::generic_node::SsrNode; - use crate::render::Render; - let node = SsrNode::fragment(); - let root = Dom::new_from_node(&node); - Render::render_into(Box::new(dom), &root).unwrap(); - format!("{}", root.node()) -} - -#[inline] -pub fn spawn(future: F) -> DiscardOnDrop -where - F: Future + 'static, -{ - let (handle, future) = cancelable_future(future, || ()); - - #[cfg(feature = "dom")] - wasm_bindgen_futures::spawn_local(future); - - #[cfg(not(feature = "dom"))] - drop(future); - // tokio::task::spawn_local(future); - - handle -} - pub mod prelude { - - // pub use crate::spawn; + pub use crate::callback::Callback; pub use crate::effect::SideEffect; - #[cfg(feature = "dom")] - pub use crate::generic_node::DomNode as DomType; + pub use crate::generic_node::EventListener; pub use crate::generic_node::GenericNode; - #[cfg(feature = "ssr")] - pub use crate::generic_node::SsrNode as DomType; + pub use crate::generic_node::*; + pub use crate::mixin::*; + pub use crate::render::*; pub use crate::templating::flow::{Indexed, IndexedProps}; - pub use crate::templating::noderef::NodeRef; pub use crate::templating::suspense::{Suspend, Suspense, SuspenseResult::*}; pub use crate::templating::switch::Switch; - pub use futures_signals::*; - pub use hirola_macros::{component, html}; - - #[cfg(feature = "dom")] - pub use crate::callback::Callback; - pub use crate::dom::Dom; - #[cfg(feature = "ssr")] - pub use crate::render_to_string; - #[cfg(feature = "dom")] - pub use crate::{render, render_to}; - - #[cfg(feature = "app")] - pub use crate::app::*; - - pub use crate::mixins::*; - pub use crate::render::*; pub use crate::BoxedLocal; - + pub use futures_signals::*; pub use futures_signals::signal::Mutable; pub use futures_signals::signal_map::MutableBTreeMap; pub use futures_signals::signal_vec::MutableVec; } - -#[cfg(feature = "dom")] -pub mod dom_test_utils { - use wasm_bindgen::{prelude::Closure, JsCast}; - - pub fn next_tick_with(with: &N, f: impl Fn(&N) -> () + 'static) { - let with = with.clone(); - let f: Box ()> = Box::new(move || f(&with)); - let a = Closure::::new(f); - web_sys::window() - .unwrap() - .set_timeout_with_callback(a.as_ref().unchecked_ref()) - .unwrap(); - } - - pub fn next_tick(f: F) { - let a = Closure::::new(move || f()); - web_sys::window() - .unwrap() - .set_timeout_with_callback(a.as_ref().unchecked_ref()) - .unwrap(); - } -} diff --git a/crates/hirola-core/src/mixin.rs b/crates/hirola-core/src/mixin.rs new file mode 100644 index 0000000..603bbdf --- /dev/null +++ b/crates/hirola-core/src/mixin.rs @@ -0,0 +1,79 @@ +//! ## Mixins +//! Hirola aims to be extensible and follow DRY principles. +//! Here is an example of a mixin +//! ```rust,no_run +//! use hirola::prelude::*; +//! use hirola::dom::Dom; +//! use web_sys::Element; +//! // Mixin that controls tailwind opacity based on a bool signal +//! fn opacity<'a>(signal: &'a Mutable) -> Box () + 'a> { +//! let cb = move |dom: &Dom| { +//! let node = dom.clone(); +//! let element = node.unchecked_into::(); +//! if signal.get() { +//! element.class_list().add_1("opacity-100").unwrap(); +//! element.class_list().remove_1("opacity-0").unwrap(); +//! } else { +//! element.class_list().add_1("opacity-0").unwrap(); +//! element.class_list().remove_1("opacity-100").unwrap(); +//! } +//! }; +//! Box::new(cb) +//! } +//! +//! fn mixin_demo() -> Dom { +//! let is_shown = Mutable::new(true); +//! let toggle = is_shown.callback(|show| { +//! let current = show.get(); +//! *show.lock_mut() = !current; +//! }); +//! html! { +//!
+//!
+//! +//!
+//! } +//! } +//! fn main() { +//! +//! } +//! ``` + +use crate::generic_node::GenericNode; + +pub trait Mixin { + fn mixin(self, node: &Target); +} + +/// Unbound mixin in the form of `Fn(&Dom)` +/// +/// ## Example +/// ```rust,no_run +/// use hirola::prelude::*; +/// use hirola::dom::Dom; +/// use hirola::dom::mixins::raw_text; +/// +/// fn counter() -> Dom { +/// html! { +/// +/// } +/// } +/// ``` +#[derive(Debug)] +pub struct Identity; + +impl Mixin for T +where + T: FnOnce(&Node), +{ + fn mixin(self, node: &Node) { + (self)(node); + } +} diff --git a/crates/hirola-core/src/mixins.rs b/crates/hirola-core/src/mixins.rs deleted file mode 100644 index d8cc494..0000000 --- a/crates/hirola-core/src/mixins.rs +++ /dev/null @@ -1,133 +0,0 @@ -//! ## Mixins -//! Hirola aims to be extensible and follow DRY principles. -//! Here is an example of a mixin -//! ```rust,no_run -//! use hirola::prelude::*; -//! use web_sys::Element; -//! // Mixin that controls tailwind opacity based on a bool signal -//! fn opacity<'a>(signal: &'a Mutable) -> Box () + 'a> { -//! let cb = move |dom: &Dom| { -//! let node = dom.node().clone(); -//! let element = node.unchecked_into::(); -//! if signal.get() { -//! element.class_list().add_1("opacity-100").unwrap(); -//! element.class_list().remove_1("opacity-0").unwrap(); -//! } else { -//! element.class_list().add_1("opacity-0").unwrap(); -//! element.class_list().remove_1("opacity-100").unwrap(); -//! } -//! }; -//! Box::new(cb) -//! } -//! -//! fn mixin_demo() -> Dom { -//! let is_shown = Mutable::new(true); -//! let toggle = is_shown.callback(|show| { -//! let current = show.get(); -//! *show.lock_mut() = !current; -//! }); -//! html! { -//!
-//!
-//! -//!
-//! } -//! } -//! fn main() { -//! -//! } -//! ``` -use crate::dom::Dom; -use futures_signals::signal::{Signal, SignalExt}; -use std::fmt::Display; -#[cfg(feature = "dom")] -use wasm_bindgen::JsCast; -#[cfg(feature = "dom")] -use web_sys::Element; - -pub trait Mixin { - fn mixin(&self, node: &Dom); -} - -/// Unbound mixin in the form of `Fn(&Dom)` -/// -/// ## Example -/// ```rust,no_run -/// use hirola::prelude::*; -/// fn counter() -> Dom { -/// html! { -/// -/// } -/// } -/// ``` -#[derive(Debug)] -pub struct Identity; - -impl Mixin for T -where - T: Fn(&Dom), -{ - fn mixin(&self, node: &Dom) { - (&self)(node); - } -} - -/// A mixin that allows adding raw html -/// Note: This is a security risk if the string to be inserted might contain potentially malicious content. -/// sanitize the content before it is inserted. -/// See more: https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML -#[allow(unused_variables)] -pub fn raw_html<'a>(text: &'a str) -> Box () + 'a> { - let cb = move |node: &Dom| { - #[cfg(feature = "dom")] - { - let element = node.node().as_ref().clone().unchecked_into::(); - element.set_inner_html(text); - } - }; - Box::new(cb) -} - -/// A mixin that allows adding non-signal text -#[allow(unused_variables)] -pub fn raw_text<'a>(text: &'a str) -> Box { - let cb = move |dom: &Dom| { - #[cfg(feature = "dom")] - { - dom.node().node.set_text_content(Some(&format!("{text}"))); - } - }; - Box::new(cb) -} - -/// Mixin that adds text to a dom node -#[allow(unused_variables)] -pub fn text(text: &S) -> Box -where - T: Display + 'static, - S: Signal + SignalExt + Clone + 'static, -{ - let signal = text.clone(); - - let cb = move |_node: &Dom| { - #[cfg(feature = "dom")] - { - use std::future::ready; - let element = _node.node().as_ref().clone().unchecked_into::(); - let signal = signal.clone(); - let future = signal.for_each(move |value| { - element.set_text_content(Some(&format!("{}", value))); - ready(()) - }); - _node.effect(future); - } - }; - Box::new(cb) -} diff --git a/crates/hirola-core/src/render.rs b/crates/hirola-core/src/render.rs index 6de3966..b78d19b 100644 --- a/crates/hirola-core/src/render.rs +++ b/crates/hirola-core/src/render.rs @@ -1,7 +1,6 @@ -//! Trait for describing how something should be rendered into DOM nodes. +//! Trait for describing how components and other custom types should be rendered into DOM nodes. use crate::{ - dom::Dom, - generic_node::{DomType, GenericNode}, + generic_node::GenericNode, templating::flow::{Indexed, IndexedProps}, }; use futures_signals::{ @@ -20,53 +19,53 @@ pub enum Error { } /// Trait for describing how something should be rendered into nodes. -pub trait Render { +pub trait Render { /// Called during the initial render when creating the nodes inside a dom. - fn render_into(self: Box, parent: &Dom) -> Result<(), Error>; + fn render_into(self: Box, parent: &N) -> Result<(), Error>; } /// Does nothing -impl Render for () { - fn render_into(self: Box, _dom: &Dom) -> Result<(), Error> { +impl Render for () { + fn render_into(self: Box, _dom: &N) -> Result<(), Error> { Ok(()) } } -impl Render for &str { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { - let child = Dom::new_from_node(&DomType::text_node(*self)); - parent.append_child(child)?; +impl Render for &str { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { + let child = &N::text_node(*self); + parent.append_child(child); Ok(()) } } -impl Render for String { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { - let child = Dom::new_from_node(&DomType::text_node(&self)); - parent.append_child(child)?; +impl Render for String { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { + let child = &N::text_node(&self); + parent.append_child(child); Ok(()) } } -impl Render for &String { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { - let child = Dom::new_from_node(&DomType::text_node(&self)); - parent.append_child(child)?; +impl Render for &String { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { + let child = &N::text_node(&self); + parent.append_child(child); Ok(()) } } /// Renders `A`, then `B` -impl Render for (A, B) { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { +impl, B: Render, N: GenericNode> Render for (A, B) { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { Box::new(self.0).render_into(parent)?; Box::new(self.1).render_into(parent) } } /// Renders `A`, then `B`, then `C` -impl Render for (A, B, C) { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { +impl, B: Render, C: Render, N: GenericNode> Render for (A, B, C) { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { Box::new(self.0).render_into(parent)?; Box::new(self.1).render_into(parent)?; Box::new(self.2).render_into(parent) @@ -74,8 +73,8 @@ impl Render for (A, B, C) { } /// Renders `T` or nothing -impl Render for Option { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { +impl, N: GenericNode> Render for Option { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { match *self { None => Ok(()), Some(x) => Box::new(x).render_into(parent), @@ -83,8 +82,8 @@ impl Render for Option { } } -impl Render for Vec { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { +impl, N: GenericNode> Render for Vec { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { for elem in *self { Box::new(elem).render_into(parent)?; } @@ -92,98 +91,130 @@ impl Render for Vec { } } -impl Render for Box { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { +impl, N: GenericNode> Render for Box { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { (*self).render_into(parent)?; Ok(()) } } -impl Render for Mutable { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { - let node = DomType::text_node(&self.get_cloned().to_string()); - let child = Dom::new_from_node(&node); - let fut = self.signal_ref(move |e| node.update_inner_text(&e.to_string())); +impl Render for Mutable { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { + let child = N::text_node(&self.get_cloned().to_string()); + parent.append_child(&child); + let fut = self.signal_ref(move |e| child.update_inner_text(&e.to_string())); parent.effect(fut.to_future()); - parent.append_child(child).unwrap(); Ok(()) } } -pub struct Mapped { +pub struct MappedVec { pub iter: Pin>>, - callback: Box Dom>, + callback: Box G>, } -pub trait RenderMap { +// pub struct Mapped { +// pub signal: Pin>>, +// callback: Box G>, +// } + +pub trait MapRender { type Item; - fn render_map(self, callback: impl Fn(Self::Item) -> Dom + 'static) -> Mapped; + type Output; + fn map_render(self, callback: impl Fn(Self::Item) -> G + 'static) -> Self::Output; } -impl RenderMap for MutableSignalVec { +impl MapRender for MutableSignalVec { type Item = T; - fn render_map(self, callback: impl Fn(Self::Item) -> Dom + 'static) -> Mapped { - Mapped { + type Output = MappedVec; + fn map_render(self, callback: impl Fn(Self::Item) -> G + 'static) -> MappedVec { + MappedVec { iter: Box::pin(self), callback: Box::new(callback), } } } -impl + 'static, F: FnMut(&T) -> bool + 'static> RenderMap - for Filter +// impl MapRender for Mutable { +// type Item = T; +// type Output = Mapped; + +// fn map_render(self, callback: impl Fn(Self::Item) -> G + 'static) -> Mapped { +// Mapped { +// signal: Box::pin(self.signal_cloned()), +// callback: Box::new(callback), +// } +// } +// } + +impl< + T: Clone + 'static, + I: SignalVec + 'static, + F: FnMut(&T) -> bool + 'static, + G: GenericNode, + > MapRender for Filter { type Item = T; - fn render_map(self, callback: impl Fn(Self::Item) -> Dom + 'static) -> Mapped { - Mapped { + type Output = MappedVec; + + fn map_render(self, callback: impl Fn(Self::Item) -> G + 'static) -> MappedVec { + MappedVec { iter: Box::pin(self), callback: Box::new(callback), } } } -impl> RenderMap for Enumerate { +impl, G: GenericNode> MapRender for Enumerate { type Item = (usize, T); - fn render_map(self, callback: impl Fn(Self::Item) -> Dom + 'static) -> Mapped { + type Output = MappedVec; + + fn map_render(self, callback: impl Fn(Self::Item) -> G + 'static) -> MappedVec { let items = self.collect(); - Mapped { + MappedVec { iter: Box::pin(MutableVec::new_with_values(items).signal_vec_cloned()), callback: Box::new(callback), } } } -impl + Unpin + 'static> RenderMap - for futures_signals::signal_vec::Enumerate +impl + Unpin + 'static, G: GenericNode> + MapRender for futures_signals::signal_vec::Enumerate { type Item = (ReadOnlyMutable>, T); - fn render_map(self, callback: impl Fn(Self::Item) -> Dom + 'static) -> Mapped { - Mapped { + type Output = MappedVec; + + fn map_render(self, callback: impl Fn(Self::Item) -> G + 'static) -> MappedVec { + MappedVec { iter: Box::pin(self.to_signal_cloned().to_signal_vec()), callback: Box::new(callback), } } } -impl RenderMap for Vec { +impl MapRender for Vec { type Item = T; - fn render_map(self, callback: impl Fn(Self::Item) -> Dom + 'static) -> Mapped { - Mapped { + type Output = MappedVec; + + fn map_render(self, callback: impl Fn(Self::Item) -> G + 'static) -> MappedVec { + MappedVec { iter: Box::pin(MutableVec::new_with_values(self).signal_vec_cloned()), callback: Box::new(callback), } } } -impl Render for Mapped { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { +impl Render for MappedVec { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { let template = { - let props = IndexedProps { - iterable: self.iter, - template: self.callback, - }; - let indexed = Indexed { props }; - indexed + #[allow(clippy::type_complexity)] + let props: IndexedProps>>, Box N>, N> = + IndexedProps { + iterable: self.iter, + template: self.callback, + }; + + Indexed { props } }; Box::new(template).render_into(parent)?; Ok(()) @@ -191,8 +222,8 @@ impl Render for Mapped { } /// Renders `O` or `E` -impl Render for std::result::Result { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { +impl, E: Render, N: GenericNode> Render for std::result::Result { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { match *self { Ok(o) => Box::new(o).render_into(parent), Err(e) => Box::new(e).render_into(parent), diff --git a/crates/hirola-core/src/templating/flow.rs b/crates/hirola-core/src/templating/flow.rs index 1fe1469..abf1e1c 100644 --- a/crates/hirola-core/src/templating/flow.rs +++ b/crates/hirola-core/src/templating/flow.rs @@ -2,8 +2,7 @@ //! //! Iteration can be either _"keyed"_ or _"non keyed"_. //! Use the [`Keyed`] and [`Indexed`] utility components respectively. -use crate::dom::Dom; -use crate::generic_node::{DomType, GenericNode}; +use crate::generic_node::GenericNode; use crate::render::{Error, Render}; use futures_signals::signal_vec::{SignalVec, SignalVecExt, VecDiff}; use std::cell::RefCell; @@ -13,9 +12,9 @@ use std::rc::Rc; /// Props for [`Indexed`]. /// #[derive(Debug)] -pub struct IndexedProps + Unpin, F> +pub struct IndexedProps + Unpin, F, G: GenericNode> where - F: Fn(T) -> Dom, + F: Fn(T) -> G, { pub iterable: I, pub template: F, @@ -29,51 +28,51 @@ where /// # Example /// ```rust,no_run /// use hirola::prelude::*; -/// +/// use hirola::dom::Dom; /// let count = MutableVec::new_with_values(vec![1, 2]); /// /// let res = html! { ///
    /// {count /// .signal_vec() -/// .render_map(|item| { +/// .map_render(|item| { /// html! {
  • {item.to_string()}
  • } /// })} ///
/// }; /// # let _ : Dom = res; /// ``` -pub struct Indexed + Unpin, F> +pub struct Indexed + Unpin, F, G: GenericNode> where - F: Fn(T) -> Dom, + F: Fn(T) -> G, { - pub props: IndexedProps, + pub props: IndexedProps, } -impl Render for Indexed +impl Render for Indexed where T: 'static + Clone, I: 'static + SignalVecExt + Unpin, - F: Fn(T) -> Dom + 'static, + F: Fn(T) -> N + 'static, { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { let props = self.props; let template = props.template; let iterable = SignalVecExt::map(props.iterable, move |item| { - template(item).mount(&DomType::fragment()).unwrap() + template(item) }); - let marker = DomType::marker(); + let marker = N::marker(); - struct State { - element: DomType, - marker: DomType, - children: Vec, + struct State { + element: N, + marker: N, + children: Vec, } - impl State { - fn new(element: DomType, marker: DomType) -> Rc> { + impl State { + fn new(element: N, marker: N) -> Rc> { Rc::new(RefCell::new(State { element, marker, @@ -83,46 +82,44 @@ where fn clear(&mut self) { for dom in self.children.drain(..) { - self.element.remove_child(&dom.node()); + self.element.remove_child(&dom); drop(dom) } } - fn insert_at(&self, new_index: usize, child: &DomType) { + fn insert_at(&self, new_index: usize, child: &N) { if let Some(dom) = self.children.get(new_index) { - self.element.insert_child_before(child, Some(&dom.node())); + self.element.insert_child_before(child, Some(dom)); } else { self.element.insert_child_before(child, Some(&self.marker)); } } // TODO verify that this will drop `children` - fn process_change(&mut self, change: VecDiff) { + fn process_change(&mut self, change: VecDiff) { match change { VecDiff::Replace { values } => { self.clear(); self.children = values; for dom in self.children.iter_mut() { - self.element - .insert_child_before(&dom.node(), Some(&self.marker)); + self.element.insert_child_before(dom, Some(&self.marker)); } } VecDiff::InsertAt { index, value } => { - self.insert_at(index, &value.node()); + self.insert_at(index, &value); self.children.insert(index, value); } VecDiff::Push { value } => { let marker = self.marker.clone(); - self.element - .insert_child_before(value.node(), Some(&marker)); + self.element.insert_child_before(&value, Some(&marker)); self.children.push(value); } VecDiff::UpdateAt { index, mut value } => { let dom = &mut self.children[index]; - self.element.replace_child(value.node(), &self.marker); + self.element.replace_child(&value, &self.marker); ::std::mem::swap(dom, &mut value); } @@ -132,7 +129,7 @@ where } => { let value = self.children.remove(old_index); - self.insert_at(new_index, value.node()); + self.insert_at(new_index, &value); self.children.insert(new_index, value); } @@ -141,8 +138,9 @@ where let dom = self.children.remove(index); let children = dom.children().take(); for child in children { - child.node().remove_self() + child.remove_self() } + drop(dom) } @@ -151,7 +149,7 @@ where let dom = self.children.pop().unwrap(); let children = dom.children().take(); for child in children { - child.node().remove_self() + child.remove_self() } drop(dom) } @@ -163,11 +161,9 @@ where } } - parent - .append_child(Dom::new_from_node(&marker.clone())) - .unwrap(); + parent.append_child(&marker.clone()); - let state = State::new(parent.node().clone(), marker); + let state = State::new(parent.clone(), marker); let fut = iterable.for_each(move |change| { let mut state = state.borrow_mut(); diff --git a/crates/hirola-core/src/templating/mod.rs b/crates/hirola-core/src/templating/mod.rs index 74dbdb0..ca19194 100644 --- a/crates/hirola-core/src/templating/mod.rs +++ b/crates/hirola-core/src/templating/mod.rs @@ -1,4 +1,3 @@ pub mod flow; -pub mod noderef; pub mod suspense; pub mod switch; diff --git a/crates/hirola-core/src/templating/suspense.rs b/crates/hirola-core/src/templating/suspense.rs index f2275d8..9c086cd 100644 --- a/crates/hirola-core/src/templating/suspense.rs +++ b/crates/hirola-core/src/templating/suspense.rs @@ -1,6 +1,5 @@ use crate::{ - dom::Dom, - generic_node::{DomType, GenericNode}, + generic_node::GenericNode, render::{Error, Render}, BoxedLocal, }; @@ -29,21 +28,21 @@ where } } -pub struct Suspense { - pub template: Box Dom>, +pub struct Suspense { + pub template: Box G>, pub future: Pin>>, } -impl Render for Suspense { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { +impl Render for Suspense { + fn render_into(self: Box, parent: &N) -> Result<(), Error> { let template = self.template; - struct State { - holder: DomType, - current: Option, + struct State { + holder: N, + current: Option, } - impl State { - fn new(parent: DomType) -> Rc> { + impl State { + fn new(parent: N) -> Rc> { Rc::new(RefCell::new(State { holder: parent, current: None, @@ -51,34 +50,37 @@ impl Render for Suspense { } fn clear(&mut self) { - let node = &mut self.holder; - if let Some(frag) = &self.current { - for child in &frag.children().take() { - node.remove_child(&child.node()); - } - }; + { + let node = &mut self.holder; + if let Some(frag) = &self.current { + for child in &frag.children().take() { + node.remove_child(child); + } + }; + } self.current = None; } - fn apply(&mut self, dom: Dom) -> Result<(), Error> { + fn apply(&mut self, dom: N) -> Result<(), Error> { self.clear(); let node = &mut self.holder; - let dom = dom.mount(&DomType::fragment())?; - node.append_child(&dom.node()); - self.current = Some(dom); + let frag = N::fragment(); + frag.append_child(&dom); + node.append_child(&frag); + self.current = Some(frag); Ok(()) } } - let state = State::new(parent.node().clone()); - let binding = state.clone(); + let state = State::new(parent.clone()); + let binding = Rc::<_>::clone(&state); let mut binding = binding.borrow_mut(); // Apply loading binding.apply(template(Res::default()))?; let future = self.future; let fut = async move { - let mut state = state.borrow_mut(); let new_dom = template(future.await); + let mut state = state.borrow_mut(); state.apply(new_dom).unwrap(); }; parent.effect(fut); diff --git a/crates/hirola-core/src/templating/switch.rs b/crates/hirola-core/src/templating/switch.rs index 1930f0a..939c8cc 100644 --- a/crates/hirola-core/src/templating/switch.rs +++ b/crates/hirola-core/src/templating/switch.rs @@ -3,36 +3,35 @@ use std::{cell::RefCell, rc::Rc}; use futures_signals::signal::{Signal, SignalExt}; use crate::{ - dom::Dom, - generic_node::{DomType, GenericNode}, + generic_node::GenericNode, render::{Error, Render}, }; -pub struct Switch, F> +pub struct Switch, F, G> where - F: Fn(bool) -> Dom, + F: Fn(bool) -> G, { pub signal: S, pub renderer: F, } -impl Render for Switch +impl Render for Switch where - F: Fn(bool) -> Dom + 'static, + F: Fn(bool) -> N + 'static, S: Signal + 'static, { - fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { - let marker = DomType::marker(); - parent.node().append_child(&marker); - let state = State::new(parent.node().clone(), marker); + fn render_into(self: Box, parent: &N) -> Result<(), Error> { + let marker = N::marker(); + parent.append_child(&marker); + let state = State::new(parent.clone(), marker); let renderer = self.renderer; - struct State { + struct State { holder: DomType, marker: DomType, - current: Option, + current: Option, } - impl State { + impl State { fn new(element: DomType, marker: DomType) -> Rc> { Rc::new(RefCell::new(State { holder: element, @@ -42,20 +41,21 @@ where } fn clear(&mut self) { - let node = &mut self.holder; - if let Some(frag) = &self.current { - for child in &frag.children().take() { - log::debug!("Result for remove {:?}", node.remove_child(&child.node())); - } - }; + { + let node = &mut self.holder; + if let Some(frag) = &self.current { + for child in &frag.children().take() { + node.remove_child(child) + } + }; + } self.current = None; } - fn apply(&mut self, dom: Dom) { + fn apply(&mut self, dom: DomType) { self.clear(); let node = &self.holder; - let dom = dom.mount(&DomType::fragment()).unwrap(); - node.insert_child_before(&dom.node(), Some(&self.marker)); + node.insert_child_before(&dom, Some(&self.marker)); self.current = Some(dom); } } diff --git a/crates/hirola-core/tests/.DS_Store b/crates/hirola-core/tests/.DS_Store deleted file mode 100644 index bd2ae5dd3a21f2744f5845597a8da2a840e5cad3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKK~4iP47A%GiYlQVIpzgO{XwXfJ5oOYrKlivH&uaqu6&0t@D(1yIJQbx+ePAn zP-R#4WF0%nPSkZmL_B|8&4{K%G=>Te&R~v+^ow?6U>@n@GRB&AbVo1rM5z<)j{nGj z?A-+W)nL~i=y3m<&3d-DPxV%peficOS*NO6ZqgDF7%#s!=O0%;MX!Dly?s1f#f>ax zNYD7~+Uw)b@1CCZSYDlu&TqZ#`Q(4$;tV(g&cMkrfSN5bo+!F?2AlzBV9$Vj9|BY` z8fL}v>3}I$0N@DjB50R06EKJa7!9)`JP_7Ypr*22F<8^#4;B{->f==E|8@WUzn$by&VVy;QVj5@T2ynqlGWDE%So*b&|9d8 n#AU^O3L2#pBUVcB1+)nKK^nklm=)oH_(7o1;KmvFQwF{Oln6>= diff --git a/crates/hirola-core/tests/ssr/main.rs b/crates/hirola-core/tests/ssr/main.rs deleted file mode 100644 index 785c3da..0000000 --- a/crates/hirola-core/tests/ssr/main.rs +++ /dev/null @@ -1,51 +0,0 @@ -use futures_signals::{signal::Mutable, signal_vec::MutableVec}; -use hirola::prelude::*; - -#[test] -fn hello_world() { - let node = html! { -

"Hello World!"

- }; - - assert_eq!(render_to_string(node), "

Hello World!

"); -} - -#[test] -fn reactive_text() { - let count = Mutable::new(0); - - assert_eq!( - render_to_string(html! { -

{count.clone()}

- }), - "

0

" - ); - - count.set(1); - assert_eq!( - render_to_string(html! { -

{count}

- }), - "

1

" - ); -} - -#[test] -fn check_effects() { - let count = MutableVec::new_with_values(vec![1, 2, 3]); - - let node = html! { -
    - { - count.signal_vec().render_map(move |item| { - html! { -
  • {item.to_string()}
  • - } - } ) - } -
- }; - - let dom = render_to_string(node); - assert_eq!("
  • 1
  • 2
  • 3
", dom); -} diff --git a/crates/hirola-dom/Cargo.toml b/crates/hirola-dom/Cargo.toml new file mode 100644 index 0000000..c34ccc8 --- /dev/null +++ b/crates/hirola-dom/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "hirola-dom" +version = "0.3.1" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +wasm-bindgen = { version = "0.2" } +log = "0.4" +hirola-core = { path = "../hirola-core", version = "0.3.1" } +matchit = { version = "0.7" } +wasm-bindgen-futures = { version = "0.4.29" } +discard = "1" + +[dependencies.web-sys] +features = [ + "Comment", + "Document", + "DocumentFragment", + "Element", + "Event", + "HtmlElement", + "Node", + "Text", + "Window", + "History", + "Location" +] +version = "0.3.64" + +[dev-dependencies] +hirola = { path = "../../", version = "0.3.1" } +wasm-bindgen-test = "0.3.39" diff --git a/crates/hirola-core/src/app/mod.rs b/crates/hirola-dom/src/app/mod.rs similarity index 79% rename from crates/hirola-core/src/app/mod.rs rename to crates/hirola-dom/src/app/mod.rs index c3bef6d..be69a7e 100644 --- a/crates/hirola-core/src/app/mod.rs +++ b/crates/hirola-dom/src/app/mod.rs @@ -2,7 +2,7 @@ pub mod router; use router::Router; use std::fmt::Debug; -use crate::{dom::Dom}; +use crate::Dom; #[derive(Debug, Clone)] pub struct App { @@ -20,15 +20,14 @@ pub struct App { /// # Example /// ```no_run /// use hirola::prelude::*; +/// use hirola_dom::app::App; /// #[derive(Clone)] /// struct AppState { /// // ... fields and methods for your application state ... /// } /// -/// fn main() { -/// let initial_state = AppState { /* ... */ }; -/// let app = App::new(initial_state); -/// } +/// let initial_state = AppState { /* ... */ }; +/// let app = App::new(initial_state); /// ``` impl App { /// Creates a new instance of the App with the given initial state. @@ -75,6 +74,9 @@ impl App { /// # Example /// ```no_run /// use hirola::prelude::*; + /// use hirola::dom::app::App; + /// use hirola::dom::Dom; + /// /// #[derive(Clone)] /// struct AppState { /// // ... fields and methods for your application state ... @@ -92,8 +94,11 @@ impl App { /// app.route("/", home_page); /// app.route("/about", about_page); /// ``` - pub fn route(&mut self, path: &str, page: fn(&Self) -> Dom) { - self.router.handler.insert(path.to_string(), page).unwrap(); + pub fn route(&mut self, path: impl AsRef, page: fn(&Self) -> Dom) { + self.router + .handler + .insert(path.as_ref().to_string(), page) + .unwrap(); } /// Set the not-found page for the application. @@ -107,6 +112,8 @@ impl App { /// # Example /// ```no_run /// use hirola::prelude::*; + /// use hirola::dom::app::App; + /// use hirola::dom::Dom; /// /// #[derive(Clone)] /// struct AppState { @@ -125,7 +132,6 @@ impl App { } } -#[cfg(feature = "dom")] impl App { /// Mounts the application on the web page body and starts the rendering process. /// @@ -142,9 +148,9 @@ impl App { /// # Example /// /// ```no_run - /// fn main() { + /// // fn main() { /// use hirola::prelude::*; - /// + /// use hirola::dom::app::App; /// #[derive(Clone)] /// struct AppState { /// // ... fields and methods for your application state ... @@ -156,16 +162,17 @@ impl App { /// /// // Mount the app on the web page body and start rendering /// app.mount(); - /// } + /// //} /// ``` pub fn mount(&self) { let window = web_sys::window().unwrap(); let document = window.document().unwrap(); let router = self.router.clone(); let dom = router.render( - &self, - &crate::generic_node::DomNode { + self, + &crate::Dom { node: document.body().unwrap().into(), + ..Default::default() }, ); // We leak the root node to avoid callbacks and futures being dropped @@ -185,8 +192,9 @@ impl App { /// # Example /// /// ```no_run - /// fn main() { + ///// fn main() { /// use hirola::prelude::*; + /// use hirola::dom::app::App; /// #[derive(Clone)] /// struct AppState { /// // ... fields and methods for your application state ... @@ -204,14 +212,15 @@ impl App { /// /// // Mount the app on the specified parent node and start rendering /// app.mount_to(&parent_node); - /// } + /// //} /// ``` pub fn mount_to(&self, parent: &web_sys::Node) { let router = self.router.clone(); let dom = router.render( - &self, - &crate::generic_node::DomNode { + self, + &crate::Dom { node: parent.clone(), + ..Default::default() }, ); // We leak the root node to avoid callbacks and futures being dropped @@ -234,8 +243,11 @@ impl App { /// # Example /// /// ```no_run - /// fn main() { + ///// fn main() { /// use hirola::prelude::*; + /// use hirola::dom::app::App; + /// use hirola::dom::Dom; + /// /// #[derive(Clone)] /// struct AppState { /// // ... fields and methods for your application state ... @@ -255,9 +267,7 @@ impl App { /// // In this example, we wrap the rendered content with a layout component /// app.mount_with(&parent_node, |app| { /// let router = app.router().clone(); - /// let inner = router.render(app, &DomType { - /// node: parent_node.clone().into() - /// }); + /// let inner = router.render(app, &Dom::new_from_node(&parent_node)); /// html! { ///
///
/// } /// }); - /// } + /// //} /// ``` pub fn mount_with(&self, parent: &web_sys::Node, cb: impl Fn(&Self) -> Dom) { let res = cb(self); - parent.append_child(&res.node().inner_element()).unwrap(); + parent.append_child(&res.inner_element()).unwrap(); // We leak the root node to avoid callbacks and futures being dropped std::mem::forget(res); } } - -#[cfg(feature = "ssr")] -impl App { - /// Renders the application to a string representation based on the specified route path. - /// - /// This method is useful for server-side rendering (SSR) scenarios where you want to generate - /// the initial HTML content on the server and send it to the client. It renders the application - /// for the provided route path and returns the result as a string. - /// - /// # Arguments - /// - /// * `path` - The path for the route to render, a string representing the route pattern. - /// - /// # Returns - /// - /// A string containing the HTML representation of the rendered content. - /// - /// # Example - /// - /// ```no_run - /// fn main() { - /// use hirola::prelude::*; - /// - /// #[derive(Clone)] - /// struct AppState { - /// // ... fields and methods for your application state ... - /// } - /// - /// // ... add routes and set up the app ... - /// - /// // Render the application for the "/about" route and get the result as a string - /// let rendered_html = app.render_to_string("/about"); - /// - /// // ... send `rendered_html` to the client for server-side rendering ... - /// } - /// ``` - pub fn render_to_string(&self, path: &str) -> String { - use crate::generic_node::GenericNode; - let fragment = crate::generic_node::SsrNode::fragment(); - let router = self.router().clone(); - // Set the path - router.push(path); - // Render path to fragment - router.render(self, &fragment); - format!("{fragment}") - } -} diff --git a/crates/hirola-core/src/app/router.rs b/crates/hirola-dom/src/app/router.rs similarity index 89% rename from crates/hirola-core/src/app/router.rs rename to crates/hirola-dom/src/app/router.rs index 4a70245..cba7263 100644 --- a/crates/hirola-core/src/app/router.rs +++ b/crates/hirola-dom/src/app/router.rs @@ -1,12 +1,14 @@ -use crate::{dom::Dom, prelude::*}; -use futures_signals::signal::{Mutable, MutableSignalCloned, SignalExt}; +use hirola_core::prelude::signal::{Mutable, MutableSignalCloned, SignalExt}; +use hirola_core::prelude::*; use std::collections::HashMap; use std::fmt; -#[cfg(feature = "dom")] use wasm_bindgen::{prelude::Closure, JsCast, JsValue}; -#[cfg(feature = "dom")] use web_sys::{Element, Event}; +use crate::Dom; + +use super::App; + /// Router struct for handling routing in the frontend application. /// /// This struct manages the routing functionality for the frontend application. It keeps track of @@ -18,6 +20,8 @@ use web_sys::{Element, Event}; /// /// ```no_run /// use hirola::prelude::*; +/// use hirola::dom::Dom; +/// use hirola_dom::app::App; /// #[derive(Clone)] /// struct AppState { /// // ... fields and methods for your application state ... @@ -71,20 +75,18 @@ impl Router { /// /// ```no_run /// use hirola::prelude::*; - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; /// let router = Router::<()>::new(); /// ``` pub fn new() -> Self { - #[allow(unused_mut)] let mut path = String::from("/"); - #[cfg(feature = "dom")] if let Some(window) = web_sys::window() { path = window.location().pathname().unwrap_or("/".to_string()); } Router { current: Mutable::new(path), handler: Default::default(), - not_found: Box::new(|_| Dom::text("Not Found")), + not_found: Box::new(|_| Dom::text_node("Not Found")), } } @@ -101,7 +103,7 @@ impl Router { /// # Example /// /// ```no_run - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; /// let router = Router::<()>::new(); /// let params = router.current_params(); /// ``` @@ -133,17 +135,15 @@ impl Router { /// # Example /// /// ```no_run - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; /// let router = Router::<()>::new(); /// router.push("/about"); pub fn push(&self, path: &str) { - #[cfg(feature = "dom")] let window = web_sys::window().unwrap(); - #[cfg(feature = "dom")] window .history() .unwrap() - .push_state_with_url(&JsValue::default(), "", Some(&path)) + .push_state_with_url(&JsValue::default(), "", Some(path)) .unwrap(); self.current.set(path.to_owned()); } @@ -162,27 +162,22 @@ impl Router { /// # Example /// /// ```no_run - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; /// let router = Router::<()>::new(); /// let link_handler = router.link(); /// /// // ... attach `link_handler` as an event handler to an anchor or button element ... /// ``` - pub fn link(&self) -> Box () + '_> { - #[cfg(feature = "dom")] + pub fn link(&self) -> Box { let router = self.clone(); - #[allow(unused_variables)] let cb = move |node: &Dom| { - #[cfg(feature = "dom")] let router = router.clone(); - #[cfg(feature = "dom")] let handle_click = Box::new(move |e: Event| { e.prevent_default(); let element = e.current_target().unwrap().dyn_into::().unwrap(); let href = element.get_attribute("href").unwrap(); router.push(&href); }) as Box; - #[cfg(feature = "dom")] node.event("click", handle_click); }; Box::new(cb) @@ -201,7 +196,7 @@ impl Router { /// # Example /// /// ```no_run - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; /// let router = Router::<()>::new(); /// let signal = router.signal(); /// @@ -230,7 +225,9 @@ impl Router { /// # Example /// /// ```no_run - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; + /// use hirola::dom::app::App; + /// use hirola::dom::Dom; /// use hirola::prelude::*; /// #[derive(Clone)] /// struct AppState { @@ -250,13 +247,11 @@ impl Router { /// app.route("/about", about_page); /// let router = app.router().clone(); /// let doc = web_sys::window().unwrap().document().unwrap(); - /// router.render(&app, &DomType::fragment()); + /// router.render(&app, &Dom::fragment()); /// ``` - pub fn render(self, app: &App, parent: &DomType) -> Dom { + pub fn render(&self, app: &App, parent: &Dom) -> Dom { let router = &self.handler; - #[cfg(feature = "dom")] let current = self.current.clone(); - #[cfg(feature = "dom")] //Hash routing forward in history and URL rewrite let handle_hash = Closure::wrap(Box::new(move |_evt: web_sys::Event| { let l: String = web_sys::window() @@ -276,17 +271,13 @@ impl Router { current.set(l.to_string()); }) as Box); - #[cfg(feature = "dom")] web_sys::window() .unwrap() .set_onhashchange(Some(handle_hash.as_ref().unchecked_ref())); - #[cfg(feature = "dom")] handle_hash.forget(); - #[cfg(feature = "dom")] let current = self.current.clone(); //Routing for navigating in history and escaping hash routes - #[cfg(feature = "dom")] let handle_pop = Closure::wrap(Box::new(move |_evt: web_sys::Event| { let path_name = web_sys::window().unwrap().location().pathname().unwrap(); @@ -300,18 +291,16 @@ impl Router { > 0 { log::debug!("hash detected"); - return (); + return; } current.set(path_name.to_string()); log::debug!("pop handle : {path_name}"); }) as Box); - #[cfg(feature = "dom")] web_sys::window() .unwrap() .set_onpopstate(Some(handle_pop.as_ref().unchecked_ref())); - #[cfg(feature = "dom")] handle_pop.forget(); let route = &self.current.clone(); @@ -322,8 +311,8 @@ impl Router { Err(_) => &self.not_found, }; - let builder = page_fn(&app); - let dom = builder.mount(&parent).unwrap(); + let builder = page_fn(app); + let _ = &parent.append_child(&builder); let router = router.clone(); let app = app.clone(); @@ -339,11 +328,10 @@ impl Router { }; let builder = page_fn(&app); - let dom = builder.mount(&DomType::fragment()).unwrap(); - node.replace_children_with(&dom.node()); - #[cfg(feature = "dom")] + let dom = Dom::fragment(); + dom.append_child(&builder); + node.replace_children_with(&dom); let window = web_sys::window().unwrap(); - #[cfg(feature = "dom")] window .history() .unwrap() @@ -352,8 +340,8 @@ impl Router { log::debug!("Router received new path: {route_match}"); }) .to_future(); - dom.effect(wait_for_next_route); - dom + parent.effect(wait_for_next_route); + parent.clone() } /// Inserts a new route and its corresponding page rendering function into the router. @@ -379,8 +367,10 @@ impl Router { /// # Example /// /// ```no_run - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; /// use hirola::prelude::*; + /// use hirola::dom::Dom; + /// use hirola_dom::app::App; /// /// // Define a custom function to render the home page /// fn home_page(_: &App<()>) -> Dom { @@ -412,7 +402,9 @@ impl Router { /// # Example /// /// ```no_run - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; + /// use hirola::dom::Dom; + /// use hirola_dom::app::App; /// use hirola::prelude::*; /// // Define a custom function to render the not-found page /// fn not_found_page(_: &App<()>) -> Dom { @@ -442,7 +434,9 @@ impl Router { /// # Example /// /// ```no_run - /// use hirola::prelude::router::Router; + /// use hirola::dom::app::router::Router; + /// use hirola::dom::Dom; + /// use hirola_dom::app::App; /// use hirola::prelude::*; /// /// // Define custom functions to render the home and about pages @@ -470,3 +464,9 @@ impl Router { self.handler.clone() } } + +impl Default for Router { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/hirola-dom/src/lib.rs b/crates/hirola-dom/src/lib.rs new file mode 100644 index 0000000..8099329 --- /dev/null +++ b/crates/hirola-dom/src/lib.rs @@ -0,0 +1,365 @@ +pub mod app; +pub mod mixins; +pub mod node_ref; + +use core::fmt; +use discard::{DiscardOnDrop, Discard}; +use hirola_core::prelude::cancelable_future; +use hirola_core::render::Render; +use hirola_core::{ + generic_node::{EventListener, GenericNode}, + prelude::CancelableFutureHandle, + render::Error, + BoxedLocal, +}; +use std::rc::Rc; +use std::{cell::RefCell, future::Future}; +use wasm_bindgen::{prelude::*, JsCast}; +pub use web_sys::Event; +use web_sys::{Element, Node, Text}; + +pub enum DomSideEffect { + UnMounted(BoxedLocal<()>), + Mounted(CancelableFutureHandle), +} + +pub type EventHandlers = Rc>>>; + +/// Rendering backend for the DOM. +/// +/// The `DomNode` struct represents a node in the Document Object Model (DOM) and serves as the +/// rendering backend for the frontend application. It allows interacting with DOM nodes directly +/// and provides utility methods for type conversion and cloning. +/// +/// _This API requires the following crate features to be activated: `dom`_ +/// +#[derive(Clone)] +pub struct Dom { + pub node: Node, + pub side_effects: Rc>>, + event_handlers: EventHandlers, + children: RefCell>, +} + +impl fmt::Debug for Dom { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Dom") + .field("node", &self.node) + .field("side_effects", &self.side_effects.borrow().len()) + .field("event_handlers", &self.event_handlers.borrow()) + .field("children", &self.children.borrow()) + .finish() + } +} + +impl PartialEq for Dom { + fn eq(&self, other: &Self) -> bool { + self.node == other.node + } +} + +impl Eq for Dom {} + +impl Default for Dom { + fn default() -> Self { + Dom { + node: document().create_document_fragment().dyn_into().unwrap(), + side_effects: Default::default(), + event_handlers: Default::default(), + children: Default::default(), + } + } +} + +impl Dom { + pub fn inner_html(&self) -> String { + { + let window = web_sys::window().unwrap(); + let document = window.document().unwrap(); + let element = document.create_element("div").unwrap(); + crate::render_to(self.clone(), &element.clone().try_into().unwrap()).unwrap(); + element.inner_html() + } + } + + pub fn new_from_node(node: &Node) -> Self { + Dom { + node: node.clone(), + ..Default::default() + } + } + + pub fn discard(&mut self) { + let _cleanup: Vec<()> = self + .event_handlers + .take() + .into_iter() + .map(|c| c.forget()) + .collect(); + let _cleanup: Vec<()> = self + .side_effects + .take() + .into_iter() + .map(|e| match e { + DomSideEffect::Mounted(e) => e.discard(), + DomSideEffect::UnMounted(_) => { + log::warn!("Dropping a side effect that was not mounted") + } + }) + .collect(); + } +} + +impl Dom { + /// Retrieves the inner DOM node contained within the `DomNode`. + /// + /// # Returns + /// + /// The underlying DOM node represented by this `DomNode`. + pub fn inner_element(&self) -> Node { + self.node.clone() + } + /// Converts the `DomNode` into a specified type using unchecked casting. + /// + /// This method allows converting the `DomNode` into a specific type, without performing a + /// runtime type check. It can be used when you are confident about the type of the DOM node, + /// and it avoids the overhead of dynamic type checking. + /// + /// # Type Parameters + /// + /// * `T` - The target type to convert the `DomNode` into. It should implement the `JsCast` + /// trait, which provides the unchecked casting functionality. + /// + /// # Returns + /// + /// The converted `DomNode` as the target type `T`. + pub fn unchecked_into(self) -> T { + self.node.unchecked_into() + } + /// Attempts to dynamically cast the `DomNode` into a specified type. + /// + /// This method performs a runtime type check to determine if the `DomNode` can be converted + /// into the desired type. If the conversion succeeds, it returns the converted value; + /// otherwise, it returns an error containing the original `DomNode`. + /// + /// # Type Parameters + /// + /// * `T` - The target type to cast the `DomNode` into. It should implement the `JsCast` + /// trait, which provides the dynamic type casting functionality. + /// + /// # Returns + /// + /// - `Ok(T)` if the `DomNode` was successfully cast into the target type `T`. + /// - `Err(Node)` if the `DomNode` could not be cast into the target type `T`. + + pub fn dyn_into(self) -> Result { + self.node.dyn_into() + } +} + +impl AsRef for Dom { + fn as_ref(&self) -> &JsValue { + self.node.as_ref() + } +} + +impl From for JsValue { + fn from(node: Dom) -> Self { + node.node.into() + } +} + +fn document() -> web_sys::Document { + web_sys::window().unwrap().document().unwrap() +} + +impl GenericNode for Dom { + fn element(tag: &str) -> Self { + Dom { + node: document().create_element(tag).unwrap().dyn_into().unwrap(), + ..Default::default() + } + } + + fn text_node(text: &str) -> Self { + Dom { + node: document().create_text_node(text).into(), + ..Default::default() + } + } + + fn fragment() -> Self { + Dom { + node: document().create_document_fragment().dyn_into().unwrap(), + ..Default::default() + } + } + + fn marker() -> Self { + Dom { + node: document().create_comment("").into(), + ..Default::default() + } + } + + fn set_attribute(&self, name: &str, value: &str) { + self.node + .unchecked_ref::() + .set_attribute(name, value) + .unwrap(); + } + + fn append_child(&self, child: &Self) { + match self.node.append_child(&child.node) { + Err(e) => log::warn!("Could not append child: {e:?}"), + _ => { + self.children.borrow_mut().push(child.clone()); + } + } + } + + fn insert_child_before(&self, new_node: &Self, reference_node: Option<&Self>) { + match self + .node + .insert_before(&new_node.node, reference_node.map(|n| &n.node)) + { + Ok(_) => {} + Err(e) => log::warn!("Failed to insert child: {e:?}"), + } + } + + fn remove_child(&self, child: &Self) { + match self.node.remove_child(&child.node) { + Ok(_) => {} + Err(e) => log::warn!("Failed to remove child: {e:?}"), + }; + } + + fn replace_child(&self, old: &Self, new: &Self) { + match self.node.replace_child(&old.node, &new.node) { + Ok(_) => {} + Err(e) => log::warn!("Failed to replace child: {e:?}"), + }; + } + + fn insert_sibling_before(&self, child: &Self) { + self.node + .unchecked_ref::() + .before_with_node_1(&child.node) + .unwrap(); + } + + fn parent_node(&self) -> Option { + let n =self.node.parent_node().unwrap(); + Some(Self { + node: n, + ..Default::default() + }) + } + + fn next_sibling(&self) -> Option { + self.node.next_sibling().map(|node| Self { + node, + ..Default::default() + }) + } + + fn remove_self(&self) { + self.node.unchecked_ref::().remove(); + } + + fn update_inner_text(&self, text: &str) { + self.node + .dyn_ref::() + .unwrap() + .set_text_content(Some(text)); + } + fn replace_children_with(&self, node: &Self) { + let element = self.node.unchecked_ref::(); + element.replace_children_with_node_1(&node.inner_element()) + } + + fn effect(&self, future: impl std::future::Future + 'static) { + self.side_effects + .borrow_mut() + .push(DomSideEffect::Mounted(DiscardOnDrop::leak(spawn(future)))); + } + + fn children(&self) -> RefCell> { + self.children.clone() + } +} + +/// Render a [`Dom`] into the DOM. +/// Alias for [`render_to`] with `parent` being the `` tag. +pub fn render(dom: Dom) -> Result { + let window = web_sys::window().unwrap(); + let document = window.document().unwrap(); + + render_to(dom, &document.body().unwrap()) +} + +/// Render a [`Dom`] under a `parent` node. +/// For rendering under the `` tag, use [`render()`] instead. + +pub fn render_to(dom: Dom, parent: &web_sys::Node) -> Result { + let parent = Dom { + node: parent.clone(), + ..Default::default() + }; + parent.append_child(&dom); + Ok(parent) +} + +impl EventListener for Dom { + type Handler = Box; + fn event(&self, name: &str, handler: Self::Handler) { + let closure = Closure::wrap(handler); + self.node + .add_event_listener_with_callback(name, closure.as_ref().unchecked_ref()) + .unwrap(); + self.event_handlers.borrow_mut().push(closure); + } +} + +#[inline] +pub fn spawn(future: F) -> DiscardOnDrop +where + F: Future + 'static, +{ + let (handle, future) = cancelable_future(future, || ()); + + wasm_bindgen_futures::spawn_local(future); + + handle +} + +impl Render for Dom { + fn render_into(self: Box, parent: &Dom) -> Result<(), Error> { + parent.append_child(&self); + Ok(()) + } +} + + +pub mod dom_test_utils { + use wasm_bindgen::{prelude::Closure, JsCast}; + + pub fn next_tick_with(with: &N, f: impl Fn(&N) + 'static) { + let with = with.clone(); + let f: Box = Box::new(move || f(&with)); + let a = Closure::::new(f); + web_sys::window() + .unwrap() + .set_timeout_with_callback(a.as_ref().unchecked_ref()) + .unwrap(); + } + + pub fn next_tick(f: F) { + let a = Closure::::new(f); + web_sys::window() + .unwrap() + .set_timeout_with_callback(a.as_ref().unchecked_ref()) + .unwrap(); + } +} diff --git a/crates/hirola-dom/src/mixins.rs b/crates/hirola-dom/src/mixins.rs new file mode 100644 index 0000000..de22136 --- /dev/null +++ b/crates/hirola-dom/src/mixins.rs @@ -0,0 +1,51 @@ +use std::fmt::Display; + +use hirola_core::{ + generic_node::GenericNode, + prelude::signal::{Signal, SignalExt}, +}; +use wasm_bindgen::JsCast; +use web_sys::Element; + +use crate::Dom; + +/// A mixin that allows adding raw html +/// Note: This is a security risk if the string to be inserted might contain potentially malicious content. +/// sanitize the content before it is inserted. +/// See more: https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML +#[allow(unused_variables)] +pub fn raw_html<'a>(text: &'a str) -> Box { + let cb = move |node: &Dom| { + let element = node.as_ref().clone().unchecked_into::(); + element.set_inner_html(text); + }; + Box::new(cb) +} + +/// A mixin that allows adding non-signal text +#[allow(unused_variables)] +pub fn raw_text<'a>(text: &'a str) -> Box { + let cb = move |dom: &Dom| { + dom.node.set_text_content(Some(text)); + }; + Box::new(cb) +} + +/// Mixin that adds text to a dom node +#[allow(unused_variables)] +pub fn text(signal: S) -> Box +where + T: Display + 'static, + S: Signal + SignalExt + 'static, +{ + let cb = move |_node: &Dom| { + use std::future::ready; + let element = _node.as_ref().clone().unchecked_into::(); + let future = signal.for_each(move |value| { + element.set_text_content(Some(&format!("{}", value))); + ready(()) + }); + _node.effect(future); + }; + Box::new(cb) +} diff --git a/crates/hirola-core/src/templating/noderef.rs b/crates/hirola-dom/src/node_ref.rs similarity index 68% rename from crates/hirola-core/src/templating/noderef.rs rename to crates/hirola-dom/src/node_ref.rs index 5721638..8d64c79 100644 --- a/crates/hirola-core/src/templating/noderef.rs +++ b/crates/hirola-dom/src/node_ref.rs @@ -1,13 +1,16 @@ //! References to nodes in templates. -use crate::generic_node::DomType; use std::any::Any; use std::cell::RefCell; use std::fmt; use std::rc::Rc; +use hirola_core::generic_node::NodeReference; + +use crate::Dom; + /// A reference to a [`GenericNode`]. #[derive(Clone, PartialEq, Eq)] -pub struct NodeRef(Rc>>); +pub struct NodeRef(Rc>>); impl NodeRef { /// Creates an empty [`NodeRef`]. @@ -21,7 +24,7 @@ impl NodeRef { /// Panics if the [`NodeRef`] is not set yet or is the wrong type. /// /// For a non panicking version, see [`NodeRef::try_get`]. - pub fn get(&self) -> DomType { + pub fn get(&self) -> Dom { self.try_get().expect("NodeRef is not set") } @@ -29,31 +32,31 @@ impl NodeRef { /// the wrong type. /// /// For a panicking version, see [`NodeRef::get`]. - pub fn try_get(&self) -> Option { + fn inner_try_get(&self) -> Option { let obj = self.0.borrow(); (obj.as_ref()? as &dyn Any).downcast_ref().cloned() } - /// Gets the raw [`DomType`] stored inside the [`NodeRef`]. + /// Gets the raw [`DomNode`] stored inside the [`NodeRef`]. /// /// # Panics /// Panics if the [`NodeRef`] is not set yet. /// /// For a non panicking version, see [`NodeRef::try_get_raw`]. - pub fn get_raw(&self) -> DomType { + pub fn get_raw(&self) -> Dom { self.try_get().expect("NodeRef is not set") } - /// Tries to get the raw [`DomType`] stored inside the [`NodeRef`] or `None` if it is + /// Tries to get the raw [`DomNode`] stored inside the [`NodeRef`] or `None` if it is /// not yet set. /// /// For a panicking version, see [`NodeRef::get`]. - pub fn try_get_raw(&self) -> Option { + pub fn try_get_raw(&self) -> Option { self.0.borrow().clone() } - /// Sets the [`NodeRef`] with the specified [`DomType`]. - pub fn set(&self, node: DomType) { + /// Sets the [`NodeRef`] with the specified [`DomNode`]. + fn inner_set(&self, node: Dom) { *self.0.borrow_mut() = Some(node); } } @@ -69,3 +72,13 @@ impl fmt::Debug for NodeRef { f.debug_tuple("NodeRef").field(&self.0.borrow()).finish() } } + +impl NodeReference for NodeRef { + type Target = Dom; + fn set(&self, node: Self::Target) { + self.inner_set(node) + } + fn try_get(&self) -> Option { + self.inner_try_get() + } +} diff --git a/crates/hirola-core/tests/integration/keyed.rs b/crates/hirola-dom/tests/integration/keyed.rs similarity index 100% rename from crates/hirola-core/tests/integration/keyed.rs rename to crates/hirola-dom/tests/integration/keyed.rs diff --git a/crates/hirola-core/tests/integration/main.rs b/crates/hirola-dom/tests/integration/main.rs similarity index 92% rename from crates/hirola-core/tests/integration/main.rs rename to crates/hirola-dom/tests/integration/main.rs index 5395ed1..b93697f 100644 --- a/crates/hirola-core/tests/integration/main.rs +++ b/crates/hirola-dom/tests/integration/main.rs @@ -2,9 +2,10 @@ pub mod keyed; pub mod non_keyed; pub mod router; -use futures_signals::signal::Mutable; +use hirola::prelude::signal::Mutable; use hirola::prelude::*; -use hirola_core::dom_test_utils::{next_tick, next_tick_with}; +use hirola_dom::dom_test_utils::{next_tick, next_tick_with}; +use hirola_dom::{node_ref::NodeRef, render_to}; use wasm_bindgen_test::*; use web_sys::{Document, HtmlElement, Node, Window}; @@ -121,14 +122,14 @@ fn reactive_attribute() { let count = Mutable::new(0); let node = html! { - + }; let _ = render_to(node, &test_div()); let span = document().query_selector("span").unwrap().unwrap(); - assert_eq!(span.get_attribute("attribute").unwrap(), "0"); + // assert_eq!(span.get_attribute("attribute").unwrap(), "0"); count.set(1); next_tick(move || { diff --git a/crates/hirola-core/tests/integration/non_keyed.rs b/crates/hirola-dom/tests/integration/non_keyed.rs similarity index 90% rename from crates/hirola-core/tests/integration/non_keyed.rs rename to crates/hirola-dom/tests/integration/non_keyed.rs index 9b571c9..6d870db 100644 --- a/crates/hirola-core/tests/integration/non_keyed.rs +++ b/crates/hirola-dom/tests/integration/non_keyed.rs @@ -1,5 +1,5 @@ -use futures_signals::{signal::Mutable, signal_vec::MutableVec}; -use hirola_core::dom_test_utils::{next_tick, next_tick_with}; +use hirola_core::prelude::{signal::Mutable, signal_vec::MutableVec}; +use hirola_dom::dom_test_utils::{next_tick, next_tick_with}; use super::*; @@ -10,7 +10,7 @@ fn append() { let node = html! {
    { - count.signal_vec().render_map(|item| { + count.signal_vec().map_render(|item| { html! {
  • { item.to_string() }
  • @@ -46,7 +46,7 @@ fn swap_rows() { let node = html! {
      { - count.signal_vec().render_map(|item| { + count.signal_vec().map_render(|item| { html! {
    • { item.to_string() }
    • @@ -81,7 +81,7 @@ fn delete_row() { let node = html! {
        { - count.signal_vec().render_map(|item| { + count.signal_vec().map_render(|item| { html! {
      • { item.to_string() }
      • @@ -111,7 +111,7 @@ fn clear() { let node = html! {
          { - count.signal_vec().render_map(|item: i32| { + count.signal_vec().map_render(|item: i32| { html! {
        • { item.to_string() }
        • } @@ -143,7 +143,7 @@ fn insert_front() { let node = html! {
            { - count.signal_vec().render_map(|item| { + count.signal_vec().map_render(|item| { html! {
          • { item.to_string() }
          • } @@ -172,7 +172,7 @@ fn nested_reactivity() { let node = html! {
              { - count.signal_vec_cloned().render_map(|item| { + count.signal_vec_cloned().map_render(|item| { html! {
            • { item }
            • diff --git a/crates/hirola-core/tests/integration/router.rs b/crates/hirola-dom/tests/integration/router.rs similarity index 88% rename from crates/hirola-core/tests/integration/router.rs rename to crates/hirola-dom/tests/integration/router.rs index ee916a6..3b2d3b7 100644 --- a/crates/hirola-core/tests/integration/router.rs +++ b/crates/hirola-dom/tests/integration/router.rs @@ -1,6 +1,8 @@ use hirola::prelude::*; -use hirola_core::dom_test_utils::next_tick; -use hirola_core::prelude::router::Router; +use hirola_dom::dom_test_utils::next_tick; +use hirola_dom::Dom; +use hirola_dom::app::App; +use hirola_dom::app::router::Router; use wasm_bindgen_test::*; wasm_bindgen_test_configure!(run_in_browser); @@ -11,23 +13,23 @@ struct AppState { } fn home_page(_: &App) -> Dom { - Dom::text("Home") + Dom::text_node("Home") } fn about_page(_: &App) -> Dom { - Dom::text("About") + Dom::text_node("About") } fn not_found_page(_: &App) -> Dom { - Dom::text("NotFound") + Dom::text_node("NotFound") } fn user(_: &App) -> Dom { - Dom::text("User") + Dom::text_node("User") } -fn body() -> DomType { - DomType::fragment() +fn body() -> Dom { + Dom::fragment() } // Helper function to set up a test instance of Router @@ -53,7 +55,7 @@ fn test_router_insert_and_render() { let app = App::new(AppState {}); let body = &body(); let home_dom = (router.handler().at("/").unwrap().value)(&app); - let rendered = router.clone().render(&app, &body); + let rendered = router.clone().render(&app, body); assert_eq!(rendered.inner_html(), home_dom.inner_html()); router.push("/about"); diff --git a/crates/hirola-form/Cargo.toml b/crates/hirola-form/Cargo.toml index 93f0cf6..8d19d05 100644 --- a/crates/hirola-form/Cargo.toml +++ b/crates/hirola-form/Cargo.toml @@ -12,9 +12,8 @@ keywords = ["wasm", "html", "form", "web"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -hirola-core = { path = "../hirola-core", features = [ - "dom", -], version = "0.3.1" } +hirola-core = { path = "../hirola-core", version = "0.3.1" } +hirola-dom = { path = "../hirola-dom", version = "0.3.1", default-features = false } wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } serde = { version = "1.0.193", features = ["derive"] } serde_json = "1" diff --git a/crates/hirola-form/src/bind.rs b/crates/hirola-form/src/bind.rs index 4f5c265..c0e58a0 100644 --- a/crates/hirola-form/src/bind.rs +++ b/crates/hirola-form/src/bind.rs @@ -5,19 +5,20 @@ use std::{ }; use hirola_core::prelude::{*, signal::SignalExt}; +use hirola_dom::Dom; use wasm_bindgen::JsCast; use web_sys::{Event, HtmlInputElement}; /// Model allows 2-way binding eg between a signal and an input pub struct Model(Mutable, PhantomData); -impl Mixin for Model +impl Mixin for Model where ::Err: Debug, { - fn mixin(&self, node: &Dom) { + fn mixin(self, node: &Dom) { let input = { - let node = node.node().as_ref().clone(); + let node = node.as_ref().clone(); node.dyn_into::().unwrap() }; let signal = self.0.clone(); diff --git a/crates/hirola-form/src/lib.rs b/crates/hirola-form/src/lib.rs index 0949144..0df824e 100644 --- a/crates/hirola-form/src/lib.rs +++ b/crates/hirola-form/src/lib.rs @@ -1,9 +1,10 @@ pub mod bind; -use hirola_core::prelude::{ +use hirola_core::{prelude::{ signal::{Mutable, MutableSignalRef, ReadOnlyMutable}, - Dom, GenericNode, Mixin, NodeRef, -}; + GenericNode, Mixin +}, generic_node::EventListener}; +use hirola_dom::{Dom, node_ref::NodeRef}; use json_dotpath::DotPaths; use serde::{de::DeserializeOwned, Serialize}; use std::{collections::HashMap, marker::PhantomData}; @@ -29,6 +30,7 @@ pub struct Form; #[derive(Clone, Debug)] pub struct FormHandler { node_ref: NodeRef, + // TODO: change to MutableBTreeMap value: Mutable, } @@ -43,7 +45,7 @@ impl FormHandler { /// Get the immutable handle for form value pub fn handle(&self) -> ReadOnlyMutable { - (&self.value).read_only() + self.value.read_only() } /// Update a specific field using the dot notation. @@ -51,7 +53,7 @@ impl FormHandler { pub fn update_field(&self, name: &str, value: S) -> Result<(), Error> { let current_value = self.value.clone(); let mut json = serde_json::to_value(¤t_value).map_err(Error::Json)?; - json.dot_set(&name, value).map_err(Error::InvalidSetter)?; + json.dot_set(name, value).map_err(Error::InvalidSetter)?; let ser: T = serde_json::from_value(json).map_err(Error::Json)?; current_value.set(ser); Ok(()) @@ -77,8 +79,8 @@ pub struct Register { element_type: PhantomData, } -impl Mixin
              for Register { - fn mixin(&self, dom: &Dom) { +impl Mixin for Register { + fn mixin(self, dom: &Dom) { let form = self.form.clone(); let handler = Box::new(move |e: Event| { let input = e @@ -93,17 +95,17 @@ impl Mixin for Register().unwrap() }; let name = input.name(); let value: String = self.form.get_value_by_field(&name).unwrap().unwrap(); - dom.node().set_attribute("value", &value); + dom.set_attribute("value", &value); } } -impl Mixin for Register { - fn mixin(&self, node: &Dom) { +impl Mixin for Register { + fn mixin(self, node: &Dom) { let form = self.form.clone(); let handler = Box::new(move |e: Event| { let input = e @@ -142,7 +144,7 @@ impl B let json = serde_json::to_value(value).unwrap(); json.dot_get(name).unwrap().unwrap() } - current_value.signal_ref(|value| read_inner_value::(&value, name)) + current_value.signal_ref(|value| read_inner_value::(value, name)) } } diff --git a/crates/hirola-kit/src/formatter/format/mod.rs b/crates/hirola-kit/src/formatter/format/mod.rs index c1d9855..08ecddc 100644 --- a/crates/hirola-kit/src/formatter/format/mod.rs +++ b/crates/hirola-kit/src/formatter/format/mod.rs @@ -51,6 +51,7 @@ impl From<&FormatterSettings> for PrinterSettings { margin: value.max_width as isize, indent: value.tab_spaces as isize, min_space: 60, + crlf_line_endings: true } } } diff --git a/crates/hirola-macros/Cargo.toml b/crates/hirola-macros/Cargo.toml index 98e5629..863630e 100644 --- a/crates/hirola-macros/Cargo.toml +++ b/crates/hirola-macros/Cargo.toml @@ -26,5 +26,6 @@ proc-macro-hack = "0.5" paste = { version = "1" } [dev-dependencies] -hirola = { path = "../../", features=["ssr"] } +hirola = { path = "../../" } trybuild = "1.0" +hirola-ssr = { path = "../hirola-ssr" } diff --git a/crates/hirola-macros/src/component.rs b/crates/hirola-macros/src/component.rs index c160634..e6682ff 100644 --- a/crates/hirola-macros/src/component.rs +++ b/crates/hirola-macros/src/component.rs @@ -1,3 +1,4 @@ + use proc_macro::TokenStream; use proc_macro_error::emit_error; use quote::quote; @@ -9,6 +10,16 @@ pub fn create_function_component(f: syn::ItemFn) -> TokenStream { let inputs = f.sig.inputs; let block = f.block; let vis = f.vis; + let output = f.sig.output; + + let output = match output { + syn::ReturnType::Default => { + emit_error!(output.span(), "A valid return is expected"); + panic!("invalid component provided") + }, + syn::ReturnType::Type(_, ty) => ty, + + }; let inputs_block = if !inputs.is_empty() { let input_names: Vec<_> = inputs.iter().collect(); @@ -44,13 +55,14 @@ pub fn create_function_component(f: syn::ItemFn) -> TokenStream { // #[derive(Debug)] #vis struct #struct_name #impl_generics #inputs_block - impl #impl_generics ::hirola::prelude::Render for #struct_name #ty_generics #where_clause { - fn render_into(self: Box, dom: &Dom) -> Result<(), Error> { + impl #impl_generics ::hirola::prelude::Render<#output> for #struct_name #ty_generics #where_clause { + fn render_into(self: Box, dom: &#output) -> Result<(), hirola::prelude::Error> { let result = { #inputs_reading #block }; - Box::new(result).render_into(&dom)?; + hirola::prelude::GenericNode::append_child(dom, &result); + // Box::new(result).render_into(&dom)?; Ok(()) } } diff --git a/crates/hirola-macros/src/lib.rs b/crates/hirola-macros/src/lib.rs index 1142f2b..234430d 100644 --- a/crates/hirola-macros/src/lib.rs +++ b/crates/hirola-macros/src/lib.rs @@ -29,7 +29,6 @@ fn to_token_stream(input: proc_macro::TokenStream) -> TokenStream { #nodes_output } } - .into() } fn fragment_to_tokens(nodes: Vec) -> TokenStream { @@ -37,7 +36,7 @@ fn fragment_to_tokens(nodes: Vec) -> TokenStream { let children_tokens = children_to_tokens(nodes); tokens.extend(quote! { { - let mut template = ::hirola::prelude::Dom::new(); + let mut template = ::hirola::prelude::GenericNode::fragment(); #children_tokens template } @@ -57,13 +56,13 @@ fn node_to_tokens(node: Node) -> TokenStream { let children_tokens = children_to_tokens(node.children.clone()); tokens.extend(quote! { - { - let mut template: ::hirola::prelude::Dom = ::hirola::prelude::Dom::element(#name); - #children_tokens - #(#attributes)* - template - } - }); + { + let template = ::hirola::prelude::GenericNode::element(#name); + #children_tokens + #(#attributes)* + template + } + }); } else { let fnname: Ident = syn::parse_str(&name).unwrap(); @@ -122,19 +121,14 @@ fn attribute_to_tokens(attribute: &NodeAttribute) -> TokenStream { match attribute { NodeAttribute::Block(block) => quote! { #block - } - .into(), + }, NodeAttribute::Attribute(attr) => { let name = attr.key.to_string(); let value = attr.value(); if name.starts_with("on:") { let name = name.replace("on:", ""); quote! { - ::hirola::prelude::Dom::event( - &mut template, - #name, - ::std::boxed::Box::new(#value), - ); + ::hirola::prelude::EventListener::event(&template, #name, #value); } } else if name.starts_with("use:") { let effect = if value.is_some() { @@ -148,24 +142,25 @@ fn attribute_to_tokens(attribute: &NodeAttribute) -> TokenStream { } }; quote! { - ::hirola::prelude::Dom::effect( + ::hirola::prelude::GenericNode::effect( &template, + #[allow(unused_braces)] #effect ); } - } else if name.starts_with("mixin:") { - let name_space = name.replace("mixin:", ""); + } else if name.starts_with("mixin:") || name.starts_with("x:") { + let name_space = name.replace("mixin:", "").replace("x:", ""); let ns_struct = format_ident!("{}", &some_kind_of_uppercase_first_letter(&name_space)); quote! { - hirola::prelude::Mixin::<#ns_struct>::mixin(#value, &template); + hirola::prelude::Mixin::<#ns_struct, _>::mixin(#value, &template); } } else if &name == "ref" { quote! { - let _ = ::hirola::prelude::NodeRef::set( + let _ = ::hirola::prelude::NodeReference::set( &#value, - ::std::clone::Clone::clone(&template.node()), + ::std::clone::Clone::clone(&template), ); } @@ -173,28 +168,29 @@ fn attribute_to_tokens(attribute: &NodeAttribute) -> TokenStream { let attribute_name = convert_name(&name).replace("bind:", ""); quote! { { - use hirola::signal::SignalExt; - let t = template.clone(); - ::hirola::prelude::Dom::attribute( - &template, - #attribute_name, - &::std::format!("{}", #value.get_cloned()), - ); - template.effect(#value.signal_ref(move |value| { - ::hirola::prelude::Dom::attribute( - &t, + use ::hirola::signal::SignalExt; + let template_clone = ::std::clone::Clone::clone(&template); + // ::hirola::prelude::GenericNode::set_attribute( + // &template, + // #attribute_name, + // &::std::format!("{}", #value), + // ); + let future = SignalExt::dedupe_map(#value, move |value| { + ::hirola::prelude::GenericNode::set_attribute( + &template_clone, #attribute_name, &::std::format!("{}", value), ); - }).to_future()); + }).to_future(); + ::hirola::prelude::GenericNode::effect(&template, future); } } } else { let attribute_name = convert_name(&name); quote! { - ::hirola::prelude::Dom::attribute( - &mut template, + ::hirola::prelude::GenericNode::set_attribute( + &template, #attribute_name, &::std::format!("{}", #value), ); @@ -209,36 +205,50 @@ fn children_to_tokens(children: Vec) -> TokenStream { let mut tokens = TokenStream::new(); if !children.is_empty() { for child in children { - match child { - Node::Element(_) => { - let node = node_to_tokens(child); - append_children.extend(quote! { - ::hirola::prelude::Dom::append_render(&mut template, #node ); - }); + match &child { + Node::Element(element) => { + let node = node_to_tokens(child.clone()); + let name = element.name().to_string(); + + match child { + // Its a component + Node::Element(_) if name[0..1].to_lowercase() != name[0..1] => { + append_children.extend(quote! { + #[allow(unused_braces)] + ::hirola::prelude::GenericNode::append_render(&template, #node ); + }); + } + _ => { + append_children.extend(quote! { + #[allow(unused_braces)] + ::hirola::prelude::GenericNode::append_child(&template, &#node ); + }); + } + } } Node::Text(text) => { append_children.extend(quote! { - ::hirola::prelude::Dom::append_render( - &mut template, + ::hirola::prelude::GenericNode::append_child( + &template, #[allow(unused_braces)] - ::hirola::prelude::Dom::text(#text), + &::hirola::prelude::GenericNode::text_node(#text), ); }); } Node::Comment(comment) => { - let s = comment.value; + let s = comment.value.clone(); append_children.extend(quote! { - ::hirola::prelude::Dom::append_render( - &mut template, + ::hirola::prelude::GenericNode::append_child( + &template, #[allow(unused_braces)] - ::hirola::prelude::Dom::new_from_node(::hirola::prelude::GenericNode::comment(#s)), + &::hirola::prelude::GenericNode::comment(#s), ); }); } Node::Doctype(_) => {} Node::Block(block) => match block { - NodeBlock::ValidBlock(block) => match braced_for_control(&block) { - Some(Control::ExprForLoop(ExprForLoop { + NodeBlock::ValidBlock(block) => match braced_for_control(block) { + Some(Control::ForLoop(ExprForLoop { pat, expr, body, .. })) => { if let Expr::Cast(ExprCast { ty, expr, .. }) = expr.as_ref() { @@ -259,7 +269,7 @@ fn children_to_tokens(children: Vec) -> TokenStream { }; }); } - &Type::Path(ref path) => { + Type::Path(path) => { let ident = Ident::new("SignalVec", Span::call_site()); if path.path.is_ident(&ident) { append_children.extend(quote! { @@ -296,15 +306,16 @@ fn children_to_tokens(children: Vec) -> TokenStream { } else { append_children.extend(quote! { for #pat in #expr { - ::hirola::prelude::Dom::append_child( - &mut template, - #body, - ).unwrap(); + ::hirola::prelude::GenericNode::append_child( + &template, + #[allow(unused_braces)] + &#body, + ); } }); } } - Some(Control::ExprIf(ExprIf { + Some(Control::If(ExprIf { cond, then_branch, else_branch, @@ -316,10 +327,11 @@ fn children_to_tokens(children: Vec) -> TokenStream { match ty.as_ref() { &Type::Infer(_) => { append_children.extend(quote! { - let mut template = { + #[allow(unused_braces)] + let switch = { let switch = ::hirola::prelude::Switch { signal: #expr, - renderer: |res| { + renderer: move |res| { if res { #then_branch } else { @@ -327,18 +339,23 @@ fn children_to_tokens(children: Vec) -> TokenStream { } } }; - Box::new(switch) + switch }; + ::hirola::prelude::GenericNode::append_render( + &template, + switch + ); }); } - &Type::Path(ref path) => { + Type::Path(path) => { let ident = Ident::new("Signal", Span::call_site()); if path.path.is_ident(&ident) { append_children.extend(quote! { - let mut template = { + let switch = { + #[allow(unused_braces)] let switch = ::hirola::prelude::Switch { signal: #expr, - renderer: |res| { + renderer: move |res| { if res { #then_branch } else { @@ -346,8 +363,12 @@ fn children_to_tokens(children: Vec) -> TokenStream { } } }; - Box::new(switch) + switch }; + ::hirola::prelude::GenericNode::append_render( + &template, + switch + ); }); } else { append_children.extend( @@ -368,21 +389,21 @@ fn children_to_tokens(children: Vec) -> TokenStream { } } else { append_children.extend(quote! { - ::hirola::prelude::Dom::append_render( - &mut template, + ::hirola::prelude::GenericNode::append_child( + &template, #[allow(unused_braces)] - #block, + &#block, ); }); } } - Some(Control::ExprMatch(ExprMatch { expr, arms, .. })) => match *expr { + Some(Control::Match(ExprMatch { expr, arms, .. })) => match *expr { Expr::Await(fut) => { let fut = fut.base; append_children.extend(quote! { let suspense = { - + #[allow(unused_braces)] let suspense = ::hirola::prelude::Suspense { future: Box::pin(#fut), template: Box::new(move |res| { @@ -393,8 +414,8 @@ fn children_to_tokens(children: Vec) -> TokenStream { }; suspense }; - ::hirola::prelude::Dom::append_render( - &mut template, + ::hirola::prelude::GenericNode::append_render( + &template, suspense ); @@ -402,20 +423,20 @@ fn children_to_tokens(children: Vec) -> TokenStream { } _ => { append_children.extend(quote! { - ::hirola::prelude::Dom::append_render( - &mut template, + ::hirola::prelude::GenericNode::append_child( + &template, #[allow(unused_braces)] - #block, + &#block, ); }); } }, _ => { append_children.extend(quote! { - ::hirola::prelude::Dom::append_render( - &mut template, + let _ = ::hirola::prelude::Render::render_into( #[allow(unused_braces)] - #block, + Box::new(#block), + &template, ); }); } @@ -442,9 +463,9 @@ fn children_to_tokens(children: Vec) -> TokenStream { } enum Control { - ExprForLoop(ExprForLoop), - ExprIf(ExprIf), - ExprMatch(ExprMatch), + ForLoop(ExprForLoop), + If(ExprIf), + Match(ExprMatch), } fn braced_for_control(block: &Block) -> Option { @@ -454,9 +475,9 @@ fn braced_for_control(block: &Block) -> Option { } else { let stmt = &block.stmts[0]; match stmt { - Stmt::Expr(Expr::ForLoop(expr), _) => Some(Control::ExprForLoop(expr.clone())), - Stmt::Expr(Expr::If(expr), _) => Some(Control::ExprIf(expr.clone())), - Stmt::Expr(Expr::Match(expr), _) => Some(Control::ExprMatch(expr.clone())), + Stmt::Expr(Expr::ForLoop(expr), _) => Some(Control::ForLoop(expr.clone())), + Stmt::Expr(Expr::If(expr), _) => Some(Control::If(expr.clone())), + Stmt::Expr(Expr::Match(expr), _) => Some(Control::Match(expr.clone())), _ => None, } } @@ -480,7 +501,7 @@ pub fn html(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let output = to_token_stream(input); let quoted = quote! { - ::hirola::prelude::Dom::from(#output) + #output }; quoted.into() } diff --git a/crates/hirola-macros/tests/component.rs b/crates/hirola-macros/tests/component.rs index dfdc1e0..d0e3a15 100644 --- a/crates/hirola-macros/tests/component.rs +++ b/crates/hirola-macros/tests/component.rs @@ -1,8 +1,8 @@ -use hirola::prelude::*; -use hirola_macros::html; +use hirola_macros::{component, html}; +use hirola_ssr::{render_to_string, SsrNode}; #[component] -fn MyComponent() -> Dom { +fn MyComponent() -> SsrNode { let world = "planet"; html! {

              {world}

              @@ -10,7 +10,7 @@ fn MyComponent() -> Dom { } #[component] -fn MyComponentWithProps(world: &'static str) -> Dom { +fn MyComponentWithProps(world: &'static str) -> SsrNode { html! {

              {world}

              } @@ -24,7 +24,8 @@ fn it_renders_component() { } - }); + }) + .unwrap(); assert_eq!("

              planet

              ", result); } @@ -36,6 +37,7 @@ fn it_renders_component_with_props() { } - }); + }) + .unwrap(); assert_eq!("

              hirola

              ", result); } diff --git a/crates/hirola-macros/tests/lib.rs b/crates/hirola-macros/tests/lib.rs index eb6e236..469f628 100644 --- a/crates/hirola-macros/tests/lib.rs +++ b/crates/hirola-macros/tests/lib.rs @@ -1,5 +1,5 @@ -use hirola::prelude::*; use hirola_macros::html; +use hirola_ssr::render_to_string; #[test] fn it_works() { @@ -7,6 +7,6 @@ fn it_works() { let template = html! {

              {world}

              }; - let result = render_to_string(template); + let result = render_to_string(template).unwrap(); assert_eq!("

              planet

              ", result); } diff --git a/crates/hirola-ssr/Cargo.toml b/crates/hirola-ssr/Cargo.toml new file mode 100644 index 0000000..67bfb55 --- /dev/null +++ b/crates/hirola-ssr/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "hirola-ssr" +version = "0.3.1" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +hirola-core = { path = "../hirola-core", version = "0.3.1" } +html-escape = { version = "0.2.7" } + + +[dev-dependencies] +hirola = { path = "../../", version = "0.3.1" } +wasm-bindgen-test = "0.3.39" \ No newline at end of file diff --git a/crates/hirola-core/src/generic_node/ssr_node.rs b/crates/hirola-ssr/src/lib.rs similarity index 79% rename from crates/hirola-core/src/generic_node/ssr_node.rs rename to crates/hirola-ssr/src/lib.rs index 259fb6f..1de48b1 100644 --- a/crates/hirola-core/src/generic_node/ssr_node.rs +++ b/crates/hirola-ssr/src/lib.rs @@ -3,13 +3,12 @@ use std::collections::HashMap; use std::rc::{Rc, Weak}; use std::{fmt, mem}; -use crate::generic_node::GenericNode; +use hirola_core::generic_node::GenericNode; +use hirola_core::render::{Error, Render}; /// Rendering backend for Server Side Rendering, aka. SSR. -/// -/// _This API requires the following crate features to be activated: `ssr`_ +/// Offers interior mutability and is not thread safe. #[derive(Debug)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] enum SsrNodeType { Element(RefCell), Comment(RefCell), @@ -18,8 +17,6 @@ enum SsrNodeType { } #[derive(Debug, Clone)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] - struct SsrNodeInner { ty: Rc, /// No parent if `Weak::upgrade` returns `None`. @@ -27,7 +24,6 @@ struct SsrNodeInner { } #[derive(Debug, Clone)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct SsrNode(Rc); impl PartialEq for SsrNode { @@ -81,7 +77,7 @@ impl SsrNode { if let Some(index) = children .iter() .enumerate() - .find_map(|(i, c)| (c == child).then(|| i)) + .find_map(|(i, c)| (c == child).then_some(i)) { children.remove(index); } else { @@ -89,7 +85,7 @@ impl SsrNode { for c in &children { if let SsrNodeType::Fragment(fragment) = c.0.ty.as_ref() { for c in &fragment.borrow().0 { - c.try_remove_child(&child); + c.try_remove_child(child); } } } @@ -165,7 +161,7 @@ impl GenericNode for SsrNode { children .iter() .enumerate() - .find_map(|(i, child)| (child == reference).then(|| i)) + .find_map(|(i, child)| (child == reference).then_some(i)) .expect("couldn't find reference node"), new_node.clone(), ); @@ -189,7 +185,7 @@ impl GenericNode for SsrNode { let index = children .iter() .enumerate() - .find_map(|(i, c)| (c == child).then(|| i)) + .find_map(|(i, c)| (c == child).then_some(i)) .expect("couldn't find child"); children.remove(index); @@ -208,7 +204,7 @@ impl GenericNode for SsrNode { let index = children .iter() .enumerate() - .find_map(|(i, c)| (c == old).then(|| i)) + .find_map(|(i, c)| (c == old).then_some(i)) .expect("Couldn't find child"); children[index] = new.clone(); } @@ -235,9 +231,9 @@ impl GenericNode for SsrNode { unimplemented!() } - // fn event(&self, _name: &str, _handler: Box) { - // // Don't do anything. Events are attached on client side. - // } + fn children(&self) -> RefCell> { + unimplemented!() + } fn update_inner_text(&self, text: &str) { self.unwrap_text().borrow_mut().0 = text.to_string(); @@ -246,6 +242,9 @@ impl GenericNode for SsrNode { fn replace_children_with(&self, _node: &Self) { unimplemented!() } + fn effect(&self, _future: impl std::future::Future + 'static) { + // panic!("SsrNode does not support effects, please use SsrNodeAsync!") + } } impl fmt::Display for SsrNode { @@ -259,8 +258,14 @@ impl fmt::Display for SsrNode { } } +impl Render for SsrNode { + fn render_into(self: Box, parent: &SsrNode) -> Result<(), Error> { + parent.append_child(&self); + Ok(()) + } +} + #[derive(Debug, Clone, Eq, PartialEq)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Element { name: String, attributes: HashMap, @@ -284,7 +289,6 @@ impl fmt::Display for Element { } #[derive(Debug, Clone, Eq, PartialEq, Default)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Comment(String); impl fmt::Display for Comment { @@ -294,7 +298,6 @@ impl fmt::Display for Comment { } #[derive(Debug, Clone, Eq, PartialEq, Default)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Text(String); impl fmt::Display for Text { @@ -304,7 +307,6 @@ impl fmt::Display for Text { } #[derive(Debug, Clone, Eq, PartialEq, Default)] -#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Fragment(Vec); impl fmt::Display for Fragment { @@ -315,3 +317,67 @@ impl fmt::Display for Fragment { Ok(()) } } + +/// Render a [`SsrNode`] into a static [`String`]. Useful for rendering to a string on the server side. +pub fn render_to_string(dom: SsrNode) -> Result { + let root = SsrNode::fragment(); + Render::render_into(Box::new(dom), &root)?; + Ok(format!("{}", root)) +} + +#[cfg(test)] +mod tests { + use super::*; + use hirola::prelude::*; + + #[test] + fn hello_world() { + let node = html! { +

              "Hello World!"

              + }; + + assert_eq!(render_to_string(node).unwrap(), "

              Hello World!

              "); + } + + #[test] + fn reactive_text() { + let count = Mutable::new(0); + + assert_eq!( + render_to_string(html! { +

              {count.clone()}

              + }) + .unwrap(), + "

              0

              " + ); + + count.set(1); + assert_eq!( + render_to_string(html! { +

              {count}

              + }).unwrap(), + "

              1

              " + ); + } + + #[test] + #[should_panic] + fn check_reject_effects() { + let count = MutableVec::new_with_values(vec![1, 2, 3]); + + let node = html! { +
                + { + count.signal_vec().map_render(move |item| { + html! { +
              • {item.to_string()}
              • + } + } ) + } +
              + }; + + let dom = render_to_string(node).unwrap(); + assert_eq!("
              • 1
              • 2
              • 3
              ", dom); + } +} diff --git a/examples/axum/Cargo.toml b/examples/axum/Cargo.toml new file mode 100644 index 0000000..5fd3b9c --- /dev/null +++ b/examples/axum/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "axum-example" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +hirola = { path = "../../", default-features = false, features = ["ssr"] } +axum = { version = "0.7" } +tokio = { version = "1.0", features = ["full"] } +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/examples/axum/src/layout.rs b/examples/axum/src/layout.rs new file mode 100644 index 0000000..5000a1c --- /dev/null +++ b/examples/axum/src/layout.rs @@ -0,0 +1,113 @@ +use std::fmt::Display; + +use hirola::{prelude::*, ssr::SsrNode}; + +const STYLE: &str = r#" +nav { + border-bottom: 1px solid black; +} + +.crumbs ol { + list-style-type: none; + padding-left: 0; +} + +.crumb { + display: inline-block; +} + +.crumb a::after { + display: inline-block; + color: #000; + content: '>'; + font-size: 80%; + font-weight: bold; + padding: 0 3px; +} +"#; +#[derive(Debug, Clone)] +pub struct Seo { + pub title: String, + pub author: String, + pub description: String, //.. +} + +#[component] +pub fn Layout(seo: Seo, nav: Nav, main: Main, footer: Footer) -> SsrNode +where + Nav: Render, + Main: Render, + Footer: Render, +{ + html! { + + + + {&seo.title} + + + + + + + + + + + + + + + + + + + + + + + +
              + +
              +
              {main}
              +
              {footer}
              + + + } +} + +fn skip_last(mut iter: impl Iterator) -> impl Iterator { + let last = iter.next(); + iter.scan(last, |state, item| std::mem::replace(state, Some(item))) +} + +#[component] +pub fn Nav<'a, T: Display>(items: &'a [T]) -> SsrNode { + let last = items.last(); + + let other_items = skip_last(items.iter()); + + html! { + + } +} diff --git a/examples/axum/src/main.rs b/examples/axum/src/main.rs new file mode 100644 index 0000000..f1b9a2f --- /dev/null +++ b/examples/axum/src/main.rs @@ -0,0 +1,86 @@ +//! Run with +//! +//! ```not_rust +//! cargo run -p axum-example +//! ``` + +mod layout; + +use crate::layout::*; + +use axum::{ + http::StatusCode, + response::{Html, IntoResponse, Response}, + routing::get, + Router, +}; +use hirola::{ + prelude::*, + ssr::{render_to_string, SsrNode}, +}; +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; + +async fn home() -> impl IntoResponse { + let posting = Seo { + author: "Jude Bellingham".to_owned(), + description: "This BMX bike is a solid step into the pro world. It looks as legit as it rides and is built to polish your skills.".to_owned(), + title: "Jump Bike 3000".to_owned(), + }; + + let template = html! { + <> + } + } + main={ + let node: SsrNode = html! { + <> +

              {&posting.title}

              +

              {&posting.description}

              + + }; + node + } + footer=SsrNode::fragment() + /> + + }; + SsrTemplate(template) +} + +struct SsrTemplate(SsrNode); + +impl IntoResponse for SsrTemplate { + fn into_response(self) -> Response { + match render_to_string(self.0) { + Ok(html) => Html(html).into_response(), + Err(err) => ( + StatusCode::INTERNAL_SERVER_ERROR, + format!("Failed to render template. Error: {err:?}"), + ) + .into_response(), + } + } +} + +#[tokio::main] +async fn main() { + tracing_subscriber::registry() + .with( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| "axum_example=debug".into()), + ) + .with(tracing_subscriber::fmt::layer()) + .init(); + + let app = Router::new().route("/", get(home)); + + // run it + let listener = tokio::net::TcpListener::bind("127.0.0.1:3000") + .await + .unwrap(); + tracing::debug!("listening on {}", listener.local_addr().unwrap()); + axum::serve(listener, app).await.unwrap(); +} diff --git a/examples/canvas/Cargo.toml b/examples/canvas/Cargo.toml index 39a029f..729a423 100644 --- a/examples/canvas/Cargo.toml +++ b/examples/canvas/Cargo.toml @@ -6,8 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -hirola = { path = "../../"} - +hirola = { path = "../../" } js-sys = "0.3.59" wasm-bindgen = "0.2.82" @@ -19,5 +18,5 @@ features = [ 'Element', 'HtmlCanvasElement', 'Window', - 'MouseEvent' + 'MouseEvent', ] diff --git a/examples/canvas/src/main.rs b/examples/canvas/src/main.rs index 51ed9ae..7711dba 100644 --- a/examples/canvas/src/main.rs +++ b/examples/canvas/src/main.rs @@ -1,9 +1,10 @@ use hirola::prelude::*; +use hirola::dom::{node_ref::NodeRef, Dom}; use tool::SignTool; mod tool; -fn signature_pad(_app: &App) -> Dom { +fn signature_pad() -> Dom { let canvas = NodeRef::new(); let tool = SignTool::new(canvas.clone()); @@ -50,5 +51,6 @@ fn main() { let document = window.document().unwrap(); let body = document.body().unwrap(); - hirola::prelude::render_to(signature_pad, &body); + let root = hirola::dom::render_to(signature_pad(), &body).unwrap(); + std::mem::forget(root) } diff --git a/examples/canvas/src/tool.rs b/examples/canvas/src/tool.rs index 0f11ebc..677130d 100644 --- a/examples/canvas/src/tool.rs +++ b/examples/canvas/src/tool.rs @@ -1,4 +1,5 @@ use hirola::prelude::*; +use hirola::dom::node_ref::NodeRef; use wasm_bindgen::JsCast; use wasm_bindgen::JsValue; use web_sys::Event; @@ -12,11 +13,11 @@ pub struct SignTool { pub(crate) cur_x: Mutable, pub(crate) prev_y: Mutable, pub(crate) cur_y: Mutable, - pub(crate) canvas: NodeRef, + pub(crate) canvas: NodeRef, } impl SignTool { - pub fn new(canvas: NodeRef) -> Self { + pub fn new(canvas: NodeRef) -> Self { SignTool { is_mouse_clicked: Mutable::new(false), is_mouse_in_canvas: Mutable::new(false), @@ -32,7 +33,7 @@ impl SignTool { let e: MouseEvent = event.dyn_into().unwrap(); let canvas = self .canvas - .get::() + .get() .inner_element() .dyn_into::() .unwrap(); @@ -56,7 +57,7 @@ impl SignTool { pub fn draw(&self) { let canvas = self .canvas - .get::() + .get() .inner_element() .dyn_into::() .unwrap(); diff --git a/examples/counter/Cargo.toml b/examples/counter/Cargo.toml index e4382c6..c484700 100644 --- a/examples/counter/Cargo.toml +++ b/examples/counter/Cargo.toml @@ -6,9 +6,24 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -hirola = { path = "../../", features = ["dom", "app"]} +hirola = { path = "../../" } +gloo-timers = { version = "0.3.0", features = ["futures"] } + +[dependencies.web-sys] +features = [ + "Comment", + "Document", + "DocumentFragment", + "Element", + "Event", + "HtmlElement", + "Node", + "Text", + "Window", +] +version = "0.3.64" [dev-dependencies] wasm-bindgen-test = "0.3.0" -hirola = { path = "../../", default-features=false, features =["dom"]} \ No newline at end of file +hirola = { path = "../../", default-features = false } diff --git a/examples/counter/src/main.rs b/examples/counter/src/main.rs index d3f1c20..61da7fe 100644 --- a/examples/counter/src/main.rs +++ b/examples/counter/src/main.rs @@ -1,28 +1,29 @@ -use std::fmt::Display; +use gloo_timers::future::TimeoutFuture; +use hirola::dom::Dom; use hirola::prelude::*; -use hirola::signal::Mutable; - -#[component] -pub fn Menu(title: &'static str, children: R) -> Dom { - Dom::new() -} - fn counter() -> Dom { let count = Mutable::new(0i32); let decrement = count.callback(|s| *s.lock_mut() -= 1); let increment = count.callback(|s| *s.lock_mut() += 1); + let counter = count.clone(); + let second_counter = async move { + loop { + TimeoutFuture::new(1_000).await; + *counter.lock_mut() += 1; + } + }; + html! { <> - {count} + {count} - } } fn main() { - let root = render(counter()).unwrap(); + let root = hirola::dom::render(counter()).unwrap(); std::mem::forget(root); } diff --git a/examples/docs/Cargo.toml b/examples/docs/Cargo.toml index fb86cfd..c15dc1e 100644 --- a/examples/docs/Cargo.toml +++ b/examples/docs/Cargo.toml @@ -6,10 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -hirola = { path = "../../", default-features = false, features = [ - "app", - "ssr", -] } +hirola = { path = "../../", features = ["ssr"], default-features = false} glob = "0.3.1" comrak = { version = "0.18", features = ["syntect"] } fronma = "0.2" diff --git a/examples/docs/src/components/logo.rs b/examples/docs/src/components/logo.rs index 47d19be..46296e6 100644 --- a/examples/docs/src/components/logo.rs +++ b/examples/docs/src/components/logo.rs @@ -1,7 +1,7 @@ -use hirola::prelude::*; +use hirola::{prelude::*, ssr::SsrNode}; #[component] -pub fn HirolaLogo() -> Dom { +pub fn HirolaLogo() -> SsrNode { html! {

              "Hirola" diff --git a/examples/docs/src/components/side_bar.rs b/examples/docs/src/components/side_bar.rs index 2dfda6a..65bbf44 100644 --- a/examples/docs/src/components/side_bar.rs +++ b/examples/docs/src/components/side_bar.rs @@ -1,7 +1,7 @@ -use hirola::prelude::*; +use hirola::{prelude::*, ssr::SsrNode}; #[component] -pub fn SideBar() -> Dom { +pub fn SideBar() -> SsrNode { html! {
              • diff --git a/examples/docs/src/main.rs b/examples/docs/src/main.rs index 3d9a9df..20b4673 100644 --- a/examples/docs/src/main.rs +++ b/examples/docs/src/main.rs @@ -1,12 +1,9 @@ mod components; -// mod markdown; -// mod pages; - use std::{fs::File, path::PathBuf}; use components::logo::HirolaLogo; use comrak::{markdown_to_html_with_plugins, ComrakPlugins}; -use hirola::prelude::*; +use hirola::{prelude::*, ssr::{SsrNode, render_to_string}}; use crate::components::side_bar::SideBar; use serde::Deserialize; @@ -23,7 +20,7 @@ struct Seo { draft: bool, } -fn with_layout(seo: Seo) -> Dom { +fn with_layout(seo: Seo) -> SsrNode { html! { @@ -49,9 +46,9 @@ fn with_layout(seo: Seo) -> Dom { @@ -199,7 +196,7 @@ fn main() { Ok(path) => { let (content, seo) = markdown_page(&path); let mut layout = "".to_string(); - layout.extend(render_to_string(with_layout(seo)).chars()); + layout.push_str(&render_to_string(with_layout(seo)).unwrap()); let html_path = path .to_string_lossy() .replace("src/pages", "dist") @@ -229,7 +226,7 @@ fn markdown_page(path: &PathBuf) -> (String, Seo) { options.extension.front_matter_delimiter = Some("---".to_owned()); plugins.render.codefence_syntax_highlighter = Some(&adapter); let data = fronma::parser::parse::(&markdown) - .expect(&format!("in file: {}", path.to_string_lossy())); - let res = markdown_to_html_with_plugins(&data.body, &options, &plugins); + .unwrap(); + let res = markdown_to_html_with_plugins(data.body, &options, &plugins); (res, data.headers) } diff --git a/examples/docs/src/pages/index.md b/examples/docs/src/pages/index.md index e208046..e81f53b 100644 --- a/examples/docs/src/pages/index.md +++ b/examples/docs/src/pages/index.md @@ -20,9 +20,8 @@ draft: false ## Example ```rust -use std::fmt::Display; +use hirola::dom::Dom; use hirola::prelude::*; -use hirola::signal::Mutable; fn counter() -> Dom { let count = Mutable::new(0i32); @@ -38,7 +37,7 @@ fn counter() -> Dom { } fn main() { - let root = render(counter()).unwrap(); + let root = hirola::dom::render(counter()).unwrap(); // We prevent the root from being dropped std::mem::forget(root); } @@ -46,7 +45,7 @@ fn main() { ## Features -- **`serde`**— Enables serialization of state -- **`ssr`**— Enables server side rendering 🚧 +- **`dom`**— Enables rendering on browsers +- **`ssr`**— Enables server side rendering - **`router`**— Enables Isomorphic Routing - **`form`**— Enables form mixins and utilities 🚧 diff --git a/examples/fake-api/src/main.rs b/examples/fake-api/src/main.rs index 5667440..641c81d 100644 --- a/examples/fake-api/src/main.rs +++ b/examples/fake-api/src/main.rs @@ -1,5 +1,6 @@ mod model; use hirola::prelude::*; +use hirola::dom::Dom; use model::Users; use reqwasm::http::Request; use anyhow::bail; @@ -8,7 +9,7 @@ async fn user_fetcher() -> anyhow::Result { let request = Request::get("https://jsonplaceholder.typicode.com/users"); let response = request.send().await?; if response.status() == 200 { - return Ok(response.json().await?); + Ok(response.json().await?) } else { bail!( "Failed with status {}, {}", @@ -48,7 +49,7 @@ fn main() { let document = window.document().unwrap(); let body = document.body().unwrap(); - let dom = render_to(fetch_users(), &body).unwrap(); + let dom = hirola::dom::render_to(fetch_users(), &body).unwrap(); std::mem::forget(dom); } diff --git a/examples/form/Cargo.toml b/examples/form/Cargo.toml index 6930c00..0d476da 100644 --- a/examples/form/Cargo.toml +++ b/examples/form/Cargo.toml @@ -6,7 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -hirola = { path = "../../", features = ["form", "dom"] } +hirola = { path = "../../"} +hirola-form = { path = "../../crates/hirola-form"} wasm-bindgen = { version = "0.2", features = ["serde-serialize"] } validator = "0.10" validator_derive = "0.10" diff --git a/examples/form/src/main.rs b/examples/form/src/main.rs index bdcf9d9..1f5bd92 100644 --- a/examples/form/src/main.rs +++ b/examples/form/src/main.rs @@ -2,13 +2,11 @@ extern crate validator_derive; use serde::{Deserialize, Serialize}; -use validator::{Validate, ValidationErrors}; +use validator::Validate; -use hirola::{ - form::{Bind, Form, FormHandler}, - prelude::*, -}; -use web_sys::{Event, HtmlInputElement}; +use hirola::{dom::*, prelude::*}; +use hirola_form::{Form, FormHandler}; +use web_sys::HtmlInputElement; #[derive(Validate, PartialEq, Clone, Serialize, Deserialize, Debug)] struct Login { @@ -22,21 +20,21 @@ struct Login { remember: String, } -impl hirola::form::Validate for Login { - type Error = ValidationErrors; - fn validate(&self) -> Result<(), Self::Error> { - Validate::validate(&self) - } +// impl hirola::form::Validate for Login { +// type Error = ValidationErrors; +// fn validate(&self) -> Result<(), Self::Error> { +// Validate::validate(&self) +// } - fn errors(&self) -> std::collections::HashMap<&'static str, String> { - Validate::validate(&self) - .unwrap_err() - .errors() - .into_iter() - .map(|(key, value)| (*key, format!("{value:?}"))) - .collect() - } -} +// fn errors(&self) -> std::collections::HashMap<&'static str, String> { +// Validate::validate(&self) +// .unwrap_err() +// .errors() +// .into_iter() +// .map(|(key, value)| (*key, format!("{value:?}"))) +// .collect() +// } +// } // #[component] // fn InnerComponent(bind: Bind) -> Dom { @@ -66,7 +64,7 @@ fn form_demo() -> Dom { class="h-screen flex flex-col items-center justify-center" method="post" ref=form.node_ref() - on:submit=|e| e.prevent_default() + on:submit=Box::new(|e: web_sys::Event| e.prevent_default()) >
                @@ -115,7 +113,7 @@ fn form_demo() -> Dom { value="" class="w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-600 dark:ring-offset-gray-800" required="" - mixin:form={&form.register::()} + mixin:form={form.register::()} />