3.0 “Liberté, Égalité, Fraternité”
Autoprefixer 3.0 changes browsers API, adds autoprefixer-core
package and uses GNU style for syntax error messages.
API Changes
Method autoprefixer()
had confused and too difficult options. @sindresorhus showed issue and @lydell suggested new API.
Now you will set browsers list in browsers
key with other options:
autoprefixer({ browsers: ['> 5%', 'IE 7'], cascade: false }).process(css).css;
If you want to clean CSS from any prefixes you should set []
instead of deprecated none
.
var cleaner = autoprefixer({ browsers: [] });
Old API was deprecated and prints warnings. It will be removed in 3.1 release.
Core Package
@MoOx and @jonathanong noticed, that autoprefixer
package contained many unnecessary code for plugin like grunt-autoprefixer
.
So Autoprefixer was split to autoprefixer
and autoprefixer-core
npm packages. CLI tool and all file system code and dependencies were moved from autoprefixer-core
to autoprefixer
.
Package autoprefixer
provide same API as autoprefixer-core
, but all plugin developers should use only autoprefixer-core
.
GNU Style for Syntax Errors
Autoprefixer 3.0 uses new PostCSS 2.2. It uses GNU Coding Standards for syntax error messages:
a.css:2:1 Unexpected { in decls
CoffeeScript and other tools uses same format and some IDE can parse this format and open wrong line in editor.
ES6 Migration
To be more familiar to new developers PostCSS was rewritten from CoffeeScript to JS ES6. Now Autoprefixer starts to use more ES6.
Autoprefixer package now contains only ES6 code. Autoprefixer Core uses ES6 only in built tasks, but we want to rewrite it completely.
Maybe you want to help us in ES6 migration? Work is very easy, but it will be routine. This help will makes you one of the biggest contributor (because you will changes many files :) ). Write me and I will send you instructions.
PostCSS Organization
Autoprefixer and Autoprefixer Core repositories was moved to PostCSS organization to be with other official PostCSS plugins.