mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-28 05:32:42 -05:00
Compare commits
17 Commits
0.7.0-alph
...
v0.6.14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7789d58e7b | ||
|
|
4c6f3d067f | ||
|
|
0388903110 | ||
|
|
d50012f8d4 | ||
|
|
c9d4ea9307 | ||
|
|
77c74bccbb | ||
|
|
528d1eae65 | ||
|
|
5809c8f699 | ||
|
|
b9c620d4cd | ||
|
|
8c9dfd9c9d | ||
|
|
8848eb8b87 | ||
|
|
7e75801f7c | ||
|
|
0763a81cf1 | ||
|
|
3d37f08539 | ||
|
|
b3db094618 | ||
|
|
0c817d51fe | ||
|
|
fb5d8513ff |
4
.github/workflows/ci-semver.yml
vendored
4
.github/workflows/ci-semver.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
test:
|
||||
needs: [get-leptos-changed]
|
||||
if: needs.get-leptos-changed.outputs.leptos_changed == 'true'
|
||||
name: Run semver check (nightly-2024-04-14)
|
||||
name: Run semver check (nightly-2024-07-21)
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -25,4 +25,4 @@ jobs:
|
||||
- name: Semver Checks
|
||||
uses: obi1kenobi/cargo-semver-checks-action@v2
|
||||
with:
|
||||
rust-toolchain: nightly-2024-04-14
|
||||
rust-toolchain: nightly-2024-07-21
|
||||
|
||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -40,4 +40,4 @@ jobs:
|
||||
with:
|
||||
directory: ${{ matrix.directory }}
|
||||
cargo_make_task: "ci"
|
||||
toolchain: nightly-2024-04-14
|
||||
toolchain: nightly-2024-07-21
|
||||
|
||||
26
Cargo.toml
26
Cargo.toml
@@ -28,24 +28,24 @@ members = [
|
||||
exclude = ["benchmarks", "examples"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.6.12"
|
||||
version = "0.6.14"
|
||||
rust-version = "1.75"
|
||||
|
||||
[workspace.dependencies]
|
||||
oco_ref = { path = "./oco", version = "0.1.0" }
|
||||
leptos = { path = "./leptos", version = "0.6.12" }
|
||||
leptos_dom = { path = "./leptos_dom", version = "0.6.12" }
|
||||
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.6.12" }
|
||||
leptos_macro = { path = "./leptos_macro", version = "0.6.12" }
|
||||
leptos_reactive = { path = "./leptos_reactive", version = "0.6.12" }
|
||||
leptos_server = { path = "./leptos_server", version = "0.6.12" }
|
||||
server_fn = { path = "./server_fn", version = "0.6.12" }
|
||||
server_fn_macro = { path = "./server_fn_macro", version = "0.6.12" }
|
||||
leptos = { path = "./leptos", version = "0.6.14" }
|
||||
leptos_dom = { path = "./leptos_dom", version = "0.6.14" }
|
||||
leptos_hot_reload = { path = "./leptos_hot_reload", version = "0.6.14" }
|
||||
leptos_macro = { path = "./leptos_macro", version = "0.6.14" }
|
||||
leptos_reactive = { path = "./leptos_reactive", version = "0.6.14" }
|
||||
leptos_server = { path = "./leptos_server", version = "0.6.14" }
|
||||
server_fn = { path = "./server_fn", version = "0.6.14" }
|
||||
server_fn_macro = { path = "./server_fn_macro", version = "0.6.14" }
|
||||
server_fn_macro_default = { path = "./server_fn/server_fn_macro_default", version = "0.6" }
|
||||
leptos_config = { path = "./leptos_config", version = "0.6.12" }
|
||||
leptos_router = { path = "./router", version = "0.6.12" }
|
||||
leptos_meta = { path = "./meta", version = "0.6.12" }
|
||||
leptos_integration_utils = { path = "./integrations/utils", version = "0.6.12" }
|
||||
leptos_config = { path = "./leptos_config", version = "0.6.14" }
|
||||
leptos_router = { path = "./router", version = "0.6.14" }
|
||||
leptos_meta = { path = "./meta", version = "0.6.14" }
|
||||
leptos_integration_utils = { path = "./integrations/utils", version = "0.6.14" }
|
||||
|
||||
[profile.release]
|
||||
codegen-units = 1
|
||||
|
||||
@@ -11,7 +11,7 @@ actix-files = { version = "0.6", optional = true }
|
||||
actix-web = { version = "4", optional = true, features = ["macros"] }
|
||||
console_error_panic_hook = "0.1"
|
||||
cfg-if = "1"
|
||||
http = { version = "0.2", optional = true }
|
||||
http = { version = "1.0", optional = true }
|
||||
leptos = { path = "../../leptos" }
|
||||
leptos_meta = { path = "../../meta" }
|
||||
leptos_actix = { path = "../../integrations/actix", optional = true }
|
||||
|
||||
@@ -24,7 +24,7 @@ leptos_meta = { path = "../../meta" }
|
||||
leptos_router = { path = "../../router" }
|
||||
log = "0.4"
|
||||
once_cell = "1.18"
|
||||
gloo-net = { git = "https://github.com/rustwasm/gloo" }
|
||||
gloo-net = { version = "0.6" }
|
||||
wasm-bindgen = "0.2"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
simple_logger = "4.3"
|
||||
@@ -33,13 +33,13 @@ tracing = { version = "0.1", optional = true }
|
||||
[features]
|
||||
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
|
||||
ssr = [
|
||||
"dep:actix-files",
|
||||
"dep:actix-web",
|
||||
"dep:tracing",
|
||||
"leptos/ssr",
|
||||
"leptos_actix",
|
||||
"leptos_meta/ssr",
|
||||
"leptos_router/ssr",
|
||||
"dep:actix-files",
|
||||
"dep:actix-web",
|
||||
"dep:tracing",
|
||||
"leptos/ssr",
|
||||
"leptos_actix",
|
||||
"leptos_meta/ssr",
|
||||
"leptos_router/ssr",
|
||||
]
|
||||
|
||||
[package.metadata.cargo-all-features]
|
||||
|
||||
@@ -22,4 +22,4 @@ rstest = "0.17.0"
|
||||
|
||||
[dev-dependencies.web-sys]
|
||||
features = ["HtmlElement", "XPathResult"]
|
||||
version = "0.3.61"
|
||||
version = "0.3.70"
|
||||
|
||||
@@ -23,11 +23,7 @@ pub fn copy_to_clipboard(el: HtmlElement<AnyElement>, content: &str) {
|
||||
evt.prevent_default();
|
||||
evt.stop_propagation();
|
||||
|
||||
let _ = window()
|
||||
.navigator()
|
||||
.clipboard()
|
||||
.expect("navigator.clipboard to be available")
|
||||
.write_text(&content);
|
||||
let _ = window().navigator().clipboard().write_text(&content);
|
||||
|
||||
let _ = el.clone().inner_html(format!("Copied \"{}\"", &content));
|
||||
});
|
||||
@@ -76,9 +72,13 @@ pub fn App() -> impl IntoView {
|
||||
let data = "Hello World!";
|
||||
|
||||
view! {
|
||||
<a href="#" use:copy_to_clipboard=data>"Copy \"" {data} "\" to clipboard"</a>
|
||||
<a href="#" use:copy_to_clipboard=data>
|
||||
"Copy \""
|
||||
{data}
|
||||
"\" to clipboard"
|
||||
</a>
|
||||
// automatically applies the directive to every root element in `SomeComponent`
|
||||
<SomeComponent use:highlight />
|
||||
<SomeComponent use:highlight/>
|
||||
// no value will default to `().into()`
|
||||
<button use:add_dot>"Add a dot"</button>
|
||||
// `5.into()` automatically called
|
||||
|
||||
@@ -21,8 +21,8 @@ leptos_actix = { path = "../../integrations/actix", optional = true }
|
||||
leptos_router = { path = "../../router" }
|
||||
log = "0.4"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
gloo-net = { version = "0.2", features = ["http"] }
|
||||
reqwest = { version = "0.11", features = ["json"] }
|
||||
gloo-net = { version = "0.6", features = ["http"] }
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
tracing = "0.1"
|
||||
# openssl = { version = "0.10", features = ["v110"] }
|
||||
wasm-bindgen = "0.2"
|
||||
@@ -32,12 +32,12 @@ web-sys = { version = "0.3", features = ["AbortController", "AbortSignal"] }
|
||||
csr = ["leptos/csr", "leptos_meta/csr", "leptos_router/csr"]
|
||||
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
|
||||
ssr = [
|
||||
"dep:actix-files",
|
||||
"dep:actix-web",
|
||||
"dep:leptos_actix",
|
||||
"leptos/ssr",
|
||||
"leptos_meta/ssr",
|
||||
"leptos_router/ssr",
|
||||
"dep:actix-files",
|
||||
"dep:actix-web",
|
||||
"dep:leptos_actix",
|
||||
"leptos/ssr",
|
||||
"leptos_meta/ssr",
|
||||
"leptos_router/ssr",
|
||||
]
|
||||
|
||||
[profile.wasm-release]
|
||||
|
||||
@@ -21,8 +21,8 @@ log = "0.4"
|
||||
simple_logger = "4.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tracing = "0.1"
|
||||
gloo-net = { version = "0.4", features = ["http"] }
|
||||
reqwest = { version = "0.11", features = ["json"] }
|
||||
gloo-net = { version = "0.6", features = ["http"] }
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
axum = { version = "0.7", optional = true }
|
||||
tower = { version = "0.4", optional = true }
|
||||
tower-http = { version = "0.5", features = ["fs"], optional = true }
|
||||
|
||||
@@ -13,20 +13,18 @@ lto = true
|
||||
[dependencies]
|
||||
console_log = "1.0"
|
||||
console_error_panic_hook = "0.1"
|
||||
leptos = { path = "../../leptos", features = [
|
||||
"experimental-islands",
|
||||
] }
|
||||
leptos = { path = "../../leptos", features = ["experimental-islands"] }
|
||||
leptos_axum = { path = "../../integrations/axum", optional = true, features = [
|
||||
"experimental-islands",
|
||||
] }
|
||||
leptos_meta = { path = "../../meta" }
|
||||
leptos_router = { path = "../../router"}
|
||||
leptos_router = { path = "../../router" }
|
||||
log = "0.4"
|
||||
simple_logger = "4.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tracing = "0.1"
|
||||
gloo-net = { version = "0.4", features = ["http"] }
|
||||
reqwest = { version = "0.11", features = ["json"] }
|
||||
gloo-net = { version = "0.6", features = ["http"] }
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
axum = { version = "0.7", optional = true, features = ["http2"] }
|
||||
tower = { version = "0.4", optional = true }
|
||||
tower-http = { version = "0.5", features = [
|
||||
@@ -39,7 +37,11 @@ http = { version = "1.0", optional = true }
|
||||
web-sys = { version = "0.3", features = ["AbortController", "AbortSignal"] }
|
||||
wasm-bindgen = "0.2"
|
||||
lazy_static = "1.4.0"
|
||||
rust-embed = { version = "8", features = ["axum", "mime_guess", "tokio"], optional = true }
|
||||
rust-embed = { version = "8", features = [
|
||||
"axum",
|
||||
"mime_guess",
|
||||
"tokio",
|
||||
], optional = true }
|
||||
mime_guess = { version = "2.0.4", optional = true }
|
||||
|
||||
[features]
|
||||
|
||||
@@ -22,11 +22,11 @@ log = "0.4.17"
|
||||
simple_logger = "4.0.0"
|
||||
serde = { version = "1.0.148", features = ["derive"] }
|
||||
tracing = "0.1"
|
||||
gloo-net = { version = "0.4.0", features = ["http"] }
|
||||
reqwest = { version = "0.11.13", features = ["json"] }
|
||||
gloo-net = { version = "0.6", features = ["http"] }
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
axum = { version = "0.7", default-features = false, optional = true }
|
||||
tower = { version = "0.4.13", optional = true }
|
||||
http = { version = "0.2.11", optional = true }
|
||||
http = { version = "1.0", optional = true }
|
||||
web-sys = { version = "0.3", features = [
|
||||
"AbortController",
|
||||
"AbortSignal",
|
||||
|
||||
@@ -14,7 +14,7 @@ leptos_router = { path = "../../../router", features = ["csr"] }
|
||||
log = "0.4"
|
||||
console_error_panic_hook = "0.1"
|
||||
console_log = "1"
|
||||
gloo-net = "0.5"
|
||||
gloo-net = "0.6"
|
||||
gloo-storage = "0.3"
|
||||
serde = "1.0"
|
||||
thiserror = "1.0"
|
||||
|
||||
@@ -27,7 +27,7 @@ thiserror = "1.0"
|
||||
wasm-bindgen = "0.2"
|
||||
serde_toml = "0.0.1"
|
||||
toml = "0.8.8"
|
||||
web-sys = { version = "0.3.67", features = ["FileList", "File"] }
|
||||
web-sys = { version = "0.3.70", features = ["FileList", "File"] }
|
||||
strum = { version = "0.25.0", features = ["strum_macros", "derive"] }
|
||||
notify = { version = "6.1.1", optional = true }
|
||||
pin-project-lite = "0.2.13"
|
||||
|
||||
@@ -27,39 +27,39 @@ tower-http = { version = "0.5", features = ["fs"], optional = true }
|
||||
tokio = { version = "1.22.0", features = ["full"], optional = true }
|
||||
http = { version = "1" }
|
||||
sqlx = { version = "0.7", features = [
|
||||
"runtime-tokio-rustls",
|
||||
"sqlite",
|
||||
"runtime-tokio-rustls",
|
||||
"sqlite",
|
||||
], optional = true }
|
||||
thiserror = "1.0.38"
|
||||
wasm-bindgen = "0.2"
|
||||
axum_session_auth = { version = "0.12", features = [
|
||||
"sqlite-rustls",
|
||||
"sqlite-rustls",
|
||||
], optional = true }
|
||||
axum_session = { version = "0.12", features = [
|
||||
"sqlite-rustls",
|
||||
"sqlite-rustls",
|
||||
], optional = true }
|
||||
async-trait = { version = "0.1.64", optional = true }
|
||||
reqwest = { version = "0.11", optional = true, features = ["json"] }
|
||||
reqwest = { version = "0.12", optional = true, features = ["json"] }
|
||||
|
||||
[features]
|
||||
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
|
||||
ssr = [
|
||||
"dep:serde_json",
|
||||
"dep:axum",
|
||||
"dep:tower",
|
||||
"dep:tower-http",
|
||||
"dep:tokio",
|
||||
"dep:reqwest",
|
||||
"dep:oauth2",
|
||||
"dep:axum_session_auth",
|
||||
"dep:axum_session",
|
||||
"dep:async-trait",
|
||||
"dep:sqlx",
|
||||
"dep:rand",
|
||||
"leptos/ssr",
|
||||
"leptos_meta/ssr",
|
||||
"leptos_router/ssr",
|
||||
"dep:leptos_axum",
|
||||
"dep:serde_json",
|
||||
"dep:axum",
|
||||
"dep:tower",
|
||||
"dep:tower-http",
|
||||
"dep:tokio",
|
||||
"dep:reqwest",
|
||||
"dep:oauth2",
|
||||
"dep:axum_session_auth",
|
||||
"dep:axum_session",
|
||||
"dep:async-trait",
|
||||
"dep:sqlx",
|
||||
"dep:rand",
|
||||
"leptos/ssr",
|
||||
"leptos_meta/ssr",
|
||||
"leptos_router/ssr",
|
||||
"dep:leptos_axum",
|
||||
]
|
||||
|
||||
[package.metadata.cargo-all-features]
|
||||
|
||||
@@ -13,7 +13,7 @@ leptos = { path = "../../leptos" }
|
||||
leptos_actix = { path = "../../integrations/actix", optional = true }
|
||||
leptos_meta = { path = "../../meta" }
|
||||
leptos_router = { path = "../../router" }
|
||||
gloo-net = { version = "0.2", features = ["http"] }
|
||||
gloo-net = { version = "0.6", features = ["http"] }
|
||||
log = "0.4"
|
||||
|
||||
# dependencies for client (enable when csr or hydrate set)
|
||||
|
||||
@@ -8,7 +8,7 @@ leptos = { path = "../../leptos", features = ["csr"] }
|
||||
leptos_meta = { path = "../../meta", features = ["csr"] }
|
||||
leptos_router = { path = "../../router", features = ["csr"] }
|
||||
log = "0.4"
|
||||
gloo-net = { version = "0.5", features = ["http"] }
|
||||
gloo-net = { version = "0.6", features = ["http"] }
|
||||
|
||||
# dependencies for client (enable when csr or hydrate set)
|
||||
wasm-bindgen = { version = "0.2" }
|
||||
|
||||
@@ -15,7 +15,7 @@ console_error_panic_hook = "0.1.7"
|
||||
uuid = { version = "1", features = ["v4", "js", "serde"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
web-sys = { version = "0.3.60", features = ["Storage"] }
|
||||
web-sys = { version = "0.3.70", features = ["Storage"] }
|
||||
|
||||
[dev-dependencies]
|
||||
wasm-bindgen-test = "0.3.0"
|
||||
|
||||
@@ -27,3 +27,6 @@ tokio = { version = "1", features = ["rt", "fs"] }
|
||||
[features]
|
||||
nonce = ["leptos/nonce"]
|
||||
experimental-islands = ["leptos_integration_utils/experimental-islands"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -729,10 +729,7 @@ async fn stream_app(
|
||||
|
||||
build_stream_response(options, res_options, stream, runtime).await
|
||||
}
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
#[cfg_attr(any(debug_assertions), instrument(level = "trace", skip_all,))]
|
||||
async fn stream_app_in_order(
|
||||
options: &LeptosOptions,
|
||||
app: impl FnOnce() -> View + 'static,
|
||||
|
||||
@@ -37,3 +37,6 @@ nonce = ["leptos/nonce"]
|
||||
wasm = []
|
||||
default = ["tokio/fs", "tokio/sync"]
|
||||
experimental-islands = ["leptos_integration_utils/experimental-islands"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -18,3 +18,6 @@ tracing = "0.1.37"
|
||||
|
||||
[features]
|
||||
experimental-islands = []
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -28,7 +28,7 @@ server_fn = { workspace = true, features = [
|
||||
"url",
|
||||
"cbor",
|
||||
] }
|
||||
web-sys = { version = "0.3.63", features = [
|
||||
web-sys = { version = "0.3.70", features = [
|
||||
"ShadowRoot",
|
||||
"ShadowRootInit",
|
||||
"ShadowRootMode",
|
||||
@@ -141,3 +141,6 @@ skip_feature_sets = [
|
||||
"rustls",
|
||||
],
|
||||
]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -2,6 +2,11 @@ use crate::ChildrenFn;
|
||||
use cfg_if::cfg_if;
|
||||
use leptos_dom::IntoView;
|
||||
use leptos_macro::component;
|
||||
#[cfg(all(
|
||||
target_arch = "wasm32",
|
||||
any(feature = "hydrate", feature = "csr")
|
||||
))]
|
||||
use leptos_reactive::untrack;
|
||||
|
||||
/// Renders components somewhere else in the DOM.
|
||||
///
|
||||
@@ -36,6 +41,7 @@ pub fn Portal(
|
||||
.unwrap_or_else(|| document().body().expect("body to exist").unchecked_into());
|
||||
|
||||
create_effect(move |_| {
|
||||
leptos::logging::log!("inside Portal effect");
|
||||
let tag = if is_svg { "g" } else { "div" };
|
||||
|
||||
let container = document()
|
||||
@@ -53,7 +59,8 @@ pub fn Portal(
|
||||
container.clone()
|
||||
};
|
||||
|
||||
let _ = render_root.append_child(&children().into_view().get_mountable_node());
|
||||
let children = untrack(|| children().into_view().get_mountable_node());
|
||||
let _ = render_root.append_child(&children);
|
||||
|
||||
let _ = mount.append_child(&container);
|
||||
|
||||
|
||||
@@ -20,3 +20,6 @@ typed-builder = "0.18"
|
||||
tokio = { version = "1", features = ["rt", "macros"] }
|
||||
tempfile = "3"
|
||||
temp-env = { version = "0.3.6", features = ["async_closure"] }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -178,3 +178,6 @@ trace-component-props = []
|
||||
[package.metadata.cargo-all-features]
|
||||
denylist = ["nightly", "trace-component-props"]
|
||||
skip_feature_sets = [["web", "ssr"]]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -112,7 +112,7 @@ pub fn request_animation_frame(cb: impl FnOnce() + 'static) {
|
||||
// Closure::once_into_js only frees the callback when it's actually
|
||||
// called, so this instead uses into_js_value, which can be freed by
|
||||
// the host JS engine's GC if it supports weak references (which all
|
||||
// modern brower engines do). The way this works is that the provided
|
||||
// modern browser engines do). The way this works is that the provided
|
||||
// callback's captured data is dropped immediately after being called,
|
||||
// as before, but it leaves behind a small stub closure rust-side that
|
||||
// will be freed "eventually" by the JS GC. If the function is never
|
||||
|
||||
@@ -46,6 +46,16 @@ pub trait IntoStyle {
|
||||
fn into_style_boxed(self: Box<Self>) -> Style;
|
||||
}
|
||||
|
||||
impl IntoStyle for Style {
|
||||
fn into_style(self) -> Style {
|
||||
self
|
||||
}
|
||||
|
||||
fn into_style_boxed(self: Box<Self>) -> Style {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoStyle for &'static str {
|
||||
#[inline(always)]
|
||||
fn into_style(self) -> Style {
|
||||
@@ -176,7 +186,7 @@ impl Style {
|
||||
/// Converts the style to its HTML value at that moment so it can be rendered on the server.
|
||||
pub fn as_value_string(
|
||||
&self,
|
||||
style_name: &'static str,
|
||||
style_name: &str,
|
||||
) -> Option<Oco<'static, str>> {
|
||||
match self {
|
||||
Style::Value(value) => {
|
||||
|
||||
@@ -51,3 +51,6 @@ axum = ["server_fn_macro/axum"]
|
||||
[package.metadata.cargo-all-features]
|
||||
denylist = ["nightly", "tracing", "trace-component-props"]
|
||||
skip_feature_sets = [["csr", "hydrate"], ["hydrate", "csr"], ["hydrate", "ssr"]]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -11,13 +11,13 @@ dependencies = [
|
||||
[tasks.test-leptos_macro-example]
|
||||
description = "Tests the leptos_macro/example to check if macro handles doc comments correctly"
|
||||
command = "cargo"
|
||||
args = ["+nightly-2024-04-14", "test", "--doc"]
|
||||
args = ["+nightly-2024-07-21", "test", "--doc"]
|
||||
cwd = "example"
|
||||
install_crate = false
|
||||
|
||||
[tasks.doc-leptos_macro-example]
|
||||
description = "Docs the leptos_macro/example to check if macro handles doc comments correctly"
|
||||
command = "cargo"
|
||||
args = ["+nightly-2024-04-14", "doc"]
|
||||
args = ["+nightly-2024-07-21", "doc"]
|
||||
cwd = "example"
|
||||
install_crate = false
|
||||
|
||||
@@ -24,10 +24,7 @@ pub(crate) enum Mode {
|
||||
|
||||
impl Default for Mode {
|
||||
fn default() -> Self {
|
||||
if cfg!(feature = "hydrate")
|
||||
|| cfg!(feature = "csr")
|
||||
|| cfg!(feature = "web")
|
||||
{
|
||||
if cfg!(feature = "hydrate") || cfg!(feature = "csr") {
|
||||
Mode::Client
|
||||
} else {
|
||||
Mode::Ssr
|
||||
|
||||
@@ -52,12 +52,10 @@ pub(crate) fn fragment_to_tokens(
|
||||
None,
|
||||
)?;
|
||||
|
||||
let node = quote_spanned! {span=>
|
||||
#[allow(unused_braces)] {#node}
|
||||
};
|
||||
let node = quote_spanned!(span => { #node });
|
||||
|
||||
Some(quote! {
|
||||
::leptos::IntoView::into_view(#node)
|
||||
::leptos::IntoView::into_view(#[allow(unused_braces)] #node)
|
||||
})
|
||||
})
|
||||
.peekable();
|
||||
@@ -339,9 +337,7 @@ pub(crate) fn element_to_tokens(
|
||||
quote! {}
|
||||
};
|
||||
let ide_helper_close_tag = ide_helper_close_tag.into_iter();
|
||||
Some(quote_spanned! {node.span()=>
|
||||
#[allow(unused_braces)]
|
||||
{
|
||||
let result = quote_spanned! {node.span()=> {
|
||||
#(#ide_helper_close_tag)*
|
||||
#name
|
||||
#(#attrs)*
|
||||
@@ -352,7 +348,10 @@ pub(crate) fn element_to_tokens(
|
||||
#(#children)*
|
||||
#view_marker
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
// We need to move "allow" out of "quote_spanned" because it breaks hovering in rust-analyzer
|
||||
Some(quote!(#[allow(unused_braces)] #result))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,12 +70,10 @@ pub(crate) fn component_to_tokens(
|
||||
})
|
||||
.unwrap_or_else(|| quote! { #name });
|
||||
|
||||
let value = quote_spanned! {value.span()=>
|
||||
#[allow(unused_braces)] {#value}
|
||||
};
|
||||
let value = quote_spanned!(value.span()=> { #value });
|
||||
|
||||
quote_spanned! {attr.span()=>
|
||||
.#name(#value)
|
||||
.#name(#[allow(unused_braces)] #value)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -83,12 +83,10 @@ pub(crate) fn fragment_to_tokens_ssr(
|
||||
let nodes = nodes.iter().map(|node| {
|
||||
let span = node.span();
|
||||
let node = root_node_to_tokens_ssr(node, global_class, None);
|
||||
let node = quote_spanned! {span=>
|
||||
#[allow(unused_braces)] {#node}
|
||||
};
|
||||
let node = quote_spanned!(span=> { #node });
|
||||
|
||||
quote! {
|
||||
::leptos::IntoView::into_view(#node)
|
||||
::leptos::IntoView::into_view(#[allow(unused_braces)] #node)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -61,12 +61,10 @@ pub(crate) fn slot_to_tokens(
|
||||
})
|
||||
.unwrap_or_else(|| quote! { #name });
|
||||
|
||||
let value = quote_spanned! {value.span()=>
|
||||
#[allow(unused_braces)] {#value}
|
||||
};
|
||||
let value = quote_spanned!(value.span()=> { #value });
|
||||
|
||||
quote_spanned! {attr.span()=>
|
||||
.#name(#value)
|
||||
.#name(#[allow(unused_braces)] #value)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -187,7 +185,7 @@ pub(crate) fn slot_to_tokens(
|
||||
};
|
||||
|
||||
let slot = quote_spanned! {node.span()=>
|
||||
#[allow(unused_braces)] {
|
||||
{
|
||||
let slot = #component_name::builder()
|
||||
#(#props)*
|
||||
#(#slots)*
|
||||
@@ -200,6 +198,9 @@ pub(crate) fn slot_to_tokens(
|
||||
},
|
||||
};
|
||||
|
||||
// We need to move "allow" out of "quote_spanned" because it breaks hovering in rust-analyzer
|
||||
let slot = quote!(#[allow(unused_braces)] #slot);
|
||||
|
||||
parent_slots
|
||||
.entry(name)
|
||||
.and_modify(|entry| entry.push(slot.clone()))
|
||||
|
||||
@@ -145,27 +145,27 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
],
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
],
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
@@ -195,27 +195,27 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
],
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
],
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
|
||||
@@ -145,27 +145,27 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
],
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
],
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
@@ -195,27 +195,27 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
],
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
],
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
|
||||
@@ -1,33 +1,27 @@
|
||||
---
|
||||
source: leptos_macro/src/view/tests.rs
|
||||
assertion_line: 101
|
||||
expression: result
|
||||
---
|
||||
TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(10..331),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(10..331),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(10..331),
|
||||
},
|
||||
],
|
||||
span: bytes(10..331),
|
||||
},
|
||||
],
|
||||
span: bytes(10..331),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
@@ -153,27 +147,22 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(28..83),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(28..83),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(28..83),
|
||||
},
|
||||
],
|
||||
span: bytes(28..83),
|
||||
},
|
||||
],
|
||||
span: bytes(28..83),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
@@ -404,27 +393,22 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(96..176),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(96..176),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(96..176),
|
||||
},
|
||||
],
|
||||
span: bytes(96..176),
|
||||
},
|
||||
],
|
||||
span: bytes(96..176),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
@@ -697,27 +681,22 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(189..223),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(189..223),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(189..223),
|
||||
},
|
||||
],
|
||||
span: bytes(189..223),
|
||||
},
|
||||
],
|
||||
span: bytes(189..223),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
@@ -902,27 +881,22 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(236..316),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(236..316),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(236..316),
|
||||
},
|
||||
],
|
||||
span: bytes(236..316),
|
||||
},
|
||||
],
|
||||
span: bytes(236..316),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
|
||||
@@ -145,27 +145,27 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
],
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
],
|
||||
span: bytes(51..52),
|
||||
span: bytes(37..52),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
@@ -195,27 +195,27 @@ TokenStream [
|
||||
Punct {
|
||||
char: '#',
|
||||
spacing: Alone,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Bracket,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: allow,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Parenthesis,
|
||||
stream: TokenStream [
|
||||
Ident {
|
||||
sym: unused_braces,
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
],
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
],
|
||||
span: bytes(70..71),
|
||||
span: bytes(65..71),
|
||||
},
|
||||
Group {
|
||||
delimiter: Brace,
|
||||
|
||||
@@ -121,3 +121,6 @@ skip_feature_sets = [
|
||||
"rkyv",
|
||||
],
|
||||
]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -31,7 +31,7 @@ pub struct SharedContext {
|
||||
impl SharedContext {
|
||||
/// Returns IDs for all [`Resource`](crate::Resource)s found on any scope.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn all_resources() -> Vec<ResourceId> {
|
||||
@@ -41,7 +41,7 @@ impl SharedContext {
|
||||
/// Returns IDs for all [`Resource`](crate::Resource)s found on any scope that are
|
||||
/// pending from the server.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn pending_resources() -> Vec<ResourceId> {
|
||||
@@ -50,7 +50,7 @@ impl SharedContext {
|
||||
|
||||
/// Returns IDs for all [`Resource`](crate::Resource)s found on any scope.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn serialization_resolvers(
|
||||
@@ -62,7 +62,7 @@ impl SharedContext {
|
||||
/// Registers the given [`SuspenseContext`](crate::SuspenseContext) with the current scope,
|
||||
/// calling the `resolver` when its resources are all resolved.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn register_suspense(
|
||||
@@ -121,7 +121,7 @@ impl SharedContext {
|
||||
/// Returns a tuple of two pinned `Future`s that return content for out-of-order
|
||||
/// and in-order streaming, respectively.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn take_pending_fragment(id: &str) -> Option<FragmentData> {
|
||||
@@ -135,7 +135,7 @@ impl SharedContext {
|
||||
|
||||
/// A future that will resolve when all blocking fragments are ready.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn blocking_fragments_ready() -> PinnedFuture<()> {
|
||||
@@ -162,7 +162,7 @@ impl SharedContext {
|
||||
/// The keys are hydration IDs. Values are tuples of two pinned
|
||||
/// `Future`s that return content for out-of-order and in-order streaming, respectively.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn pending_fragments() -> HashMap<String, FragmentData> {
|
||||
@@ -176,7 +176,7 @@ impl SharedContext {
|
||||
/// Registers the given element as an island with the current reactive owner.
|
||||
#[cfg(all(feature = "hydrate", feature = "experimental-islands"))]
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn register_island(el: &web_sys::HtmlElement) {
|
||||
@@ -190,7 +190,7 @@ impl SharedContext {
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn fragment_has_local_resources(fragment: &str) -> bool {
|
||||
@@ -204,7 +204,7 @@ impl SharedContext {
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn fragments_with_local_resources() -> HashSet<String> {
|
||||
@@ -216,7 +216,7 @@ impl SharedContext {
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn register_local_fragment(key: String) {
|
||||
|
||||
@@ -174,7 +174,7 @@ where
|
||||
///
|
||||
/// Unlike a "derived signal," a memo comes with two guarantees:
|
||||
/// 1. The memo will only run *once* per change, no matter how many times you
|
||||
/// access its value.
|
||||
/// access its value.
|
||||
/// 2. The memo will only notify its dependents if the value of the computation changes.
|
||||
///
|
||||
/// This makes a memo the perfect tool for expensive computations.
|
||||
@@ -190,11 +190,11 @@ where
|
||||
/// - [`.get()`](#impl-SignalGet<T>-for-Memo<T>) (or calling the signal as a function) clones the current
|
||||
/// value of the signal. If you call it within an effect, it will cause that effect
|
||||
/// to subscribe to the signal, and to re-run whenever the value of the signal changes.
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-Memo<T>) clones the value of the signal
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-Memo<T>) clones the value of the signal
|
||||
/// without reactively tracking it.
|
||||
/// - [`.with()`](#impl-SignalWith<T>-for-Memo<T>) allows you to reactively access the signal’s value without
|
||||
/// cloning by applying a callback function.
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-Memo<T>) allows you to access the signal’s
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-Memo<T>) allows you to access the signal’s
|
||||
/// value without reactively tracking it.
|
||||
/// - [`.to_stream()`](#impl-SignalStream<T>-for-Memo<T>) converts the signal to an `async` stream of values.
|
||||
///
|
||||
|
||||
@@ -629,7 +629,7 @@ impl Runtime {
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
#[track_caller]
|
||||
@@ -644,7 +644,7 @@ impl Runtime {
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
#[track_caller]
|
||||
@@ -1382,7 +1382,7 @@ impl Drop for SetObserverOnDrop {
|
||||
///
|
||||
/// To avoid panicking under any circumstances, use [`try_batch`].
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
#[inline(always)]
|
||||
@@ -1398,7 +1398,7 @@ pub fn batch<T>(f: impl FnOnce() -> T) -> T {
|
||||
///
|
||||
/// Unlike [`batch`], this will not panic if the runtime has been disposed.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
#[inline(always)]
|
||||
@@ -1447,7 +1447,7 @@ pub fn on_cleanup(cleanup_fn: impl FnOnce() + 'static) {
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
fn push_cleanup(cleanup_fn: Box<dyn FnOnce()>) {
|
||||
@@ -1509,7 +1509,7 @@ impl ScopeProperty {
|
||||
/// # runtime.dispose();
|
||||
/// ```
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
#[inline(always)]
|
||||
@@ -1519,7 +1519,7 @@ pub fn untrack<T>(f: impl FnOnce() -> T) -> T {
|
||||
|
||||
#[doc(hidden)]
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
#[inline(always)]
|
||||
|
||||
@@ -332,7 +332,7 @@ pub trait SignalDispose {
|
||||
/// #
|
||||
/// ```
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features="ssr"),
|
||||
any(debug_assertions, feature="ssr"),
|
||||
instrument(
|
||||
level = "trace",
|
||||
skip_all,
|
||||
@@ -354,7 +354,7 @@ pub fn create_signal<T>(value: T) -> (ReadSignal<T>, WriteSignal<T>) {
|
||||
/// **Note**: If used on the server side during server rendering, this will return `None`
|
||||
/// immediately and not begin driving the stream.
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features = "ssr"),
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", skip_all,)
|
||||
)]
|
||||
pub fn create_signal_from_stream<T>(
|
||||
@@ -394,11 +394,11 @@ pub fn create_signal_from_stream<T>(
|
||||
/// - [`.get()`](#impl-SignalGet<T>-for-ReadSignal<T>) (or calling the signal as a function) clones the current
|
||||
/// value of the signal. If you call it within an effect, it will cause that effect
|
||||
/// to subscribe to the signal, and to re-run whenever the value of the signal changes.
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-ReadSignal<T>) clones the value of the signal
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-ReadSignal<T>) clones the value of the signal
|
||||
/// without reactively tracking it.
|
||||
/// - [`.with()`](#impl-SignalWith<T>-for-ReadSignal<T>) allows you to reactively access the signal’s value without
|
||||
/// cloning by applying a callback function.
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-ReadSignal<T>) allows you to access the signal’s
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-ReadSignal<T>) allows you to access the signal’s
|
||||
/// value without reactively tracking it.
|
||||
/// - [`.to_stream()`](#impl-SignalStream<T>-for-ReadSignal<T>) converts the signal to an `async` stream of values.
|
||||
///
|
||||
@@ -817,11 +817,11 @@ impl<T> Hash for ReadSignal<T> {
|
||||
/// - [`.set()`](#impl-SignalSet<T>-for-WriteSignal<T>) (or calling the setter as a function)
|
||||
/// sets the signal’s value, and notifies all subscribers that the signal’s value has changed.
|
||||
/// to subscribe to the signal, and to re-run whenever the value of the signal changes.
|
||||
/// - [`.set_untracked()`](#impl-SignalSetUntracked<T>-for-WriteSignal<T>) sets the signal’s value
|
||||
/// - [`.set_untracked()`](#impl-SignalSetUntracked<T>-for-WriteSignal<T>) sets the signal’s value
|
||||
/// without notifying its subscribers.
|
||||
/// - [`.update()`](#impl-SignalUpdate<T>-for-WriteSignal<T>) mutates the signal’s value in place
|
||||
/// and notifies all subscribers that the signal’s value has changed.
|
||||
/// - [`.update_untracked()`](#impl-SignalUpdateUntracked<T>-for-WriteSignal<T>) mutates the signal’s value
|
||||
/// - [`.update_untracked()`](#impl-SignalUpdateUntracked<T>-for-WriteSignal<T>) mutates the signal’s value
|
||||
/// in place without notifying its subscribers.
|
||||
///
|
||||
/// ## Examples
|
||||
@@ -1143,7 +1143,7 @@ impl<T> Hash for WriteSignal<T> {
|
||||
/// #
|
||||
/// ```
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features="ssr"),
|
||||
any(debug_assertions, feature="ssr"),
|
||||
instrument(
|
||||
level = "trace",
|
||||
skip_all,
|
||||
@@ -1165,20 +1165,20 @@ pub fn create_rw_signal<T>(value: T) -> RwSignal<T> {
|
||||
/// - [`.get()`](#impl-SignalGet<T>-for-RwSignal<T>) clones the current
|
||||
/// value of the signal. If you call it within an effect, it will cause that effect
|
||||
/// to subscribe to the signal, and to re-run whenever the value of the signal changes.
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-RwSignal<T>) clones the value of the signal
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-RwSignal<T>) clones the value of the signal
|
||||
/// without reactively tracking it.
|
||||
/// - [`.with()`](#impl-SignalWith<T>-for-RwSignal<T>) allows you to reactively access the signal’s value without
|
||||
/// cloning by applying a callback function.
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-RwSignal<T>) allows you to access the signal’s
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-RwSignal<T>) allows you to access the signal’s
|
||||
/// value without reactively tracking it.
|
||||
/// - [`.set()`](#impl-SignalSet<T>-for-RwSignal<T>) sets the signal’s value,
|
||||
/// and notifies all subscribers that the signal’s value has changed.
|
||||
/// to subscribe to the signal, and to re-run whenever the value of the signal changes.
|
||||
/// - [`.set_untracked()`](#impl-SignalSetUntracked<T>-for-RwSignal<T>) sets the signal’s value
|
||||
/// - [`.set_untracked()`](#impl-SignalSetUntracked<T>-for-RwSignal<T>) sets the signal’s value
|
||||
/// without notifying its subscribers.
|
||||
/// - [`.update()`](#impl-SignalUpdate<T>-for-RwSignal<T>) mutates the signal’s value in place
|
||||
/// and notifies all subscribers that the signal’s value has changed.
|
||||
/// - [`.update_untracked()`](#impl-SignalUpdateUntracked<T>-for-RwSignal<T>) mutates the signal’s value
|
||||
/// - [`.update_untracked()`](#impl-SignalUpdateUntracked<T>-for-RwSignal<T>) mutates the signal’s value
|
||||
/// in place without notifying its subscribers.
|
||||
/// - [`.to_stream()`](#impl-SignalStream<T>-for-RwSignal<T>) converts the signal to an `async` stream of values.
|
||||
///
|
||||
@@ -1432,17 +1432,17 @@ impl<T> SignalSetUntracked<T> for RwSignal<T> {
|
||||
|
||||
impl<T> SignalUpdateUntracked<T> for RwSignal<T> {
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, features="ssr"),
|
||||
instrument(
|
||||
level = "trace",
|
||||
name = "RwSignal::update_untracked()",
|
||||
skip_all,
|
||||
fields(
|
||||
id = ?self.id,
|
||||
defined_at = %self.defined_at,
|
||||
ty = %std::any::type_name::<T>()
|
||||
any(debug_assertions, feature="ssr"),
|
||||
instrument(
|
||||
level = "trace",
|
||||
name = "RwSignal::update_untracked()",
|
||||
skip_all,
|
||||
fields(
|
||||
id = ?self.id,
|
||||
defined_at = %self.defined_at,
|
||||
ty = %std::any::type_name::<T>()
|
||||
)
|
||||
)
|
||||
)
|
||||
)]
|
||||
#[inline(always)]
|
||||
fn update_untracked(&self, f: impl FnOnce(&mut T)) {
|
||||
|
||||
@@ -46,11 +46,11 @@ where
|
||||
/// - [`.get()`](#impl-SignalGet-for-Signal<T>) (or calling the signal as a function) clones the current
|
||||
/// value of the signal. If you call it within an effect, it will cause that effect
|
||||
/// to subscribe to the signal, and to re-run whenever the value of the signal changes.
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-Signal<T>) clones the value of the signal
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-Signal<T>) clones the value of the signal
|
||||
/// without reactively tracking it.
|
||||
/// - [`.with()`](#impl-SignalWith-for-Signal<T>) allows you to reactively access the signal’s value without
|
||||
/// cloning by applying a callback function.
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-Signal<T>) allows you to access the signal’s
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-Signal<T>) allows you to access the signal’s
|
||||
/// value without reactively tracking it.
|
||||
/// - [`.to_stream()`](#impl-SignalStream<T>-for-Signal<T>) converts the signal to an `async` stream of values.
|
||||
///
|
||||
@@ -494,11 +494,11 @@ impl<T> Eq for SignalTypes<T> where T: PartialEq {}
|
||||
/// - [`.get()`](#impl-SignalGet-for-MaybeSignal<T>) (or calling the signal as a function) clones the current
|
||||
/// value of the signal. If you call it within an effect, it will cause that effect
|
||||
/// to subscribe to the signal, and to re-run whenever the value of the signal changes.
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-MaybeSignal<T>) clones the value of the signal
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-MaybeSignal<T>) clones the value of the signal
|
||||
/// without reactively tracking it.
|
||||
/// - [`.with()`](#impl-SignalWith-for-MaybeSignal<T>) allows you to reactively access the signal’s value without
|
||||
/// cloning by applying a callback function.
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-MaybeSignal<T>) allows you to access the signal’s
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-MaybeSignal<T>) allows you to access the signal’s
|
||||
/// value without reactively tracking it.
|
||||
/// - [`.to_stream()`](#impl-SignalStream<T>-for-MaybeSignal<T>) converts the signal to an `async` stream of values.
|
||||
///
|
||||
@@ -889,11 +889,11 @@ where
|
||||
/// value of the signal. If you call it within an effect, it will cause that effect
|
||||
/// to subscribe to the signal, and to re-run whenever the value of the signal changes.
|
||||
/// - [`.get_untracked()`](#impl-SignalGetUntracked<T>-for-MaybeProp<T>) clones the value of the signal
|
||||
/// without reactively tracking it.
|
||||
/// without reactively tracking it.
|
||||
/// - [`.with()`](#impl-SignalWith-for-MaybeProp<T>) allows you to reactively access the signal’s value without
|
||||
/// cloning by applying a callback function.
|
||||
/// - [`.with_untracked()`](#impl-SignalWithUntracked<T>-for-MaybeProp<T>) allows you to access the signal’s
|
||||
/// value without reactively tracking it.
|
||||
/// value without reactively tracking it.
|
||||
/// - [`.to_stream()`](#impl-SignalStream<T>-for-MaybeProp<T>) converts the signal to an `async` stream of values.
|
||||
///
|
||||
/// ## Examples
|
||||
|
||||
@@ -32,3 +32,6 @@ nightly = ["leptos_reactive/nightly"]
|
||||
|
||||
[package.metadata.cargo-all-features]
|
||||
denylist = ["nightly"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -392,7 +392,7 @@ where
|
||||
let pending_dispatches = Rc::clone(&self.pending_dispatches);
|
||||
let value = self.value;
|
||||
pending.set(true);
|
||||
pending_dispatches.set(pending_dispatches.get().saturating_sub(1));
|
||||
pending_dispatches.set(pending_dispatches.get().wrapping_add(1));
|
||||
spawn_local(async move {
|
||||
let new_value = fut.await;
|
||||
let res = try_batch(move || {
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
////! HTML forms don’t support `PUT` or `DELETE`, and they don’t support sending JSON. This means that if you use anything
|
||||
////! but a `GET` or `POST` request with URL-encoded data, it can only work once WASM has loaded.
|
||||
////!
|
||||
////! The CBOR encoding is suported for historical reasons; an earlier version of server functions used a URL encoding that
|
||||
////! The CBOR encoding is supported for historical reasons; an earlier version of server functions used a URL encoding that
|
||||
////! didn’t support nested objects like structs or vectors as server function arguments, which CBOR did. But note that the
|
||||
////! CBOR forms encounter the same issue as `PUT`, `DELETE`, or JSON: they do not degrade gracefully if the WASM version of
|
||||
////! your app is not available.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "leptos_meta"
|
||||
version = "0.6.12"
|
||||
version = "0.6.14"
|
||||
edition = "2021"
|
||||
authors = ["Greg Johnston"]
|
||||
license = "MIT"
|
||||
@@ -29,3 +29,6 @@ nightly = ["leptos/nightly"]
|
||||
[package.metadata.cargo-all-features]
|
||||
denylist = ["nightly"]
|
||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -117,7 +117,7 @@ impl core::fmt::Debug for MetaTagsContext {
|
||||
|
||||
impl MetaTagsContext {
|
||||
/// Converts metadata tags into an HTML string.
|
||||
#[cfg(any(feature = "ssr", docs))]
|
||||
#[cfg(any(feature = "ssr", doc))]
|
||||
pub fn as_string(&self) -> String {
|
||||
self.els
|
||||
.borrow()
|
||||
|
||||
@@ -8,9 +8,9 @@ codegen-units = 1
|
||||
lto = true
|
||||
|
||||
[dependencies]
|
||||
leptos = { version = "0.6.12", features = ["csr"] }
|
||||
leptos_meta = { version = "0.6.12", features = ["csr"] }
|
||||
leptos_router = { version = "0.6.12", features = ["csr"] }
|
||||
leptos = { version = "0.6.14", features = ["csr"] }
|
||||
leptos_meta = { version = "0.6.14", features = ["csr"] }
|
||||
leptos_router = { version = "0.6.14", features = ["csr"] }
|
||||
console_log = "1"
|
||||
log = "0.4"
|
||||
console_error_panic_hook = "0.1.7"
|
||||
|
||||
@@ -37,7 +37,7 @@ pub fn make_openapi_call_via_gpt(message:String) -> ChatCompletionParameters {
|
||||
// This name will be given to the OpenAI API as part of our functions
|
||||
let name = operation.operation_id.clone().expect("Each operation to have an operation id");
|
||||
|
||||
// we'll use the descrition
|
||||
// we'll use the description
|
||||
let desc = operation.description.clone().expect("Each operation to have a description, this is how GPT knows what the functiond does and it is helpful for calling it.");
|
||||
let mut required_list = vec![];
|
||||
let mut properties = serde_json::Map::new();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["app", "frontend", "ids", "server","e2e"]
|
||||
members = ["app", "frontend", "ids", "server", "e2e"]
|
||||
|
||||
# need to be applied only to wasm build
|
||||
[profile.release]
|
||||
@@ -13,34 +13,38 @@ leptos = { version = "0.6.9", features = ["nightly"] }
|
||||
leptos_meta = { version = "0.6.9", features = ["nightly"] }
|
||||
leptos_router = { version = "0.6.9", features = ["nightly"] }
|
||||
leptos_axum = { version = "0.6.9" }
|
||||
leptos-use = {version = "0.10.5"}
|
||||
leptos-use = { version = "0.10.5" }
|
||||
|
||||
axum = "0.7"
|
||||
axum-server = {version = "0.6", features = ["tls-rustls"]}
|
||||
axum-extra = { version = "0.9.2", features=["cookie"]}
|
||||
axum-server = { version = "0.6", features = ["tls-rustls"] }
|
||||
axum-extra = { version = "0.9.2", features = ["cookie"] }
|
||||
cfg-if = "1"
|
||||
console_error_panic_hook = "0.1.7"
|
||||
console_log = "1"
|
||||
http = "1"
|
||||
ids = {path="./ids"}
|
||||
ids = { path = "./ids" }
|
||||
# this goes to this personal branch because of https://github.com/ory/sdk/issues/325#issuecomment-1960834676
|
||||
ory-kratos-client = {git="https://github.com/sjud/kratos-client-rust"}
|
||||
ory-keto-client = {version = "0.11.0-alpha.0"}
|
||||
reqwest = { version = "0.11.24", features = ["json","cookies"] }
|
||||
ory-kratos-client = { git = "https://github.com/sjud/kratos-client-rust" }
|
||||
ory-keto-client = { version = "0.11.0-alpha.0" }
|
||||
reqwest = { version = "0.12", features = ["json", "cookies"] }
|
||||
serde = "1.0.197"
|
||||
serde_json = "1.0.114"
|
||||
sqlx = {version= "0.7.3", features=["runtime-tokio","sqlite","macros"]}
|
||||
sqlx = { version = "0.7.3", features = ["runtime-tokio", "sqlite", "macros"] }
|
||||
thiserror = "1"
|
||||
time = "0.3.34"
|
||||
tokio = { version = "1.33.0", features = ["full"] }
|
||||
tower = { version = "0.4.13", features = ["full"] }
|
||||
tower-http = { version = "0.5", features = ["full"] }
|
||||
tracing = "0.1.40"
|
||||
tracing-subscriber = {version="0.3.18", features=["env-filter"]}
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||
url = "2.5.0"
|
||||
uuid = {version = "1.7.0", features=["v4","serde"]}
|
||||
uuid = { version = "1.7.0", features = ["v4", "serde"] }
|
||||
wasm-bindgen = "0.2.92"
|
||||
web-sys = {version = "0.3.69", features=["HtmlDocument","HtmlFormElement","FormData"]}
|
||||
web-sys = { version = "0.3.69", features = [
|
||||
"HtmlDocument",
|
||||
"HtmlFormElement",
|
||||
"FormData",
|
||||
] }
|
||||
|
||||
|
||||
# See https://github.com/akesson/cargo-leptos for documentation of all the parameters.
|
||||
|
||||
@@ -93,7 +93,7 @@ pub fn kratos_html(node: UiNode, body: RwSignal<HashMap<String, String>>) -> imp
|
||||
body.update(|map| {
|
||||
_ = map.insert(name.clone(), value.clone());
|
||||
});
|
||||
// this expects the identifer to be an email, but it could be telelphone etc so code is extra fragile
|
||||
// this expects the identifier to be an email, but it could be telephone etc so code is extra fragile
|
||||
view! {<input type="hidden" value=value name=name /> }.into_view()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,19 +6,21 @@ edition = "2021"
|
||||
[dev-dependencies]
|
||||
anyhow = "1.0.72"
|
||||
async-trait = "0.1.72"
|
||||
cucumber = {version="0.20.2",features=["tracing","macros"]}
|
||||
cucumber = { version = "0.20.2", features = ["tracing", "macros"] }
|
||||
pretty_assertions = "1.4.0"
|
||||
serde_json = "1.0.104"
|
||||
tokio = { version = "1.29.1", features = ["macros", "rt-multi-thread", "time"] }
|
||||
url = "2.4.0"
|
||||
reqwest = "0.11.25"
|
||||
reqwest = "0.12"
|
||||
tracing = "0.1.40"
|
||||
chromiumoxide = {version = "0.5.7", default-features = false, features=["tokio-runtime"]}
|
||||
chromiumoxide = { version = "0.5.7", default-features = false, features = [
|
||||
"tokio-runtime",
|
||||
] }
|
||||
ids.workspace = true
|
||||
fake = "2.9.2"
|
||||
tokio-tungstenite = "0.21.0"
|
||||
futures-util = "0.3.30"
|
||||
uuid = {version="1.7.0",features=["serde"]}
|
||||
uuid = { version = "1.7.0", features = ["serde"] }
|
||||
once_cell = "1.19.0"
|
||||
futures = "0.3.30"
|
||||
|
||||
@@ -28,13 +30,9 @@ harness = false # Allow Cucumber to print output instead of libtest
|
||||
|
||||
[features]
|
||||
#vscode thing to get autocomplete
|
||||
ssr=[]
|
||||
ssr = []
|
||||
|
||||
[dependencies]
|
||||
once_cell = "1.19.0"
|
||||
regex = "1.10.3"
|
||||
serde.workspace = true
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ pub static LOGOUT_BUTTON_ID: &'static str = "logout_button_id";
|
||||
pub static LOGIN_BUTTON_ID: &'static str = "login_button_id";
|
||||
/// This function is for use in kratos_html, it takes the name of the input node and it
|
||||
/// matches it according to what we've specified in the kratos schema file. If we change the schema.
|
||||
/// I.e use a phone instead of an email, the identifer id will change and break tests that expect an email.
|
||||
/// I.e use a phone instead of an email, the identifier id will change and break tests that expect an email.
|
||||
/// i.e use oidc instead of password, as auth method... that will break tests too.
|
||||
/// Which is good.
|
||||
pub fn match_name_to_id(name: String) -> &'static str {
|
||||
|
||||
@@ -5,7 +5,7 @@ First
|
||||
cargo new leptos_tauri_from_scratch
|
||||
```
|
||||
|
||||
Then, make our two seperate project folders. We need one for our actual app, 'src-orig' and the other is required when using `cargo tauri`
|
||||
Then, make our two separate project folders. We need one for our actual app, 'src-orig' and the other is required when using `cargo tauri`
|
||||
```sh
|
||||
mkdir src-orig && mkdir src-tauri
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "leptos_router"
|
||||
version = "0.6.12"
|
||||
version = "0.6.14"
|
||||
edition = "2021"
|
||||
authors = ["Greg Johnston", "Ben Wishovich"]
|
||||
license = "MIT"
|
||||
@@ -15,7 +15,7 @@ leptos_integration_utils = { workspace = true, optional = true }
|
||||
leptos_meta = { workspace = true, optional = true }
|
||||
cached = { version = "0.45.0", optional = true }
|
||||
cfg-if = "1"
|
||||
gloo-net = { version = "0.5", features = ["http"] }
|
||||
gloo-net = { version = "0.6", features = ["http"] }
|
||||
lazy_static = "1"
|
||||
linear-map = { version = "1", features = ["serde_impl"] }
|
||||
once_cell = "1.18"
|
||||
@@ -78,3 +78,6 @@ nightly = ["leptos/nightly"]
|
||||
# No need to test optional dependencies as they are enabled by the ssr feature
|
||||
denylist = ["url", "regex", "nightly"]
|
||||
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
@@ -13,8 +13,6 @@ use leptos::{
|
||||
},
|
||||
*,
|
||||
};
|
||||
#[cfg(feature = "transition")]
|
||||
use leptos_reactive::use_transition;
|
||||
use send_wrapper::SendWrapper;
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use thiserror::Error;
|
||||
@@ -189,10 +187,6 @@ impl RouterContext {
|
||||
let (state, set_state) =
|
||||
create_signal(source.with_untracked(|s| s.state.clone()));
|
||||
|
||||
// we'll use this transition to wait for async resources to load when navigating to a new route
|
||||
#[cfg(feature = "transition")]
|
||||
let transition = use_transition();
|
||||
|
||||
// Each field of `location` reactively represents a different part of the current location
|
||||
let location = create_location(reference, state);
|
||||
let referrers: Rc<RefCell<Vec<LocationChange>>> =
|
||||
|
||||
@@ -14,7 +14,7 @@ server_fn_macro_default = { workspace = true }
|
||||
# used for hashing paths in #[server] macro
|
||||
const_format = "0.2"
|
||||
xxhash-rust = { version = "0.8", features = ["const_xxh64"] }
|
||||
# used across multiple featurs
|
||||
# used across multiple features
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
send_wrapper = { version = "0.6", features = ["futures"], optional = true }
|
||||
|
||||
@@ -57,7 +57,7 @@ rkyv = { version = "0.7", features = [
|
||||
rmp-serde = { version = "1.1", optional = true }
|
||||
|
||||
# client
|
||||
gloo-net = { version = "0.5", optional = true }
|
||||
gloo-net = { version = "0.6", optional = true }
|
||||
js-sys = { version = "0.3", optional = true }
|
||||
wasm-bindgen = { version = "0.2", optional = true }
|
||||
wasm-bindgen-futures = { version = "0.4", optional = true }
|
||||
@@ -69,7 +69,7 @@ web-sys = { version = "0.3", optional = true, features = [
|
||||
] }
|
||||
|
||||
# reqwest client
|
||||
reqwest = { version = "0.11", default-features = false, optional = true, features = [
|
||||
reqwest = { version = "0.12", default-features = false, optional = true, features = [
|
||||
"multipart",
|
||||
"stream",
|
||||
] }
|
||||
@@ -111,6 +111,7 @@ ssr = ["inventory"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
# disables some feature combos for testing in CI
|
||||
[package.metadata.cargo-all-features]
|
||||
|
||||
@@ -40,7 +40,8 @@ where
|
||||
{
|
||||
async fn from_req(req: Request) -> Result<Self, ServerFnError<CustErr>> {
|
||||
let string_data = req.as_query().unwrap_or_default();
|
||||
let args = serde_qs::from_str::<Self>(string_data)
|
||||
let args = serde_qs::Config::new(5, false)
|
||||
.deserialize_str::<Self>(string_data)
|
||||
.map_err(|e| ServerFnError::Args(e.to_string()))?;
|
||||
Ok(args)
|
||||
}
|
||||
@@ -74,7 +75,8 @@ where
|
||||
{
|
||||
async fn from_req(req: Request) -> Result<Self, ServerFnError<CustErr>> {
|
||||
let string_data = req.try_into_string().await?;
|
||||
let args = serde_qs::from_str::<Self>(&string_data)
|
||||
let args = serde_qs::Config::new(5, false)
|
||||
.deserialize_str::<Self>(&string_data)
|
||||
.map_err(|e| ServerFnError::Args(e.to_string()))?;
|
||||
Ok(args)
|
||||
}
|
||||
|
||||
@@ -192,8 +192,10 @@ fn streaming_request(
|
||||
let headers = Headers::new()?;
|
||||
headers.append("Content-Type", content_type)?;
|
||||
headers.append("Accept", accepts)?;
|
||||
let mut init = RequestInit::new();
|
||||
init.headers(&headers).method("POST").body(Some(&stream));
|
||||
let init = RequestInit::new();
|
||||
init.set_headers(&headers);
|
||||
init.set_method("POST");
|
||||
init.set_body(&stream);
|
||||
|
||||
// Chrome requires setting `duplex: "half"` on streaming requests
|
||||
Reflect::set(
|
||||
|
||||
@@ -22,3 +22,6 @@ ssr = []
|
||||
actix = []
|
||||
axum = []
|
||||
reqwest = []
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
rustdoc-args = ["--generate-link-to-definition"]
|
||||
|
||||
Reference in New Issue
Block a user