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/document/src/elements/meta.rs
packages/document/src/elements/meta.rs
use super::*; use crate::document; use dioxus_core::{use_hook, VNode}; use dioxus_html as dioxus_elements; #[non_exhaustive] /// Props for the [`Meta`] component #[derive(Clone, Props, PartialEq)] pub struct MetaProps { pub property: Option<String>, pub name: Option<String>, pub charset: Option<String>, ...
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/script.rs
packages/document/src/elements/script.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 ScriptProps { /// The contents of the script tag. If present, the children must be a single text node. pub children: Element, /// Script...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores-macro/src/lib.rs
packages/stores-macro/src/lib.rs
use proc_macro::TokenStream; use syn::{parse_macro_input, DeriveInput, ItemImpl}; use crate::extend::ExtendArgs; mod derive; mod extend; /// # `derive(Store)` /// /// The `Store` macro is used to create an extension trait for stores that makes it possible to access the fields or variants /// of an item as stores. //...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores-macro/src/extend.rs
packages/stores-macro/src/extend.rs
use proc_macro2::TokenStream; use quote::quote; use syn::parse::Parse; use syn::spanned::Spanned; use syn::{ parse_quote, Ident, ImplItem, ImplItemConst, ImplItemType, ItemImpl, PathArguments, Type, WherePredicate, }; pub(crate) fn extend_store(args: ExtendArgs, mut input: ItemImpl) -> syn::Result<TokenStream>...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/stores-macro/src/derive.rs
packages/stores-macro/src/derive.rs
use convert_case::{Case, Casing}; use proc_macro2::TokenStream as TokenStream2; use quote::{format_ident, quote, ToTokens}; use syn::{ parse_quote, spanned::Spanned, DataEnum, DataStruct, DeriveInput, Field, Fields, Generics, Ident, Index, LitInt, }; pub(crate) fn derive_store(input: DeriveInput) -> syn::Resul...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-macro/src/lib.rs
packages/manganis/manganis-macro/src/lib.rs
#![doc = include_str!("../README.md")] #![deny(missing_docs)] use std::path::PathBuf; use proc_macro::TokenStream; use proc_macro2::Span; use quote::{quote, ToTokens}; use syn::{ parse::{Parse, ParseStream}, parse_macro_input, ItemStruct, }; pub(crate) mod asset; pub(crate) mod css_module; pub(crate) mod lin...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-macro/src/css_module.rs
packages/manganis/manganis-macro/src/css_module.rs
use crate::{asset::AssetParser, resolve_path}; use macro_string::MacroString; use manganis_core::{create_module_hash, get_class_mappings}; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote, ToTokens, TokenStreamExt}; use syn::{ parse::{Parse, ParseStream}, spanned::Spanned, token::Comma,...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-macro/src/asset.rs
packages/manganis/manganis-macro/src/asset.rs
use crate::{resolve_path, AssetParseError}; use macro_string::MacroString; use proc_macro2::TokenStream as TokenStream2; use quote::{quote, ToTokens}; use std::{ hash::{DefaultHasher, Hash, Hasher}, path::{Path, PathBuf}, }; use syn::{ parse::{Parse, ParseStream}, spanned::Spanned as _, Token, }; p...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-macro/src/linker.rs
packages/manganis/manganis-macro/src/linker.rs
use proc_macro2::TokenStream as TokenStream2; use quote::ToTokens; /// We store description of the assets an application uses in the executable. /// We use the `link_section` attribute embed an extra section in the executable. /// We force rust to store a serialized representation of the asset description /// inside a...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-macro/tests/option_asset.rs
packages/manganis/manganis-macro/tests/option_asset.rs
use manganis::{asset, option_asset, Asset}; #[test] fn resolves_existing_asset() { const REQUIRED: Asset = asset!("/assets/asset.txt"); const OPTIONAL: Option<Asset> = option_asset!("/assets/asset.txt"); let optional = OPTIONAL.expect("option_asset! should return Some for existing assets"); assert_eq!...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/css.rs
packages/manganis/manganis-core/src/css.rs
use crate::{AssetOptions, AssetOptionsBuilder, AssetVariant}; use const_serialize_07 as const_serialize; use const_serialize_08::SerializeConst; /// Options for a css asset #[derive( Debug, Eq, PartialEq, PartialOrd, Clone, Copy, Hash, SerializeConst, const_serialize::SerializeConst...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/lib.rs
packages/manganis/manganis-core/src/lib.rs
mod folder; pub use folder::*; mod images; pub use images::*; mod options; pub use options::*; mod css; pub use css::*; mod js; pub use js::*; mod asset; pub use asset::*; mod css_module; pub use css_module::*; mod css_module_parser; pub use css_module_parser::*;
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/css_module.rs
packages/manganis/manganis-core/src/css_module.rs
use std::{ collections::HashSet, hash::{DefaultHasher, Hash, Hasher}, path::Path, }; use crate::{AssetOptions, AssetOptionsBuilder, AssetVariant}; use const_serialize_07 as const_serialize; use const_serialize_08::SerializeConst; /// Options for a css module asset #[derive( Debug, Eq, PartialE...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/css_module_parser.rs
packages/manganis/manganis-core/src/css_module_parser.rs
use std::borrow::Cow; use winnow::{ combinator::{alt, cut_err, delimited, opt, peek, preceded, repeat, terminated}, error::{ContextError, ErrMode, ParseError}, prelude::*, stream::{AsChar, ContainsToken, Range}, token::{none_of, one_of, take_till, take_until, take_while}, }; /// ```text /// ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/asset.rs
packages/manganis/manganis-core/src/asset.rs
use crate::AssetOptions; use const_serialize_07 as const_serialize; use const_serialize_08::{deserialize_const, ConstStr, SerializeConst}; use std::{fmt::Debug, hash::Hash, path::PathBuf}; /// An asset that should be copied by the bundler with some options. This type will be /// serialized into the binary. /// CLIs th...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/js.rs
packages/manganis/manganis-core/src/js.rs
use const_serialize_07 as const_serialize; use const_serialize_08::SerializeConst; use crate::{AssetOptions, AssetOptionsBuilder, AssetVariant}; /// Options for a javascript asset #[derive( Debug, Eq, PartialEq, PartialOrd, Clone, Copy, Hash, SerializeConst, const_serialize::Serial...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/options.rs
packages/manganis/manganis-core/src/options.rs
use const_serialize_07 as const_serialize; use const_serialize_08::SerializeConst; use crate::{ CssAssetOptions, CssModuleAssetOptions, FolderAssetOptions, ImageAssetOptions, JsAssetOptions, }; /// Settings for a generic asset #[derive( Debug, Eq, PartialEq, PartialOrd, Clone, Copy, Ha...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/folder.rs
packages/manganis/manganis-core/src/folder.rs
use const_serialize_07 as const_serialize; use const_serialize_08::SerializeConst; use crate::{AssetOptions, AssetOptionsBuilder}; /// The builder for a folder asset. #[derive( Debug, Eq, PartialEq, PartialOrd, Clone, Copy, Hash, SerializeConst, const_serialize::SerializeConst, ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis-core/src/images.rs
packages/manganis/manganis-core/src/images.rs
use const_serialize_07 as const_serialize; use const_serialize_08::SerializeConst; use crate::{AssetOptions, AssetOptionsBuilder, AssetVariant}; /// The type of an image. You can read more about the tradeoffs between image formats [here](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types) #[derive...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis/src/lib.rs
packages/manganis/manganis/src/lib.rs
#![doc = include_str!("../README.md")] #![deny(missing_docs)] #[doc(hidden)] pub mod macro_helpers; pub use manganis_macro::asset; pub use manganis_macro::css_module; pub use manganis_macro::option_asset; pub use manganis_core::{ Asset, AssetOptions, AssetVariant, BundledAsset, CssAssetOptions, CssModuleAssetOpti...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/manganis/manganis/src/macro_helpers.rs
packages/manganis/manganis/src/macro_helpers.rs
pub use const_serialize; use const_serialize::{serialize_const, ConstVec, SerializeConst}; pub use const_serialize_07; use const_serialize_07::{ serialize_const as serialize_const_07, ConstVec as ConstVec07, SerializeConst as SerializeConst07, }; use manganis_core::{AssetOptions, BundledAsset}; /// Create a bu...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/config-macro/src/lib.rs
packages/config-macro/src/lib.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")] use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::quote; macro_rules! define_config_macr...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/src/lib.rs
packages/generational-box/src/lib.rs
#![doc = include_str!("../README.md")] #![warn(missing_docs)] use parking_lot::Mutex; use std::{ fmt::Debug, marker::PhantomData, num::NonZeroU64, ops::{Deref, DerefMut}, sync::Arc, }; pub use error::*; pub use references::*; pub use sync::SyncStorage; pub use unsync::UnsyncStorage; mod entry; mo...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/src/unsync.rs
packages/generational-box/src/unsync.rs
use crate::{ entry::{MemoryLocationBorrowInfo, RcStorageEntry, StorageEntry}, error, references::{GenerationalRef, GenerationalRefMut}, AnyStorage, BorrowError, BorrowMutError, BorrowMutResult, BorrowResult, GenerationalLocation, GenerationalPointer, Storage, ValueDroppedError, }; use std::{ any...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/src/sync.rs
packages/generational-box/src/sync.rs
use parking_lot::{ MappedRwLockReadGuard, MappedRwLockWriteGuard, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard, }; use std::{ any::Any, fmt::Debug, num::NonZeroU64, sync::{Arc, OnceLock}, }; use crate::{ entry::{MemoryLocationBorrowInfo, RcStorageEntry, StorageEntry}, error::{self, Valu...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/src/references.rs
packages/generational-box/src/references.rs
use std::{ fmt::{Debug, Display}, ops::{Deref, DerefMut}, }; /// A reference to a value in a generational box. This reference acts similarly to [`std::cell::Ref`], but has extra debug information /// to track when all references to the value are created and dropped. /// /// [`GenerationalRef`] implements [`Der...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/src/error.rs
packages/generational-box/src/error.rs
//! Generational box errors #![allow(clippy::uninlined_format_args, reason = "causes compile error")] use std::error::Error; use std::fmt::Debug; use std::fmt::Display; use crate::GenerationalLocation; /// A result that can be returned from a borrow operation. pub type BorrowResult<T = ()> = std::result::Result<T, B...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/src/entry.rs
packages/generational-box/src/entry.rs
use crate::{ BorrowError, BorrowMutError, GenerationalLocation, GenerationalRefBorrowGuard, GenerationalRefBorrowMutGuard, }; use std::{ num::NonZeroU64, sync::atomic::{AtomicU64, Ordering}, }; pub(crate) struct RcStorageEntry<T> { ref_count: AtomicU64, pub data: T, } impl<T> RcStorageEntry<T>...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/tests/errors.rs
packages/generational-box/tests/errors.rs
use generational_box::{ AlreadyBorrowedError, AlreadyBorrowedMutError, BorrowError, BorrowMutError, GenerationalBox, Owner, Storage, SyncStorage, UnsyncStorage, ValueDroppedError, }; #[track_caller] fn read_at_location<S: Storage<i32>>( value: GenerationalBox<i32, S>, ) -> (S::Ref<'static, i32>, &'static s...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/tests/sync.rs
packages/generational-box/tests/sync.rs
// Regression test for https://github.com/DioxusLabs/dioxus/issues/2636 use std::time::Duration; use generational_box::{AnyStorage, GenerationalBox, SyncStorage}; #[test] fn race_condition_regression() { for _ in 0..100 { let handle = { let owner = SyncStorage::owner(); let key = ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/tests/reused.rs
packages/generational-box/tests/reused.rs
//! This test needs to be in its own file such that it doesn't share //! an address space with the other tests. //! //! That will cause random failures on CI. use generational_box::{Storage, SyncStorage, UnsyncStorage}; #[test] fn reused() { fn reused_test<S: Storage<i32> + 'static>() { let first_ptr; ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/tests/reference_counting.rs
packages/generational-box/tests/reference_counting.rs
use generational_box::{Storage, SyncStorage, UnsyncStorage}; #[test] fn reference_counting() { fn reference_counting<S: Storage<String> + 'static>() { let data = String::from("hello world"); let reference; { let outer_owner = S::owner(); { // create a...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/tests/basic.rs
packages/generational-box/tests/basic.rs
use generational_box::{GenerationalBox, Storage, SyncStorage, UnsyncStorage}; /// # Example /// /// ```compile_fail /// let data = String::from("hello world"); /// let owner = UnsyncStorage::owner(); /// let key = owner.insert(&data); /// drop(data); /// assert_eq!(*key.read(), "hello world"); /// ``` #[allow(unused)]...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/generational-box/benches/lock.rs
packages/generational-box/benches/lock.rs
#![allow(unused)] use generational_box::*; use criterion::{criterion_group, criterion_main, Criterion}; use std::hint::black_box; fn create<S: Storage<u32>>(owner: &Owner<S>) -> GenerationalBox<u32, S> { owner.insert(0) } fn set_read<S: Storage<u32>>(signal: GenerationalBox<u32, S>) -> u32 { signal.set(1); ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/subsecond/subsecond-tests/cross-tls-crate/src/lib.rs
packages/subsecond/subsecond-tests/cross-tls-crate/src/lib.rs
pub use std::cell::Cell; use std::{cell::RefCell, thread::LocalKey}; #[derive(Debug)] pub struct StoredItem { pub name: String, pub value: f32, pub items: Vec<String>, } thread_local! { pub static BAR: RefCell<Option<StoredItem>> = const { RefCell::new(None) }; } pub fn get_bar() -> &'static LocalKey...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/subsecond/subsecond-tests/cross-tls-crate-dylib/src/lib.rs
packages/subsecond/subsecond-tests/cross-tls-crate-dylib/src/lib.rs
pub use std::cell::Cell; use std::{cell::RefCell, thread::LocalKey}; #[derive(Debug)] pub struct StoredItem { pub name: String, pub value: f32, pub items: Vec<String>, } thread_local! { pub static BAZ: RefCell<Option<StoredItem>> = const { RefCell::new(None) }; } pub fn get_baz() -> &'static LocalKey...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/subsecond/subsecond-tests/cross-tls-test/src/main.rs
packages/subsecond/subsecond-tests/cross-tls-test/src/main.rs
use std::{cell::Cell, thread, time::Duration}; use cross_tls_crate::get_bar; use cross_tls_crate_dylib::get_baz; fn main() { dioxus_devtools::connect_subsecond(); loop { dioxus_devtools::subsecond::call(|| { use cross_tls_crate::BAR; use cross_tls_crate_dylib::BAZ; ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/subsecond/subsecond-types/src/lib.rs
packages/subsecond/subsecond-types/src/lib.rs
use serde::{Deserialize, Serialize}; use std::{ collections::HashMap, hash::{BuildHasherDefault, Hasher}, path::PathBuf, }; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] pub struct JumpTable { /// The dylib containing the patch. This should be a valid path so you can just pass it to LibLoa...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/subsecond/subsecond/src/lib.rs
packages/subsecond/subsecond/src/lib.rs
#![allow(clippy::needless_doctest_main)] //! # Subsecond: Hot-patching for Rust //! //! Subsecond is a library that enables hot-patching for Rust applications. This allows you to change //! the code of a running application without restarting it. This is useful for game engines, servers, //! and other long-running appl...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
true
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/fullstack-hydration-order/src/main.rs
packages/playwright-tests/fullstack-hydration-order/src/main.rs
// Adjacent server components that both use server functions shouldn't cause // hydration issues // https://github.com/DioxusLabs/dioxus/issues/4595 use dioxus::prelude::*; fn main() { dioxus::launch(|| rsx! { Home {} }); } #[component] pub fn Home() -> Element { let mut count = use_signal(|| 0); rsx! { ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/windows-headless/src/main.rs
packages/playwright-tests/windows-headless/src/main.rs
use dioxus::LaunchBuilder; use dioxus::prelude::*; fn main() { LaunchBuilder::new() .with_cfg( dioxus::desktop::Config::new() .with_windows_browser_args("--remote-debugging-port=8787"), ) .launch(app); } fn app() -> Element { let mut count = use_signal(|| 0)...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/default-features-disabled/src/main.rs
packages/playwright-tests/default-features-disabled/src/main.rs
// This test asserts that the client feature is disable on the server build by the cli // even if it is set as a default feature #![allow(non_snake_case)] use dioxus::prelude::*; fn main() { launch(app); } fn app() -> Element { let server_features = use_server_future(get_server_features)?.unwrap().unwrap(); ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/wasm-split-harness/src/main.rs
packages/playwright-tests/wasm-split-harness/src/main.rs
//! This file is a fuzz-test for the wasm-split engine to ensure that it works as expected. //! The docsite is a better target for this, but we try to boil down the complexity into this small //! test file. #![allow(non_snake_case)] use dioxus::prelude::*; use futures::AsyncReadExt; use js_sys::Date; use std::pin::Pi...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/fullstack-mounted/src/main.rs
packages/playwright-tests/fullstack-mounted/src/main.rs
// Regression test for https://github.com/DioxusLabs/dioxus/pull/3480 use dioxus::prelude::*; fn main() { dioxus::launch(App); } #[component] fn App() -> Element { let mut mounted = use_signal(|| false); rsx! { div { onmounted: move |_| { mounted.set(true); ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/fullstack/src/main.rs
packages/playwright-tests/fullstack/src/main.rs
// This test is used by playwright configured in the root of the repo // Tests: // - Server functions // - SSR // - Hydration #![allow(non_snake_case)] use dioxus::fullstack::{commit_initial_chunk, Websocket}; use dioxus::{fullstack::WebSocketOptions, prelude::*}; fn main() { #[cfg(feature = "server")] dioxus...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/liveview/src/main.rs
packages/playwright-tests/liveview/src/main.rs
// This test is used by playwright configured in the root of the repo use axum::{extract::ws::WebSocketUpgrade, response::Html, routing::get, Router}; use dioxus::{logger::tracing::Level, prelude::*}; fn app() -> Element { let mut num = use_signal(|| 0); rsx! { div { "hello axum! {num}" ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/web-routing/src/main.rs
packages/playwright-tests/web-routing/src/main.rs
use dioxus::prelude::*; fn main() { launch(|| { rsx! { Router::<Route> {} } }) } #[derive(Routable, Clone, PartialEq)] #[rustfmt::skip] enum Route { #[redirect("/",|| Route::Other)] #[route("/other")] Other, #[route("/other/:id")] OtherId { id: String }, #[r...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/barebones-template/src/main.rs
packages/playwright-tests/barebones-template/src/main.rs
use dioxus::prelude::*; const FAVICON: Asset = asset!("/assets/favicon.ico"); const MAIN_CSS: Asset = asset!("/assets/main.css"); const HEADER_SVG: Asset = asset!("/assets/header.svg"); fn main() { dioxus::launch(App); } #[component] fn App() -> Element { rsx! { document::Link { rel: "icon", href: FA...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/web-hot-patch/src/main.rs
packages/playwright-tests/web-hot-patch/src/main.rs
use dioxus::prelude::*; const CSS: Asset = asset!("/assets/style.css"); const IMAGE: Asset = asset!("/assets/toasts.png"); fn app() -> Element { let mut num = use_signal(|| 0); // make sure to emit funky closure code in this module to test wasm-bindgen handling let _closures = wasm_bindgen::closure::Clos...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/fullstack-spread/src/main.rs
packages/playwright-tests/fullstack-spread/src/main.rs
//! Regression test for <https://github.com/DioxusLabs/dioxus/issues/4646> use dioxus::prelude::*; fn main() { // we split these two to ensure `dioxus::serve` works properly. #[cfg(feature = "server")] dioxus::serve(|| async move { Ok(dioxus::server::router(app)) }); #[cfg(not(feature = "server"))] ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/fullstack-error-codes/src/main.rs
packages/playwright-tests/fullstack-error-codes/src/main.rs
//! To render custom error pages, you can create a layout component that captures errors from routes //! with an `ErrorBoundary` and display different content based on the error type. //! //! While capturing the error, we set the appropriate HTTP status code using `FullstackContext::commit_error_status`. //! The router...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/fullstack-errors/src/main.rs
packages/playwright-tests/fullstack-errors/src/main.rs
// This test is used by playwright configured in the root of the repo // Tests: // - Errors that originate in the initial render #![allow(non_snake_case)] use dioxus::prelude::*; fn main() { dioxus::launch(app); } fn app() -> Element { rsx! { Errors {} } } #[server] async fn server_error() -> Se...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/cli-optimization/build.rs
packages/playwright-tests/cli-optimization/build.rs
fn main() { // use std::path::PathBuf; // // If the monaco editor folder doesn't exist, download it // let monaco_path = PathBuf::from("monaco-editor"); // if monaco_path.exists() { // return; // } // let url = "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.52.2.tgz"; ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/cli-optimization/src/lib.rs
packages/playwright-tests/cli-optimization/src/lib.rs
// This test checks the CLI optimizes assets correctly without breaking them use dioxus::prelude::*; const SOME_IMAGE: Asset = asset!("/images/toasts.png", AssetOptions::image().with_avif()); const SOME_IMAGE_WITH_THE_SAME_URL: Asset = asset!("/images/toasts.png", AssetOptions::image().with_jpg()); #[used] static...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/cli-optimization/src/old_cli.rs
packages/playwright-tests/cli-optimization/src/old_cli.rs
fn main() { dioxus_cli_optimization_test::main() }
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/cli-optimization/src/main.rs
packages/playwright-tests/cli-optimization/src/main.rs
fn main() { dioxus_cli_optimization_test::main() }
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/web-hash-routing/src/main.rs
packages/playwright-tests/web-hash-routing/src/main.rs
use std::rc::Rc; use dioxus::{prelude::*, web::HashHistory}; fn main() { dioxus::LaunchBuilder::new() .with_cfg(dioxus::web::Config::new().history(Rc::new(HashHistory::new(false)))) .launch(|| { rsx! { Router::<Route> {} } }) } #[derive(Routable, Cl...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/fullstack-routing/src/main.rs
packages/playwright-tests/fullstack-routing/src/main.rs
// This test is used by playwright configured in the root of the repo // Tests: // - 200 Routes // - 404 Routes // - 500 Routes #![allow(non_snake_case)] use dioxus::prelude::*; fn main() { dioxus::LaunchBuilder::new() .with_cfg(server_only! { dioxus::server::ServeConfig::builder().enable_out_...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/nested-suspense/src/lib.rs
packages/playwright-tests/nested-suspense/src/lib.rs
// This test is used by playwright configured in the root of the repo // Tests: // - SEO without JS // - Streaming hydration // - Suspense // - Server functions // // Without Javascript, content may not load into the right location, but it should still be somewhere in the html even if it is invisible use dioxus::prelu...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/nested-suspense/src/main.rs
packages/playwright-tests/nested-suspense/src/main.rs
#![allow(non_snake_case)] use dioxus::prelude::*; use nested_suspense::app; fn main() { LaunchBuilder::new() .with_cfg(server_only! { ServeConfig::builder() .enable_out_of_order_streaming() }) .launch(app); }
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/nested-suspense/src/ssg.rs
packages/playwright-tests/nested-suspense/src/ssg.rs
#![allow(non_snake_case)] use dioxus::prelude::*; use nested_suspense::app; fn main() { dioxus::logger::init(dioxus::logger::tracing::Level::TRACE).expect("logger failed to init"); dioxus::LaunchBuilder::new() .with_cfg(server_only! { ServeConfig::builder() .incremental( ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/web-hot-patch-fullstack/src/main.rs
packages/playwright-tests/web-hot-patch-fullstack/src/main.rs
use dioxus::prelude::*; const CSS: Asset = asset!("/assets/style.css"); const IMAGE: Asset = asset!("/assets/toasts.png"); fn app() -> Element { let mut num = use_signal(|| 0); rsx! { document::Link { href: CSS, rel: "stylesheet", } img { id: "toast...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/web/src/main.rs
packages/playwright-tests/web/src/main.rs
// This test is used by playwright configured in the root of the repo use dioxus::prelude::*; use wasm_bindgen::prelude::*; fn app() -> Element { let mut num = use_signal(|| 0); let mut eval_result = use_signal(String::new); rsx! { div { "hello axum! {num}" document::Title...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/playwright-tests/suspense-carousel/src/main.rs
packages/playwright-tests/suspense-carousel/src/main.rs
// This test is used by playwright configured in the root of the repo // Tests: // - Streaming hydration // - Suspense // - Server futures #![allow(non_snake_case, unused)] use dioxus::{fullstack::commit_initial_chunk, prelude::*}; use serde::{Deserialize, Serialize}; fn app() -> Element { // Start streaming imme...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/build.rs
packages/web/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/eval.ts", "./src/js/eval.js") .run(); }
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/launch.rs
packages/web/src/launch.rs
//! This module contains the `launch` function, which is the main entry point for dioxus web pub use crate::Config; use dioxus_core::{Element, VirtualDom}; use std::any::Any; /// Launch the web application with the given root component, context and config /// /// For a builder API, see `LaunchBuilder` defined in the `...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/lib.rs
packages/web/src/lib.rs
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")] #![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")] #![deny(missing_docs)] //! # Dioxus Web pub use crate::cfg::Config; use crate::hydration::SuspenseMessage; use dioxus_core::{ScopeId, VirtualDom}; use dom::WebsysD...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/document.rs
packages/web/src/document.rs
use dioxus_core::queue_effect; use dioxus_core::ScopeId; use dioxus_core::{provide_context, Runtime}; use dioxus_document::{ Document, Eval, EvalError, Evaluator, LinkProps, MetaProps, ScriptProps, StyleProps, }; use dioxus_history::History; use futures_util::FutureExt; use generational_box::{AnyStorage, Generation...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/devtools.rs
packages/web/src/devtools.rs
//! Handler code for hotreloading. //! //! This sets up a websocket connection to the devserver and handles messages from it. //! We also set up a little recursive timer that will attempt to reconnect if the connection is lost. use dioxus_devtools::{DevserverMsg, HotReloadMsg}; use futures_channel::mpsc::{unbounded, U...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/mutations.rs
packages/web/src/mutations.rs
use crate::dom::WebsysDom; use dioxus_core::{ AttributeValue, ElementId, Template, TemplateAttribute, TemplateNode, WriteMutations, }; use dioxus_core_types::event_bubbles; use dioxus_interpreter_js::minimal_bindings; use wasm_bindgen::JsCast; use wasm_bindgen::JsValue; impl WebsysDom { pub(crate) fn create_te...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/history.rs
packages/web/src/history.rs
use wasm_bindgen::{prelude::Closure, JsCast, JsValue}; use web_sys::{window, Event, History, ScrollRestoration, Window}; /// A [`dioxus_history::History`] provider that integrates with a browser via the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API). /// /// # Prefix /// This [`dioxus_hist...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/dom.rs
packages/web/src/dom.rs
//! Implementation of a renderer for Dioxus on the web. //! //! Outstanding todos: //! - Passive event listeners //! - no-op event listener patch for safari //! - tests to ensure dyn_into works for various event types. //! - Partial delegation? use std::{any::Any, rc::Rc}; use dioxus_core::Runtime; use dioxus_core::{...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/files.rs
packages/web/src/files.rs
use dioxus_core::AnyhowContext; use dioxus_html::{bytes::Bytes, FileData, NativeFileData}; use futures_channel::oneshot; use js_sys::Uint8Array; use send_wrapper::SendWrapper; use std::{pin::Pin, prelude::rust_2024::Future}; use wasm_bindgen::{prelude::Closure, JsCast}; use web_sys::{File, FileList, FileReader}; /// A...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/data_transfer.rs
packages/web/src/data_transfer.rs
use crate::WebFileData; use dioxus_html::{FileData, NativeDataTransfer}; /// A wrapper around the web_sys::DataTransfer to implement NativeDataTransfer #[derive(Clone)] pub struct WebDataTransfer { pub(crate) data: web_sys::DataTransfer, } impl WebDataTransfer { /// Create a new WebDataTransfer from a web_sys...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/cfg.rs
packages/web/src/cfg.rs
use std::rc::Rc; use dioxus_core::LaunchConfig; use wasm_bindgen::JsCast as _; /// Configuration for the WebSys renderer for the Dioxus VirtualDOM. /// /// This struct helps configure the specifics of hydration and render destination for WebSys. /// /// # Example /// /// ```rust, ignore /// dioxus_web::launch(App, C...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/focus.rs
packages/web/src/events/focus.rs
use dioxus_html::HasFocusData; use super::{Synthetic, WebEventExt}; impl HasFocusData for Synthetic<web_sys::FocusEvent> { fn as_any(&self) -> &dyn std::any::Any { &self.event } } impl WebEventExt for dioxus_html::FocusData { type WebEvent = web_sys::FocusEvent; #[inline(always)] fn try_...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/scroll.rs
packages/web/src/events/scroll.rs
use dioxus_html::HasScrollData; use wasm_bindgen::JsCast; use web_sys::{Document, Element, Event}; use super::{Synthetic, WebEventExt}; impl HasScrollData for Synthetic<Event> { fn as_any(&self) -> &dyn std::any::Any { &self.event } fn scroll_top(&self) -> f64 { if let Some(target) = self...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/mouse.rs
packages/web/src/events/mouse.rs
use dioxus_html::{ geometry::{ClientPoint, ElementPoint, PagePoint, ScreenPoint}, input_data::{decode_mouse_button_set, MouseButton}, HasMouseData, InteractionElementOffset, InteractionLocation, Modifiers, ModifiersInteraction, PointerInteraction, }; use web_sys::MouseEvent; use super::{Synthetic, WebE...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/clipboard.rs
packages/web/src/events/clipboard.rs
use dioxus_html::HasClipboardData; use web_sys::Event; use super::{Synthetic, WebEventExt}; impl From<&Event> for Synthetic<Event> { fn from(e: &Event) -> Self { Synthetic::new(e.clone()) } } impl HasClipboardData for Synthetic<Event> { fn as_any(&self) -> &dyn std::any::Any { &self.event...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/composition.rs
packages/web/src/events/composition.rs
use dioxus_html::HasCompositionData; use web_sys::CompositionEvent; use super::{Synthetic, WebEventExt}; impl HasCompositionData for Synthetic<CompositionEvent> { fn data(&self) -> std::string::String { self.event.data().unwrap_or_default() } fn as_any(&self) -> &dyn std::any::Any { &self...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/animation.rs
packages/web/src/events/animation.rs
use dioxus_html::HasAnimationData; use web_sys::AnimationEvent; use super::{Synthetic, WebEventExt}; impl HasAnimationData for Synthetic<AnimationEvent> { fn animation_name(&self) -> String { self.event.animation_name() } fn pseudo_element(&self) -> String { self.event.pseudo_element() ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/form.rs
packages/web/src/events/form.rs
use super::WebEventExt; use crate::WebFileData; use dioxus_html::{FileData, FormValue, HasFileData, HasFormData}; use js_sys::Array; use std::any::Any; use wasm_bindgen::{prelude::wasm_bindgen, JsCast}; use web_sys::{Element, Event, FileReader}; pub(crate) struct WebFormData { element: Element, event: Event, }...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/drag.rs
packages/web/src/events/drag.rs
use crate::{WebDataTransfer, WebFileData, WebFileEngine}; use super::{Synthetic, WebEventExt}; use dioxus_html::{ geometry::{ClientPoint, ElementPoint, PagePoint, ScreenPoint}, input_data::{decode_mouse_button_set, MouseButton}, FileData, HasDataTransferData, HasDragData, HasFileData, HasMouseData, Int...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/media.rs
packages/web/src/events/media.rs
use super::{Synthetic, WebEventExt}; use dioxus_html::HasMediaData; impl HasMediaData for Synthetic<web_sys::Event> { fn as_any(&self) -> &dyn std::any::Any { &self.event } } impl WebEventExt for dioxus_html::MediaData { type WebEvent = web_sys::Event; #[inline(always)] fn try_as_web_even...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/toggle.rs
packages/web/src/events/toggle.rs
use super::{Synthetic, WebEventExt}; use dioxus_html::HasToggleData; impl HasToggleData for Synthetic<web_sys::Event> { fn as_any(&self) -> &dyn std::any::Any { &self.event } } impl WebEventExt for dioxus_html::ToggleData { type WebEvent = web_sys::Event; #[inline(always)] fn try_as_web_e...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/cancel.rs
packages/web/src/events/cancel.rs
use super::{Synthetic, WebEventExt}; use dioxus_html::HasCancelData; impl HasCancelData for Synthetic<web_sys::Event> { fn as_any(&self) -> &dyn std::any::Any { &self.event } } impl WebEventExt for dioxus_html::CancelData { type WebEvent = web_sys::Event; #[inline(always)] fn try_as_web_e...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/transition.rs
packages/web/src/events/transition.rs
use dioxus_html::HasTransitionData; use web_sys::TransitionEvent; use super::Synthetic; impl HasTransitionData for Synthetic<TransitionEvent> { fn elapsed_time(&self) -> f32 { self.event.elapsed_time() } fn property_name(&self) -> String { self.event.property_name() } fn pseudo_e...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/wheel.rs
packages/web/src/events/wheel.rs
use dioxus_html::{ geometry::{ClientPoint, ElementPoint, PagePoint, ScreenPoint}, input_data::{decode_mouse_button_set, MouseButton}, HasMouseData, HasWheelData, InteractionElementOffset, InteractionLocation, Modifiers, ModifiersInteraction, PointerInteraction, }; use web_sys::WheelEvent; use super::{S...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/file.rs
packages/web/src/events/file.rs
use dioxus_html::{FileData, HasFileData}; use web_sys::FileReader; use crate::{WebFileData, WebFileEngine}; use super::Synthetic; impl HasFileData for Synthetic<web_sys::Event> { fn files(&self) -> Vec<FileData> { use wasm_bindgen::JsCast; let target = self.event.target(); if let Some(ta...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/mod.rs
packages/web/src/events/mod.rs
use dioxus_html::{ DragData, FormData, HtmlEventConverter, ImageData, MountedData, PlatformEventData, }; use form::WebFormData; use load::WebImageEvent; use wasm_bindgen::JsCast; use web_sys::{Document, Element, Event}; mod animation; mod cancel; mod clipboard; mod composition; mod drag; mod file; mod focus; mod f...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/selection.rs
packages/web/src/events/selection.rs
use super::{Synthetic, WebEventExt}; use dioxus_html::HasSelectionData; impl HasSelectionData for Synthetic<web_sys::Event> { fn as_any(&self) -> &dyn std::any::Any { &self.event } } impl WebEventExt for dioxus_html::SelectionData { type WebEvent = web_sys::Event; #[inline(always)] fn try...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/mounted.rs
packages/web/src/events/mounted.rs
use dioxus_html::{ geometry::euclid::{Point2D, Size2D}, MountedData, }; use wasm_bindgen::JsCast; use super::{Synthetic, WebEventExt}; impl dioxus_html::RenderedElementBacking for Synthetic<web_sys::Element> { fn get_scroll_offset( &self, ) -> std::pin::Pin< Box< dyn std::f...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/load.rs
packages/web/src/events/load.rs
use std::any::Any; use dioxus_html::HasImageData; use web_sys::Event; use super::WebEventExt; #[derive(Clone)] pub(crate) struct WebImageEvent { raw: Event, error: bool, } impl WebImageEvent { pub fn new(raw: Event, error: bool) -> Self { Self { raw, error } } } impl HasImageData for WebIma...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/keyboard.rs
packages/web/src/events/keyboard.rs
use std::str::FromStr; use dioxus_html::{ input_data::decode_key_location, Code, HasKeyboardData, Key, Location, Modifiers, ModifiersInteraction, }; use web_sys::KeyboardEvent; use super::{Synthetic, WebEventExt}; impl HasKeyboardData for Synthetic<KeyboardEvent> { fn key(&self) -> Key { Key::fro...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/pointer.rs
packages/web/src/events/pointer.rs
use dioxus_html::{ geometry::{ClientPoint, ElementPoint, PagePoint, ScreenPoint}, input_data::{decode_mouse_button_set, MouseButton}, HasPointerData, InteractionElementOffset, InteractionLocation, Modifiers, ModifiersInteraction, PointerInteraction, }; use web_sys::PointerEvent; use super::{Synthetic, ...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/visible.rs
packages/web/src/events/visible.rs
use std::time::SystemTime; use dioxus_html::{ geometry::{ euclid::{Point2D, Size2D}, PixelsRect, }, HasVisibleData, VisibleData, VisibleError, VisibleResult, }; use wasm_bindgen::JsCast; use web_sys::{CustomEvent, DomRectReadOnly, Event, IntersectionObserverEntry}; use super::{Synthetic, W...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/resize.rs
packages/web/src/events/resize.rs
use dioxus_html::{geometry::PixelsSize, HasResizeData, ResizeResult}; use wasm_bindgen::JsCast; use web_sys::{CustomEvent, Event, ResizeObserverEntry}; use super::{Synthetic, WebEventExt}; impl From<Event> for Synthetic<ResizeObserverEntry> { #[inline] fn from(e: Event) -> Self { <Synthetic<ResizeObse...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/events/touch.rs
packages/web/src/events/touch.rs
use dioxus_html::{ geometry::{ClientPoint, PagePoint, ScreenPoint}, HasTouchPointData, InteractionLocation, Modifiers, ModifiersInteraction, TouchPoint, }; use web_sys::{Touch, TouchEvent}; use super::{Synthetic, WebEventExt}; impl ModifiersInteraction for Synthetic<TouchEvent> { fn modifiers(&self) -> Mo...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/hydration/hydrate.rs
packages/web/src/hydration/hydrate.rs
//! When hydrating streaming components: //! 1. Just hydrate the template on the outside //! 2. As we render the virtual dom initially, keep track of the server ids of the suspense boundaries //! 3. Register a callback for dx_hydrate(id, data) that takes some new data, reruns the suspense boundary with that new data an...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false
DioxusLabs/dioxus
https://github.com/DioxusLabs/dioxus/blob/ec8f31dece5c75371177bf080bab46dff54ffd0e/packages/web/src/hydration/mod.rs
packages/web/src/hydration/mod.rs
#[cfg(feature = "hydrate")] mod hydrate; #[cfg(feature = "hydrate")] #[allow(unused)] pub use hydrate::*; /// The message sent from the server to the client to hydrate a suspense boundary #[derive(Debug)] pub(crate) struct SuspenseMessage { #[cfg(feature = "hydrate")] /// The path to the suspense boundary. Ea...
rust
Apache-2.0
ec8f31dece5c75371177bf080bab46dff54ffd0e
2026-01-04T15:32:28.012891Z
false