Postponed as this warning doesn't exist until #3261163: Update to PostCSS 8
Problem/Motivation
As of #3261163: Update to PostCSS 8 there's a deprecation warning during yarn build
remove-unwanted-comments-from-variables: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
The link in the warning on how to address the deprecation seems to explain it pretty well
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | postcss-do-not-test.patch | 2.17 KB | xjm |
| #19 | interdiff.16-19.txt | 1.8 KB | spokje |
| #19 | 3308872-10.1.x-19.patch | 56.62 KB | spokje |
Comments
Comment #2
bnjmnmComment #3
longwave#3261163: Update to PostCSS 8 landed so this can be addressed now.
Comment #4
spokjeWhilst looking to upgrade our custom plugin, I found out nothing changes if I remove the plugin on my local after running a
yarn build.Let's see if TestBot sees it the same way.
Comment #5
spokjeComment #6
spokjeHmm, looks like the plugin does actually does things on 9.x and doesn't (need to) on 10.x
Comment #7
spokjeSo let's try an upgrade attempt on 9.5.x where the custom plugin actually does something.
The goal here is to have:
- No CSS changes
- No deprecation message in the build log
Comment #8
spokjeSince
yarn builddoesn't seem to be part of the drupal CI, we need manual testing for this one:- Checkout dev branch
- Apply patch
-
cd core/-
yarn install-
node ./scripts/css/postcss-build.js(This is the acual sub-command inyarn buildthat triggers the deprecation message.After the above commands are fully finished, for a successful test, there should be:
- NO changes in any of the CSS files.
- NO occurrence of the deprecation message
remove-unwanted-comments-from-variables: postcss.plugin was deprecated. Migration guide: https://evilmartians.com/chronicles/postcss-8-plugin-migrationanywhere in the output of the above commands.Comment #9
spokjeComment #10
spokjeComment #11
longwaveIs this required? We already have an actual dependency on postcss, not sure we need a peer dependency as well.
In 10.x if we replace
variables.pcss.csswithmedia-queries.pcss.cssthen some cruft is removed from the built CSS. Maybe we should also just rename the plugin toremove-unwanted-comments?Comment #12
spokjeComment #13
spokjehttps://www.drupal.org/project/drupal/issues/3308872#comment-14814010.1
The way I understand this: https://evilmartians.com/chronicles/postcss-8-plugin-migration : Step 1: Move postcss to peerDependencies:
it isn't (really?) necessary, but will make all postcss-plugins use the same postcss version, which seems like a good thing to me.
https://www.drupal.org/project/drupal/issues/3308872#comment-14814010.2
Nice!
Booh to cruft!
Comment #14
spokjeComment #15
longwaveRe
peerDependencies, I might be wrong here but I think that statement only applies when you are distributing the plugin as a separate npm package. Here we are just shipping it along with core so thedevDependenciesentry is enough.Comment #16
spokjeWell, you're the native speaker...:)
Comment #17
longwaveOh, nice that we can remove the filename check entirely, and the output is still sensible, and even cleaner than before!
This all looks good to me now.
Comment #18
xjmGiven that this includes an API addition, it should probably be 10.1.x only. (Also, 9.5.x does not seem to have the unwanted comments anyway, so no need to backport the API there?)
As far as I can see, these hunks are just having their whitespace changed. Out of scope? I confirmed locally that these changes don't show up with
git diff -wAside from that, I confirmed that if I simply apply these three hunks:
...and then rerun
yarn build, it results in the comments being removed from the Olivero files.NW to remove the out-of-scope whitespace changes. Thanks!
Comment #19
spokjeRemoved whitespaces, now 10.1.x only.
Comment #20
xjmPartial patch for build testing purposes.
Comment #21
longwave#19 looks good to me.
Comment #23
xjmCommitted to 10.1.x. Thanks!