Problem/Motivation
From core/lib/Drupal/Component/Render/composer.json
"require": {
"php": ">=5.5.9",
"drupal/core-utility": "^8.2"
},
From core/lib/Drupal/Component/Utility/composer.json
"require": {
"php": ">=5.5.9",
"paragonie/random_compat": "^1.0|^2.0",
"drupal/core-render": "^8.2",
"symfony/polyfill-iconv": "~1.0",
"symfony/polyfill-mbstring": "~1.0"
},
The only reason Utility depends on Render is SafeMarkup.
Proposed resolution
I propose that we remove the render dependency from utility and properly deprecate SafeMarkup and remove it's usages from core. And only load the class if a render class exists.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #2
alexpottI've filed #2958429: Properly deprecate SafeMarkup::format() and #2958407: Properly deprecate SafeMarkup::isSafe, SafeMarkup::checkPlain and the SafeMarkup class to remove all non SafeMarkupTest usages of SafeMarkup::* in core. Those issues are the first steps to resolving this.
Comment #3
mile23It's a mutual dependency, but not a circular one. There isn't a circumstance where you you're unable to 'uninstall' one. You only have a set of dependencies which can either be resolved for installation or not.
If the need for Render goes away then then we should definitely remove it from Utility's composer.json requirements.
Comment #11
mile23Based on changes to #2958429: Properly deprecate SafeMarkup::format(), we adjust composer.json for Gettext.
Based on #3091447: Remove Utility component BC layers there's no more
SafeMarkup, making this almost a duplicate issue. It also means drupal/core-utility no longer depends on drupal/core-render so we can change that in the composer.json file.If we had a way to test components in isolation, then we could validate that this is a fact. As it is, our dependencies are broken anyway, and this change should not further break them. I can't find the word 'Render' in Utility other than the description comment for
Drupal\Component\Utility\ToStringTrait::render().Further version constraint issues will be found and fixed in a maintainable way in #3272110: Drupal 9 and 10's Drupal\Component composer.json files are totally out of date
Further journeys into the world of isolated component testing on #2943856: [meta] Reorganize Components so they are testable in isolation
Comment #12
mile23Comment #13
mile23Geez. It's like I haven't been contributing for a while.
Comment #14
alexpottLooks good. I checked the dependencies of both the GetText and the Utility component and this is correct.
Comment #17
catchCommitted/pushed to 10.0.x, cherry-picked to 9.5.x and 9.4.x, thanks!