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

build: update postcss to version 8.0.3 - autoclosed #18799

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 16, 2020

This PR contains the following updates:

Package Type Update Change
postcss (source) dependencies major 7.0.32 -> 8.0.3
postcss (source) devDependencies major 7.0.32 -> 8.0.3

Release Notes

postcss/postcss

v8.0.3

Compare Source

  • Fixed client-side bundling support.

v8.0.2

Compare Source

  • Fixed plugin packs support.

v8.0.1

Compare Source

  • Updated Processor#version.

v8.0.0

Compare Source

President Ose seal

PostCSS 8.0 brings new plugin API, node_modules size reduction, better source map support, and CSS parser improvements.

Check out a day-by-day diary of PostCSS 8.0 development process.

Known Issues

  • postcss-cli need to be updated PostCSS to run new plugins
  • gulp-postcss need to be updated PostCSS to run new plugins
  • postcss-load-plugins (used by some environments) can’t load new plugins

Thanks to Sponsors

With more than 100 M downloads per month, it becomes hard to support PostCSS in free time. For instance, getting the 8.0 release ready took 4 months of work.

This release was possible thanks to out community. Tailwind CSS, De Voorhoede, InVision AG, Brainbow, and many individual contributions.

Sponsored by Tailwind CSS

If your company wants to support the sustainability of front-end infrastructure or just wants to give some love to PostCSS, you can join our supporters by:

Breaking Changes

We try to avoid any breaking changes for end-users:

  • PostCSS 8 dropped Node.js 6.x, 8.x, 11.x, and 13.x versions support. All these versions have no security updates anymore.
  • We now serve ES6+ sources in the npm package without Babel compilation. If you are creating tools like CodePen and put PostCSS into the client-side JS bundle, you may need to run Babel on node_modules/postcss for old browsers.
  • We removed rarely used postcss.vendor API.

New Plugin API

The biggest change in PostCSS 8 is a new plugin API. Thanks to @​BondarenkoAlex for big help in creating a new API.

module.exports = () => {
  return {
    postcssPlugin: 'postcss-will-change',
    Declaration: {
      'will-change': (decl, { Declaration }) => {
        decl.cloneBefore(
          new Declaration({ prop: 'backface-visibility', value: 'hidden' })
        )
      }
    }
  }
}
module.exports.postcss = true

We know that rewriting old plugins will take time, but the new API will improve the end-user’s experience and make life easier for plugin developers:

  • With new API, all plugins can share a single scan of the CSS tree. It makes CSS processing up to 20% faster.
  • Because npm often duplicates dependencies, you may have many postcss duplicates in your node_modules. New API fixes this problem.
  • Plugins will re-visit changed nodes to reduce compatibility issues between plugins. Now the order of plugins in your PostCSS config will be less important.
  • New API is close to Babel’s visitor API.

These resources will help plugin developers in API migration:

PostCSS development guidelines were also changed:

  • Now it is prohibited to create own AST on top of PostCSS AST classes since it could lead to painful bugs due to the usage private APIs.
  • Plugins and runners must have postcss in peerDependencies.

New Website without React

Previously PostCSS used a React-based framework for the project's website. Since we have a static website, we decided to migrate to a React-free framework and got good performance improvements:

  • 360 → 20 ms for Max Potential First Input Delay
  • 3.3 → 1.5 seconds for First CPU Idle
  • 3.3 → 1.5 seconds for Time to Interactive

Check out postcss.org and new API docs that feature the awesome alchemy-inspired design by @​okonet.

PostCSS website performance results

We also removed Google Analytics tracking scripts and encourage other open source projects to be an example in caring about user’s privacy and performance.

Parser Improvments

Did you know that all examples below are valid CSS?

:root {
  --empty: ;
  --JSON: [1, "2", {"three": {"a":1}}, [4]];
  --javascript: function(rule) { console.log(rule) };
}

@​supports (--element(".minwidth", { "minWidth": 300 })) {
  [--self] {
    background: greenyellow;
  }
}

Now PostCSS parses even those rare edge cases correctly. Thanks to Tailwind CSS and Prettier teams for adding more cases to our CSS parser tests collection.

Note that now --roundMixin: { border-radius: 8px } will be parsed as a Declaration with the { border-radius: 8px } value.

Better Source Map Support

We have added support for two new source map formats: Index map and JSON (data:application/json).

PostCSS 8 is now much closer to the source map spec. Thanks to the Google team for reports:

  • We now treat sources in map as URLs instead of file paths.
  • We now resolve sources relative to map file, not CSS file.

A few source map APIs were added:

  • opts.maps.absolute = true option for absolute paths in source map.
  • opts.maps.annotation = (file, root) => url for a dynamic path to source map.
  • Node#origin() now returns position.url in addition to position.file for compatibility with absolute URLs in source map’s sources.

API Changes

We have added ES modules support and now we export all classes from the main entry:

import { CssSyntaxError, parse } from "postcss"

@​graberzz added Node#source.offset in addition to line and column.

CSS Custom Properties and Sass-like $-variables now have a special Declaration#variable mark:

const root = parse(`
  :root {
    --propery: value;
  }
  $variable: value
`)

root.first.first.variable //=> true
root.last.variable //=> true

TypeScript

PostCSS now has a first-class TypeScript support:

  • We moved API docs from JSDoc to TypeDoc. Check out our new API docs.
  • We are using check-dts to test types with special unit tests.
  • We keep types in separate files for better readability.
  • With the new structure and test system, we fixed many small issues in types.

Other Changes


Renovate configuration

📅 Schedule: "after 10pm every weekday,before 4am every weekday,every weekend" in timezone America/Tijuana.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot added action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release labels Sep 16, 2020
@alan-agius4 alan-agius4 added state: blocked and removed action: merge The PR is ready for merge by the caretaker labels Sep 16, 2020
@renovate renovate bot changed the title build: update postcss to version 8.0.3 build: update postcss to version 8.0.3 - autoclosed Sep 16, 2020
@renovate renovate bot closed this Sep 16, 2020
@renovate renovate bot deleted the renovate/postcss-8.x branch September 16, 2020 22:16
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
state: blocked target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants