diff --git a/apps/documentation/src/routes/documentation/tutorial/dynamic-routes.mdx b/apps/documentation/src/routes/documentation/tutorial/dynamic-routes.mdx index 54161201..a217d964 100644 --- a/apps/documentation/src/routes/documentation/tutorial/dynamic-routes.mdx +++ b/apps/documentation/src/routes/documentation/tutorial/dynamic-routes.mdx @@ -32,7 +32,7 @@ Let’s first work on the server side file. Paste into the new `[pokemon].rs` fi ```rust // src/routes/pokemons/[pokemon].rs use serde::{Deserialize, Serialize}; -use tuono_lib::reqwest::Client; +use reqwest::Client; use tuono_lib::{Props, Request, Response}; const POKEMON_API: &str = "https://pokeapi.co/api/v2/pokemon"; diff --git a/apps/documentation/src/routes/documentation/tutorial/error-handling.mdx b/apps/documentation/src/routes/documentation/tutorial/error-handling.mdx index f9511748..ffcddb51 100644 --- a/apps/documentation/src/routes/documentation/tutorial/error-handling.mdx +++ b/apps/documentation/src/routes/documentation/tutorial/error-handling.mdx @@ -27,8 +27,8 @@ Let's see how it works! ```diff // src/routes/pokemons/[pokemon].rs use serde::{Deserialize, Serialize}; --- use tuono_lib::reqwest::Client; -++ use tuono_lib::reqwest::{Client, StatusCode}; +-- use reqwest::Client; +++ use reqwest::{Client, StatusCode}; use tuono_lib::{Props, Request, Response}; const POKEMON_API: &str = "https://pokeapi.co/api/v2/pokemon"; @@ -69,8 +69,8 @@ async fn get_pokemon(req: Request, fetch: Client) -> Response { ```diff // src/routes/index.rs use serde::{Deserialize, Serialize}; --- use tuono_lib::reqwest::Client; -++ use tuono_lib::reqwest::{Client, StatusCode}; +-- use reqwest::Client; +++ use reqwest::{Client, StatusCode}; use tuono_lib::{Props, Request, Response}; const ALL_POKEMON: &str = "https://pokeapi.co/api/v2/pokemon?limit=151"; diff --git a/crates/tuono/Cargo.toml b/crates/tuono/Cargo.toml index 94089e5b..1b4999af 100644 --- a/crates/tuono/Cargo.toml +++ b/crates/tuono/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tuono" -version = "0.13.0" +version = "0.13.1" edition = "2021" authors = ["V. Ageno "] description = "Superfast React fullstack framework" diff --git a/crates/tuono_lib/Cargo.toml b/crates/tuono_lib/Cargo.toml index 6dd545ce..74fc4ce9 100644 --- a/crates/tuono_lib/Cargo.toml +++ b/crates/tuono_lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tuono_lib" -version = "0.13.0" +version = "0.13.1" edition = "2021" authors = ["V. Ageno "] description = "Superfast React fullstack framework" @@ -31,7 +31,7 @@ either = "1.13.0" tower-http = {version = "0.6.0", features = ["fs"]} colored = "2.1.0" -tuono_lib_macros = {path = "../tuono_lib_macros", version = "0.13.0"} +tuono_lib_macros = {path = "../tuono_lib_macros", version = "0.13.1"} # Match the same version used by axum tokio-tungstenite = "0.24.0" futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] } diff --git a/crates/tuono_lib/src/lib.rs b/crates/tuono_lib/src/lib.rs index 1f8e19f0..d02b4ff9 100644 --- a/crates/tuono_lib/src/lib.rs +++ b/crates/tuono_lib/src/lib.rs @@ -19,5 +19,4 @@ pub use tuono_lib_macros::handler; // Re-exports pub use axum; -pub use reqwest; pub use tokio; diff --git a/crates/tuono_lib_macros/Cargo.toml b/crates/tuono_lib_macros/Cargo.toml index 13ba0027..94f3b1eb 100644 --- a/crates/tuono_lib_macros/Cargo.toml +++ b/crates/tuono_lib_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tuono_lib_macros" -version = "0.13.0" +version = "0.13.1" edition = "2021" description = "Superfast React fullstack framework" homepage = "https://tuono.dev" diff --git a/crates/tuono_lib_macros/src/handler.rs b/crates/tuono_lib_macros/src/handler.rs index ffc94997..f01b79e3 100644 --- a/crates/tuono_lib_macros/src/handler.rs +++ b/crates/tuono_lib_macros/src/handler.rs @@ -2,7 +2,7 @@ use proc_macro::TokenStream; use quote::quote; use syn::punctuated::Punctuated; use syn::token::Comma; -use syn::{parse2, parse_macro_input, parse_quote, FnArg, ItemFn, ItemUse, Pat, Stmt}; +use syn::{parse2, parse_macro_input, parse_quote, FnArg, ItemFn, Pat, Stmt}; fn create_struct_fn_arg() -> FnArg { parse2(quote! { @@ -11,10 +11,12 @@ fn create_struct_fn_arg() -> FnArg { .unwrap() } -fn import_main_application_state(argument_names: Punctuated) -> Option { +fn import_main_application_state(argument_names: Punctuated) -> Option { if !argument_names.is_empty() { - let use_item: ItemUse = parse_quote!(let ApplicationState { #argument_names } = state;); - return Some(use_item); + let local: Stmt = parse_quote!( + use crate::tuono_main_state::ApplicationState; + ); + return Some(local); } None @@ -22,10 +24,8 @@ fn import_main_application_state(argument_names: Punctuated) -> Opti fn crate_application_state_extractor(argument_names: Punctuated) -> Option { if !argument_names.is_empty() { - let local: Stmt = parse_quote!( - use crate::tuono_main_state::ApplicationState; - ); - return Some(local); + let use_item: Stmt = parse_quote!(let ApplicationState { #argument_names } = state;); + return Some(use_item); } None diff --git a/examples/tutorial/src/routes/index.rs b/examples/tutorial/src/routes/index.rs index ea28998f..deaa5699 100644 --- a/examples/tutorial/src/routes/index.rs +++ b/examples/tutorial/src/routes/index.rs @@ -1,6 +1,6 @@ // src/routes/index.rs +use reqwest::{Client, StatusCode}; use serde::{Deserialize, Serialize}; -use tuono_lib::reqwest::{Client, StatusCode}; use tuono_lib::{Props, Request, Response}; const ALL_POKEMON: &str = "https://pokeapi.co/api/v2/pokemon?limit=151"; diff --git a/examples/tutorial/src/routes/pokemons/[pokemon].rs b/examples/tutorial/src/routes/pokemons/[pokemon].rs index 3d514abd..8e1cd3aa 100644 --- a/examples/tutorial/src/routes/pokemons/[pokemon].rs +++ b/examples/tutorial/src/routes/pokemons/[pokemon].rs @@ -1,6 +1,6 @@ // src/routes/pokemons/[pokemon].rs +use reqwest::{Client, StatusCode}; use serde::{Deserialize, Serialize}; -use tuono_lib::reqwest::{Client, StatusCode}; use tuono_lib::{Props, Request, Response}; const POKEMON_API: &str = "https://pokeapi.co/api/v2/pokemon"; diff --git a/packages/fs-router-vite-plugin/package.json b/packages/fs-router-vite-plugin/package.json index 22d79387..4c9a1617 100644 --- a/packages/fs-router-vite-plugin/package.json +++ b/packages/fs-router-vite-plugin/package.json @@ -1,6 +1,6 @@ { "name": "tuono-fs-router-vite-plugin", - "version": "0.13.0", + "version": "0.13.1", "description": "Plugin for the tuono's file system router. Tuono is the react/rust fullstack framework", "homepage": "https://tuono.dev", "scripts": { diff --git a/packages/lazy-fn-vite-plugin/package.json b/packages/lazy-fn-vite-plugin/package.json index 887d864c..6c624a71 100644 --- a/packages/lazy-fn-vite-plugin/package.json +++ b/packages/lazy-fn-vite-plugin/package.json @@ -1,6 +1,6 @@ { "name": "tuono-lazy-fn-vite-plugin", - "version": "0.13.0", + "version": "0.13.1", "description": "Plugin for the tuono's lazy fn. Tuono is the react/rust fullstack framework", "homepage": "https://tuono.dev", "scripts": { diff --git a/packages/router/package.json b/packages/router/package.json index c6ee2e08..83b93f3d 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "tuono-router", - "version": "0.13.0", + "version": "0.13.1", "description": "React routing component for the framework tuono. Tuono is the react/rust fullstack framework", "homepage": "https://tuono.dev", "scripts": { diff --git a/packages/tuono/package.json b/packages/tuono/package.json index d02568bc..bce7d964 100644 --- a/packages/tuono/package.json +++ b/packages/tuono/package.json @@ -1,6 +1,6 @@ { "name": "tuono", - "version": "0.13.0", + "version": "0.13.1", "description": "Superfast React fullstack framework", "homepage": "https://tuono.dev", "scripts": {