Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix leptos_dom reexports (closes #3166) #3168

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/axum_js_ssr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async fn main() {
};
use axum_js_ssr::app::*;
use http_body_util::BodyExt;
use leptos::logging::log;
use leptos::prelude::*;
use leptos_axum::{generate_route_list, LeptosRoutes};

Expand Down
2 changes: 1 addition & 1 deletion examples/portal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once();
let handle = mount_to(
helpers::document()
document()
.get_element_by_id("app")
.unwrap()
.unchecked_into(),
Expand Down
1 change: 1 addition & 0 deletions examples/ssr_modes_axum/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#[tokio::main]
async fn main() {
use axum::Router;
use leptos::logging::log;
use leptos::prelude::*;
use leptos_axum::{generate_route_list, LeptosRoutes};
use ssr_modes_axum::app::*;
Expand Down
1 change: 1 addition & 0 deletions examples/static_routing/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#[tokio::main]
async fn main() {
use axum::Router;
use leptos::logging::log;
use leptos::prelude::*;
use leptos_axum::{generate_route_list_with_ssg, LeptosRoutes};
use static_routing::app::*;
Expand Down
1 change: 1 addition & 0 deletions examples/stores/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::sync::atomic::{AtomicUsize, Ordering};

use chrono::{Local, NaiveDate};
use leptos::logging::warn;
use leptos::prelude::*;
use reactive_stores::{Field, Patch, Store};
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion leptos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub mod prelude {
form::*, hydration::*, into_view::*, mount::*, suspense::*,
};
pub use leptos_config::*;
pub use leptos_dom::{helpers::*, *};
pub use leptos_dom::helpers::*;
pub use leptos_macro::*;
pub use leptos_server::*;
pub use oco_ref::*;
Expand Down
1 change: 0 additions & 1 deletion leptos_dom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ pub mod helpers;
pub mod macro_helpers;

/// Utilities for simple isomorphic logging to the console or terminal.
#[macro_use]
pub mod logging;
2 changes: 1 addition & 1 deletion router/src/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
location::{BrowserUrl, LocationProvider},
NavigateOptions,
};
use leptos::{ev, html::form, prelude::*, task::spawn_local};
use leptos::{ev, html::form, logging::*, prelude::*, task::spawn_local};
use std::{error::Error, sync::Arc};
use wasm_bindgen::{JsCast, UnwrapThrowExt};
use web_sys::{FormData, RequestRedirect, Response};
Expand Down
4 changes: 2 additions & 2 deletions router/src/location/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,15 @@ impl LocationProvider for BrowserUrl {
let Some(url) = resolve_redirect_url(loc) else {
return; // resolve_redirect_url() already logs an error
};
let current_origin = helpers::location().origin().unwrap();
let current_origin = location().origin().unwrap();
if url.origin() == current_origin {
let navigate = navigate.clone();
// delay by a tick here, so that the Action updates *before* the redirect
request_animation_frame(move || {
navigate(&url.href(), Default::default());
});
// Use set_href() if the conditions for client-side navigation were not satisfied
} else if let Err(e) = helpers::location().set_href(&url.href()) {
} else if let Err(e) = location().set_href(&url.href()) {
leptos::logging::error!("Failed to redirect: {e:#?}");
}
}
Expand Down