Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up from #2244447: Translation of low-level info/annotations leads to circular dependencies
This should allow us to do three things:
1. Improve cache hit rate on multilingual sites.
2. Remove several cache tags.
3. Remove the translation manager dependency from plugin discovery.
Comment | File | Size | Author |
---|---|---|---|
#16 | so-many-plugin-managers-2281905-16-interdiff.txt | 2.29 KB | Berdir |
#16 | so-many-plugin-managers-2281905-16.patch | 82.08 KB | Berdir |
#7 | so-many-plugin-managers-2281905-5-interdiff.txt | 878 bytes | Berdir |
#7 | so-many-plugin-managers-2281905-7.patch | 80.79 KB | Berdir |
#5 | so-many-plugin-managers-2281905-5.patch | 79.87 KB | Berdir |
Comments
Comment #1
catchComment #2
BerdirJust trying to see what happens...
Comment #4
BerdirSo this worked, the only test fails are broken unit tests that expect calls to the language manager...
Comment #5
BerdirSo. many. plugin. managers.
We still need a by-language cache for yaml and I also kept it for the config mapper stuff, which only uses an info hook.
Comment #7
BerdirRe-roll and fixing the test fail.
Comment #8
tim.plunkettNice job, looks great.
Comment #9
BerdirThanks, but...
Also not sure if there's something else we can clean up based on @catch statements...
Comment #10
BerdirComment #11
catchI was wrong on the cache tags, forgot we're explicitly avoiding those, so ignore that at least :)
Comment #12
BerdirYes, that I know, except the ones that now still need them because they manually add the langcode to the cache key, but most of them already had one, with the exception of the contextual links manager.
Comment #13
Gábor HojtsySo what is left here? Not clear to me. Looks like catch's steps from the issue summary are done then? :)
Comment #14
BerdirA change record :)
Comment #15
Gábor HojtsyAdded draft change notice at https://drupal.org/node/2284277. While doing that, found the following:
So this will be a bug then when this is committed? It will not cache by language but will be language specific? Not sure we want to do this?! At least we need to add an issue URL in the @todo.
Wrote this for the change notice but not sure if this can be considered a bug as well, sounds like it will make plugin cache clearing for the few plugin managers that cache by language (see my list on the change notice if I identified them right):
Comment #16
BerdirFixed the @todo, updated the change record a bit and made it reference this issue.
Updated the last sentence there, not clearing all languages anymore is by design because the default plugin manager has no understanding anymore of languages. If you add that manually, the easiest way to ensure the caches are cleared is to use a cache tag which all the relevant core plugin managers are doing now.
Comment #17
tim.plunkettThat last interdiff looks good, sorry for the premature RTBC the first time :)
Comment #18
catchCommitted/pushed to 8.x, thanks!
Comment #20
Gábor HojtsyPublished the change record. :)
Comment #22
effulgentsia CreditAttribution: effulgentsia at Acquia commentedI don't know if alter hooks were discussed when this first went in, but #2509180: [meta] Various plugin definition alter() hooks incorrectly document to use t() is for doing so now.