Page MenuHomePhabricator

VisualEditor: ce.GeneratedContentNode.generateContents() should be static, so we can cache based on config objects alone
Open, MediumPublicFeature

Description

Right now, GCNode caching uses both the model hash and the hash of the config object. However, when properties in the config override properties in the model, the preview of a change and the new model node after the actual change will be the same but have different hashes (because the model is different, and because in the second case the config object is empty/undefined).

We should make generatedContents() static, so it can't inspect the model or any object state, and have a function that provides the default config that is then used to extend the provided config. That way we don't end up duplicating things in cache and rendering things twice.


Version: unspecified
Severity: enhancement

Details

Reference
bz54582

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:12 AM
bzimport added a project: Technical-Debt.
bzimport set Reference to bz54582.
Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:23 PM
Aklapper removed a subscriber: TrevorParscal.