clean up prelude (#4416)

* clear away prelude on dioxus

* clippy

* wip - drop prelude from dioxus-html

* docs clippy

* wip

* more fixe

* delete all preludes

* doc...

* better export

* merge some imports

* fewer global imports

* global incremental renderer

* fix cargo doc
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-07-16 16:04:13 -07:00
1 parent 54d465a7b5
commit 4f1d039bad
140 files changed
+374 -477

No files matched your search

@@ -1,4 +1,4 @@
use dioxus_core::{prelude::suspense_context, use_hook};
use dioxus_core::{suspense_context, use_hook};
/// Run a closure after the suspense boundary this is under is resolved. The
/// closure will be run immediately if the suspense boundary is already resolved
+1 -2
View File
@@ -1,5 +1,4 @@
use dioxus_core::prelude::use_hook;
use dioxus_core::prelude::Callback;
use dioxus_core::{use_hook, Callback};
/// Create a callback that's always up to date. Whenever this hook is called the inner callback will be replaced with the new callback but the handle will remain.
///
+1 -4
View File
@@ -1,7 +1,4 @@
use dioxus_core::{
prelude::{consume_context, provide_context, try_consume_context},
use_hook,
};
use dioxus_core::{consume_context, provide_context, try_consume_context, use_hook};
/// Consume some context in the tree, providing a sharable handle to the value
///
+1 -1
View File
@@ -1,6 +1,6 @@
use crate::{use_context_provider, use_future, UseFuture};
use dioxus_core::prelude::{consume_context, use_hook};
use dioxus_core::Task;
use dioxus_core::{consume_context, use_hook};
use dioxus_signals::*;
pub use futures_channel::mpsc::{UnboundedReceiver, UnboundedSender};
use std::future::Future;
+1 -1
View File
@@ -1,6 +1,6 @@
use std::{cell::Cell, rc::Rc};
use dioxus_core::prelude::*;
use dioxus_core::*;
use futures_util::StreamExt;
use crate::use_callback;
+3 -3
View File
@@ -1,6 +1,6 @@
#![allow(missing_docs)]
use crate::{use_callback, use_hook_did_run, use_signal};
use dioxus_core::prelude::*;
use dioxus_core::{use_hook, Callback, Task};
use dioxus_signals::*;
use std::future::Future;
use std::ops::Deref;
@@ -8,7 +8,7 @@ use std::ops::Deref;
/// A hook that allows you to spawn a future the first time you render a component.
///
///
/// This future will **not** run on the server. To run a future on the server, you should use [`spawn_isomorphic`] directly.
/// This future will **not** run on the server. To run a future on the server, you should use [`dioxus_core::spawn_isomorphic`] directly.
///
///
/// `use_future` **won't return a value**. If you want to return a value from a future, use [`crate::use_resource()`] instead.
@@ -50,7 +50,7 @@ where
let callback = use_callback(move |_| {
let fut = future();
spawn(async move {
dioxus_core::spawn(async move {
state.set(UseFutureState::Pending);
fut.await;
state.set(UseFutureState::Ready);
+1 -1
View File
@@ -1,4 +1,4 @@
use dioxus_core::prelude::*;
use dioxus_core::{use_after_render, use_before_render, use_hook};
use dioxus_signals::{CopyValue, Writable};
/// A hook that uses before/after lifecycle hooks to determine if the hook was run
+1 -1
View File
@@ -1,5 +1,5 @@
use crate::use_callback;
use dioxus_core::prelude::*;
use dioxus_core::use_hook;
use dioxus_signals::Memo;
#[doc = include_str!("../docs/derived_state.md")]
+1 -1
View File
@@ -1,4 +1,4 @@
use dioxus_core::prelude::use_drop;
use dioxus_core::use_drop;
#[deprecated(note = "Use `use_drop` instead, which has the same functionality.")]
pub fn use_on_unmount<D: FnOnce() + 'static>(destroy: D) {
+5 -1
View File
@@ -1,7 +1,11 @@
#![allow(missing_docs)]
use crate::{use_callback, use_signal};
use dioxus_core::prelude::*;
use dioxus_core::{
spawn, use_hook, Callback, IntoAttributeValue, IntoDynNode, ReactiveContext, RenderError,
SuspendedFuture, Task,
};
use dioxus_signals::*;
use futures_util::{future, pin_mut, FutureExt, StreamExt};
use std::ops::Deref;
+1 -1
View File
@@ -1,4 +1,4 @@
use dioxus_core::{prelude::provide_root_context, prelude::try_consume_context, use_hook};
use dioxus_core::{provide_root_context, try_consume_context, use_hook};
/// Try to get a value from the root of the virtual dom, if it doesn't exist, create a new one with the closure provided.
///
+2 -3
View File
@@ -1,7 +1,6 @@
use std::hash::Hash;
use dioxus_core::prelude::*;
use dioxus_core::use_hook;
use dioxus_signals::{ReadOnlySignal, SetCompare};
use std::hash::Hash;
/// Creates a new SetCompare which efficiently tracks when a value changes to check if it is equal to a set of values.
///
+1 -1
View File
@@ -1,4 +1,4 @@
use dioxus_core::prelude::*;
use dioxus_core::use_hook;
use dioxus_signals::{Signal, SignalData, Storage, SyncStorage, UnsyncStorage};
/// Creates a new Signal. Signals are a Copy state management solution with automatic dependency tracking.