Simplify cli-config, hotreload -> devtools (drop to 0 deps, fast compile times) (#2975)
* simplify cli-config crate * clean up configs * add devtools crate, update cargo imports * fix serve addr, fix websocket proxy issue * add comment about opt profiles * rename hot-reload to devtools
This commit is contained in:
1 parent
8203ee571f
commit
3fb1f739d1
58 files changed
+1131
-1654
No files matched your search
@@ -6,11 +6,15 @@ edition = "2018"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
cached = "0.44.0"
|
||||
dioxus = { workspace = true, features = ["fullstack", "router"] }
|
||||
reqwest = { version = "0.11.16", features = ["json"] }
|
||||
serde = "1.0.160"
|
||||
chrono = { version = "0.4.24", features = ["serde"] }
|
||||
reqwest = { workspace = true, features = ["json"] }
|
||||
serde = { workspace = true }
|
||||
|
||||
[target.'cfg(target_family = "wasm")'.dependencies]
|
||||
chrono = { workspace = true, features = ["serde", "wasmbind"] }
|
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dependencies]
|
||||
chrono = { workspace = true, features = ["serde"] }
|
||||
|
||||
[features]
|
||||
web = ["dioxus/web"]
|
||||
|
||||
@@ -55,7 +55,6 @@ impl Display for Sort {
|
||||
}
|
||||
|
||||
// Cache up to 100 requests, invalidating them after 60 seconds
|
||||
#[cached::proc_macro::cached(size = 100, time = 60, result = true)]
|
||||
pub(crate) async fn fetch_user_carts(user_id: usize) -> Result<Vec<Cart>, reqwest::Error> {
|
||||
reqwest::get(format!(
|
||||
"https://fakestoreapi.com/carts/user/{user_id}?startdate=2019-12-10&enddate=2023-01-01"
|
||||
@@ -66,7 +65,6 @@ pub(crate) async fn fetch_user_carts(user_id: usize) -> Result<Vec<Cart>, reqwes
|
||||
}
|
||||
|
||||
// Cache up to 100 requests, invalidating them after 60 seconds
|
||||
#[cached::proc_macro::cached(size = 100, time = 60, result = true)]
|
||||
pub(crate) async fn fetch_user(user_id: usize) -> dioxus::Result<Product> {
|
||||
Ok(
|
||||
reqwest::get(format!("https://fakestoreapi.com/users/{user_id}"))
|
||||
@@ -77,7 +75,6 @@ pub(crate) async fn fetch_user(user_id: usize) -> dioxus::Result<Product> {
|
||||
}
|
||||
|
||||
// Cache up to 100 requests, invalidating them after 60 seconds
|
||||
#[cached::proc_macro::cached(size = 100, time = 60, result = true)]
|
||||
pub(crate) async fn fetch_product(product_id: usize) -> dioxus::Result<Product> {
|
||||
Ok(
|
||||
reqwest::get(format!("https://fakestoreapi.com/products/{product_id}"))
|
||||
@@ -88,7 +85,6 @@ pub(crate) async fn fetch_product(product_id: usize) -> dioxus::Result<Product>
|
||||
}
|
||||
|
||||
// Cache up to 100 requests, invalidating them after 60 seconds
|
||||
#[cached::proc_macro::cached(size = 100, time = 60, result = true)]
|
||||
pub(crate) async fn fetch_products(count: usize, sort: Sort) -> dioxus::Result<Vec<Product>> {
|
||||
Ok(reqwest::get(format!(
|
||||
"https://fakestoreapi.com/products/?sort={sort}&limit={count}"
|
||||
|
||||
Reference in new issue
Block a user