add debug information for signal subscriptions

This commit is contained in:
Evan Almloff committed 2024-02-26 11:46:01 -06:00
1 parent c0f2e8391c
commit f539698963
7 files changed
+96 -13

No files matched your search

+1 -5
View File
@@ -79,11 +79,7 @@ impl VNode {
// The target ScopeState still has the reference to the old props, so there's no need to update anything
// This also implicitly drops the new props since they're not used
if old_props.memoize(new_props.props()) {
tracing::trace!(
"Memoized props for component {:#?} ({})",
scope_id,
old_scope.state().name
);
tracing::trace!("Memoized props for component {:#?}", scope_id,);
return;
}
+18 -1
View File
@@ -9,9 +9,26 @@ use std::{cell::Ref, fmt::Debug, rc::Rc};
/// time. We do try and guarantee that between calls to `wait_for_work`, no ScopeIds will be recycled in order to give
/// time for any logic that relies on these IDs to properly update.
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, PartialOrd, Ord)]
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ScopeId(pub usize);
impl std::fmt::Debug for ScopeId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut builder = f.debug_tuple("ScopeId");
let mut builder = builder.field(&self.0);
#[cfg(debug_assertions)]
{
if let Some(name) = Runtime::current()
.as_ref()
.and_then(|rt| rt.get_state(*self))
{
builder = builder.field(&name.name);
}
}
builder.finish()
}
}
impl ScopeId {
/// The root ScopeId.
///
+1 -1
View File
@@ -373,7 +373,7 @@ impl VirtualDom {
return;
};
tracing::trace!("Marking scope {:?} ({}) as dirty", id, scope.name);
tracing::trace!("Marking scope {:?} as dirty", id);
self.dirty_scopes.insert(DirtyScope {
height: scope.height(),
id,