Add a prelude module to Dioxus Native (#5104)
* Add prelude to dioxus-native crate Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix unreachable_patterns lint --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
1 parent
db23197925
commit
31bee1417c
7 files changed
+71
-17
No files matched your search
+32
-10
@@ -11,21 +11,30 @@ keywords = ["dom", "ui", "gui", "react"]
|
||||
|
||||
[features]
|
||||
default = ["accessibility", "hot-reload", "net", "html", "svg", "system-fonts", "clipboard", "file_dialog"]
|
||||
clipboard = ["blitz-shell/clipboard"]
|
||||
file_dialog = ["blitz-shell/file_dialog"]
|
||||
prelude = ["dep:dioxus-core-macro", "dep:dioxus-hooks", "dep:dioxus-signals", "dep:dioxus-stores", "dep:manganis"]
|
||||
|
||||
# DOM features
|
||||
svg = ["blitz-dom/svg", "blitz-paint/svg"]
|
||||
incremental = ["blitz-dom/incremental"]
|
||||
autofocus = ["blitz-dom/autofocus"]
|
||||
system-fonts = ["blitz-dom/system_fonts"]
|
||||
|
||||
# Shell Features
|
||||
clipboard = ["blitz-shell/clipboard"]
|
||||
file_dialog = ["file-dialog"] # Backwards compat. Remove in next breaking version
|
||||
file-dialog = ["blitz-shell/file_dialog"]
|
||||
accessibility = ["blitz-shell/accessibility", "blitz-dom/accessibility"]
|
||||
|
||||
# Other features
|
||||
net = ["dep:tokio", "dep:blitz-net"]
|
||||
html = ["dep:blitz-html"]
|
||||
accessibility = ["blitz-shell/accessibility", "blitz-dom/accessibility"]
|
||||
tracing = ["dep:tracing", "dioxus-native-dom/tracing", "blitz-shell/tracing", "blitz-dom/tracing"]
|
||||
|
||||
# Dev / Debug
|
||||
hot-reload = ["dep:dioxus-cli-config", "dep:dioxus-devtools"]
|
||||
system-fonts = ["blitz-dom/system_fonts"]
|
||||
autofocus = []
|
||||
tracing = ["dep:tracing", "dioxus-native-dom/tracing", "blitz-shell/tracing", "blitz-dom/tracing"]
|
||||
|
||||
[dependencies]
|
||||
# Blitz dependencies
|
||||
anyrender = { workspace = true }
|
||||
anyrender_vello = { workspace = true }
|
||||
blitz-dom = { workspace = true }
|
||||
blitz-html = { workspace = true, optional = true }
|
||||
blitz-net = { workspace = true, optional = true }
|
||||
@@ -33,16 +42,29 @@ blitz-paint = { workspace = true, optional = true }
|
||||
blitz-traits = { workspace = true }
|
||||
blitz-shell = { workspace = true }
|
||||
|
||||
# AnyRender dependencies
|
||||
anyrender = { workspace = true }
|
||||
anyrender_vello = { workspace = true }
|
||||
|
||||
# DioxusLabs dependencies
|
||||
dioxus-core = { workspace = true }
|
||||
dioxus-html = { workspace = true }
|
||||
dioxus-native-dom = { workspace = true }
|
||||
dioxus-asset-resolver = { workspace = true, features = ["native"] }
|
||||
dioxus-cli-config = { workspace = true, optional = true }
|
||||
dioxus-devtools = { workspace = true, optional = true }
|
||||
dioxus-history = { workspace = true }
|
||||
dioxus-document = { workspace = true }
|
||||
|
||||
# Dioxus hot reload
|
||||
dioxus-cli-config = { workspace = true, optional = true }
|
||||
dioxus-devtools = { workspace = true, optional = true }
|
||||
|
||||
# Dioxus prelude
|
||||
dioxus-hooks = { workspace = true, optional = true }
|
||||
dioxus-signals = { workspace = true, optional = true }
|
||||
dioxus-stores = { workspace = true, optional = true }
|
||||
dioxus-core-macro = { workspace = true, optional = true }
|
||||
manganis = { workspace = true, features = ["dioxus"], optional = true }
|
||||
|
||||
# Windowing & Input
|
||||
winit = { workspace = true }
|
||||
keyboard-types = { workspace = true }
|
||||
|
||||
@@ -111,6 +111,7 @@ impl DioxusNativeApplication {
|
||||
not(target_os = "android"),
|
||||
not(target_os = "ios")
|
||||
)))]
|
||||
#[allow(unreachable_patterns)]
|
||||
_ => {
|
||||
let _ = event_loop;
|
||||
let _ = event;
|
||||
|
||||
@@ -15,6 +15,9 @@ mod dioxus_application;
|
||||
mod dioxus_renderer;
|
||||
mod link_handler;
|
||||
|
||||
#[cfg(feature = "prelude")]
|
||||
pub mod prelude;
|
||||
|
||||
#[doc(inline)]
|
||||
pub use dioxus_native_dom::*;
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// RSX and component definition
|
||||
pub use dioxus_core;
|
||||
pub use dioxus_core::{
|
||||
consume_context, provide_context, spawn, suspend, try_consume_context, use_drop, use_hook,
|
||||
AnyhowContext, Attribute, Callback, Component, Element, ErrorBoundary, ErrorContext, Event,
|
||||
EventHandler, Fragment, HasAttributes, IntoDynNode, RenderError, ScopeId, SuspenseBoundary,
|
||||
SuspenseContext, VNode, VirtualDom,
|
||||
};
|
||||
#[allow(deprecated)]
|
||||
pub use dioxus_core_macro::{component, rsx, Props};
|
||||
pub use dioxus_html as dioxus_elements;
|
||||
pub use dioxus_html::{
|
||||
events::*, extensions::*, global_attributes, keyboard_types, svg_attributes, traits::*,
|
||||
GlobalAttributesExtension, SvgAttributesExtension,
|
||||
};
|
||||
pub use dioxus_html::{Code, Key, Location, Modifiers};
|
||||
|
||||
// Assets
|
||||
pub use manganis::{self, *};
|
||||
|
||||
// Hooks, signals, stores
|
||||
pub use dioxus_hooks::*;
|
||||
pub use dioxus_signals::{self, *};
|
||||
pub use dioxus_stores::{self, store, use_store, GlobalStore, ReadStore, Store, WriteStore};
|
||||
|
||||
// Document and History
|
||||
pub use dioxus_document::{self as document, Meta, Stylesheet, Title};
|
||||
pub use dioxus_history::{history, History};
|
||||
Reference in new issue
Block a user