Removed crate once_cell (#4083)

* Removed crate once_cell

As of rust_version 1.80.0 there are now equivalent options in std.

Async and sync changes are as follows.

-use once_cell::sync::Lazy;
+use std::sync::LazyLock;

-use once_cell::sync::Lazy;
+use std::sync::LazyLock;

* ran cargo fmt.

* fixed server_fn errors.

* cargo fmt fixes.

* "use srd::sync" becomes "use std::sync".

* fixed formatting issue.

* formatting issues.

* Fixed error in examples/server_fns_axum

* more formatting issues.

* more formatting issues.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
martin frances
2025-06-16 18:38:32 +01:00
committed by GitHub
parent 40ea20057f
commit d555c1e0ce
21 changed files with 166 additions and 185 deletions

249
Cargo.lock generated
View File

@@ -88,7 +88,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -205,7 +205,7 @@ dependencies = [
"actix-router", "actix-router",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -233,9 +233,9 @@ dependencies = [
[[package]] [[package]]
name = "adler2" name = "adler2"
version = "2.0.0" version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
@@ -327,7 +327,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -344,7 +344,7 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -367,7 +367,7 @@ dependencies = [
"manyhow", "manyhow",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -383,7 +383,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"quote-use", "quote-use",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -509,9 +509,9 @@ dependencies = [
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.17.0" version = "3.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee"
[[package]] [[package]]
name = "bytecheck" name = "bytecheck"
@@ -533,7 +533,7 @@ checksum = "efb7846e0cb180355c2dec69e721edafa36919850f1a9f52ffba4ebc0393cb71"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -559,15 +559,15 @@ dependencies = [
[[package]] [[package]]
name = "camino" name = "camino"
version = "1.1.9" version = "1.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab"
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.2.24" version = "1.2.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16595d3be041c03b09d08d0858631facccee9221e579704070e6e9e4915d3bc7" checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc"
dependencies = [ dependencies = [
"jobserver", "jobserver",
"libc", "libc",
@@ -586,9 +586,9 @@ dependencies = [
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "1.0.0" version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
[[package]] [[package]]
name = "cfg_aliases" name = "cfg_aliases"
@@ -850,7 +850,7 @@ checksum = "e73f2692d4bd3cac41dca28934a39894200c9fabf49586d77d0e5954af1d7902"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -863,7 +863,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustc_version", "rustc_version",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -883,7 +883,7 @@ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
"unicode-xid", "unicode-xid",
] ]
@@ -905,7 +905,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -1006,9 +1006,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.1.1" version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d"
dependencies = [ dependencies = [
"crc32fast", "crc32fast",
"miniz_oxide", "miniz_oxide",
@@ -1120,7 +1120,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -1172,7 +1172,7 @@ dependencies = [
"cfg-if", "cfg-if",
"js-sys", "js-sys",
"libc", "libc",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi 0.11.1+wasi-snapshot-preview1",
"wasm-bindgen", "wasm-bindgen",
] ]
@@ -1240,7 +1240,7 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -1356,9 +1356,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.15.3" version = "0.15.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
[[package]] [[package]]
name = "heapless" name = "heapless"
@@ -1382,9 +1382,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.3.9" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
[[package]] [[package]]
name = "html-escape" name = "html-escape"
@@ -1470,7 +1470,6 @@ version = "0.3.0"
dependencies = [ dependencies = [
"futures", "futures",
"js-sys", "js-sys",
"once_cell",
"or_poisoned", "or_poisoned",
"pin-project-lite", "pin-project-lite",
"serde", "serde",
@@ -1500,9 +1499,9 @@ dependencies = [
[[package]] [[package]]
name = "hyper-rustls" name = "hyper-rustls"
version = "0.27.6" version = "0.27.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03a01595e11bdcec50946522c32dde3fc6914743000a68b93000965f2f02406d" checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
dependencies = [ dependencies = [
"http 1.3.1", "http 1.3.1",
"hyper", "hyper",
@@ -1533,9 +1532,9 @@ dependencies = [
[[package]] [[package]]
name = "hyper-util" name = "hyper-util"
version = "0.1.13" version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1c293b6b3d21eca78250dc7dbebd6b9210ec5530e038cbfe0661b5c47ab06e8" checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb"
dependencies = [ dependencies = [
"base64", "base64",
"bytes", "bytes",
@@ -1675,7 +1674,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown 0.15.3", "hashbrown 0.15.4",
] ]
[[package]] [[package]]
@@ -1812,7 +1811,7 @@ dependencies = [
"http 1.3.1", "http 1.3.1",
"proc-macro-error", "proc-macro-error",
"server_fn_macro 0.6.15", "server_fn_macro 0.6.15",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -1831,7 +1830,6 @@ dependencies = [
"leptos_macro", "leptos_macro",
"leptos_meta", "leptos_meta",
"leptos_router", "leptos_router",
"once_cell",
"parking_lot", "parking_lot",
"send_wrapper", "send_wrapper",
"serde_json", "serde_json",
@@ -1855,7 +1853,6 @@ dependencies = [
"leptos_macro", "leptos_macro",
"leptos_meta", "leptos_meta",
"leptos_router", "leptos_router",
"once_cell",
"parking_lot", "parking_lot",
"server_fn", "server_fn",
"tachys", "tachys",
@@ -1908,7 +1905,7 @@ dependencies = [
"quote", "quote",
"rstml", "rstml",
"serde", "serde",
"syn 2.0.101", "syn 2.0.103",
"walkdir", "walkdir",
] ]
@@ -1948,7 +1945,7 @@ dependencies = [
"serde", "serde",
"server_fn", "server_fn",
"server_fn_macro 0.8.2", "server_fn_macro 0.8.2",
"syn 2.0.101", "syn 2.0.103",
"tracing", "tracing",
"trybuild", "trybuild",
"typed-builder", "typed-builder",
@@ -1962,7 +1959,6 @@ dependencies = [
"futures", "futures",
"indexmap", "indexmap",
"leptos", "leptos",
"once_cell",
"or_poisoned", "or_poisoned",
"send_wrapper", "send_wrapper",
"tracing", "tracing",
@@ -1981,7 +1977,6 @@ dependencies = [
"js-sys", "js-sys",
"leptos", "leptos",
"leptos_router_macro", "leptos_router_macro",
"once_cell",
"or_poisoned", "or_poisoned",
"percent-encoding", "percent-encoding",
"reactive_graph", "reactive_graph",
@@ -2004,7 +1999,7 @@ dependencies = [
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2030,9 +2025,9 @@ dependencies = [
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.172" version = "0.2.173"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb"
[[package]] [[package]]
name = "linear-map" name = "linear-map"
@@ -2100,7 +2095,7 @@ dependencies = [
"manyhow-macros", "manyhow-macros",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2122,9 +2117,9 @@ checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.7.4" version = "2.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
[[package]] [[package]]
name = "mime" name = "mime"
@@ -2150,7 +2145,7 @@ checksum = "d6c74ab4f1a0c0ab045260ee4727b23c00cc17e5eff5095262d08eef8c3c8d49"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2176,9 +2171,9 @@ dependencies = [
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.8.8" version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
dependencies = [ dependencies = [
"adler2", "adler2",
] ]
@@ -2191,7 +2186,7 @@ checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c"
dependencies = [ dependencies = [
"libc", "libc",
"log", "log",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi 0.11.1+wasi-snapshot-preview1",
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
@@ -2229,7 +2224,7 @@ checksum = "0ac7d860b767c6398e88fe93db73ce53eb496057aa6895ffa4d60cb02e1d1c6b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2270,9 +2265,9 @@ dependencies = [
[[package]] [[package]]
name = "num_cpus" name = "num_cpus"
version = "1.16.0" version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"
dependencies = [ dependencies = [
"hermit-abi", "hermit-abi",
"libc", "libc",
@@ -2304,9 +2299,9 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.10.72" version = "0.10.73"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cfg-if", "cfg-if",
@@ -2325,7 +2320,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2336,9 +2331,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.9.108" version = "0.9.109"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571"
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
@@ -2414,7 +2409,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2474,12 +2469,12 @@ dependencies = [
[[package]] [[package]]
name = "prettyplease" name = "prettyplease"
version = "0.2.33" version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dee91521343f4c5c6a63edd65e54f31f5c92fe8978c40a4282f8372194c6a7d" checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2534,7 +2529,7 @@ dependencies = [
"proc-macro-error-attr2", "proc-macro-error-attr2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2565,7 +2560,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
"version_check", "version_check",
"yansi", "yansi",
] ]
@@ -2587,7 +2582,7 @@ checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2673,7 +2668,7 @@ dependencies = [
"proc-macro-utils", "proc-macro-utils",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2770,14 +2765,14 @@ dependencies = [
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.5.12" version = "0.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6"
dependencies = [ dependencies = [
"bitflags", "bitflags",
] ]
@@ -2828,9 +2823,9 @@ dependencies = [
[[package]] [[package]]
name = "reqwest" name = "reqwest"
version = "0.12.18" version = "0.12.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e98ff6b0dbbe4d5a37318f433d4fc82babd21631f194d370409ceb2e40b2f0b5" checksum = "eabf4c97d9130e2bf606614eb937e86edac8292eaa6f422f995d7e8de1eb1813"
dependencies = [ dependencies = [
"base64", "base64",
"bytes", "bytes",
@@ -2843,13 +2838,10 @@ dependencies = [
"hyper-rustls", "hyper-rustls",
"hyper-tls", "hyper-tls",
"hyper-util", "hyper-util",
"ipnet",
"js-sys", "js-sys",
"log", "log",
"mime",
"mime_guess", "mime_guess",
"native-tls", "native-tls",
"once_cell",
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",
"quinn", "quinn",
@@ -2896,7 +2888,7 @@ checksum = "1e147371c75553e1e2fcdb483944a8540b8438c31426279553b9a8182a9b7b65"
dependencies = [ dependencies = [
"bytecheck", "bytecheck",
"bytes", "bytes",
"hashbrown 0.15.3", "hashbrown 0.15.4",
"indexmap", "indexmap",
"munge", "munge",
"ptr_meta", "ptr_meta",
@@ -2915,7 +2907,7 @@ checksum = "246b40ac189af6c675d124b802e8ef6d5246c53e17367ce9501f8f66a81abb7a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -2950,16 +2942,16 @@ dependencies = [
"proc-macro2", "proc-macro2",
"proc-macro2-diagnostics", "proc-macro2-diagnostics",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
"syn_derive", "syn_derive",
"thiserror 2.0.12", "thiserror 2.0.12",
] ]
[[package]] [[package]]
name = "rustc-demangle" name = "rustc-demangle"
version = "0.1.24" version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
[[package]] [[package]]
name = "rustc-hash" name = "rustc-hash"
@@ -3146,7 +3138,7 @@ checksum = "7ce26a84e3d8d10853301cf6a75c58132b8f5d5e8fee65949ea8dd7758d6760b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3168,7 +3160,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3206,9 +3198,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_spanned" name = "serde_spanned"
version = "0.6.8" version = "0.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"
dependencies = [ dependencies = [
"serde", "serde",
] ]
@@ -3247,7 +3239,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3271,7 +3263,6 @@ dependencies = [
"inventory", "inventory",
"js-sys", "js-sys",
"multer", "multer",
"once_cell",
"pin-project-lite", "pin-project-lite",
"postcard", "postcard",
"reqwest", "reqwest",
@@ -3310,7 +3301,7 @@ dependencies = [
"convert_case 0.6.0", "convert_case 0.6.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
"xxhash-rust", "xxhash-rust",
] ]
@@ -3323,7 +3314,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustc_version", "rustc_version",
"syn 2.0.101", "syn 2.0.103",
"xxhash-rust", "xxhash-rust",
] ]
@@ -3332,7 +3323,7 @@ name = "server_fn_macro_default"
version = "0.8.2" version = "0.8.2"
dependencies = [ dependencies = [
"server_fn_macro 0.8.2", "server_fn_macro 0.8.2",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3399,7 +3390,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f62f06db0370222f7f498ef478fce9f8df5828848d1d3517e3331936d7074f55" checksum = "f62f06db0370222f7f498ef478fce9f8df5828848d1d3517e3331936d7074f55"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3422,9 +3413,9 @@ dependencies = [
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.15.0" version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
[[package]] [[package]]
name = "socket2" name = "socket2"
@@ -3469,9 +3460,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.101" version = "2.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -3487,7 +3478,7 @@ dependencies = [
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3507,7 +3498,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3541,7 +3532,6 @@ dependencies = [
"linear-map", "linear-map",
"next_tuple", "next_tuple",
"oco_ref", "oco_ref",
"once_cell",
"or_poisoned", "or_poisoned",
"parking_lot", "parking_lot",
"paste", "paste",
@@ -3633,7 +3623,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3644,7 +3634,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3736,7 +3726,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -3811,9 +3801,9 @@ dependencies = [
[[package]] [[package]]
name = "toml" name = "toml"
version = "0.8.22" version = "0.8.23"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
dependencies = [ dependencies = [
"serde", "serde",
"serde_spanned", "serde_spanned",
@@ -3823,18 +3813,18 @@ dependencies = [
[[package]] [[package]]
name = "toml_datetime" name = "toml_datetime"
version = "0.6.9" version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
dependencies = [ dependencies = [
"serde", "serde",
] ]
[[package]] [[package]]
name = "toml_edit" name = "toml_edit"
version = "0.22.26" version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"serde", "serde",
@@ -3846,9 +3836,9 @@ dependencies = [
[[package]] [[package]]
name = "toml_write" name = "toml_write"
version = "0.1.1" version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
[[package]] [[package]]
name = "tower" name = "tower"
@@ -3868,12 +3858,13 @@ dependencies = [
[[package]] [[package]]
name = "tower-http" name = "tower-http"
version = "0.6.4" version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fdb0c213ca27a9f57ab69ddb290fd80d970922355b83ae380b395d3986b8a2e" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"bytes", "bytes",
"futures-core",
"futures-util", "futures-util",
"http 1.3.1", "http 1.3.1",
"http-body", "http-body",
@@ -3919,20 +3910,20 @@ dependencies = [
[[package]] [[package]]
name = "tracing-attributes" name = "tracing-attributes"
version = "0.1.28" version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
name = "tracing-core" name = "tracing-core"
version = "0.1.33" version = "0.1.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
dependencies = [ dependencies = [
"once_cell", "once_cell",
] ]
@@ -3992,7 +3983,7 @@ checksum = "60d8d828da2a3d759d3519cdf29a5bac49c77d039ad36d0782edadbf9cd5415b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -4116,9 +4107,9 @@ dependencies = [
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.11.0+wasi-snapshot-preview1" version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]] [[package]]
name = "wasi" name = "wasi"
@@ -4151,7 +4142,7 @@ dependencies = [
"log", "log",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@@ -4186,7 +4177,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@@ -4221,7 +4212,7 @@ checksum = "17d5042cc5fa009658f9a7333ef24291b1291a25b6382dd68862a7f3b969f69b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -4359,9 +4350,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.7.10" version = "0.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -4413,7 +4404,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
"synstructure", "synstructure",
] ]
@@ -4434,7 +4425,7 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]
@@ -4454,7 +4445,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
"synstructure", "synstructure",
] ]
@@ -4494,7 +4485,7 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.101", "syn 2.0.103",
] ]
[[package]] [[package]]

View File

@@ -42,7 +42,7 @@ exclude = ["benchmarks", "examples", "projects"]
[workspace.package] [workspace.package]
version = "0.8.2" version = "0.8.2"
edition = "2021" edition = "2021"
rust-version = "1.76" rust-version = "1.80"
[workspace.dependencies] [workspace.dependencies]
# members # members
@@ -85,7 +85,6 @@ rstml = { default-features = false, version = "0.12.1" }
rustc_version = { default-features = false, version = "0.4.1" } rustc_version = { default-features = false, version = "0.4.1" }
guardian = { default-features = false, version = "1.3.0" } guardian = { default-features = false, version = "1.3.0" }
rustc-hash = { default-features = false, version = "2.1.1" } rustc-hash = { default-features = false, version = "2.1.1" }
once_cell = { default-features = false, version = "1.21.3" }
actix-web = { default-features = false, version = "4.11.0" } actix-web = { default-features = false, version = "4.11.0" }
tracing = { default-features = false, version = "0.1.41" } tracing = { default-features = false, version = "0.1.41" }
slotmap = { default-features = false, version = "1.0.7" } slotmap = { default-features = false, version = "1.0.7" }

View File

@@ -23,7 +23,6 @@ leptos = { path = "../../leptos" }
leptos_actix = { path = "../../integrations/actix", optional = true } leptos_actix = { path = "../../integrations/actix", optional = true }
leptos_router = { path = "../../router" } leptos_router = { path = "../../router" }
log = "0.4.22" log = "0.4.22"
once_cell = "1.19"
gloo-net = { version = "0.6.0" } gloo-net = { version = "0.6.0" }
wasm-bindgen = "0.2.93" wasm-bindgen = "0.2.93"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }

View File

@@ -38,7 +38,6 @@ strum = { version = "0.27.1", features = ["strum_macros", "derive"] }
notify = { version = "8.0", optional = true } notify = { version = "8.0", optional = true }
pin-project-lite = "0.2.14" pin-project-lite = "0.2.14"
dashmap = { version = "6.0", optional = true } dashmap = { version = "6.0", optional = true }
once_cell = { version = "1.19", optional = true }
async-broadcast = { version = "0.7.1", optional = true } async-broadcast = { version = "0.7.1", optional = true }
bytecheck = "0.8.0" bytecheck = "0.8.0"
rkyv = { version = "0.8.8" } rkyv = { version = "0.8.8" }
@@ -54,7 +53,6 @@ ssr = [
"dep:leptos_axum", "dep:leptos_axum",
"dep:notify", "dep:notify",
"dep:dashmap", "dep:dashmap",
"dep:once_cell",
"dep:async-broadcast", "dep:async-broadcast",
] ]

View File

@@ -424,7 +424,7 @@ pub fn FileUploadWithProgress() -> impl IntoView {
use async_broadcast::{broadcast, Receiver, Sender}; use async_broadcast::{broadcast, Receiver, Sender};
use dashmap::DashMap; use dashmap::DashMap;
use futures::Stream; use futures::Stream;
use once_cell::sync::Lazy; use std::sync::LazyLock;
struct File { struct File {
total: usize, total: usize,
@@ -432,7 +432,8 @@ pub fn FileUploadWithProgress() -> impl IntoView {
rx: Receiver<usize>, rx: Receiver<usize>,
} }
static FILES: Lazy<DashMap<String, File>> = Lazy::new(DashMap::new); static FILES: LazyLock<DashMap<String, File>> =
LazyLock::new(DashMap::new);
pub async fn add_chunk(filename: &str, len: usize) { pub async fn add_chunk(filename: &str, len: usize) {
println!("[{filename}]\tadding {len}"); println!("[{filename}]\tadding {len}");

View File

@@ -16,7 +16,6 @@ futures = { workspace = true, default-features = true }
serde = { features = ["derive"] , workspace = true, default-features = true } serde = { features = ["derive"] , workspace = true, default-features = true }
wasm-bindgen = { workspace = true, optional = true , default-features = true } wasm-bindgen = { workspace = true, optional = true , default-features = true }
js-sys = { optional = true , workspace = true, default-features = true } js-sys = { optional = true , workspace = true, default-features = true }
once_cell = { workspace = true, default-features = true }
pin-project-lite = { workspace = true, default-features = true } pin-project-lite = { workspace = true, default-features = true }
[features] [features]

View File

@@ -7,10 +7,12 @@ use super::{SerializedDataId, SharedContext};
use crate::{PinnedFuture, PinnedStream}; use crate::{PinnedFuture, PinnedStream};
use core::fmt::Debug; use core::fmt::Debug;
use js_sys::Array; use js_sys::Array;
use once_cell::sync::Lazy;
use std::{ use std::{
fmt::Display, fmt::Display,
sync::atomic::{AtomicBool, AtomicUsize, Ordering}, sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
LazyLock,
},
}; };
use throw_error::{Error, ErrorId}; use throw_error::{Error, ErrorId};
use wasm_bindgen::{prelude::wasm_bindgen, JsCast}; use wasm_bindgen::{prelude::wasm_bindgen, JsCast};
@@ -79,8 +81,8 @@ pub struct HydrateSharedContext {
id: AtomicUsize, id: AtomicUsize,
is_hydrating: AtomicBool, is_hydrating: AtomicBool,
during_hydration: AtomicBool, during_hydration: AtomicBool,
errors: Lazy<Vec<(SerializedDataId, ErrorId, Error)>>, errors: LazyLock<Vec<(SerializedDataId, ErrorId, Error)>>,
incomplete: Lazy<Vec<SerializedDataId>>, incomplete: LazyLock<Vec<SerializedDataId>>,
} }
impl HydrateSharedContext { impl HydrateSharedContext {
@@ -90,8 +92,8 @@ impl HydrateSharedContext {
id: AtomicUsize::new(0), id: AtomicUsize::new(0),
is_hydrating: AtomicBool::new(true), is_hydrating: AtomicBool::new(true),
during_hydration: AtomicBool::new(true), during_hydration: AtomicBool::new(true),
errors: Lazy::new(serialized_errors), errors: LazyLock::new(serialized_errors),
incomplete: Lazy::new(incomplete_chunks), incomplete: LazyLock::new(incomplete_chunks),
} }
} }
@@ -104,8 +106,8 @@ impl HydrateSharedContext {
id: AtomicUsize::new(0), id: AtomicUsize::new(0),
is_hydrating: AtomicBool::new(false), is_hydrating: AtomicBool::new(false),
during_hydration: AtomicBool::new(true), during_hydration: AtomicBool::new(true),
errors: Lazy::new(serialized_errors), errors: LazyLock::new(serialized_errors),
incomplete: Lazy::new(incomplete_chunks), incomplete: LazyLock::new(incomplete_chunks),
} }
} }
} }

View File

@@ -28,7 +28,6 @@ tracing = { optional = true , workspace = true, default-features = true }
tokio = { features = ["rt", "fs"] , workspace = true, default-features = true } tokio = { features = ["rt", "fs"] , workspace = true, default-features = true }
send_wrapper = { workspace = true, default-features = true } send_wrapper = { workspace = true, default-features = true }
dashmap = { workspace = true, default-features = true } dashmap = { workspace = true, default-features = true }
once_cell = { workspace = true, default-features = true }
[package.metadata.docs.rs] [package.metadata.docs.rs]
rustdoc-args = ["--generate-link-to-definition"] rustdoc-args = ["--generate-link-to-definition"]

View File

@@ -38,7 +38,6 @@ use leptos_router::{
static_routes::{RegenerationFn, ResolvedStaticPath}, static_routes::{RegenerationFn, ResolvedStaticPath},
ExpandOptionals, Method, PathSegment, RouteList, RouteListing, SsrMode, ExpandOptionals, Method, PathSegment, RouteList, RouteListing, SsrMode,
}; };
use once_cell::sync::Lazy;
use parking_lot::RwLock; use parking_lot::RwLock;
use send_wrapper::SendWrapper; use send_wrapper::SendWrapper;
use server_fn::{ use server_fn::{
@@ -51,7 +50,7 @@ use std::{
future::Future, future::Future,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
path::Path, path::Path,
sync::Arc, sync::{Arc, LazyLock},
}; };
/// This struct lets you define headers and override the status of the Response from an Element or a Server Function /// This struct lets you define headers and override the status of the Response from an Element or a Server Function
@@ -1210,8 +1209,8 @@ impl StaticRouteGenerator {
} }
} }
static STATIC_HEADERS: Lazy<DashMap<String, ResponseOptions>> = static STATIC_HEADERS: LazyLock<DashMap<String, ResponseOptions>> =
Lazy::new(DashMap::new); LazyLock::new(DashMap::new);
fn was_404(owner: &Owner) -> bool { fn was_404(owner: &Owner) -> bool {
let resp = owner.with(|| expect_context::<ResponseOptions>()); let resp = owner.with(|| expect_context::<ResponseOptions>());

View File

@@ -23,7 +23,6 @@ leptos_meta = { workspace = true, features = ["ssr", "nonce"] }
leptos_router = { workspace = true, features = ["ssr"] } leptos_router = { workspace = true, features = ["ssr"] }
leptos_integration_utils = { workspace = true } leptos_integration_utils = { workspace = true }
tachys = { workspace = true } tachys = { workspace = true }
once_cell = { workspace = true, default-features = true }
parking_lot = { workspace = true, default-features = true } parking_lot = { workspace = true, default-features = true }
tokio = { default-features = false , workspace = true } tokio = { default-features = false , workspace = true }
tower = { features = ["util"] , workspace = true, default-features = true } tower = { features = ["util"] , workspace = true, default-features = true }

View File

@@ -69,12 +69,12 @@ use leptos_router::{
static_routes::RegenerationFn, ExpandOptionals, PathSegment, RouteList, static_routes::RegenerationFn, ExpandOptionals, PathSegment, RouteList,
RouteListing, SsrMode, RouteListing, SsrMode,
}; };
#[cfg(feature = "default")]
use once_cell::sync::Lazy;
use parking_lot::RwLock; use parking_lot::RwLock;
use server_fn::{error::ServerFnErrorErr, redirect::REDIRECT_HEADER}; use server_fn::{error::ServerFnErrorErr, redirect::REDIRECT_HEADER};
#[cfg(feature = "default")] #[cfg(feature = "default")]
use std::path::Path; use std::path::Path;
#[cfg(feature = "default")]
use std::sync::LazyLock;
use std::{collections::HashSet, fmt::Debug, io, pin::Pin, sync::Arc}; use std::{collections::HashSet, fmt::Debug, io, pin::Pin, sync::Arc};
#[cfg(feature = "default")] #[cfg(feature = "default")]
use tower::util::ServiceExt; use tower::util::ServiceExt;
@@ -1522,8 +1522,8 @@ impl StaticRouteGenerator {
} }
#[cfg(feature = "default")] #[cfg(feature = "default")]
static STATIC_HEADERS: Lazy<DashMap<String, ResponseOptions>> = static STATIC_HEADERS: LazyLock<DashMap<String, ResponseOptions>> =
Lazy::new(DashMap::new); LazyLock::new(DashMap::new);
#[cfg(feature = "default")] #[cfg(feature = "default")]
fn was_404(owner: &Owner) -> bool { fn was_404(owner: &Owner) -> bool {

View File

@@ -10,7 +10,6 @@ edition.workspace = true
[dependencies] [dependencies]
leptos = { workspace = true } leptos = { workspace = true }
once_cell = { workspace = true, default-features = true }
or_poisoned = { workspace = true } or_poisoned = { workspace = true }
indexmap = { workspace = true, default-features = true } indexmap = { workspace = true, default-features = true }
send_wrapper = { workspace = true, default-features = true } send_wrapper = { workspace = true, default-features = true }

View File

@@ -63,13 +63,12 @@ use leptos::{
}, },
IntoView, IntoView,
}; };
use once_cell::sync::Lazy;
use send_wrapper::SendWrapper; use send_wrapper::SendWrapper;
use std::{ use std::{
fmt::Debug, fmt::Debug,
sync::{ sync::{
mpsc::{channel, Receiver, Sender}, mpsc::{channel, Receiver, Sender},
Arc, Arc, LazyLock,
}, },
}; };
use wasm_bindgen::JsCast; use wasm_bindgen::JsCast;
@@ -101,7 +100,7 @@ pub struct MetaContext {
/// Metadata associated with the `<title>` element. /// Metadata associated with the `<title>` element.
pub(crate) title: TitleContext, pub(crate) title: TitleContext,
/// The hydration cursor for the location in the `<head>` for arbitrary tags will be rendered. /// The hydration cursor for the location in the `<head>` for arbitrary tags will be rendered.
pub(crate) cursor: Arc<Lazy<SendWrapper<Cursor>>>, pub(crate) cursor: Arc<LazyLock<SendWrapper<Cursor>>>,
} }
impl MetaContext { impl MetaContext {
@@ -143,7 +142,7 @@ impl Default for MetaContext {
)) ))
}; };
let cursor = Arc::new(Lazy::new(build_cursor)); let cursor = Arc::new(LazyLock::new(build_cursor));
Self { Self {
title: Default::default(), title: Default::default(),
cursor, cursor,

View File

@@ -21,7 +21,6 @@ fake = "2.9"
tokio-tungstenite = "0.23.1" tokio-tungstenite = "0.23.1"
futures-util = "0.3.30" futures-util = "0.3.30"
uuid = { version = "1.10", features = ["serde"] } uuid = { version = "1.10", features = ["serde"] }
once_cell = "1.19"
futures = "0.3.30" futures = "0.3.30"
[[test]] [[test]]
@@ -33,6 +32,5 @@ harness = false # Allow Cucumber to print output instead of libtest
ssr = [] ssr = []
[dependencies] [dependencies]
once_cell = "1.19.0"
regex = "1.10.6" regex = "1.10.6"
serde.workspace = true serde.workspace = true

View File

@@ -18,14 +18,14 @@ use chromiumoxide::{
use cucumber::World; use cucumber::World;
use futures::channel::mpsc::Sender; use futures::channel::mpsc::Sender;
use futures_util::stream::StreamExt; use futures_util::stream::StreamExt;
use once_cell::sync::Lazy; use std::sync::LazyLock;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{collections::HashMap, sync::Arc, time::Duration}; use std::{collections::HashMap, sync::Arc, time::Duration};
use tokio::sync::RwLock; use tokio::sync::RwLock;
use tokio_tungstenite::connect_async; use tokio_tungstenite::connect_async;
use uuid::Uuid; use uuid::Uuid;
static EMAIL_ID_MAP: Lazy<RwLock<HashMap<String, String>>> = static EMAIL_ID_MAP: LazyLock<RwLock<HashMap<String, String>>> =
Lazy::new(|| RwLock::new(HashMap::new())); LazyLock::new(|| RwLock::new(HashMap::new()));
#[derive(Clone, Debug, PartialEq)] #[derive(Clone, Debug, PartialEq)]
pub struct RequestPair { pub struct RequestPair {
@@ -93,7 +93,7 @@ impl RequestPair {
async fn main() -> Result<()> { async fn main() -> Result<()> {
// create a thread and store a // create a thread and store a
// tokio-tungstenite client that connectsto http://127.0.0.1:1080/ws // tokio-tungstenite client that connectsto http://127.0.0.1:1080/ws
// and then stores the recieved messages in a once_cell::Lazy<RwLock<Vec<MailCrabMsg>>> // and then stores the recieved messages in a std::sync::LazyLock<RwLock<Vec<MailCrabMsg>>>
// or a custom struct that matches the body or has specific impls for verify codes, links etc. // or a custom struct that matches the body or has specific impls for verify codes, links etc.
let _ = tokio::spawn(async move { let _ = tokio::spawn(async move {
let (mut socket, _) = connect_async( let (mut socket, _) = connect_async(
@@ -152,7 +152,7 @@ async fn main() -> Result<()> {
tokio::task::spawn(async move { tokio::task::spawn(async move {
while let Some(event) = log_events.next().await { while let Some(event) = log_events.next().await {
if let Some(EventEntryAdded { entry }) = if let Some(EventEntryAdded { entry }) =
Arc::<EventEntryAdded>::into_inner(event) { Arc::<EventEntryAdded>::into_inner(event) {
console_logs.write().await.push(format!(" {entry:#?} ")); console_logs.write().await.push(format!(" {entry:#?} "));
} else { } else {
@@ -171,7 +171,7 @@ async fn main() -> Result<()> {
} else { } else {
tracing::error!("tried to into inner but none") tracing::error!("tried to into inner but none")
} }
} }
}); });
@@ -208,7 +208,7 @@ async fn main() -> Result<()> {
thing.cookies_before_request = cookies; thing.cookies_before_request = cookies;
} }
} }
CookieEnum::AfterResp(req_id) => { CookieEnum::AfterResp(req_id) => {
let cookies = page let cookies = page
@@ -293,8 +293,8 @@ async fn main() -> Result<()> {
} else { } else {
tracing::error!(" uhh err here") tracing::error!(" uhh err here")
} }
} }
}); });
// We don't need to join on our join handles, they will run detached and clean up whenever. // We don't need to join on our join handles, they will run detached and clean up whenever.

View File

@@ -22,7 +22,6 @@ url = { workspace = true, default-features = true }
js-sys = { workspace = true, default-features = true } js-sys = { workspace = true, default-features = true }
wasm-bindgen = { workspace = true , default-features = true } wasm-bindgen = { workspace = true , default-features = true }
tracing = { optional = true , workspace = true, default-features = true } tracing = { optional = true , workspace = true, default-features = true }
once_cell = { workspace = true, default-features = true }
send_wrapper = { workspace = true, default-features = true } send_wrapper = { workspace = true, default-features = true }
thiserror = { workspace = true , default-features = true } thiserror = { workspace = true , default-features = true }
percent-encoding = { optional = true , workspace = true, default-features = true } percent-encoding = { optional = true , workspace = true, default-features = true }

View File

@@ -29,7 +29,6 @@ thiserror = { workspace = true, default-features = true }
# registration system # registration system
inventory = { optional = true, workspace = true, default-features = true } inventory = { optional = true, workspace = true, default-features = true }
dashmap = { workspace = true, default-features = true } dashmap = { workspace = true, default-features = true }
once_cell = { workspace = true, default-features = true }
## servers ## servers
# actix # actix

View File

@@ -151,7 +151,6 @@ use error::{FromServerFnError, ServerFnErrorErr};
use futures::{pin_mut, SinkExt, Stream, StreamExt}; use futures::{pin_mut, SinkExt, Stream, StreamExt};
use http::Method; use http::Method;
use middleware::{BoxedService, Layer, Service}; use middleware::{BoxedService, Layer, Service};
use once_cell::sync::Lazy;
use redirect::call_redirect_hook; use redirect::call_redirect_hook;
use request::Req; use request::Req;
use response::{ClientRes, Res, TryRes}; use response::{ClientRes, Res, TryRes};
@@ -169,7 +168,7 @@ use std::{
marker::PhantomData, marker::PhantomData,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
pin::Pin, pin::Pin,
sync::Arc, sync::{Arc, LazyLock},
}; };
#[doc(hidden)] #[doc(hidden)]
pub use xxhash_rust; pub use xxhash_rust;
@@ -862,7 +861,7 @@ pub use inventory;
#[macro_export] #[macro_export]
macro_rules! initialize_server_fn_map { macro_rules! initialize_server_fn_map {
($req:ty, $res:ty) => { ($req:ty, $res:ty) => {
once_cell::sync::Lazy::new(|| { std::sync::LazyLock::new(|| {
$crate::inventory::iter::<ServerFnTraitObj<$req, $res>> $crate::inventory::iter::<ServerFnTraitObj<$req, $res>>
.into_iter() .into_iter()
.map(|obj| { .map(|obj| {
@@ -981,7 +980,7 @@ impl<Req, Res> Clone for ServerFnTraitObj<Req, Res> {
#[allow(unused)] // used by server integrations #[allow(unused)] // used by server integrations
type LazyServerFnMap<Req, Res> = type LazyServerFnMap<Req, Res> =
Lazy<DashMap<(String, Method), ServerFnTraitObj<Req, Res>>>; LazyLock<DashMap<(String, Method), ServerFnTraitObj<Req, Res>>>;
#[cfg(feature = "ssr")] #[cfg(feature = "ssr")]
impl<Req: 'static, Res: 'static> inventory::Collect impl<Req: 'static, Res: 'static> inventory::Collect

View File

@@ -5,14 +5,14 @@ use crate::{
}; };
use bytes::Bytes; use bytes::Bytes;
use futures::{Stream, StreamExt}; use futures::{Stream, StreamExt};
use once_cell::sync::Lazy;
use reqwest::{ use reqwest::{
header::{ACCEPT, CONTENT_TYPE}, header::{ACCEPT, CONTENT_TYPE},
Body, Body,
}; };
pub use reqwest::{multipart::Form, Client, Method, Request, Url}; pub use reqwest::{multipart::Form, Client, Method, Request, Url};
use std::sync::LazyLock;
pub(crate) static CLIENT: Lazy<Client> = Lazy::new(Client::new); pub(crate) static CLIENT: LazyLock<Client> = LazyLock::new(Client::new);
impl<E> ClientReq<E> for Request impl<E> ClientReq<E> for Request
where where

View File

@@ -21,7 +21,6 @@ reactive_stores = { workspace = true, optional = true }
slotmap = { optional = true, workspace = true, default-features = true } slotmap = { optional = true, workspace = true, default-features = true }
oco_ref = { workspace = true, optional = true } oco_ref = { workspace = true, optional = true }
async-trait = { workspace = true, default-features = true } async-trait = { workspace = true, default-features = true }
once_cell = { workspace = true, default-features = true }
paste = { workspace = true, default-features = true } paste = { workspace = true, default-features = true }
erased = { workspace = true, default-features = true } erased = { workspace = true, default-features = true }
wasm-bindgen = { workspace = true, default-features = true } wasm-bindgen = { workspace = true, default-features = true }

View File

@@ -9,9 +9,12 @@ use crate::{
view::{Mountable, ToTemplate}, view::{Mountable, ToTemplate},
}; };
use linear_map::LinearMap; use linear_map::LinearMap;
use once_cell::unsync::Lazy;
use rustc_hash::FxHashSet; use rustc_hash::FxHashSet;
use std::{any::TypeId, borrow::Cow, cell::RefCell}; use std::{
any::TypeId,
borrow::Cow,
cell::{LazyCell, RefCell},
};
use wasm_bindgen::{intern, prelude::Closure, JsCast, JsValue}; use wasm_bindgen::{intern, prelude::Closure, JsCast, JsValue};
use web_sys::{AddEventListenerOptions, Comment, HtmlTemplateElement}; use web_sys::{AddEventListenerOptions, Comment, HtmlTemplateElement};
@@ -57,7 +60,7 @@ impl Dom {
pub fn create_placeholder() -> Placeholder { pub fn create_placeholder() -> Placeholder {
thread_local! { thread_local! {
static COMMENT: Lazy<Comment> = Lazy::new(|| { static COMMENT: LazyCell<Comment> = LazyCell::new(|| {
document().create_comment("") document().create_comment("")
}); });
} }
@@ -451,8 +454,8 @@ impl Dom {
V: ToTemplate + 'static, V: ToTemplate + 'static,
{ {
thread_local! { thread_local! {
static TEMPLATE_ELEMENT: Lazy<HtmlTemplateElement> = static TEMPLATE_ELEMENT: LazyCell<HtmlTemplateElement> =
Lazy::new(|| document().create_element("template").unwrap().unchecked_into()); LazyCell::new(|| document().create_element("template").unwrap().unchecked_into());
static TEMPLATES: RefCell<LinearMap<TypeId, HtmlTemplateElement>> = Default::default(); static TEMPLATES: RefCell<LinearMap<TypeId, HtmlTemplateElement>> = Default::default();
} }