Problem/Motivation
Remove Color module from core.
The Color module as it is isn't matching the expectations of frontend developers in 2022. It was written before CSS custom properties existed which makes it seem clunky to integrate with. There's potentially need for a module like this, which is proven by having some Color module usage in our contrib ecosystem. However, this need could be still fulfilled by a contrib module.
Steps to reproduce
Proposed resolution
Check for @todo
Bye bye Color
Remaining tasks
Manual testing (See https://drupal.slack.com/archives/C014CT1CN1M/p1658772338310209) #3302799: Manually test color module removal
Patch
#3302976: Port remaining changes from core
Review
Commit, plan for removal before Bartik but in the same week as Bartik
User interface changes
API changes
Data model changes
Release notes snippet
The Color module was deprecated in Drupal 9.4 and the module moved to contrib at https://drupal.org/project/color.
If you need the functionality provided by the Color module, read the recommendations for the Color module.
Comment | File | Size | Author |
---|---|---|---|
#66 | 3270899-d10.1-66.patch | 1.77 MB | Spokje |
|
Issue fork drupal-3270899
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
quietone CreditAttribution: quietone at PreviousNext commentedStart the removal.
Comment #3
quietone CreditAttribution: quietone at PreviousNext commentedTry again
Comment #4
quietone CreditAttribution: quietone at PreviousNext commentedPostponing on #3270941: Remove Color module from the Standard profile
Comment #5
quietone CreditAttribution: quietone at PreviousNext commentedComment #6
SpokjeUnpostponing since #3270941: Remove Color module from the Standard profile is committed
Comment #8
SpokjeColor module needs to be uninstalled in
core/modules/system/tests/fixtures/update/drupal-9.3.0.filled.standard.php.gz
, with keeping #3264120-42: Remove aggregator module and our dependency on Laminas Feed in mind.Attempting that now.
Comment #11
SpokjeComment #12
SpokjeComment #13
SpokjeI think this is ready for a review now.
Note: In the original policy issue #2808151: [policy] Move the Color module to a contributed project when Bartik is deprecated it states to (re)move the Color module when the Bartik theme is deprecated. Should we wait until that has happened?
Comment #16
Spokje@q0rban: Any particular reason you opened a new MR with exactly the same changes as the original?
Comment #17
q0rban CreditAttribution: q0rban at Tugboat for Drupal Association commentedApologies, please ignore. I am trying to figure out why the Tugboat builds are failing with composer issues, and accidentally deleted the Tugboat Preview associated with the other MR. I tried to delete my branch, but that was failing too.
Comment #20
quietone CreditAttribution: quietone at PreviousNext commentedRe-parenting
Comment #21
andypostComment #23
SpokjeComment #25
SpokjeComment #26
Wim LeersThat merge request looks … very complete! 😄
I think you missed one important thing though:
core/themes/bartik/color/color.inc
can be deleted too 🤓 Marking for that.The failures in the
and are suspiciously consistent, suggestive of an actual bug. They both fail with:But neither that test class nor any of its parents or traits install the Color module. Therefore these must be unrelated random failures nonetheless 👍
Comment #28
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedI've removed
core/themes/bartik/color/color.inc
as per comment #26, please review.Comment #29
SpokjePersonally I'm unsure about the removal of
core/themes/bartik/color/color.inc
, in my tiny mind this would mean Bartik wouldn't work (well) with the Contrib incarnation of the Color Module.But I'm certainly no FrontEndGuru, so let's not take my take for granted.
Comment #30
Wim Leers#29 Interesting take! But … core does not implement contrib APIs. So the Color module in contrib would have to take care of handling the Bartik integration, based on my understanding.
Comment #31
catchThat would normally be true, but we're on our way towards deprecating Bartik and removing it to contrib too, #3278213: [Meta] Tasks to deprecate Bartik. So it makes sense for color support to stay in the contrib Bartik theme, which will need to be moved out of core. If we remove it now, it'd be a case of adding it back in contrib. For me personally given all that, I'd live it in Bartik.
Comment #32
SpokjeSo now we need a ruling, me thinks: "Should it stay or should it go (now)".
Comment #33
catchIf there was an obvious way for color to provide integration for bartik (like #3265140: Move QuickEditImageController from image to quickedit) then we might be able to move it, but I don't think that's even possible? For me I'd leave it in, and let it be removed when Bartik is.
Comment #34
andypostWe should not remove color integration in bartik because this way BC for site-builers will be broken otherwise
Please recall how many sites using bartik+color!
Comment #35
Wim LeersIt could easily be possible if https://www.drupal.org/project/color implemented it I think. But … that's definitely extra work.
Sorry for the distraction! 🙈
e0c0fd1 already got us back to where we need to be, so back to
👍Comment #36
andypost@Wim the only question is how other contrib/custom themes will keep color integration?
Comment #37
andypostRemoval of db dump also could be shared with other module removals
Comment #38
daffie CreditAttribution: daffie commentedThe MR needs a rebase.
Comment #39
SpokjeGrmbl, just my luck, doing a rebase after 13 days, which then during the TestBot run already is outdated.
Let's try that again.
Comment #40
SpokjeHmmm, GitLab GUI was adamant that a local rebase was needed.
Looks to me like it wasn't.
Comment #41
SpokjeComment #42
SpokjePostponed on #3291601: Ensure that color does not get special core treatment per Slack discussion here: https://drupal.slack.com/archives/C014CT1CN1M/p1655750184381089
Also needs manual testing when that blocker lands (see also Slack discussion)
Comment #43
quietone CreditAttribution: quietone at PreviousNext commentedComment #44
borisson_I see that this issue is postponed on #3291601: Ensure that color does not get special core treatment, but that issue is postponed on the removal (this issue). Does that mean we're actually waiting on the manual test described in #42?
Comment #45
andypostI see no reason to postpone this issue, as it was discussed in slack (3 times at least) we should make this in and then unpostpospone #3291601: Ensure that color does not get special core treatment
Comment #46
borisson_In that case, setting it back to needs work, because I think the MR is not mergeable now?
Comment #47
SpokjeMR!2306 is mergeable, GitLab is a bit easy on declaring it needing a rebase when file-deletions are involved IMHO.
This issue is (at least) postponed on manual testing as stated in #42.
At the moment I'm unsure if Color needs extra attention on the facade-front, but postponed is, IMHO, the correct status, because of the sentence above.
I'll give the whole deprecation/removal thing one more push on the D10-readiness meeting Monday 25th to see what manual testing is needed and try to get some final answers/manpower going.
Until then, it's highly unlikely anything will be committed here, so let's leave the status as-is until Tuesday July 26.
By then I'm planning to have all deprecation/removal issues updated with the latest info gathered in the above mentioned meeting.
Comment #48
Spokje#3291601: Ensure that color does not get special core treatment is done, this issue is now postponed on manual testing (See https://drupal.slack.com/archives/C014CT1CN1M/p1658772338310209)
Comment #49
SpokjeComment #50
SpokjeRight...
This needs a reroll on the fixture after #3281434: Update System module tests to not use Bartik and Seven landed on
10.0.x
. Since there are a _lot_ of fixture changes pending in different issues and updating a fixture is rather tedious work, I'm going to leave this as is until #3302799: Manually test color module removal has been successfully completed.AFAICT manual testing should be OK, since that has nothing to do with fixtures and automated tests.
If somebody wants to update the 9.3.0-filled fixture in the mean time: Please be my guest
Comment #51
SpokjeComment #52
SpokjeFixtures updated since #3302799: Manually test color module removal is going places.
Comment #53
longwaveManual testing was completed in #3302799: Manually test color module removal by @bbrala and myself, so un-postponing this issue and will review shortly.
Comment #54
longwaveOne question about assets in the stable9 theme on the MR, otherwise no further comments on the code changes.
I also grepped through the codebase for "color" and while there are obviously many false positives relating to this removal, one thing stood out in \Drupal\Core\Asset\CssOptimizer:
I guess we could have a followup to deprecate this and make it color.module's responsibility to handle this itself.
We are also in a slightly weird situation if we complete this but don't finish removing Bartik from core before Drupal 10: since #3281430: Update non-migration Color tests to not use Bartik we have code that supports color.module in Bartik but nothing that tests it, so we won't know if it gets broken during the D10 lifecycle. It's likely not that important but not sure what we can do here if this happens.
Comment #55
longwaveComment #56
catchThis would be incredibly tricky if we were actively working on removing color module but not Bartik, but since Bartik deprecation and removal is nearly unblocked too (two issues left), I think it's fine - we should be able to complete that in time for beta.
We know the code currently works in core, and then the same code will work in contrib once everything is there. If we moved things around to avoid temporarily weirdness, we'd have to move it all back again.
Opened #3302988: Make CssOptimizer::loadFile() protected.
Comment #57
SpokjeThanks @longwave for the review (and @catch for the words of wisdom)
Postponing this again (since no decent removal issue should go through its lifecycle without a couple of those) on #3302976: Port remaining changes from core.
Any Git Gurus help in there would be appreciated.
Comment #58
SpokjeComment #59
SpokjeNote This MR (against
10.0.x
) needs a separate patch against10.1.x
.Since the MR changes include fixture changes and there are a lot of those floating around in several other issues that are close to being committed, I (=Spokje) have given up on creating the
10.1.x
-counterparts of the MR.By the time this issue is actually not being postponed any more it should be quick and easy enough (#FamousLastWords) to create said
10.1.x
-patch by me or basically anybody.Comment #60
bbralaComment #61
bbralaMR has been made for the remaining changes of color. Should be merged pretty soon ;)
Comment #62
SpokjeUpdated fixture after #3290810: Remove updates added prior to 9.4.0 (9.4.4 for ckeditor) and add 9.4.0 database dumps landed.
Comment #63
bbralaI would say pp-1 is over eager, the missing commits are test only in contrib and a mr is present. I'd vote just keep moving here.
Comment #64
SpokjeFeel free to update the status whenever you see fit, but if changed this issue should be NR.
Not so much for the changes in the fixtures, but for the thread in the MR that @longwave brought up in #54:
I addressed that here here.
All other questions he had are (IMHO) answered by @catch in #56.
Comment #65
longwaveAgree that this doesn't have to wait for the contrib module to catch up, it's only test changes and they can be applied after removal if needed.
I re-reviewed the whole MR and checked again for stragglers after applying, can't find anything that hasn't been addressed, therefore this is RTBC.
Thank you @Spokje for working on this, especially the persistent rerolling of the fixtures, which is both time consuming and error prone.
Comment #66
SpokjeThanks both.
Added
10.1.x
patch, which is equal to the MR, besides a change in line-numbers incore/phpstan-baseline.neon
Comment #67
longwaveRandom fail in a quickedit test; merged 10.0.x for a retest.
Comment #68
quietone CreditAttribution: quietone at PreviousNext commentedDiscussed with catch and xjm, the order of removal for Color and Bartik because of the test dependency discussed in the IS of #3301713: Update migration Color tests to not use Bartik. Color will be removed first followed closely, hopefully the same week, by Bartik.
Comment #69
longwaveThinking about this again, I'm not sure we've done the right thing with the fixture updates. What about the case where someone upgrades to Drupal 10 but does nothing about Color module? Don't we go down the route of e.g. Simpletest where we leave a stub
color.install
that cleanly uninstalls Color module as part of the upgrade path, and then we remove that stub in Drupal 11? This will then be overridden if the user installs the contrib module beforehand.Comment #70
dwwHad a very long and fruitful Slack thread w/ @xjm, @catch, @longwave about this. TL;DR:
Attaching the edited transcript (we went off topic a few times) for posterity.
I haven't actually reviewed or tested this 😅 but back to RTBC if this was the only concern. 😉
Comment #71
dwwHeh, not so fast. 😉 I reviewed the MR and had a question about some test changes that I don't see discussed here. See the unresolved MR thread.
Comment #72
catchExplanation makes sense, real 7.x sites may or may not have color installed so the feature continuing to cover that case works.
Comment #73
dwwAgreed, I didn't read enough context when I commented. RTBC++!
Thanks / sorry,
-Derek
Comment #75
catchAll the changes here look good.
This is directly blocking #3304256: Remove Bartik from Drupal core however we also wanted to make sure that the Bartik patch landed not too long after this one so we don't have the discrepancy of color module support in core when the module isn't. The MR over there looks good to me though except for the dependency here, so time to get this one in.
Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!