Skip to content
Open
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
11 changes: 11 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions reactive_graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tracing = { version = "0.1.41", optional = true }
guardian = "1.2"
async-lock = "3.4.0"
send_wrapper = { version = "0.6.0", features = ["futures"] }
wasm_backtrace = "0.1.1"

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
web-sys = { version = "0.3.72", features = ["console"] }
Expand Down
4 changes: 3 additions & 1 deletion reactive_graph/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ impl<T: Source + ToAnySource + DefinedAt> Track for T {
use crate::diagnostics::SpecialNonReactiveZone;

if !SpecialNonReactiveZone::is_inside() {
let backtrace = wasm_backtrace::backtrace();
let called_at = Location::caller();
let ty = std::any::type_name::<T>();
let defined_at = self
Expand All @@ -143,7 +144,8 @@ impl<T: Source + ToAnySource + DefinedAt> Track for T {
let y = x.get() * 2\n ✅ YES let y = move || \
x.get() * 2.\n\n3. If you’re *trying* to access the \
value without tracking, use `.get_untracked()` or \
`.with_untracked()` instead."
`.with_untracked()` instead.\n\nComplete backtrace \
of the call site:\n{backtrace}"
));
}
}
Expand Down