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

CommentFileSizeAuthor
#12 2958358_utility-composer.patch921 bytesmile23

Comments

alexpott created an issue. See original summary.

alexpott’s picture

mile23’s picture

Title: Circular reference between Drupal\Component\Utility and Drupal\Component\Render » Remove Drupal\Component\Utility's dependency on Drupal\Component\Render

It'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.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mile23’s picture

Based 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

mile23’s picture

StatusFileSize
new921 bytes
mile23’s picture

Status: Active » Needs review

Geez. It's like I haven't been contributing for a while.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. I checked the dependencies of both the GetText and the Utility component and this is correct.

  • catch committed 6c7ed38 on 10.0.x
    Issue #2958358 by Mile23, alexpott: Remove Drupal\Component\Utility's...

  • catch committed a478d87 on 9.4.x
    Issue #2958358 by Mile23, alexpott: Remove Drupal\Component\Utility's...
  • catch committed fc89b10 on 9.5.x
    Issue #2958358 by Mile23, alexpott: Remove Drupal\Component\Utility's...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.0.x, cherry-picked to 9.5.x and 9.4.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.