Typed data list prototypes could be more performant?

Created on 14 August 2025, about 21 hours ago

Problem/Motivation

Discovered when debugging 🐛 Migrating images into custom fields can result in corrupted data Active

TypedDataManager stores prototypes of each object so it can clone them instead of creating them each time.

However for list objects the delta is included in the key, so in my example linked where I have a custom field containing four items I end up with these prototypes:

entity:node:article:field_image_and_text.0:heading
entity:node:article:field_image_and_text.0:subtitle
entity:node:article:field_image_and_text.0:text
entity:node:article:field_image_and_text.0:image
entity:node:article:field_image_and_text.1:heading
entity:node:article:field_image_and_text.1:subtitle
entity:node:article:field_image_and_text.1:text
entity:node:article:field_image_and_text.1:image
entity:node:article:field_image_and_text.2:heading
entity:node:article:field_image_and_text.2:subtitle
entity:node:article:field_image_and_text.2:text
entity:node:article:field_image_and_text.2:image
entity:node:article:field_image_and_text.3:heading
entity:node:article:field_image_and_text.3:subtitle
entity:node:article:field_image_and_text.3:text
entity:node:article:field_image_and_text.3:image

Why is the delta included in the key? This is most obvious here where custom has multiple properties but would appear to be the same for other multi-value fields - but I think the prototype item should be the same for each delta?

Steps to reproduce

Proposed resolution

Remove the delta from the list key, ie. only store these prototypes

entity:node:article:field_image_and_text:heading
entity:node:article:field_image_and_text:subtitle
entity:node:article:field_image_and_text:text
entity:node:article:field_image_and_text:image

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

typed data system

Created by

🇬🇧United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024