Skip to content

Commit 69a0797

Browse files
lxsmnsycclaude
andcommitted
fix(timeline): hide updates to the memos of Solid's own components
solid-js rc.20 names the memos inside <Show>, <Switch> and the Loading boundary, such as value and condition, so their updates no longer carried a default name and showed in the Timeline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 4ef6446 commit 69a0797

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

‎src/dev-toolbar/timeline/tracker.test.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,15 @@ describe('isUnnamedUpdate', () => {
245245
builder.flush(flush());
246246
builder.rerun(rerun({ run: 3, interaction: undefined, causes: [named] }), undefined);
247247
builder.flush(flush());
248-
builder.rerun(rerun({ run: 4, causes: [{ ...unnamed, seq: 22, origin: click }] }), undefined);
248+
// The memo a `<Show>` keeps its children in.
249+
builder.rerun(
250+
rerun({ run: 4, interaction: undefined, causes: [{ ...unnamed, seq: 23, name: 'value' }] }),
251+
undefined,
252+
);
253+
builder.flush(flush());
254+
builder.rerun(rerun({ run: 5, causes: [{ ...unnamed, seq: 22, origin: click }] }), undefined);
249255

250-
expect(builder.snapshot().map(isUnnamedUpdate)).toEqual([false, false, true, true]);
256+
expect(builder.snapshot().map(isUnnamedUpdate)).toEqual([false, true, false, true, true]);
251257
});
252258
});
253259

‎src/dev-toolbar/timeline/tracker.ts‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,24 @@ export function rootChanges(causes: ChangeRecord[], out = new Map<number, Change
8484
return out;
8585
}
8686

87-
/** The names the runtime gives a signal or a memo created without a `name` option. */
88-
const DEFAULT_NAMES = new Set(['signal', 'computed', 'memo']);
87+
/**
88+
* The names the runtime gives a signal or a memo created without a `name`
89+
* option, and the names it gives the memos inside its own components, such
90+
* as the `value` of a `<Show>`.
91+
*/
92+
const DEFAULT_NAMES = new Set([
93+
'signal',
94+
'computed',
95+
'memo',
96+
'value',
97+
'condition',
98+
'condition value',
99+
'conditions',
100+
'eval conditions',
101+
'children',
102+
'boundary',
103+
'reveal order',
104+
]);
89105

90106
/**
91107
* An update no action caused whose writes all went to unnamed signals, or

0 commit comments

Comments
 (0)