From c636fc67bc005431db6d7b1461d5a3ab6c7eb903 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Thu, 19 Sep 2024 20:56:27 +0200 Subject: [PATCH] fix: silence snapshot warnings inside `$inspect` (#13334) It's not really actionable and also confusing because the user doesn't see `$state.snapshot` anywhere in their code --- .changeset/unlucky-spies-flow.md | 5 +++++ packages/svelte/src/internal/client/dev/inspect.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/unlucky-spies-flow.md diff --git a/.changeset/unlucky-spies-flow.md b/.changeset/unlucky-spies-flow.md new file mode 100644 index 0000000000..991885e46f --- /dev/null +++ b/.changeset/unlucky-spies-flow.md @@ -0,0 +1,5 @@ +--- +"svelte": patch +--- + +fix: silence snapshot warnings inside `$inspect` diff --git a/packages/svelte/src/internal/client/dev/inspect.js b/packages/svelte/src/internal/client/dev/inspect.js index 733f6d834a..c5765cfc07 100644 --- a/packages/svelte/src/internal/client/dev/inspect.js +++ b/packages/svelte/src/internal/client/dev/inspect.js @@ -12,7 +12,7 @@ export function inspect(get_value, inspector = console.log) { let initial = true; inspect_effect(() => { - inspector(initial ? 'init' : 'update', ...snapshot(get_value())); + inspector(initial ? 'init' : 'update', ...snapshot(get_value(), true)); initial = false; }); }