repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/hooks/use_navigator.rs
packages/router/src/hooks/use_navigator.rs
use dioxus_core::{try_consume_context, use_hook}; use crate::{Navigator, RouterContext}; /// A hook that provides access to the navigator to change the router history. /// /// > The Routable macro will define a version of this hook with an explicit type. /// /// ```rust /// # use dioxus::prelude::*; /// #[derive(Clon...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/components/link.rs
packages/router/src/components/link.rs
#![allow(clippy::type_complexity)] use std::fmt::Debug; use dioxus_core::{Attribute, Element, EventHandler, VNode}; use dioxus_core_macro::{rsx, Props}; use dioxus_html::{ self as dioxus_elements, ModifiersInteraction, MountedEvent, MouseEvent, PointerInteraction, }; use tracing::error; use crate::navigation::N...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/components/router.rs
packages/router/src/components/router.rs
use crate::{provide_router_context, routable::Routable, router_cfg::RouterConfig, Outlet}; use dioxus_core::{provide_context, use_hook, Callback, Element}; use dioxus_core_macro::{rsx, Props}; /// The props for [`Router`]. #[derive(Props)] pub struct RouterProps<R: Clone + 'static> { #[props(default, into)] co...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/components/default_errors.rs
packages/router/src/components/default_errors.rs
use dioxus_core::Element; use dioxus_core_macro::rsx; use dioxus_html as dioxus_elements; #[allow(deprecated)] use crate::hooks::use_router; /// The default component to render when an external navigation fails. #[allow(non_snake_case)] pub fn FailureExternalNavigation() -> Element { #[allow(deprecated)] let ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/components/child_router.rs
packages/router/src/components/child_router.rs
/// Components that allow the macro to add child routers. This component provides a context /// to the child router that maps child routes to root routes and vice versa. use crate::{Outlet, OutletContext, Routable}; use dioxus_core::{provide_context, try_consume_context, use_hook, Element}; use dioxus_core_macro::{comp...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/components/outlet.rs
packages/router/src/components/outlet.rs
use crate::{outlet::OutletContext, *}; use dioxus_core::Element; /// An outlet for the current content. /// /// Only works as descendant of a [`Link`] component, otherwise it will be inactive. /// /// The [`Outlet`] is aware of how many [`Outlet`]s it is nested within. It will render the content /// of the active rout...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/components/history_buttons.rs
packages/router/src/components/history_buttons.rs
use dioxus_core::{Element, VNode}; use dioxus_core_macro::{rsx, Props}; use dioxus_html as dioxus_elements; use tracing::error; use crate::utils::use_router_internal::use_router_internal; /// The properties for a [`GoBackButton`] or a [`GoForwardButton`]. #[derive(Debug, Props, Clone, PartialEq)] pub struct HistoryB...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/components/history_provider.rs
packages/router/src/components/history_provider.rs
use dioxus_core::{use_hook, Callback, Element}; use dioxus_core_macro::{component, Props}; use dioxus_history::{provide_history_context, History}; use std::rc::Rc; /// A component that provides a [`History`] for all child [`Router`] components. Renderers generally provide a default history automatically. #[component]...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/utils/use_router_internal.rs
packages/router/src/utils/use_router_internal.rs
use crate::RouterContext; use dioxus_core::{try_consume_context, use_hook}; /// A private hook to subscribe to the router. /// /// Used to reduce redundancy within other components/hooks. Safe to call multiple times for a /// single component, but not recommended. Multiple subscriptions will be discarded. /// /// # Re...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/contexts/router.rs
packages/router/src/contexts/router.rs
use std::{ collections::HashSet, error::Error, fmt::Display, sync::{Arc, Mutex}, }; use dioxus_core::{provide_context, Element, ReactiveContext, ScopeId}; use dioxus_history::history; use dioxus_signals::{CopyValue, ReadableExt, Signal, WritableExt}; use crate::{ components::child_router::consume_...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/contexts/navigator.rs
packages/router/src/contexts/navigator.rs
use crate::{ExternalNavigationFailure, NavigationTarget, RouterContext}; /// Acquire the navigator without subscribing to updates. /// /// Can be called anywhere in the application provided a Router has been initialized. /// /// ## Panics /// /// Panics if there is no router present. pub fn navigator() -> Navigator { ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/src/contexts/outlet.rs
packages/router/src/contexts/outlet.rs
use dioxus_core::{provide_context, try_consume_context, use_hook, Element, VNode}; use crate::{routable::Routable, utils::use_router_internal::use_router_internal}; /// A context that manages nested routing levels for outlet components. /// /// The outlet context keeps track of the current nesting level of routes and...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/parsing.rs
packages/router/tests/parsing.rs
use dioxus::prelude::*; use std::{ fmt::{self, Display}, str::FromStr, }; #[component] fn Root() -> Element { unimplemented!() } #[component] fn Test() -> Element { unimplemented!() } #[component] fn Dynamic(id: usize) -> Element { unimplemented!() } // Make sure trailing '/'s work correctly #[t...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/parent.rs
packages/router/tests/parent.rs
#![allow(unused)] use std::rc::Rc; use dioxus::prelude::*; #[derive(Routable, Clone, PartialEq, Debug)] #[rustfmt::skip] enum Route { #[route("/")] RootIndex {}, #[nest("/fixed")] #[layout(Fixed)] #[route("/")] FixedIndex {}, #[route("/fixed")] Fixe...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/site_map.rs
packages/router/tests/site_map.rs
use dioxus::prelude::*; #[test] fn with_class() { #[derive(Routable, Clone, PartialEq, Debug)] enum ChildRoute { #[route("/")] ChildRoot {}, #[route("/:not_static")] NotStatic { not_static: String }, } #[derive(Routable, Clone, PartialEq, Debug)] enum Route { ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/via_ssr/link.rs
packages/router/tests/via_ssr/link.rs
use dioxus::prelude::*; use dioxus_history::{History, MemoryHistory}; use dioxus_router::components::HistoryProvider; use std::rc::Rc; fn prepare<R: Routable>() -> String { prepare_at::<R>("/") } fn prepare_at<R: Routable>(at: impl ToString) -> String { prepare_at_with_base_path::<R>(at, "") } fn prepare_at_...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/via_ssr/child_outlet.rs
packages/router/tests/via_ssr/child_outlet.rs
#![allow(unused)] use std::rc::Rc; use dioxus::prelude::*; use dioxus_history::{History, MemoryHistory}; use dioxus_router::components::HistoryProvider; fn prepare(path: impl Into<String>) -> VirtualDom { let mut vdom = VirtualDom::new_with_props( App, AppProps { path: path.into().par...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/via_ssr/redirect.rs
packages/router/tests/via_ssr/redirect.rs
use dioxus::prelude::*; use dioxus_history::{History, MemoryHistory}; use dioxus_router::components::HistoryProvider; use std::{rc::Rc, str::FromStr}; // Tests for regressions of <https://github.com/DioxusLabs/dioxus/issues/2549> #[test] fn redirects_apply_in_order() { let path = Route::from_str("/").unwrap(); ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/via_ssr/navigation.rs
packages/router/tests/via_ssr/navigation.rs
use dioxus::prelude::*; use dioxus_core::NoOpMutations; use std::sync::atomic::AtomicUsize; // Regression test for <https://github.com/DioxusLabs/dioxus/issues/3235> #[test] fn layout_retains_state_after_navigation() { let mut vdom = VirtualDom::new(app); vdom.rebuild_in_place(); vdom.render_immediate(&mu...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/via_ssr/outlet.rs
packages/router/tests/via_ssr/outlet.rs
#![allow(unused)] use std::rc::Rc; use dioxus::prelude::*; use dioxus_history::{History, MemoryHistory}; use dioxus_router::components::HistoryProvider; fn prepare(path: impl Into<String>) -> VirtualDom { let mut vdom = VirtualDom::new_with_props( App, AppProps { path: path.into().par...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/via_ssr/main.rs
packages/router/tests/via_ssr/main.rs
mod child_outlet; mod link; mod navigation; mod outlet; mod redirect; mod without_index;
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/router/tests/via_ssr/without_index.rs
packages/router/tests/via_ssr/without_index.rs
use std::rc::Rc; use dioxus::prelude::*; use dioxus_history::{History, MemoryHistory}; use dioxus_router::components::HistoryProvider; // Tests for regressions of <https://github.com/DioxusLabs/dioxus/issues/2468> #[test] fn router_without_index_route_parses() { let mut vdom = VirtualDom::new_with_props( ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/build.rs
packages/cli/build.rs
fn main() { built::write_built_file().expect("Failed to acquire build-time information"); }
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/wasm_bindgen.rs
packages/cli/src/wasm_bindgen.rs
use crate::{CliSettings, Result, Workspace}; use anyhow::{anyhow, Context}; use flate2::read::GzDecoder; use std::path::{Path, PathBuf}; use tar::Archive; use tempfile::TempDir; use tokio::process::Command; pub(crate) struct WasmBindgen { version: String, input_path: PathBuf, out_dir: PathBuf, out_name...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/settings.rs
packages/cli/src/settings.rs
use crate::{Result, TraceSrc}; use anyhow::bail; use serde::{Deserialize, Serialize}; use std::sync::LazyLock; use std::{fs, path::PathBuf, sync::Arc}; use tracing::{error, trace, warn}; /// Describes cli settings from project or global level. /// The order of priority goes: /// 1. CLI Flags/Arguments /// 2. Project-l...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/workspace.rs
packages/cli/src/workspace.rs
use crate::styles::GLOW_STYLE; use crate::CliSettings; use crate::Result; use crate::{config::DioxusConfig, AndroidTools}; use anyhow::{bail, Context}; use ignore::gitignore::Gitignore; use krates::{semver::Version, KrateDetails, LockOptions}; use krates::{Cmd, Krates, NodeId}; use std::sync::Arc; use std::{collections...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/bundle_utils.rs
packages/cli/src/bundle_utils.rs
use crate::{ config::BundleConfig, CustomSignCommandSettings, DebianSettings, MacOsSettings, NSISInstallerMode, NsisSettings, PackageType, WebviewInstallMode, WindowsSettings, WixSettings, }; impl From<NsisSettings> for tauri_bundler::NsisSettings { fn from(val: NsisSettings) -> Self { tauri_bundle...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cargo_toml.rs
packages/cli/src/cargo_toml.rs
//! The cargo_toml crate contains some logic for resolving Cargo.toml files with workspace inheritance, but it //! doesn't handle global configs like ~/.cargo/config.toml. This module handles extending the manifest with those //! settings if they exist. use std::path::{Path, PathBuf}; use cargo_toml::{Manifest, Profi...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/platform.rs
packages/cli/src/platform.rs
use anyhow::Result; use clap::{arg, Arg, ArgMatches, Args, FromArgMatches}; use serde::{Deserialize, Serialize}; use std::fmt::Display; use std::str::FromStr; use target_lexicon::{Environment, OperatingSystem, Triple}; #[derive( Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Debug, Defa...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/rustcwrapper.rs
packages/cli/src/rustcwrapper.rs
use serde::{Deserialize, Serialize}; use std::{ env::{args, vars}, path::PathBuf, process::ExitCode, }; /// The environment variable indicating where the args file is located. /// /// When `dx-rustc` runs, it writes its arguments to this file. pub const DX_RUSTC_WRAPPER_ENV_VAR: &str = "DX_RUSTC"; /// Is ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/devcfg.rs
packages/cli/src/devcfg.rs
//! Configuration of the CLI at runtime to enable certain experimental features. /// Should we force the entropy to be used on the main exe? /// /// This is used to verify that binaries are copied with different names such that they don't collide /// and should generally be only enabled on certain platforms that requi...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/test_harnesses.rs
packages/cli/src/test_harnesses.rs
use crate::{BuildTargets, BundleFormat, Cli, Commands, Workspace}; use anyhow::Result; use clap::Parser; use futures_util::{stream::FuturesUnordered, StreamExt}; use std::{ collections::HashSet, fmt::Write, path::{Path, PathBuf}, pin::Pin, prelude::rust_2024::Future, }; use target_lexicon::Triple; u...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/error.rs
packages/cli/src/error.rs
pub(crate) type Result<T, E = Error> = std::result::Result<T, E>; pub use anyhow::Error; use itertools::Itertools; pub fn log_stacktrace(err: &anyhow::Error, padding: usize) -> String { let mut trace = format!("{err}",); for (idx, cause) in err.chain().enumerate().skip(1) { trace.push_str(&format!( ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/wasm_opt.rs
packages/cli/src/wasm_opt.rs
use crate::config::WasmOptLevel; use crate::{CliSettings, Result, WasmOptConfig, Workspace}; use anyhow::{anyhow, bail, Context}; use flate2::read::GzDecoder; use std::path::{Path, PathBuf}; use tar::Archive; use tempfile::NamedTempFile; /// Write these wasm bytes with a particular set of optimizations pub async fn wr...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/dx_build_info.rs
packages/cli/src/dx_build_info.rs
// The file has been placed there by the build script. include!(concat!(env!("OUT_DIR"), "/built.rs"));
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/fastfs.rs
packages/cli/src/fastfs.rs
//! Methods for working with the filesystem that are faster than the std fs methods //! Uses stuff like rayon, caching, and other optimizations //! //! Allows configuration in case you want to do some work while copying and allows you to track progress use std::{ ffi::OsString, path::{Path, PathBuf}, }; use b...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/main.rs
packages/cli/src/main.rs
#![doc = include_str!("../README.md")] #![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")] #![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")] #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::doc_overindented_list_items)] mod build; mod bundle_utils; mod cargo_...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/logging.rs
packages/cli/src/logging.rs
//! CLI Tracing //! //! The CLI's tracing has internal and user-facing logs. User-facing logs are directly routed to the user in some form. //! Internal logs are stored in a log file for consumption in bug reports and debugging. //! We use tracing fields to determine whether a log is internal or external and additional...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
true
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/tailwind.rs
packages/cli/src/tailwind.rs
use crate::{CliSettings, Result, Workspace}; use anyhow::{anyhow, Context}; use std::{ path::{Path, PathBuf}, process::Stdio, }; use tokio::process::Command; #[derive(Debug)] pub(crate) struct TailwindCli { version: String, } impl TailwindCli { const V3_TAG: &'static str = "v3.4.15"; const V4_TAG:...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/builder.rs
packages/cli/src/build/builder.rs
use crate::{ serve::WebServer, verbosity_or_default, BuildArtifacts, BuildRequest, BuildStage, BuilderUpdate, BundleFormat, ProgressRx, ProgressTx, Result, RustcArgs, StructuredOutput, }; use anyhow::{bail, Context, Error}; use dioxus_cli_opt::process_file_to; use futures_util::{future::OptionFuture, pin_mut, F...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
true
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/manifest.rs
packages/cli/src/build/manifest.rs
//! The build manifest for `dx` applications, containing metadata about the build including //! the CLI version, Rust version, and all bundled assets. //! //! We eventually plan to use this manifest to support tighter integration with deployment platforms //! and CDNs. //! //! This manifest contains the list of assets,...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/pre_render.rs
packages/cli/src/build/pre_render.rs
use anyhow::Context; use dioxus_cli_config::{server_ip, server_port}; use dioxus_dx_wire_format::BuildStage; use futures_util::{stream::FuturesUnordered, StreamExt}; use std::{ net::{IpAddr, Ipv4Addr, SocketAddr}, time::Duration, }; use tokio::process::Command; use crate::BuildId; use super::{AppBuilder, Buil...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/mod.rs
packages/cli/src/build/mod.rs
//! The core build module for `dx`, enabling building, bundling, and runtime hot-patching of Rust //! applications. This module defines the entire end-to-end build process, including bundling for //! all major platforms including Mac, Windows, Linux, iOS, Android, and WebAssembly. //! //! The bulk of the builder code i...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/request.rs
packages/cli/src/build/request.rs
//! # [`BuildRequest`] - the core of the build process //! //! The [`BuildRequest`] object is the core of the build process. It contains all the resolved arguments //! flowing in from the CLI, dioxus.toml, env vars, and the workspace. //! //! Every BuildRequest is tied to a given workspace and BuildArgs. For simplicity...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
true
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/assets.rs
packages/cli/src/build/assets.rs
//! The dioxus asset system. //! //! This module provides functionality for extracting assets from a binary file and then writing back //! their asset hashes directly into the binary file. Previously, we performed asset hashing in the //! `asset!()` macro. The new system, implemented here, instead performs the hashing ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/context.rs
packages/cli/src/build/context.rs
//! Report progress about the build to the user. We use channels to report progress back to the CLI. use super::BuildMode; use crate::{BuildArtifacts, BuildStage, Error, TraceSrc}; use cargo_metadata::diagnostic::Diagnostic; use futures_channel::mpsc::{UnboundedReceiver, UnboundedSender}; use serde::{Deserialize, Seri...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/tools.rs
packages/cli/src/build/tools.rs
use crate::Result; use anyhow::Context; use itertools::Itertools; use std::{path::PathBuf, sync::Arc}; use target_lexicon::{ Aarch64Architecture, Architecture, ArmArchitecture, Triple, X86_32Architecture, }; use tokio::process::Command; /// The tools for Android (ndk, sdk, etc) /// /// <https://gist.github.com/Pul...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/build/patch.rs
packages/cli/src/build/patch.rs
use anyhow::Context; use itertools::Itertools; use object::{ macho::{self}, read::File, write::{MachOBuildVersion, SectionId, StandardSection, Symbol, SymbolId, SymbolSection}, Endianness, Object, ObjectSymbol, SymbolFlags, SymbolKind, SymbolScope, }; use rayon::prelude::{IntoParallelRefIterator, Parall...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
true
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/config/app.rs
packages/cli/src/config/app.rs
use serde::{Deserialize, Serialize}; use std::path::PathBuf; #[derive(Debug, Clone, Serialize, Deserialize)] pub(crate) struct ApplicationConfig { /// The path where global assets will be added when components are added with `dx components add` #[serde(default)] pub(crate) asset_dir: Option<PathBuf>, ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/config/serve.rs
packages/cli/src/config/serve.rs
use clap::Parser; /// The arguments for the address the server will run on #[derive(Clone, Debug, Default, Parser)] pub(crate) struct AddressArguments { /// The port the server will run on #[clap(long)] pub(crate) port: Option<u16>, /// The address the server will run on #[clap(long)] pub(crat...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/config/dioxus_config.rs
packages/cli/src/config/dioxus_config.rs
use crate::config::component::ComponentConfig; use super::*; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] pub(crate) struct DioxusConfig { pub(crate) application: ApplicationConfig, #[serde(default)] pub(crate) web: WebConfig, #[serde(default)] pub(crate) ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/config/bundle.rs
packages/cli/src/config/bundle.rs
use serde::{Deserialize, Serialize}; use std::path::PathBuf; use std::{collections::HashMap, str::FromStr}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub(crate) struct BundleConfig { #[serde(default)] pub(crate) identifier: Option<String>, #[serde(default)] pub(crate) publisher: Option<S...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/config/mod.rs
packages/cli/src/config/mod.rs
mod app; mod bundle; mod component; mod dioxus_config; mod serve; mod web; pub(crate) use app::*; pub(crate) use bundle::*; pub(crate) use dioxus_config::*; pub(crate) use serve::*; pub(crate) use web::*;
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/config/web.rs
packages/cli/src/config/web.rs
use serde::{Deserialize, Serialize}; use std::path::PathBuf; #[derive(Debug, Clone, Serialize, Deserialize)] pub(crate) struct WebConfig { #[serde(default)] pub(crate) app: WebAppConfig, #[serde(default)] pub(crate) proxy: Vec<WebProxyConfig>, #[serde(default)] pub(crate) watcher: WebWatcherC...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/config/component.rs
packages/cli/src/config/component.rs
use crate::component::ComponentRegistry; use serde::{Deserialize, Serialize}; use std::path::PathBuf; /// Configuration for the `dioxus component` commands #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub(crate) struct ComponentConfig { /// The component registry to default to when adding components ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/config.rs
packages/cli/src/cli/config.rs
use super::*; use crate::{CliSettings, TraceSrc, Workspace}; /// Dioxus config file controls #[derive(Clone, Debug, Deserialize, Subcommand)] pub(crate) enum Config { /// Init `Dioxus.toml` for project/folder. Init { /// Init project name name: String, /// Cover old config #[cl...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/serve.rs
packages/cli/src/cli/serve.rs
use super::*; use crate::{AddressArguments, Anonymized, BuildArgs, TraceController}; /// Serve the project /// /// `dx serve` takes cargo args by default with additional renderer args like `--web`, `--webview`, and `--native`: /// /// ```sh /// dx serve --example blah --target blah --android /// ``` /// /// A simple se...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/autoformat.rs
packages/cli/src/cli/autoformat.rs
use super::{check::collect_rs_files, *}; use crate::Workspace; use anyhow::{bail, Context}; use dioxus_autofmt::{IndentOptions, IndentType}; use rayon::prelude::*; use std::{borrow::Cow, fs, path::Path}; // For reference, the rustfmt main.rs file // https://github.com/rust-lang/rustfmt/blob/master/src/bin/main.rs ///...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/link.rs
packages/cli/src/cli/link.rs
use crate::Result; use anyhow::{bail, Context}; use serde::{Deserialize, Serialize}; use std::{borrow::Cow, ffi::OsString, path::PathBuf, process::ExitCode}; use target_lexicon::Triple; /// `dx` can act as a linker in a few scenarios. Note that we don't *actually* implement the linker logic, /// instead just proxying ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/bundle.rs
packages/cli/src/cli/bundle.rs
use crate::{AppBuilder, BuildArgs, BuildId, BuildMode, BuildRequest, BundleFormat}; use anyhow::{bail, Context}; use path_absolutize::Absolutize; use std::collections::HashMap; use tauri_bundler::{BundleBinary, BundleSettings, PackageSettings, SettingsBuilder}; use walkdir::WalkDir; use super::*; /// Bundle an app a...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/update.rs
packages/cli/src/cli/update.rs
use super::*; use crate::{Result, Workspace}; use anyhow::{bail, Context}; use itertools::Itertools; use self_update::cargo_crate_version; /// Run the project with the given arguments /// /// This is a shorthand for `dx serve` with interactive mode and hot-reload disabled. #[derive(Clone, Debug, Parser)] pub(crate) st...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/build_assets.rs
packages/cli/src/cli/build_assets.rs
use std::{fs::create_dir_all, path::PathBuf}; use crate::{extract_assets_from_file, Result, StructuredOutput}; use clap::Parser; use dioxus_cli_opt::process_file_to; use tracing::debug; #[derive(Clone, Debug, Parser)] pub struct BuildAssets { /// The source executable to build assets for. pub(crate) executabl...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/check.rs
packages/cli/src/cli/check.rs
//! Run linting against the user's codebase. //! //! For reference, the rustfmt main.rs file //! <https://github.com/rust-lang/rustfmt/blob/master/src/bin/main.rs> use super::*; use crate::BuildRequest; use anyhow::{anyhow, Context}; use futures_util::{stream::FuturesUnordered, StreamExt}; use std::path::Path; /// Ch...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/target.rs
packages/cli/src/cli/target.rs
use crate::BundleFormat; use crate::Platform; use crate::{cli::*, Renderer}; // use crate::RendererArg; // use crate::PlatformAlias; use target_lexicon::Triple; const HELP_HEADING: &str = "Target Options"; /// A single target to build for #[derive(Clone, Debug, Default, Deserialize, Parser)] pub(crate) struct TargetA...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/build.rs
packages/cli/src/cli/build.rs
use dioxus_dx_wire_format::StructuredBuildArtifacts; use crate::{ cli::*, Anonymized, AppBuilder, BuildArtifacts, BuildId, BuildMode, BuildRequest, BundleFormat, Platform, TargetArgs, Workspace, }; /// Build the Rust Dioxus app and all of its assets. /// /// Produces a final output build. If a "server" featur...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/translate.rs
packages/cli/src/cli/translate.rs
use super::*; use crate::{Result, StructuredOutput}; use anyhow::bail; use dioxus_rsx::{BodyNode, CallBody, TemplateBody}; /// Translate some source file into Dioxus code #[derive(Clone, Debug, Parser)] pub(crate) struct Translate { /// Activate debug mode // short and long flags (-d, --debug) will be deduced ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/platform_override.rs
packages/cli/src/cli/platform_override.rs
#![allow(dead_code)] use crate::Anonymized; use clap::parser::ValueSource; use clap::{ArgMatches, Args, CommandFactory, FromArgMatches, Parser, Subcommand}; use serde_json::{json, Value}; /// Wraps a component with the subcommands `@server` and `@client` which will let you override the /// base arguments for the clien...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/mod.rs
packages/cli/src/cli/mod.rs
pub(crate) mod autoformat; pub(crate) mod build; pub(crate) mod build_assets; pub(crate) mod bundle; pub(crate) mod check; pub(crate) mod component; pub(crate) mod config; pub(crate) mod create; pub(crate) mod doctor; pub(crate) mod hotpatch; pub(crate) mod init; pub(crate) mod link; pub(crate) mod platform_override; p...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/verbosity.rs
packages/cli/src/cli/verbosity.rs
use clap::Parser; use std::path::PathBuf; #[derive(Parser, Clone, Debug, Default)] pub struct Verbosity { /// Use verbose output [default: false] #[clap(long, global = true)] pub(crate) verbose: bool, /// Use trace output [default: false] #[clap(long, global = true)] pub(crate) trace: bool, ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/run.rs
packages/cli/src/cli/run.rs
use super::*; use crate::{ serve::{AppServer, ServeUpdate, WebServer}, BuilderUpdate, BundleFormat, Result, }; use anyhow::bail; use dioxus_dx_wire_format::BuildStage; /// Run the project with the given arguments /// /// This is a shorthand for `dx serve` with interactive mode and hot-reload disabled. /// /// ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/init.rs
packages/cli/src/cli/init.rs
use super::*; use cargo_generate::{GenerateArgs, TemplatePath, Vcs}; #[derive(Clone, Debug, Default, Deserialize, Parser)] #[clap(name = "init")] pub struct Init { /// Create a new Dioxus project at PATH #[arg(default_value = ".")] pub path: PathBuf, /// Project name. Defaults to directory name #[...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/doctor.rs
packages/cli/src/cli/doctor.rs
use super::*; use crate::{Result, Workspace}; use anyhow::{bail, Context}; use itertools::Itertools; /// Perform a system analysis to verify the system install is working correctly. #[derive(Clone, Debug, Parser)] pub(crate) struct Doctor {} impl Doctor { pub async fn doctor(self) -> Result<StructuredOutput> { ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/hotpatch.rs
packages/cli/src/cli/hotpatch.rs
use crate::{ platform_override::CommandWithPlatformOverrides, AppBuilder, BuildArgs, BuildId, BuildMode, HotpatchModuleCache, Result, StructuredOutput, }; use anyhow::Context; use clap::Parser; use dioxus_dx_wire_format::StructuredBuildArtifacts; use std::io::Read; use std::sync::Arc; const HELP_HEADING: &str ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/print.rs
packages/cli/src/cli/print.rs
use std::{borrow::Cow, ffi::OsString}; use super::*; use crate::{BuildMode, Result}; use anyhow::Context; /// Perform a system analysis to verify the system install is working correctly. #[derive(Clone, Debug, Subcommand)] pub(crate) enum Print { /// Print the cargo args dioxus uses to build the server app. /...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/create.rs
packages/cli/src/cli/create.rs
use super::*; use crate::TraceSrc; use anyhow::{bail, Context}; use cargo_generate::{GenerateArgs, TemplatePath, Vcs}; use std::{fs, path::Path}; pub(crate) static DEFAULT_TEMPLATE: &str = "gh:dioxuslabs/dioxus-template"; #[derive(Clone, Debug, Default, Deserialize, Parser)] #[clap(name = "new")] pub struct Create { ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/cli/component.rs
packages/cli/src/cli/component.rs
use std::{ collections::{HashMap, HashSet}, ops::Deref, path::{Path, PathBuf}, }; use crate::{verbosity_or_default, DioxusConfig, Result, StructuredOutput, Workspace}; use anyhow::{bail, Context}; use clap::Parser; use dioxus_component_manifest::{ component_manifest_schema, CargoDependency, Component, ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/serve/proxy_ws.rs
packages/cli/src/serve/proxy_ws.rs
use crate::logging::TraceSrc; use crate::serve::proxy::handle_proxy_error; use anyhow::Context; use axum::body::Body; use axum::extract::ws::{CloseFrame as ClientCloseFrame, Message as ClientMessage}; use axum::extract::{FromRequestParts, WebSocketUpgrade}; use axum::http::request::Parts; use axum::response::IntoRespon...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/serve/update.rs
packages/cli/src/serve/update.rs
use crate::{BuildId, BuilderUpdate, BundleFormat, Error, TraceMsg}; use axum::extract::ws::Message as WsMessage; use std::path::PathBuf; /// One fat enum to rule them all.... /// /// Thanks to libraries like winit for the inspiration #[allow(clippy::large_enum_variant)] pub(crate) enum ServeUpdate { NewConnection ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/serve/runner.rs
packages/cli/src/serve/runner.rs
use super::{AppBuilder, ServeUpdate, WebServer}; use crate::{ platform_override::CommandWithPlatformOverrides, BuildArtifacts, BuildId, BuildMode, BuildTargets, BuilderUpdate, BundleFormat, HotpatchModuleCache, Result, ServeArgs, TailwindCli, TraceSrc, Workspace, }; use anyhow::{bail, Context}; use dioxus_c...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
true
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/serve/mod.rs
packages/cli/src/serve/mod.rs
use crate::{ styles::{GLOW_STYLE, LINK_STYLE}, AppBuilder, BuildId, BuildMode, BuilderUpdate, BundleFormat, Result, ServeArgs, TraceController, }; mod ansi_buffer; mod output; mod proxy; mod proxy_ws; mod runner; mod server; mod update; use anyhow::bail; use dioxus_dx_wire_format::BuildStage; pub(crate) u...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/serve/server.rs
packages/cli/src/serve/server.rs
use crate::{ config::WebHttpsConfig, serve::ServeUpdate, BuildId, BuildStage, BuilderUpdate, BundleFormat, Result, TraceSrc, }; use anyhow::{bail, Context}; use axum::{ body::Body, extract::{ ws::{Message, WebSocket}, Query, Request, State, WebSocketUpgrade, }, http::{ he...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/serve/output.rs
packages/cli/src/serve/output.rs
use crate::Result; use crate::{ serve::{ansi_buffer::ansi_string_to_line, ServeUpdate, WebServer}, BuildId, BuildStage, BuilderUpdate, BundleFormat, TraceContent, TraceMsg, TraceSrc, }; use anyhow::{anyhow, bail, Context}; use cargo_metadata::diagnostic::Diagnostic; use crossterm::{ cursor::{Hide, Show}, ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
true
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/serve/proxy.rs
packages/cli/src/serve/proxy.rs
use crate::config::WebProxyConfig; use crate::TraceSrc; use crate::{Error, Result}; use anyhow::{bail, Context}; use axum::body::Body; use axum::http::request::Parts; use axum::{body::Body as MyBody, response::IntoResponse}; use axum::{ http::StatusCode, routing::{any, MethodRouter}, Router, }; use hyper::...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/cli/src/serve/ansi_buffer.rs
packages/cli/src/serve/ansi_buffer.rs
use ratatui::{buffer::Cell, prelude::*}; use std::fmt::{self, Write}; /// A buffer that can be rendered to and then dumped as raw ansi codes /// /// This is taken from a PR on the ratatui repo (<https://github.com/ratatui/ratatui/pull/1065>) and /// modified to be more appropriate for our use case. pub fn ansi_string_...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-types/src/lib.rs
packages/core-types/src/lib.rs
pub mod bubbles; pub mod bundled; pub mod formatter; pub mod hr_context; pub use bubbles::*; pub use bundled::*; pub use formatter::*; pub use hr_context::*;
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-types/src/bundled.rs
packages/core-types/src/bundled.rs
use std::sync::LazyLock; pub fn is_bundled_app() -> bool { static BUNDLED: LazyLock<bool> = LazyLock::new(|| { // If the env var is set, we're bundled if std::env::var("DIOXUS_CLI_ENABLED").is_ok() { return true; } // If the cargo manifest dir is set, we're not bundled....
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-types/src/attributes.rs
packages/core-types/src/attributes.rs
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-types/src/formatter.rs
packages/core-types/src/formatter.rs
use std::borrow::Cow; /// Take this type and format it into a Cow<'static, str> /// /// This trait exists so libraries like manganis can implement this type for assets without depending /// on dioxus-core, which can be heavy in proc macros and build scripts. /// /// We don't want a blanket impl for T: Display because ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-types/src/hr_context.rs
packages/core-types/src/hr_context.rs
pub trait HotReloadingContext { fn map_attribute( element_name_rust: &str, attribute_name_rust: &str, ) -> Option<(&'static str, Option<&'static str>)>; fn map_element(element_name_rust: &str) -> Option<(&'static str, Option<&'static str>)>; } pub struct Empty; impl HotReloadingContext for...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/core-types/src/bubbles.rs
packages/core-types/src/bubbles.rs
/// Check if the event bubbles /// /// todo: this should not be in this crate, but this crate is a "root" crate and /// has zero-deps, meaning it gets compiled before anything else. /// /// This function being here means we can use it in the interpreter without pulling in dioxus-html, /// drastically shortening the cra...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/build.rs
packages/document/build.rs
fn main() { // If any TS files change, re-run the build script lazy_js_bundle::LazyTypeScriptBindings::new() .with_watching("./src/ts") .with_binding("./src/ts/head.ts", "./src/js/head.js") .run(); }
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/lib.rs
packages/document/src/lib.rs
use std::rc::Rc; mod document; mod elements; mod error; mod eval; pub use document::*; pub use elements::*; pub use error::*; pub use eval::*; /// Get the document provider for the current platform or a no-op provider if the platform doesn't document functionality. pub fn document() -> Rc<dyn Document> { match d...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/document.rs
packages/document/src/document.rs
use std::sync::Arc; use super::*; /// A context for the document pub type DocumentContext = Arc<dyn Document>; fn format_string_for_js(s: &str) -> String { let escaped = s .replace('\\', "\\\\") .replace('\n', "\\n") .replace('\r', "\\r") .replace('"', "\\\""); format!("\"{esc...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/error.rs
packages/document/src/error.rs
use std::error::Error; use std::fmt::Display; /// Represents an error when evaluating JavaScript #[derive(Debug)] #[non_exhaustive] pub enum EvalError { /// The platform does not support evaluating JavaScript. Unsupported, /// The provided JavaScript has already been ran. Finished, /// The provid...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/eval.rs
packages/document/src/eval.rs
#![doc = include_str!("../docs/eval.md")] use crate::error::EvalError; use generational_box::GenerationalBox; use std::future::{poll_fn, Future, IntoFuture}; use std::pin::Pin; use std::task::{Context, Poll}; #[doc = include_str!("../docs/eval.md")] pub struct Eval { evaluator: GenerationalBox<Box<dyn Evaluator>>...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/elements/link.rs
packages/document/src/elements/link.rs
use super::*; use crate::document; use dioxus_core::{use_hook, VNode}; use dioxus_html as dioxus_elements; #[non_exhaustive] #[derive(Clone, Props, PartialEq)] pub struct OtherLinkProps { pub rel: String, #[props(extends = link, extends = GlobalAttributes)] pub additional_attributes: Vec<Attribute>, } #[n...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/elements/title.rs
packages/document/src/elements/title.rs
use dioxus_core::{use_hook, VNode}; use crate::document; use super::*; #[derive(Clone, Props, PartialEq)] pub struct TitleProps { /// The contents of the title tag. The children must be a single text node. children: Element, } /// Render the title of the page. On web renderers, this will set the [`<title>`]...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/elements/stylesheet.rs
packages/document/src/elements/stylesheet.rs
use super::*; /// Render a [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) tag into the head of the page with the stylesheet rel. /// This is equivalent to the [`Link`](Link) component with a slightly more ergonomic API. /// /// /// # Example /// ```rust /// # use dioxus::prelude:...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/elements/mod.rs
packages/document/src/elements/mod.rs
#![doc = include_str!("../../docs/head.md")] use std::{cell::RefCell, collections::HashSet, rc::Rc}; use dioxus_core::{ Attribute, DynamicNode, Element, RenderError, Runtime, ScopeId, Template, TemplateNode, }; use dioxus_core_macro::*; mod link; pub use link::*; mod stylesheet; pub use stylesheet::*; mod meta; ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/document/src/elements/style.rs
packages/document/src/elements/style.rs
use super::*; use crate::document; use dioxus_core::{use_hook, VNode}; use dioxus_html as dioxus_elements; #[non_exhaustive] #[derive(Clone, Props, PartialEq)] pub struct StyleProps { /// Styles are deduplicated by their href attribute pub href: Option<String>, pub media: Option<String>, pub nonce: Opt...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false