diff --git a/Cargo.lock b/Cargo.lock index 477d5cb32..70063efc9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -308,6 +308,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "async-once-cell" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a" + [[package]] name = "async-stream" version = "0.3.6" @@ -465,6 +471,12 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "base16" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" + [[package]] name = "base64" version = "0.22.1" @@ -1813,6 +1825,8 @@ dependencies = [ "typed-builder", "typed-builder-macro", "wasm-bindgen", + "wasm-bindgen-futures", + "wasm_split_helpers", "web-sys", ] @@ -3360,6 +3374,17 @@ dependencies = [ "digest", ] +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "shlex" version = "1.3.0" @@ -4311,6 +4336,26 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasm_split_helpers" +version = "0.1.0" +dependencies = [ + "async-once-cell", + "wasm_split_macros", +] + +[[package]] +name = "wasm_split_macros" +version = "0.1.0" +dependencies = [ + "base16", + "digest", + "quote", + "sha2", + "syn 2.0.104", + "wasm-bindgen", +] + [[package]] name = "web-sys" version = "0.3.77" diff --git a/Cargo.toml b/Cargo.toml index 041855297..9f9b2129b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,8 +71,11 @@ server_fn = { path = "./server_fn", version = "0.8.4" } server_fn_macro = { path = "./server_fn_macro", version = "0.8.4" } server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", version = "0.8.4" } tachys = { path = "./tachys", version = "0.2.5" } +wasm_split_helpers = { path = "./wasm_split", version = "0.1.0" } +wasm_split_macros = { path = "./wasm_split_macros", version = "0.1.0" } # members deps +async-once-cell = { default-features = false, version = "0.5.3" } itertools = { default-features = false, version = "0.14.0" } convert_case = { default-features = false, version = "0.8.0" } serde_json = { default-features = false, version = "1.0.140" } @@ -165,6 +168,9 @@ rustversion = { default-features = false, version = "1.0.21" } getrandom = { default-features = false, version = "0.3.3" } actix-files = { default-features = false, version = "0.6.6" } async-lock = { default-features = false, version = "3.4.0" } +base16 = { default-features = false, version = "0.2.1" } +digest = { default-features = false, version = "0.10.7" } +sha2 = { default-features = false, version = "0.10.8" } [profile.release] codegen-units = 1 diff --git a/examples/cargo-make/cargo-leptos-split-webdriver-test.toml b/examples/cargo-make/cargo-leptos-split-webdriver-test.toml new file mode 100644 index 000000000..14b330e64 --- /dev/null +++ b/examples/cargo-make/cargo-leptos-split-webdriver-test.toml @@ -0,0 +1,11 @@ +extend = [ + { path = "./cargo-leptos.toml" }, + { path = "../cargo-make/webdriver.toml" }, +] + +[tasks.integration-test] +dependencies = [ + "install-cargo-leptos", + "start-webdriver", + "cargo-leptos-e2e-split", +] diff --git a/examples/cargo-make/cargo-leptos.toml b/examples/cargo-make/cargo-leptos.toml index 9a44b0b57..a4d44f68d 100644 --- a/examples/cargo-make/cargo-leptos.toml +++ b/examples/cargo-make/cargo-leptos.toml @@ -11,6 +11,10 @@ args = ["--locked"] command = "cargo" args = ["leptos", "end-to-end"] +[tasks.cargo-leptos-e2e-split] +command = "cargo" +args = ["leptos", "end-to-end", "--split"] + [tasks.build] clear = true command = "cargo" diff --git a/examples/hackernews_axum/src/lib.rs b/examples/hackernews_axum/src/lib.rs index 04c2efbb8..f8d96d147 100644 --- a/examples/hackernews_axum/src/lib.rs +++ b/examples/hackernews_axum/src/lib.rs @@ -4,7 +4,7 @@ mod routes; use leptos_meta::{provide_meta_context, Link, Meta, MetaTags, Stylesheet}; use leptos_router::{ components::{FlatRoutes, Route, Router, RoutingProgress}, - OptionalParamSegment, ParamSegment, StaticSegment, + Lazy, OptionalParamSegment, ParamSegment, StaticSegment, }; use routes::{nav::*, stories::*, story::*, users::*}; use std::time::Duration; @@ -44,8 +44,8 @@ pub fn App() -> impl IntoView {