Move cacheability bubbling complexity from LinkProviderManager to the overriding normalizer

Created on 6 September 2019, almost 5 years ago
Updated 17 January 2022, over 2 years ago

Thanks for addressing the feedback in the four issues I created β€” now it's much easier to scan and understand the code base! πŸ‘

Because it's now easier to understand, I can now focus on an area I glossed over in my first review round: \Drupal\jsonapi_hypermedia\Plugin\LinkProviderManager::bubbleAccessCacheability().

AFAICT you're doing this bubbling in the link provider manager because it must return LinkCollection, which cannot carry cacheability. So I think you're choosing to design the link provider manager in a future-proof way by passing cacheability out-of-band to the normalizer, in hopes that when #3055889: JsonApiResource\Link objects with inaccessible target urls should not be normalized β†’ lands, it will add cacheability carrying support to both \Drupal\jsonapi\JsonApiResource\LinkCollection and \Drupal\jsonapi\JsonApiResource\Link.

When that happens, it would allow you to remove the render context-wrapping complexity in \Drupal\jsonapi\Normalizer\JsonapiHypermediaImpostor\JsonApiHypermediaLinkCollectionNormalizer::normalize() and you would be able to remove \Drupal\jsonapi_hypermedia\Plugin\LinkProviderManager::bubbleAccessCacheability().

Is that a correct interpretation?

πŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024