diff --git a/.changeset/big-teachers-agree.md b/.changeset/big-teachers-agree.md new file mode 100644 index 0000000000..f9044541d7 --- /dev/null +++ b/.changeset/big-teachers-agree.md @@ -0,0 +1,5 @@ +--- +'svelte': minor +--- + +feat: add source name logging to `$inspect.trace` diff --git a/packages/svelte/tests/runtime-runes/samples/inspect-trace-nested/_config.js b/packages/svelte/tests/runtime-runes/samples/inspect-trace-nested/_config.js index f54f78f5c1..7cfc850c58 100644 --- a/packages/svelte/tests/runtime-runes/samples/inspect-trace-nested/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/inspect-trace-nested/_config.js @@ -35,7 +35,7 @@ export default test({ assert.deepEqual(normalise_trace_logs(logs), [ { log: 'iife', highlighted: false }, - { log: '$state', highlighted: true }, + { log: 'count — $state', highlighted: true }, { log: 0 }, { log: 'effect', highlighted: false } ]); @@ -48,7 +48,7 @@ export default test({ assert.deepEqual(normalise_trace_logs(logs), [ { log: 'iife', highlighted: false }, - { log: '$state', highlighted: true }, + { log: 'count — $state', highlighted: true }, { log: 1 }, { log: 'effect', highlighted: false } ]); diff --git a/packages/svelte/tests/runtime-runes/samples/inspect-trace-reassignment/_config.js b/packages/svelte/tests/runtime-runes/samples/inspect-trace-reassignment/_config.js index c9a66289a1..89bfd72380 100644 --- a/packages/svelte/tests/runtime-runes/samples/inspect-trace-reassignment/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/inspect-trace-reassignment/_config.js @@ -35,7 +35,7 @@ export default test({ assert.deepEqual(normalise_trace_logs(logs), [ { log: 'effect', highlighted: false }, - { log: '$state', highlighted: true }, + { log: 'checked — $state', highlighted: true }, { log: false } ]); @@ -53,19 +53,19 @@ export default test({ assert.deepEqual(normalise_trace_logs(logs), [ { log: 'effect', highlighted: false }, - { log: '$state', highlighted: true }, + { log: 'checked — $state', highlighted: true }, { log: true }, - { log: '$state', highlighted: true }, + { log: 'count — $state', highlighted: true }, { log: 1 }, { log: 'effect', highlighted: false }, - { log: '$state', highlighted: false }, + { log: 'checked — $state', highlighted: false }, { log: true }, - { log: '$state', highlighted: true }, + { log: 'count — $state', highlighted: true }, { log: 2 }, { log: 'effect', highlighted: false }, - { log: '$state', highlighted: false }, + { log: 'checked — $state', highlighted: false }, { log: true }, - { log: '$state', highlighted: true }, + { log: 'count — $state', highlighted: true }, { log: 3 } ]); } diff --git a/packages/svelte/tests/runtime-runes/samples/inspect-trace/_config.js b/packages/svelte/tests/runtime-runes/samples/inspect-trace/_config.js index efa5985e4e..a650ec6c24 100644 --- a/packages/svelte/tests/runtime-runes/samples/inspect-trace/_config.js +++ b/packages/svelte/tests/runtime-runes/samples/inspect-trace/_config.js @@ -35,11 +35,11 @@ export default test({ assert.deepEqual(normalise_trace_logs(logs), [ { log: 'effect', highlighted: false }, - { log: '$derived', highlighted: true }, + { log: 'double — $derived', highlighted: true }, { log: 0 }, - { log: '$state', highlighted: true }, + { log: 'count — $state', highlighted: true }, { log: 0 }, - { log: '$state', highlighted: true }, + { log: 'checked — $state', highlighted: true }, { log: false } ]); @@ -53,11 +53,11 @@ export default test({ assert.deepEqual(normalise_trace_logs(logs), [ { log: 'effect', highlighted: false }, - { log: '$derived', highlighted: true }, + { log: 'double — $derived', highlighted: true }, { log: 2 }, - { log: '$state', highlighted: true }, + { log: 'count — $state', highlighted: true }, { log: 1 }, - { log: '$state', highlighted: false }, + { log: 'checked — $state', highlighted: false }, { log: false } ]); @@ -71,11 +71,11 @@ export default test({ assert.deepEqual(normalise_trace_logs(logs), [ { log: 'effect', highlighted: false }, - { log: '$derived', highlighted: false }, + { log: 'double — $derived', highlighted: false }, { log: 2 }, - { log: '$state', highlighted: false }, + { log: 'count — $state', highlighted: false }, { log: 1 }, - { log: '$state', highlighted: true }, + { log: 'checked — $state', highlighted: true }, { log: true } ]); @@ -88,9 +88,9 @@ export default test({ assert.deepEqual(normalise_trace_logs(logs), [ { log: 'effect', highlighted: false }, - { log: '$derived', highlighted: true }, + { log: 'double — $derived', highlighted: true }, { log: 4 }, - { log: '$state', highlighted: true }, + { log: 'count — $state', highlighted: true }, { log: 2 } ]); }