Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 30 additions & 30 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[workspace]
members = [
"packages/accesskit_xplat",
"packages/debug_timer",
"packages/blitz-traits",
"packages/blitz-dom",
"packages/blitz-html",
"packages/blitz-net",
"packages/blitz-paint",
"packages/blitz-shell",
"packages/blitz",
"packages/stylo_taffy",
"packages/dioxus-native",
"packages/dioxus-native-dom",
"apps/browser",
"apps/readme",
"apps/bump",
"wpt/runner",
"examples/counter",
"examples/todomvc",
"examples/wgpu_texture",
"packages/accesskit_xplat",
"packages/debug_timer",
"packages/blitz-traits",
"packages/blitz-dom",
"packages/blitz-html",
"packages/blitz-net",
"packages/blitz-paint",
"packages/blitz-shell",
"packages/blitz",
"packages/stylo_taffy",
"packages/dioxus-native",
"packages/dioxus-native-dom",
"apps/browser",
"apps/readme",
"apps/bump",
"wpt/runner",
"examples/counter",
"examples/todomvc",
"examples/wgpu_texture",
]
exclude = ["sites"]
resolver = "2"
Expand Down Expand Up @@ -88,13 +88,13 @@ dioxus-core-macro = { version = "0.7.3" }

# Taffy
taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "25759dad44d8350743a4e866fee54962f996895a", default-features = false, features = [
"std",
"flexbox",
"grid",
"block_layout",
"content_size",
"calc",
"detailed_layout_info",
"std",
"flexbox",
"grid",
"block_layout",
"content_size",
"calc",
"detailed_layout_info",
] }

# AnyRender
Expand All @@ -112,19 +112,19 @@ linebender_resource_handle = "0.1"
peniko = "0.6.0"
kurbo = "0.13"
parley = { git = "https://github.com/linebender/parley", rev = "37aa8ab7103e9da89eea22899902016ce20739f2", default-features = false, features = [
"std",
"std",
] }
skrifa = { version = "0.40", default-features = false, features = [
"std",
"std",
] } # Should match parley version
wgpu = "27"
softbuffer = "0.4"
pixels = "0.15"
vello = { version = "0.6", features = ["wgpu"] }
vello_encoding = { version = "0.6", default-features = false }
vello_cpu = { version = "0.0.3", default-features = false, features = [
"std",
"text",
"std",
"text",
] }
usvg = "0.46"

Expand Down
2 changes: 1 addition & 1 deletion apps/browser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cache = ["blitz-net/cache"]
cookies = ["blitz-net/cookies"]
avif = ["image/avif"]
webp = ["image/webp"]
tracing = ["dioxus-native/tracing", "dep:tracing-subscriber"]
tracing = ["dioxus-native/tracing", "blitz-html/tracing", "blitz-net/tracing", "dep:tracing-subscriber"]
hot-reload = ["dioxus-native/hot-reload"]
accessibility = ["dioxus-native/accessibility"]
mimalloc = ["dep:mimalloc"]
Expand Down
10 changes: 6 additions & 4 deletions apps/readme/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rust-version.workspace = true
publish = false

[features]
default = ["gpu", "comrak", "floats"]
default = ["gpu", "comrak", "floats", "tracing"]

# Renderers
gpu = ["dep:anyrender_vello"]
Expand All @@ -34,14 +34,15 @@ log_frame_times = [
]
log_phase_times = ["blitz-dom/log_phase_times"]
incremental = ["blitz-dom/incremental"]
tracing = ["dep:tracing-subscriber", "blitz-shell/tracing", "blitz-net/tracing", "blitz-html/tracing"]

[dependencies]
blitz-traits = { workspace = true }
blitz-dom = { workspace = true, features = ["default", "parallel-construct"] }
blitz-html = { workspace = true }
blitz-paint = { workspace = true, features = ["default"] }
blitz-net = { workspace = true, features = ["cookies", "debug_log"] }
blitz-shell = { workspace = true, features = ["tracing", "default"] }
blitz-net = { workspace = true, features = ["cookies"] }
blitz-shell = { workspace = true, features = ["default"] }
anyrender_vello = { workspace = true, optional = true }
anyrender_skia = { workspace = true, optional = true }
anyrender_vello_cpu = { workspace = true, features = ["multithreading"], optional = true }
Expand All @@ -54,4 +55,5 @@ winit = { workspace = true }
comrak = { version = "0.50", default-features = false, optional = true }
pulldown-cmark = { version = "0.13", default-features = false, features = ["html"], optional = true }
image = { workspace = true, default-features = false, optional = true }
notify = "8.0.0"
notify = "8.0.0"
tracing-subscriber = { workspace = true, optional = true }
3 changes: 3 additions & 0 deletions apps/readme/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ impl NavigationProvider for ReadmeNavigationProvider {
}

fn main() {
#[cfg(feature = "tracing")]
tracing_subscriber::fmt::init();

let raw_url = std::env::args().nth(1).unwrap_or_else(|| {
let cwd = current_dir().unwrap();
format!("{}", cwd.display())
Expand Down
3 changes: 2 additions & 1 deletion packages/blitz-dom/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,8 @@ impl BaseDocument {
.first_element_child()
.is_none()
{
println!("No DOM - not resolving");
#[cfg(feature = "tracing")]
tracing::warn!("No DOM - not resolving hit test");
return None;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/blitz-dom/src/events/ime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ pub(crate) fn handle_ime_event<F: FnMut(DomEvent)>(
// TODO
}
}
println!("Sent ime event to {node_id}");
#[cfg(feature = "tracing")]
tracing::debug!(node_id, "Sent ime event");
}
}
}
6 changes: 4 additions & 2 deletions packages/blitz-dom/src/events/pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,13 @@ pub(crate) fn handle_click(
doc.id(),
));
} else {
println!("{href} is not parseable as a url. : {:?}", *doc.url)
#[cfg(feature = "tracing")]
tracing::warn!("{href} is not parseable as a url. : {:?}", *doc.url);
}
break 'matched true;
} else {
println!("Clicked link without href: {:?}", el.attrs());
#[cfg(feature = "tracing")]
tracing::info!("Clicked link without href: {:?}", el.attrs());
}
}
local_name!("input")
Expand Down
10 changes: 7 additions & 3 deletions packages/blitz-dom/src/layout/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,13 @@ pub(crate) fn collect_layout_children(
.special_data = SpecialElementData::Image(Box::new(svg.into()));
}
Err(err) => {
println!("{container_node_id} SVG parse failed");
println!("{outer_html}");
dbg!(err);
#[cfg(feature = "tracing")]
tracing::warn!(
node_id = container_node_id,
html = outer_html,
error = ?err,
"SVG parse failed",
);
}
};
return;
Expand Down
9 changes: 5 additions & 4 deletions packages/blitz-dom/src/layout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ impl BaseDocument {
NodeData::Text(data) => {
// With the new "inline context" architecture all text nodes should be wrapped in an "inline layout context"
// and should therefore never be measured individually.
println!(
"ERROR: Tried to lay out text node individually ({})",
usize::from(node_id)
#[cfg(feature = "tracing")]
tracing::error!(
node_id = usize::from(node_id),
data = ?data,
"Tried to lay out text node individually",
);
dbg!(data);
taffy::LayoutOutput::HIDDEN
// unreachable!();

Expand Down
3 changes: 2 additions & 1 deletion packages/blitz-dom/src/layout/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ pub(crate) fn collect_table_cells(
}

let Some(display) = node.primary_styles().map(|s| s.clone_display()) else {
println!("Ignoring table descendent because it has no styles");
#[cfg(feature = "tracing")]
tracing::info!("Ignoring table descendent because it has no styles");
return;
};

Expand Down
9 changes: 6 additions & 3 deletions packages/blitz-dom/src/node/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ impl ElementData {
);

let Ok(property_id) = PropertyId::parse(name, &context) else {
eprintln!("Warning: unsupported property {name}");
#[cfg(feature = "tracing")]
tracing::warn!(property = name, "Unsupported property");
return false;
};
let mut source_property_declaration = SourcePropertyDeclaration::default();
Expand All @@ -353,7 +354,8 @@ impl ElementData {
&context,
&mut parser,
) else {
eprintln!("Warning: invalid property value for {name}: {value}");
#[cfg(feature = "tracing")]
tracing::warn!(property = name, value, "Invalid property value");
return false;
};

Expand Down Expand Up @@ -386,7 +388,8 @@ impl ElementData {
None,
);
let Ok(property_id) = PropertyId::parse(name, &context) else {
eprintln!("Warning: unsupported property {name}");
#[cfg(feature = "tracing")]
tracing::warn!(property = name, "Unsupported property");
return false;
};

Expand Down
3 changes: 2 additions & 1 deletion packages/blitz-dom/src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ impl BaseDocument {
.first_element_child()
.is_none()
{
println!("No DOM - not resolving");
#[cfg(feature = "tracing")]
tracing::warn!("No DOM - not resolving");
return;
}

Expand Down
7 changes: 6 additions & 1 deletion packages/blitz-html/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ categories.workspace = true
edition.workspace = true
rust-version.workspace = true

[features]
tracing = ["dep:tracing", "blitz-dom/tracing"]

[dependencies]
# Blitz dependencies
blitz-dom = { workspace = true }
blitz-traits = { workspace = true }

# Servo dependencies
html5ever = { workspace = true }
xml5ever = { workspace = true }
xml5ever = { workspace = true }

tracing = { workspace = true, optional = true }
3 changes: 2 additions & 1 deletion packages/blitz-html/src/html_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ impl<'m, 'doc> TreeSink for DocumentHtmlParser<'m, 'doc> {

fn finish(self) -> Self::Output {
for error in self.errors.borrow().iter() {
println!("ERROR: {error}");
#[cfg(feature = "tracing")]
tracing::error!("{error}");
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/blitz-net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ http2 = ["reqwest/http2"]
cookies = ["reqwest/cookies"]
multipart = ["reqwest/multipart", "reqwest/stream"]
cache = ["dep:reqwest-middleware", "dep:http-cache-reqwest", "dep:directories"]
debug_log = []
tracing = ["dep:tracing"]

[dependencies]
# Blitz dependencies
Expand All @@ -30,3 +30,5 @@ data-url = { workspace = true }
reqwest-middleware = { workspace = true, optional = true }
http-cache-reqwest = { workspace = true, optional = true, features = ["manager-cacache"] }
directories = { version = "6.0.0", optional = true }

tracing = { workspace = true, optional = true }
Loading
Loading