Skip to content

Commit

Permalink
integrate leptos_query and leptos_query_devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburniske committed Feb 20, 2024
1 parent b2e6d55 commit 4af32fb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions example/leptos-query-axum-workspace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ leptos_meta = { version = "0.6", features = ["nightly"] }
leptos_router = { version = "0.6", features = ["nightly"] }
leptos_axum = { version = "0.6" }

leptos_query = { path = "../../query" }
leptos_query_devtools = { path = "../../devtools" }

axum = "0.7"
cfg-if = "1"
console_error_panic_hook = "0.1.7"
Expand Down
6 changes: 4 additions & 2 deletions example/leptos-query-axum-workspace/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ leptos.workspace = true
leptos_meta.workspace = true
leptos_router.workspace = true
leptos_axum = { workspace = true, optional = true }
leptos_query = { workspace = true }
leptos_query_devtools = { workspace = true }

http.workspace = true
cfg-if.workspace = true
thiserror.workspace = true

[features]
default = []
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
ssr = ["leptos/ssr", "leptos_meta/ssr", "leptos_router/ssr", "dep:leptos_axum"]
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate", "leptos_query/hydrate", "leptos_query_devtools/csr"]
ssr = ["leptos/ssr", "leptos_meta/ssr", "leptos_router/ssr", "dep:leptos_axum", "leptos_query/ssr"]

5 changes: 5 additions & 0 deletions example/leptos-query-axum-workspace/app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use crate::error_template::{AppError, ErrorTemplate};

use leptos::*;
use leptos_meta::*;
use leptos_query::provide_query_client;
use leptos_query_devtools::LeptosQueryDevtools;
use leptos_router::*;

pub mod error_template;
Expand All @@ -10,13 +12,16 @@ pub mod error_template;
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
provide_query_client();

view! {
<Stylesheet id="leptos" href="/pkg/start-axum-workspace.css"/>

// sets the document title
<Title text="Welcome to Leptos"/>

<LeptosQueryDevtools/>

// content for this welcome page
<Router fallback=|| {
let mut outside_errors = Errors::default();
Expand Down
2 changes: 2 additions & 0 deletions example/leptos-query-axum-workspace/frontend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
app = { path = "../app", default-features = false, features = ["hydrate"] }
leptos = { workspace = true, features = [ "hydrate" ] }
leptos_query = { workspace = true, features = [ "hydrate" ] }
leptos_query_devtools = { workspace = true, features = [ "csr" ] }

console_error_panic_hook.workspace = true
console_log.workspace = true
Expand Down
1 change: 1 addition & 0 deletions example/leptos-query-axum-workspace/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ edition = "2021"
app = { path = "../app", default-features = false, features = ["ssr"] }
leptos = { workspace = true, features = [ "ssr" ]}
leptos_axum.workspace = true
leptos_query = { workspace = true, features = [ "ssr" ]}

axum.workspace = true
simple_logger.workspace = true
Expand Down

0 comments on commit 4af32fb

Please sign in to comment.