From 94d0b08afa146562880927cb3f362b181222d2d2 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 10 Jun 2025 18:24:35 -0400 Subject: [PATCH] tweak labels --- packages/svelte/src/internal/client/dev/tracing.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/svelte/src/internal/client/dev/tracing.js b/packages/svelte/src/internal/client/dev/tracing.js index 708c69e19a..29a9323614 100644 --- a/packages/svelte/src/internal/client/dev/tracing.js +++ b/packages/svelte/src/internal/client/dev/tracing.js @@ -43,14 +43,16 @@ function log_entry(signal, entry) { const type = (signal.f & DERIVED) !== 0 ? '$derived' : '$state'; const current_reaction = /** @type {Reaction} */ (active_reaction); const dirty = signal.wv > current_reaction.wv || current_reaction.wv === 0; - const { label: name } = signal; + const style = dirty ? 'color: CornflowerBlue; font-weight: bold' : 'color: grey; font-weight: normal'; + // eslint-disable-next-line no-console console.groupCollapsed( - typeof name === 'string' ? `%c${name} — ${type}` : `%c${type}`, + signal.label ? `%c${type}%c ${signal.label}` : `%c${type}%c`, style, + dirty ? 'font-weight: normal' : style, typeof value === 'object' && value !== null && STATE_SYMBOL in value ? snapshot(value, true) : value