Skip to content

Commit 5e6b566

Browse files
committed
Re-add stable cache in fields proxy but only for plural components
1 parent 58d6ccc commit 5e6b566

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/base/field-component.gts

+11-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,17 @@ function fieldsComponentsFor<T extends BaseDef>(
421421
let field = maybeField;
422422

423423
let result = field.component(model as unknown as Box<BaseDef>);
424-
stableComponents.set(property, result);
424+
if (
425+
field.fieldType === 'linksToMany' ||
426+
field.fieldType === 'containsMany'
427+
) {
428+
let stable = stableComponents.get(property);
429+
if (stable) {
430+
return stable;
431+
} else {
432+
stableComponents.set(property, result);
433+
}
434+
}
425435
return result;
426436
},
427437
getPrototypeOf() {

0 commit comments

Comments
 (0)