Problem/Motivation
@yched :
CacheableMetadata trips me up each time as implying that it is "metadata that you can cache". Rather, it's the metadata describing the "cacheability of something" --> CacheabilityMetadata would be more accurate ?
@Wim Leers :
Dear god thank you yes!!!!!!!
I discussed this with catch almost 2 months ago and he agreed we should rename CacheableMetadata to Cacheability. I fear it's too late now though :(
@yched :
Yeah :-/ Given the importance render cache has in D8 (currently and even more after SmartCache), and the fact that it's ... complex enough ;-) (see the discussions in #2556889: [policy, no patch] Decide if SmartCache is still in scope for 8.0 and whether remaining risks require additional mitigation), I'd think not having misleading names add to the complexity is worth the disruption. I'll create the issue and ask for release manager feedback.
In short :
The render cache and "things providing the right cacheability information" is shaping up to be one of the critical concepts to grasp in D8. Yet our central class for that, "metadata about the cacheability of something", has a name that gives you the wrong idea about what it is. That doesn't really help building and keeping a good mental model, since you have to mentally translate whenever you read / write code dealing with those :-)
Proposed resolution
Rename CacheableMetadata to
- CacheabilityMetdata
- just Cacheability ?
That is late for a BC breaking API change, obviously. Not sure whether how large the potentially impacted code might be though.
Alternatively, we could keep a legacy/deprecated "CacheableMetadata extends [NewBetterName]" around for BC, and move our onternal code to the more accurate [NewBetterName] ?
Remaining tasks
Release manager feedback needed
Beta phase evaluation
Issue category | Bug : class is a central piece of the API, but its name describes it for what it's not |
---|---|
Issue priority | Major : major DX bug in a critical API |
Disruption | Breaks code, obviously, but not sure what would be the exact extent |