Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): update postcss to 8.x and adapt custom plugins #4404

Closed
wants to merge 6 commits into from

Conversation

armano2
Copy link
Contributor

@armano2 armano2 commented Mar 12, 2021

Motivation

Update postcss and all packages that depends on it to version 8.
this change is applied only to v2

This PR is not finished yet as its currently blocked by

=> Found "postcss@7.0.35"
info Has been hoisted to "postcss"
info Reasons this module exists
   - "workspace-aggregator-3f5d2bd0-33dc-4456-980d-55f4af3e0882" depends on it
   - Hoisted from "_project_#docusaurus#postcss"
   - Hoisted from "_project_#stylelint#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#postcss"
   - Hoisted from "_project_#stylelint#postcss-less#postcss"
   - Hoisted from "_project_#stylelint#sugarss#postcss"
   - Hoisted from "_project_#stylelint#postcss-sass#postcss"
   - Hoisted from "_project_#stylelint#postcss-safe-parser#postcss"
   - Hoisted from "_project_#@docusaurus#migrate#@mapbox#hast-util-to-jsx#postcss"
   - Hoisted from "_project_#docusaurus#autoprefixer#postcss"
   - Hoisted from "_project_#stylelint#autoprefixer#postcss"
   - Hoisted from "_project_#stylelint#postcss-scss#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss"
   - Hoisted from "_project_#@docusaurus#migrate#@mapbox#hast-util-to-jsx#postcss-js#postcss"
   - Hoisted from "_project_#netlify-cli#precinct#detective-postcss#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#cssnano-util-raw-cache#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-colormin#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-convert-values#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-discard-comments#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-discard-duplicates#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-discard-empty#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-discard-overridden#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-merge-longhand#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-merge-rules#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-minify-font-values#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-minify-gradients#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-minify-params#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-minify-selectors#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-charset#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-display-values#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-positions#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-repeat-style#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-string#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-timing-functions#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-unicode#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-url#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-normalize-whitespace#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-ordered-values#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-reduce-initial#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-reduce-transforms#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-svgo#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-unique-selectors#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#css-declaration-sorter#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-calc#postcss"
   - Hoisted from "_project_#docusaurus#cssnano#cssnano-preset-default#postcss-merge-longhand#stylehacks#postcss"
info Disk size without dependencies: "332KB"
info Disk size with unique dependencies: "1.29MB"
info Disk size with transitive dependencies: "1.41MB"
info Number of shared dependencies: 7
=> Found "@docusaurus/cssnano-preset#postcss@8.2.8"
info This module exists because "_project_#@docusaurus#cssnano-preset" depends on it.
=> Found "@docusaurus/theme-classic#postcss@8.2.8"
info This module exists because "_project_#@docusaurus#theme-classic" depends on it.
=> Found "@docusaurus/core#postcss@8.2.8"
info This module exists because "_project_#@docusaurus#core" depends on it.
=> Found "rtlcss#postcss@8.2.8"
info This module exists because "_project_#@docusaurus#theme-classic#rtlcss" depends on it.
=> Found "css-loader#postcss@8.2.8"
info This module exists because "_project_#@docusaurus#core#css-loader" depends on it.

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

validate if new plugin is working by creating rtl version in preview
check if styles still work correctly

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 12, 2021
@netlify
Copy link

netlify bot commented Mar 12, 2021

@netlify
Copy link

netlify bot commented Mar 12, 2021

@netlify
Copy link

netlify bot commented Mar 12, 2021

@ludofischer
Copy link
Contributor

Have you considered getting rid of preset-env? I could be wrong, but I have the impression that nowadays only IE11 needs most of the preset-env transforms. I could not find in the docs what browsers Docusaurus targets, but it is possible that it does not actually use most of the transforms any more.

@lex111
Copy link
Contributor

lex111 commented Mar 22, 2021

@ludofischer yep, we don't actually support IE11, so previously I replaced postcss-preset-env with autoprefixer. So if preset-env is not needed for CSS optimization (in advanced preset), then we can get rid of it, I guess.

@ludofischer
Copy link
Contributor

ludofischer commented Mar 23, 2021

So if preset-env is not needed for CSS optimization (in advanced preset), then we can get rid of it, I guess.

Looking at the list of plugins in preset-env, I see only support for CSS features, no optimizations. I am in favor of getting rid of it, then this pull request won't be blocked any more.

@armano2 armano2 force-pushed the postcss-8 branch 2 times, most recently from 13b1672 to 75ae299 Compare March 23, 2021 10:20
@armano2

This comment has been minimized.

@armano2 armano2 closed this Mar 24, 2021
@armano2
Copy link
Contributor Author

armano2 commented Mar 24, 2021

postponed until #4089 is merged

@slorber
Copy link
Collaborator

slorber commented Apr 16, 2021

@armano2 going to merge the webpack5 migration soon early next week, and would like to have postcss8 asap once it's merged, do you want to re-open your PR next week or I do it myself based on your suggestions?

@slorber
Copy link
Collaborator

slorber commented Apr 18, 2021

Nevermind, actually had to support postcss8 in #4089

@armano2 armano2 deleted the postcss-8 branch November 3, 2021 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants